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
Copy file name to clipboardExpand all lines: docs/src/examples/perturbation.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,8 +92,7 @@ We are nearly there! From this point on, the rest is standard ODE solving proced
92
92
```julia
93
93
using ModelingToolkit, DifferentialEquations
94
94
95
-
@named sys =ODESystem(eqs, t)
96
-
sys =structural_simplify(sys)
95
+
@mtkbuild sys =ODESystem(eqs, t)
97
96
unknowns(sys)
98
97
```
99
98
@@ -158,8 +157,7 @@ eqs = [substitute(first(v), subs) ~ substitute(last(v), subs) for v in vals]
158
157
We continue with converting 'eqs' to an `ODEProblem`, solving it, and finally plot the results against the exact solution to the original problem, which is $x(t, \epsilon) = (1 - \epsilon)^{-1/2} e^{-\epsilon t} \sin((1- \epsilon^2)^{1/2}t)$,
To ensure that the `Restrictor` component does not disrupt the domain network, the [`domain_connect()`](@ref) function can be used, which explicitly only connects the domain network and not the unknown variables.
@@ -322,15 +321,14 @@ To ensure that the `Restrictor` component does not disrupt the domain network, t
322
321
ODESystem(eqs, t, [], pars; systems, name)
323
322
end
324
323
325
-
@named ressys = RestrictorSystem()
326
-
sys = structural_simplify(ressys)
324
+
@mtkbuild ressys = RestrictorSystem()
327
325
nothing #hide
328
326
```
329
327
330
328
Now that the `Restrictor` component is properly defined using `domain_connect()`, the defaults for `res.port_b` and `vol.port` are properly defined.
0 commit comments