-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f5a4a7
commit fb92153
Showing
6 changed files
with
103 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# # Sine example | ||
# | ||
# This is a simple DACE example using the sine function, which demonstrates: | ||
# | ||
# - How to load DACE.jl | ||
# - How to initialise the DACE library | ||
# - How to create a `DA` object | ||
# - How to compute the sine of a `DA` object | ||
# - How to print a `DA` object to screen | ||
# - How to evaluate a `DA` object | ||
# | ||
# ## Install dependencies | ||
# | ||
# Make sure the required packages are installed | ||
|
||
# ```julia | ||
# using Pkg | ||
# Pkg.add("https://github.com/chrisdjscott/DACE_jll.jl.git") | ||
# Pkg.add("https://github.com/chrisdjscott/DACE.jl.git") | ||
# ``` | ||
|
||
# ## Using DACE | ||
# | ||
# Write | ||
|
||
using DACE | ||
|
||
# to load DACE functions and objects into our script. | ||
# | ||
# Initialise DACE for 20th-order computations in 1 variable | ||
|
||
DACE.init(20, 1) | ||
|
||
# Initialise `x` as a `DA` object | ||
|
||
x = DACE.DA(1) | ||
|
||
# Initialise `y` as the Taylor expansion of `sin(x)` | ||
|
||
y = sin(x) | ||
|
||
# Print `x` and `y` to screen | ||
|
||
println("x") | ||
print(x) | ||
println("y = sin(x)") | ||
print(y) | ||
|
||
# Evaluate `y` at 1.0 and compare with the builtin `sin` function. | ||
|
||
println(" y(1.0) = $(DACE.evalScalar(y, 1.0))") | ||
println("sin(1.0) = $(sin(1.0))") |