Skip to content

Commit 8f1c18c

Browse files
Merge pull request #126 from SciML/mtk
Update to ModelingToolkit v9
2 parents df61f71 + 480dd6c commit 8f1c18c

File tree

12 files changed

+52
-52
lines changed

12 files changed

+52
-52
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
- lib/NonlinearProblemLibrary
3232
version:
3333
- '1'
34-
- '1.6'
3534
steps:
3635
- uses: actions/checkout@v4
3736
- uses: julia-actions/setup-julia@v1

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ JumpProblemLibrary = "0.1"
2020
NonlinearProblemLibrary = "0.1"
2121
ODEProblemLibrary = "0.1"
2222
SDEProblemLibrary = "0.1"
23-
julia = "1.6"
23+
julia = "1.10"

lib/BVProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1111
Aqua = "0.5"
1212
DiffEqBase = "6"
1313
SpecialFunctions = "2.3"
14-
julia = "1.6"
14+
julia = "1.10"
1515

1616
[extras]
1717
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/DAEProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
99
[compat]
1010
Aqua = "0.5"
1111
DiffEqBase = "6"
12-
julia = "1.6"
12+
julia = "1.10"
1313

1414
[extras]
1515
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/DDEProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
88
[compat]
99
Aqua = "0.5"
1010
DiffEqBase = "6"
11-
julia = "1.6"
11+
julia = "1.10"
1212

1313
[extras]
1414
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/JumpProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Aqua = "0.5"
1212
Catalyst = "13"
1313
DiffEqBase = "6"
1414
RuntimeGeneratedFunctions = "0.5"
15-
julia = "1.6"
15+
julia = "1.10"
1616

1717
[extras]
1818
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/NonlinearProblemLibrary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1010
Aqua = "0.8"
1111
LinearAlgebra = "1.6"
1212
SciMLBase = "1, 2"
13-
julia = "1.6"
13+
julia = "1.10"
1414

1515
[extras]
1616
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/ODEProblemLibrary/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
1515
Aqua = "0.5"
1616
DiffEqBase = "6"
1717
Latexify = "0.15, 0.16"
18-
ModelingToolkit = "7,8"
18+
ModelingToolkit = "9"
1919
RuntimeGeneratedFunctions = "0.5"
20-
julia = "1.6"
20+
julia = "1.10"
2121

2222
[extras]
2323
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

lib/ODEProblemLibrary/src/ODEProblemLibrary.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module ODEProblemLibrary
55
using DiffEqBase
66
using Latexify
77
using ModelingToolkit
8+
using ModelingToolkit: t_nounits as t, D_nounits as D
89

910
using LinearAlgebra
1011
using Markdown

lib/ODEProblemLibrary/src/ode_simple_nonlinear_prob.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ prob_ode_fitzhughnagumo = ODEProblem(fitz, [1.0; 1.0], (0.0, 1.0),
4949
(0.7, 0.8, 1 / 12.5, 0.5))
5050

5151
#Van der Pol Equations
52-
@parameters t μ
52+
@parameters μ
5353
@variables x(t) y(t)
54-
D = Differential(t)
54+
5555
eqs = [D(y) ~ μ * ((1 - x^2) * y - x),
5656
D(x) ~ y]
57-
de = ODESystem(eqs; name = :van_der_pol)
57+
de = ODESystem(eqs,t; name = :van_der_pol) |> structural_simplify |> complete
5858
van = ODEFunction(de, [y, x], [μ], jac = true, eval_module = @__MODULE__)
5959

