@@ -38,7 +38,7 @@ lower it to a first order system, symbolically generate the Jacobian function
38
38
for the numerical integrator, and solve it.
39
39
40
40
``` julia
41
- using ModelingToolkit, OrdinaryDiffEq
41
+ using DifferentialEquations, ModelingToolkit
42
42
43
43
@parameters t σ ρ β
44
44
@variables x (t) y (t) z (t)
@@ -49,7 +49,7 @@ eqs = [D(D(x)) ~ σ*(y-x),
49
49
D (z) ~ x* y - β* z]
50
50
51
51
@named sys = ODESystem (eqs)
52
- sys = ode_order_lowering (sys)
52
+ sys = structural_simplify (sys)
53
53
54
54
u0 = [D (x) => 2.0 ,
55
55
x => 1.0 ,
@@ -62,8 +62,8 @@ p = [σ => 28.0,
62
62
63
63
tspan = (0.0 ,100.0 )
64
64
prob = ODEProblem (sys,u0,tspan,p,jac= true )
65
- sol = solve (prob, Tsit5 () )
66
- using Plots; plot (sol,vars = (x,y))
65
+ sol = solve (prob)
66
+ using Plots; plot (sol,idxs = (x,y))
67
67
```
68
68
69
69
![ Lorenz2] ( https://user-images.githubusercontent.com/1814174/79118645-744eb580-7d5c-11ea-9c37-13c4efd585ca.png )
@@ -75,7 +75,7 @@ interacting Lorenz equations and simulate the resulting Differential-Algebraic
75
75
Equation (DAE):
76
76
77
77
``` julia
78
- using ModelingToolkit, OrdinaryDiffEq
78
+ using DifferentialEquations, ModelingToolkit
79
79
80
80
@parameters t σ ρ β
81
81
@variables x (t) y (t) z (t)
@@ -111,9 +111,9 @@ p = [lorenz1.σ => 10.0,
111
111
112
112
tspan = (0.0 ,100.0 )
113
113
prob = ODEProblem (connected,u0,tspan,p)
114
- sol = solve (prob, Rodas4 () )
114
+ sol = solve (prob)
115
115
116
- using Plots; plot (sol,vars = (a,lorenz1. x,lorenz2. z))
116
+ using Plots; plot (sol,idxs = (a,lorenz1. x,lorenz2. z))
117
117
```
118
118
119
119
![ ] ( https://user-images.githubusercontent.com/1814174/110242538-87461780-7f24-11eb-983c-4b2c93cfc909.png )
0 commit comments