Skip to content

Commit 5d03220

Browse files
committed
Fix deprecated @mtkbuild usage in demo.jl
- Replace @mtkbuild macro calls with @mtkcompile - Addresses deprecation warnings in demo examples - Maintains functionality while using new recommended syntax 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3e3a6b8 commit 5d03220

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

demo.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
2020
eqs = [D(D(x)) ~ λ * x
2121
D(D(y)) ~ λ * y - g
2222
x^2 + y^2 ~ 1]
23-
@mtkbuild pend = System(eqs, t)
23+
@mtkcompile pend = System(eqs, t)
2424
prob = ODEProblem(pend, [x => -1, y => 0], (0.0, 10.0), [g => 1], guesses ==> 1])
2525

2626
sol = solve(prob, FBDF())
@@ -37,7 +37,7 @@ eqs = [
3737
D(z) ~ x * y - β * z + 0.1z * a
3838
]
3939

40-
@mtkbuild sys1 = System(eqs, t)
40+
@mtkcompile sys1 = System(eqs, t)
4141

4242
eqs = [
4343
D(x) ~ σ * (y - x),
@@ -49,7 +49,7 @@ noiseeqs = [0.1*x;
4949
0.1*y;
5050
0.1*z;;]
5151

52-
@mtkbuild sys2 = SDESystem(eqs, noiseeqs, t)
52+
@mtkcompile sys2 = SDESystem(eqs, noiseeqs, t)
5353

5454
u0 = [
5555
x => 1.0,
@@ -73,7 +73,7 @@ odeprob = ODEProblem(sys1, u0, (0.0, 10.0), p; check_compatibility = false)
7373
eqs = [0 ~ σ * (y - x),
7474
y ~ x *- z),
7575
β * z ~ x * y]
76-
@mtkbuild sys = System(eqs)
76+
@mtkcompile sys = System(eqs)
7777

7878
## ImplicitDiscrete Affects
7979

@@ -83,7 +83,7 @@ eqs = [D(D(x)) ~ λ * x
8383
D(D(y)) ~ λ * y - g
8484
x^2 + y^2 ~ 1]
8585
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)
8787
prob = ODEProblem(pend, [x => -1, y => 0], (0.0, 10.0), [g => 1], guesses ==> 1])
8888

8989
sol = solve(prob, FBDF())
@@ -104,4 +104,4 @@ function SysC(; name)
104104
@named subsys = SysB(; var1 = x)
105105
return System([D(x) ~ x], t; systems = [subsys], name)
106106
end
107-
@mtkbuild sys = SysC()
107+
@mtkcompile sys = SysC()

0 commit comments

Comments
 (0)