6060
"""
@@ -90,13 +90,13 @@ Stiff parameters.
9090
prob_ode_vanderpol_stiff = ODEProblem(van, [0; sqrt(3)], (0.0, 1.0), 1e6)
9191

9292
# ROBER
93-
@parameters t k₁ k₂ k₃
93+
@parameters k₁ k₂ k₃
9494
@variables y₁(t) y₂(t) y₃(t)
95-
D = Differential(t)
95+
9696
eqs = [D(y₁) ~ -k₁ * y₁ + k₃ * y₂ * y₃,
9797
D(y₂) ~ k₁ * y₁ - k₂ * y₂^2 - k₃ * y₂ * y₃,
9898
D(y₃) ~ k₂ * y₂^2]
99-
de = ODESystem(eqs; name = :rober)
99+
de = ODESystem(eqs,t; name = :rober) |> structural_simplify |> complete
100100
rober = ODEFunction(de, [y₁, y₂, y₃], [k₁, k₂, k₃], jac = true, eval_module = @__MODULE__)
101101

102102
"""
@@ -171,13 +171,13 @@ prob_ode_threebody = ODEProblem(threebody,
171171

172172
# Rigid Body Equations
173173

174-
@parameters t I₁ I₂ I₃
174+
@parameters I₁ I₂ I₃
175175
@variables y₁(t) y₂(t) y₃(t)
176-
D = Differential(t)
176+
177177
eqs = [D(y₁) ~ I₁ * y₂ * y₃,
178178
D(y₂) ~ I₂ * y₁ * y₃,
179179
D(y₃) ~ I₃ * y₁ * y₂]
180-
de = ODESystem(eqs; name = :rigid_body)
180+
de = ODESystem(eqs,t; name = :rigid_body) |> structural_simplify |> complete
181181
rigid = ODEFunction(de, [y₁, y₂, y₃], [I₁, I₂, I₃], jac = true, eval_module = @__MODULE__)
182182

183183
"""
@@ -348,9 +348,9 @@ mm_f = ODEFunction(mm_linear; analytic = (u0, p, t) -> exp(inv(MM_linear) * mm_A
348348
mass_matrix = MM_linear)
349349
prob_ode_mm_linear = ODEProblem(mm_f, rand(4), (0.0, 1.0))
350350

351-
@parameters t p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
351+
@parameters p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12
352352
@variables y1(t) y2(t) y3(t) y4(t) y5(t) y6(t) y7(t) y8(t)
353-
D = Differential(t)
353+
354354
eqs = [D(y1) ~ -p1 * y1 + p2 * y2 + p3 * y3 + p4,
355355
D(y2) ~ p1 * y1 - p5 * y2,
356356
D(y3) ~ -p6 * y3 + p2 * y4 + p7 * y5,
@@ -360,7 +360,7 @@ eqs = [D(y1) ~ -p1 * y1 + p2 * y2 + p3 * y3 + p4,
360360
p2 * y6 + p11 * y7,
361361
D(y7) ~ p10 * y6 * y8 - p12 * y7,
362362
D(y8) ~ -p10 * y6 * y8 + p12 * y7]
363-
de = ODESystem(eqs; name = :hires)
363+
de = ODESystem(eqs,t; name = :hires) |> structural_simplify |> complete
364364
hires = ODEFunction(de, [y1, y2, y3, y4, y5, y6, y7, y8],
365365
[p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12],
366366
jac = true)
@@ -396,13 +396,13 @@ prob_ode_hires = ODEProblem(hires, u0, (0.0, 321.8122),
396396
10.03, 0.035, 1.12, 1.745, 280.0,
397397
0.69, 1.81))
398398

399-
@parameters t p1 p2 p3
399+
@parameters p1 p2 p3
400400
@variables y1(t) y2(t) y3(t)
401-
D = Differential(t)
401+
402402
eqs = [D(y1) ~ p1 * (y2 + y1 * (1 - p2 * y1 - y2)),
403403
D(y2) ~ (y3 - (1 + y1) * y2) / p1,
404404
D(y3) ~ p3 * (y1 - y3)]
405-
de = ODESystem(eqs; name = :orego)
405+
de = ODESystem(eqs,t; name = :orego) |> structural_simplify |> complete
406406
jac = calculate_jacobian(de)
407407
orego = ODEFunction(de, [y1, y2, y3], [p1, p2, p3], jac = true, eval_module = @__MODULE__)
408408

0 commit comments

Comments
 (0)