Skip to content

Commit 51ede13

Browse files
committed
Simplify code ode modeling tutorial to match code comments
Comments mention ODE with 1 equation, but example was a DAE with 2 equations.
1 parent 2c0eb01 commit 51ede13

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/src/tutorials/ode_modeling.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@ using ModelingToolkit
1818
D = Differential(t) # define an operator for the differentiation w.r.t. time
1919

2020
# your first ODE, consisting of a single equation, indicated by ~
21-
@named fol_separate = ODESystem([ RHS ~ (1 - x)/τ,
22-
D(x) ~ RHS ])
21+
@named fol = ODESystem([ D(x) ~ (1 - x)/τ])
2322

2423
using DifferentialEquations: solve
2524
using Plots: plot
2625

27-
prob = ODEProblem(structural_simplify(fol_separate), [x => 0.0], (0.0,10.0), [τ => 3.0])
26+
prob = ODEProblem(fol, [x => 0.0], (0.0,10.0), [τ => 3.0])
2827
sol = solve(prob)
29-
plot(sol, vars=[x,RHS])
28+
plot(sol)
3029
```
3130

32-
![Simulation result of first-order lag element, with right-hand side](https://user-images.githubusercontent.com/13935112/111958403-7e8d3e00-8aed-11eb-9d18-08b5180a59f9.png)
33-
31+
![Simulation result of first-order lag element, with right-hand side](https://user-images.githubusercontent.com/13935112/111958369-703f2200-8aed-11eb-8bb4-0abe9652e850.png)
3432
Now let's start digging into MTK!
3533

3634
## Your very first ODE

0 commit comments

Comments
 (0)