@@ -45,13 +45,9 @@ equations(connected)
45
45
# Differential(t)(decay1₊x(t)) ~ decay1₊f(t) - (decay1₊a*(decay1₊x(t)))
46
46
# Differential(t)(decay2₊x(t)) ~ decay2₊f(t) - (decay2₊a*(decay2₊x(t)))
47
47
48
- equations ( alias_elimination ( connected) )
48
+ simplified_sys = structural_simplify ( connected)
49
49
50
- # 4-element Vector{Equation}:
51
- # Differential(t)(decay1₊f(t)) ~ 0
52
- # 0 ~ decay1₊x(t) - (decay2₊f(t))
53
- # Differential(t)(decay1₊x(t)) ~ decay1₊f(t) - (decay1₊a*(decay1₊x(t)))
54
- # Differential(t)(decay2₊x(t)) ~ decay2₊f(t) - (decay2₊a*(decay2₊x(t)))
50
+ equations (simplified_sys)
55
51
```
56
52
57
53
Now we can solve the system:
@@ -94,7 +90,7 @@ example, let's say there is a variable `x` in `states` and a variable
94
90
` x ` in ` subsys ` . We can declare that these two variables are the same
95
91
by specifying their equality: ` x ~ subsys.x ` in the ` eqs ` for ` sys ` .
96
92
This algebraic relationship can then be simplified by transformations
97
- like ` alias_elimination ` or ` tearing ` which will be described later.
93
+ like ` structural_simplify ` which will be described later.
98
94
99
95
### Numerics with Composed Models
100
96
@@ -123,13 +119,13 @@ done even if the variable `x` is eliminated from the system from
123
119
transformations like ` alias_elimination ` or ` tearing ` : the variable
124
120
will be lazily reconstructed on demand.
125
121
126
- ## Alias Elimination
122
+ ## Structural Simplify
127
123
128
124
In many cases, the nicest way to build a model may leave a lot of
129
125
unnecessary variables. Thus one may want to remove these equations
130
- before numerically solving. The ` alias_elimination ` function removes
131
- these relationships and trivial singularity equations, i.e. equations
132
- which result in ` 0~0 ` expressions in over-specified systems.
126
+ before numerically solving. The ` structural_simplify ` function removes
127
+ these trivial equality relationships and trivial singularity equations,
128
+ i.e. equations which result in ` 0~0 ` expressions, in over-specified systems.
133
129
134
130
## Inheritance and Combine (TODO)
135
131
@@ -179,7 +175,7 @@ values. The user of this model can then solve this model simply by
179
175
specifying the values at the highest level:
180
176
181
177
``` julia
182
- sireqn_simple = alias_elimination (sir)
178
+ sireqn_simple = structural_simplify (sir)
183
179
184
180
# # User Code
185
181
@@ -212,6 +208,22 @@ systems. For example, we could equivalently have done:
212
208
@named sir = combine ([seqn,ieqn,reqn])
213
209
```
214
210
215
- ## The Tearing Transformation
216
-
217
- ## Automatic Model Promotion
211
+ ## Tearing Problem Construction
212
+
213
+ Some system types, specifically ` ODESystem ` and ` NonlinearSystem ` , can be further
214
+ reduced if ` structural_simplify ` has already been applied to them. This is done
215
+ by using the alternative problem constructors, ` ODAEProblem ` and ` BlockNonlinearProblem `
216
+ respectively. In these cases, the constructor uses the knowledge of the
217
+ strongly connected components calculated during the process of simplification
218
+ as the basis for building pre-simplified nonlinear systems in the implicit
219
+ solving. In summary: these problems are structurally modified, but could be
220
+ more efficient and more stable.
221
+
222
+ ## Automatic Model Promotion (TODO)
223
+
224
+ In many cases one might want to compose models of different types. For example,
225
+ one may want to include a ` NonlinearSystem ` as a set of algebraic equations
226
+ within an ` ODESystem ` , or one may want to use an ` ODESystem ` as a subsystem of
227
+ an ` SDESystem ` . In these cases, the compostion works automatically by promoting
228
+ the model via ` promote_system ` . System promotions exist in the cases where a
229
+ mathematically-trivial definition of the promotion exists.
0 commit comments