You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the `equations` of `sys` is the concatenation of `get_eqs(sys)` and
77
-
`equations(subsys)`, the states are the concatenation of their states,
77
+
`equations(subsys)`, the unknowns are the concatenation of their unknowns,
78
78
etc. When the `ODEProblem` or `ODEFunction` is generated from this
79
79
system, it will build and compile the functions associated with this
80
80
composition.
81
81
82
82
The new equations within the higher level system can access the variables
83
83
in the lower level system by namespacing via the `nameof(subsys)`. For
84
-
example, let's say there is a variable `x` in `states` and a variable
84
+
example, let's say there is a variable `x` in `unknowns` and a variable
85
85
`x` in `subsys`. We can declare that these two variables are the same
86
86
by specifying their equality: `x ~ subsys.x` in the `eqs` for `sys`.
87
87
This algebraic relationship can then be simplified by transformations
@@ -133,7 +133,7 @@ sys = ODESystem(
133
133
sys.y = u *1.1
134
134
```
135
135
136
-
In a hierarchical system, variables of the subsystem get namespaced by the name of the system they are in. This prevents naming clashes, but also enforces that every state and parameter is local to the subsystem it is used in. In some cases it might be desirable to have variables and parameters that are shared between subsystems, or even global. This can be accomplished as follows.
136
+
In a hierarchical system, variables of the subsystem get namespaced by the name of the system they are in. This prevents naming clashes, but also enforces that every unknown and parameter is local to the subsystem it is used in. In some cases it might be desirable to have variables and parameters that are shared between subsystems, or even global. This can be accomplished as follows.
137
137
138
138
```julia
139
139
@parameters t a b c d e f
@@ -186,12 +186,12 @@ i.e. equations which result in `0~0` expressions, in over-specified systems.
186
186
187
187
Model inheritance can be done in two ways: implicitly or explicitly. First, one
188
188
can use the `extend` function to extend a base model with another set of
189
-
equations, states, and parameters. An example can be found in the
189
+
equations, unknowns, and parameters. An example can be found in the
190
190
[acausal components tutorial](@ref acausal).
191
191
192
192
The explicit way is to shadow variables with equality expressions. For example,
193
193
let's assume we have three separate systems which we want to compose to a single
194
-
one. This is how one could explicitly forward all states and parameters to the
194
+
one. This is how one could explicitly forward all unknowns and parameters to the
195
195
higher level system:
196
196
197
197
```@example compose
@@ -225,7 +225,7 @@ sir = compose(ODESystem([
225
225
reqn.γ => γ], name = :sir), seqn, ieqn, reqn)
226
226
```
227
227
228
-
Note that the states are forwarded by an equality relationship, while
228
+
Note that the unknowns are forwarded by an equality relationship, while
229
229
the parameters are forwarded through a relationship in their default
230
230
values. The user of this model can then solve this model simply by
231
231
specifying the values at the highest level:
@@ -266,7 +266,7 @@ more efficient and more stable.
266
266
## Components with discontinuous dynamics
267
267
268
268
When modeling, e.g., impacts, saturations or Coulomb friction, the dynamic
269
-
equations are discontinuous in either the state or one of its derivatives. This
269
+
equations are discontinuous in either the unknown or one of its derivatives. This
270
270
causes the solver to take very small steps around the discontinuity, and
271
271
sometimes leads to early stopping due to `dt <= dt_min`. The correct way to
272
272
handle such dynamics is to tell the solver about the discontinuity by a
@@ -151,13 +151,13 @@ of one or more equations, an affect is defined as a `tuple`:
151
151
[x ~0] => (affect!, [v, x], [p, q], ctx)
152
152
```
153
153
154
-
where, `affect!` is a Julia function with the signature: `affect!(integ, u, p, ctx)`; `[u,v]` and `[p,q]` are the symbolic states (variables) and parameters
154
+
where, `affect!` is a Julia function with the signature: `affect!(integ, u, p, ctx)`; `[u,v]` and `[p,q]` are the symbolic unknowns (variables) and parameters
155
155
that are accessed by `affect!`, respectively; and `ctx` is any context that is
Copy file name to clipboardexpand all lines: docs/src/basics/Linearization.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,16 @@ matrices, simplified_sys = linearize(sys, [r], [y]) # Linearize from r to y
34
34
matrices
35
35
```
36
36
37
-
The named tuple `matrices` contains the matrices of the linear statespace representation, while `simplified_sys` is an `ODESystem` that, among other things, indicates the state order in the linear system through
37
+
The named tuple `matrices` contains the matrices of the linear statespace representation, while `simplified_sys` is an `ODESystem` that, among other things, indicates the unknown variable order in the linear system through
The operating point to linearize around can be specified with the keyword argument `op` like this: `op = Dict(x => 1, r => 2)`. The operating point may include specification of state variables, input variables and parameters. For variables that are not specified in `op`, the default value specified in the model will be used if available, if no value is specified, an error is thrown.
46
+
The operating point to linearize around can be specified with the keyword argument `op` like this: `op = Dict(x => 1, r => 2)`. The operating point may include specification of unknown variables, input variables and parameters. For variables that are not specified in `op`, the default value specified in the model will be used if available, if no value is specified, an error is thrown.
We are left with only 4 equations involving 4 state variables (`mass.pos[1]`,
165
+
We are left with only 4 equations involving 4 unknown variables (`mass.pos[1]`,
166
166
`mass.pos[2]`, `mass.v[1]`, `mass.v[2]`). We can solve the system by converting
167
167
it to an `ODEProblem`. Some observed variables are not expanded by default. To
168
168
view the complete equations, one can do
@@ -179,13 +179,13 @@ sol = solve(prob, Rosenbrock23())
179
179
plot(sol)
180
180
```
181
181
182
-
What if we want the timeseries of a different variable? That information is not lost! Instead, `structural_simplify` simply changes state variables into `observed` variables.
182
+
What if we want the timeseries of a different variable? That information is not lost! Instead, `structural_simplify` simply changes unknown variables into `observed` variables.
183
183
184
184
```@example component
185
185
observed(sys)
186
186
```
187
187
188
-
These are explicit algebraic equations which can be used to reconstruct the required variables on the fly. This leads to dramatic computational savings since implicitly solving an ODE scales as O(n^3), so fewer states are significantly better!
188
+
These are explicit algebraic equations which can be used to reconstruct the required variables on the fly. This leads to dramatic computational savings since implicitly solving an ODE scales as O(n^3), so fewer unknowns are significantly better!
189
189
190
190
We can access these variables using the solution object. For example, let's retrieve the x-position of the mass over time:
0 commit comments