Skip to content

Commit 8b0ba8f

Browse files
committed
Merge branch 'master' into tutorial
2 parents 219ed9b + 31e131c commit 8b0ba8f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/ModelingToolkit.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ using .SystemStructures
151151

152152
include("systems/alias_elimination.jl")
153153
include("structural_transformation/StructuralTransformations.jl")
154+
154155
@reexport using .StructuralTransformations
155156

156157
for S in subtypes(ModelingToolkit.AbstractSystem)
@@ -207,4 +208,6 @@ export modelingtoolkitize
207208
export @variables, @parameters
208209
export @named, @nonamespace, @namespace, extend, compose
209210

211+
include("precompile.jl")
212+
210213
end # module

src/precompile.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
let
2+
while true
3+
@parameters t σ ρ β
4+
@variables x(t) y(t) z(t)
5+
D = Differential(t)
6+
7+
eqs = [D(D(x)) ~ σ*(y-x) + x^0.000000000000135,
8+
D(y) ~ x*-z)-y,
9+
D(z) ~ x*y - β*z]
10+
11+
@named sys = ODESystem(eqs)
12+
sys = structural_simplify(sys)
13+
14+
u0 = [D(x) => 2.0,
15+
x => 1.0,
16+
y => 0.0,
17+
z => 0.0]
18+
19+
p ==> 28.0,
20+
ρ => 10.0,
21+
β => 8/3]
22+
23+
tspan = (0.0,100.0)
24+
prob = ODEProblem(sys,u0,tspan,p,jac=true)
25+
26+
break
27+
end
28+
end

0 commit comments

Comments
 (0)