Skip to content

Commit d8aa030

Browse files
committed
tutorial
1 parent 53dac1b commit d8aa030

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

docs/src/tutorials/converting_to_C.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ lotka_volterra!(du, u, p, t)
2525
which gives:
2626

2727
```julia
28-
du = Operation[p₁ * u₁ - (p₂ * u₁) * u₂, -p₃ * u₂ + (p₄ * u₁) * u₂]
28+
du = Num[p₁ * u₁ - (p₂ * u₁) * u₂, -p₃ * u₂ + (p₄ * u₁) * u₂]
2929
```
3030

3131
Now we build the equations we want to solve:

docs/src/tutorials/ode_modeling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ eqs = [D(x) ~ σ*(y-x),
6969
D(z) ~ x*y - β*z]
7070
```
7171

72-
Each operation builds an `Operation` type, and thus `eqs` is an array of
73-
`Operation` and `Variable`s. This holds a tree of the full system that can be
72+
Each operation builds an `Term` type, and thus `eqs` is an array of
73+
`Term` and `Sym`s (possibly wrapped in Num). This holds a tree of the full system that can be
7474
analyzed by other programs. We can turn this into a `ODESystem` via:
7575

7676
```julia

docs/src/tutorials/symbolic_functions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ The way to define symbolic variables is via the `@variables` macro:
88
```
99

1010
After defining variables as symbolic, symbolic expressions, which we
11-
call an `Operation`, can be generated by utilizing Julia expressions.
11+
call a `Term`, can be generated by utilizing Julia expressions.
1212
For example:
1313

1414
```julia
1515
z = x^2 + y
1616
```
1717

18-
Here, `z` is the `Operation` for "square `x` and add `y`". To
18+
Here, `z` is the `Term` for "square `x` and add `y`". To
1919
make an array of symbolic expressions, simply make an array of
2020
symbolic expressions:
2121

@@ -30,6 +30,8 @@ A = [x^2+y 0 2x
3030
y ^ 2 + x 0 0
3131
```
3232

33+
Note that by default, `@variables` returns `Sym` or `Term` objects wrapped in `Num` in order to make them behave like subtypes of `Real`. Any operation on these `Num` objects will return a new `Num` object, wrapping the result of computing symbolically on the underlying values.
34+
3335
To better view the results, we can use [Latexify.jl](https://github.com/korsbo/Latexify.jl).
3436
ModelingToolkit.jl comes with Latexify recipes so it works automatically:
3537

0 commit comments

Comments
 (0)