@@ -20,7 +20,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
20
20
eqs = [D (D (x)) ~ λ * x
21
21
D (D (y)) ~ λ * y - g
22
22
x^ 2 + y^ 2 ~ 1 ]
23
- @mtkbuild pend = System (eqs, t)
23
+ @mtkcompile pend = System (eqs, t)
24
24
prob = ODEProblem (pend, [x => - 1 , y => 0 ], (0.0 , 10.0 ), [g => 1 ], guesses = [λ => 1 ])
25
25
26
26
sol = solve (prob, FBDF ())
@@ -37,7 +37,7 @@ eqs = [
37
37
D (z) ~ x * y - β * z + 0.1 z * a
38
38
]
39
39
40
- @mtkbuild sys1 = System (eqs, t)
40
+ @mtkcompile sys1 = System (eqs, t)
41
41
42
42
eqs = [
43
43
D (x) ~ σ * (y - x),
@@ -49,7 +49,7 @@ noiseeqs = [0.1*x;
49
49
0.1 * y;
50
50
0.1 * z;;]
51
51
52
- @mtkbuild sys2 = SDESystem (eqs, noiseeqs, t)
52
+ @mtkcompile sys2 = SDESystem (eqs, noiseeqs, t)
53
53
54
54
u0 = [
55
55
x => 1.0 ,
@@ -73,7 +73,7 @@ odeprob = ODEProblem(sys1, u0, (0.0, 10.0), p; check_compatibility = false)
73
73
eqs = [0 ~ σ * (y - x),
74
74
y ~ x * (ρ - z),
75
75
β * z ~ x * y]
76
- @mtkbuild sys = System (eqs)
76
+ @mtkcompile sys = System (eqs)
77
77
78
78
# # ImplicitDiscrete Affects
79
79
@@ -83,7 +83,7 @@ eqs = [D(D(x)) ~ λ * x
83
83
D (D (y)) ~ λ * y - g
84
84
x^ 2 + y^ 2 ~ 1 ]
85
85
c_evt = [t ~ 5.0 ] => [x ~ Pre (x) + 0.1 ]
86
- @mtkbuild pend = System (eqs, t, continuous_events = c_evt)
86
+ @mtkcompile pend = System (eqs, t, continuous_events = c_evt)
87
87
prob = ODEProblem (pend, [x => - 1 , y => 0 ], (0.0 , 10.0 ), [g => 1 ], guesses = [λ => 1 ])
88
88
89
89
sol = solve (prob, FBDF ())
@@ -104,4 +104,4 @@ function SysC(; name)
104
104
@named subsys = SysB (; var1 = x)
105
105
return System ([D (x) ~ x], t; systems = [subsys], name)
106
106
end
107
- @mtkbuild sys = SysC ()
107
+ @mtkcompile sys = SysC ()
0 commit comments