Skip to content

Commit 90567a0

Browse files
committed
move symbolic details to Symbolics docs
1 parent 7d7316e commit 90567a0

File tree

3 files changed

+3
-75
lines changed

3 files changed

+3
-75
lines changed

docs/pages.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pages = [
1717
"Basic Examples" => Any["examples/higher_order.md",
1818
"examples/spring_mass.md",
1919
"examples/modelingtoolkitize_index_reduction.md",
20-
"examples/parsing.md",
2120
"examples/remake.md"],
2221
"Advanced Examples" => Any["examples/tearing_parallelism.md",
2322
"examples/sparse_jacobians.md",

docs/src/examples/parsing.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/src/tutorials/programmatically_generating.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -59,51 +59,13 @@ plot(sol)
5959
As you can see, generating an ODESystem is as simple as creating an array of equations
6060
and passing it to the `ODESystem` constructor.
6161

62-
## Understanding the Difference Between the Julia Variable and the Symbolic Variable
63-
64-
In the most basic usage of ModelingToolkit and Symbolics, the name of the Julia variable
65-
and the symbolic variable are the same. For example, when we do:
66-
67-
```@example scripting
68-
@variables a
69-
```
70-
71-
the name of the symbolic variable is `a` and same with the Julia variable. However, we can
72-
de-couple these by setting `a` to a new symbolic variable, for example:
73-
74-
```@example scripting
75-
b = only(@variables(a))
76-
```
77-
78-
Now the Julia variable `b` refers to the variable named `a`. However, the downside of this current
79-
approach is that it requires that the user writing the script knows the name `a` that they want to
80-
place to the variable. But what if for example we needed to get the variable's name from a file?
81-
82-
To do this, one can interpolate a symbol into the `@variables` macro using `$`. For example:
83-
84-
```@example scripting
85-
a = :c
86-
b = only(@variables($a))
87-
```
88-
89-
In this example, `@variables($a)` created a variable named `c`, and set this variable to `b`.
90-
91-
Variables are not the only thing with names. For example, when you build a system, it knows its name
92-
that name is used in the namespacing. In the standard usage, again the Julia variable and the
93-
symbolic name are made the same via:
94-
95-
```@example scripting
96-
@named fol_model = ODESystem(eqs, t)
97-
```
98-
99-
However, one can decouple these two properties by noting that `@named` is simply shorthand for the
100-
following:
62+
`@named` automatically gives a name to the `ODESystem`, and is shorthand for
10163

10264
```@example scripting
103-
fol_model = ODESystem(eqs, t; name = :fol_model)
65+
fol_model = ODESystem(eqs, t; name = :fol_model) # @named fol_model = ODESystem(eqs, t)
10466
```
10567

106-
Thus if we had read a name from a file and wish to populate an `ODESystem` with said name, we could do:
68+
Thus, if we had read a name from a file and wish to populate an `ODESystem` with said name, we could do:
10769

10870
```@example scripting
10971
namesym = :name_from_file

0 commit comments

Comments
 (0)