Skip to content

Commit 672eeac

Browse files
authored
Merge pull request #2734 from oscardssmith/os/start-upgrade-to-MTK-v10
start upgrade to MTK@10
2 parents a8a58ab + fa2feee commit 672eeac

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

lib/OrdinaryDiffEqBDF/Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
6363
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
6464
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
6565
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
66-
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
6766
ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5"
6867
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6968
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
@@ -73,4 +72,4 @@ JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
7372
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
7473

7574
[targets]
76-
test = ["DiffEqDevTools", "ForwardDiff", "Random", "SafeTestsets", "Test", "ODEProblemLibrary", "StaticArrays", "Enzyme", "LinearSolve", "JET", "Aqua", "NonlinearSolve"]
75+
test = ["DiffEqDevTools", "ForwardDiff", "Random", "SafeTestsets", "Test", "ODEProblemLibrary", "StaticArrays", "Enzyme", "LinearSolve", "JET", "Aqua"]

lib/OrdinaryDiffEqBDF/test/inference_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using OrdinaryDiffEqBDF, NonlinearSolve, Test
1+
using OrdinaryDiffEqBDF, Test
22

33
prob = ODEProblem((du,u,p,t) -> du .= u, zeros(1), (0.0,1.0))
44
nlalg = FBDF(autodiff=false, nlsolve = OrdinaryDiffEqBDF.NonlinearSolveAlg(TrustRegion(autodiff = AutoFiniteDiff())))

lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sys = prob_ode_vanderpol.f.sys
4444

4545
# test adaptivity
4646
for iip in (true, false)
47-
vanstiff = ODEProblem{iip}(sys, [sys.y => 0, sys.x => sqrt(3)], (0.0, 1.0), [sys.μ => 1e6])
47+
vanstiff = ODEProblem{iip}(sys, [sys.y => 0, sys.x => sqrt(3), sys.μ => 1e6], (0.0, 1.0))
4848
sol = solve(vanstiff, RadauIIA5())
4949
if iip
5050
@test sol.stats.naccept + sol.stats.nreject > sol.stats.njacs # J reuse
@@ -69,7 +69,7 @@ end
6969

7070
# test adaptivity
7171
for iip in (true, false)
72-
vanstiff = ODEProblem{iip}(sys, [sys.y => 0, sys.x => sqrt(3)], (0.0, 1.0), [sys.μ => 1e6])
72+
vanstiff = ODEProblem{iip}(sys, [sys.y => 0, sys.x => sqrt(3), sys.μ => 1e6], (0.0, 1.0))
7373
sol = solve(vanstiff, RadauIIA3())
7474
if iip
7575
@test sol.stats.naccept + sol.stats.nreject > sol.stats.njacs # J reuse

test/interface/dae_initialize_integration.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ single_neuron_eqs = [
77
D(v) ~ min(max(-2 - v, v), 2 - v) - w + F, # add the flux term
88
D(w) ~ e * (v - g * w + b)
99
]
10-
n1 = ODESystem(single_neuron_eqs, t, [v, w, F], [g, e, b], name = :n1)
11-
n2 = ODESystem(single_neuron_eqs, t, [v, w, F], [g, e, b], name = :n2)
10+
n1 = System(single_neuron_eqs, t, [v, w, F], [g, e, b], name = :n1)
11+
n2 = System(single_neuron_eqs, t, [v, w, F], [g, e, b], name = :n2)
1212
@parameters Di Dk
1313
connections = [0 ~ n1.F - Di * Dk * max(n1.v - n2.v, 0)
1414
0 ~ n2.F - Di * max(n2.v - n1.v, 0)]
15-
connected = ODESystem(connections, t, [], [Di, Dk], systems = [n1, n2], name = :connected)
15+
connected = System(connections, t, [], [Di, Dk], systems = [n1, n2], name = :connected)
1616
connected = complete(connected)
1717

1818
u0 = [
@@ -82,7 +82,7 @@ sol = solve(prob, Rodas5P(), dt = 1e-10)
8282
# https://github.com/SciML/ModelingToolkit.jl/issues/3504
8383
@variables x(t) y(t)
8484
@parameters c1 c2
85-
@mtkbuild sys = ODESystem([D(x) ~ -c1 * x + c2 * y, D(y) ~ c1 * x - c2 * y], t)
85+
@mtkbuild sys = System([D(x) ~ -c1 * x + c2 * y, D(y) ~ c1 * x - c2 * y], t)
8686
prob = ODEProblem(sys, [1.0, 2.0], (0.0, 1.0), [c1 => 1.0, c2 => 2.0])
8787
@test prob.ps[Initial(x)] 1.0
8888
@test prob.ps[Initial(y)] 2.0

test/interface/jacobian_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end
5656

5757
prob = ODEProblem(lotka, [1.0, 1.0], (0.0, 1.0), [1.5, 1.0, 3.0, 1.0])
5858
de = ModelingToolkit.modelingtoolkitize(prob) |> complete
59-
prob2 = ODEProblem(de; jac = true)
59+
prob2 = ODEProblem(de, [], prob.tspan; jac = true)
6060

6161
sol = solve(prob, TRBDF2())
6262

test/interface/stiffness_detection_test.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ODEProblemLibrary: prob_ode_vanderpol
33
using ForwardDiff: Dual
44

55
sys = prob_ode_vanderpol.f.sys
6-
prob1 = ODEProblem(sys, [sys.y => 0, sys.x => 2.0], (0.0, 6), [sys.μ => inv(0.003)])
6+
prob1 = ODEProblem(sys, [sys.y => 0, sys.x => 2.0, sys.μ => inv(0.003)], (0.0, 6))
77
function __van(du, u, p, t)
88
μ = p[1]
99
du[1] = μ * ((1 - u[2]^2) * u[1] - u[2])

0 commit comments

Comments
 (0)