Skip to content

Commit 33472bb

Browse files
fix modelingtoolkize to only return the system
This is somewhat of a funny case, because we document it as only returning the system, but it was still doing the old thing of returning the states and parameters as well (which is redundant). So I'm going to call it not breaking as we changed the docs awhile ago, so it's moreso just a weird error that the package was updated after the docs.
1 parent 84cdec1 commit 33472bb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/systems/diffeqs/modelingtoolkitize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ function modelingtoolkitize(prob::DiffEqBase.ODEProblem)
2424
eqs = vcat([rhs[i] ~ lhs[i] for i in eachindex(prob.u0)]...)
2525
de = ODESystem(eqs,t,vars,params)
2626

27-
de, vars, params
27+
de
2828
end

test/odesystem.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ function lotka(u,p,t)
178178
end
179179

180180
prob = ODEProblem(ODEFunction{false}(lotka),[1.0,1.0],(0.0,1.0),[1.5,1.0,3.0,1.0])
181-
de, vars, params = modelingtoolkitize(prob)
182-
ODEFunction(de, vars, params)(similar(prob.u0), prob.u0, prob.p, 0.1)
181+
de = modelingtoolkitize(prob)
182+
ODEFunction(de)(similar(prob.u0), prob.u0, prob.p, 0.1)
183183

184184
function lotka(du,u,p,t)
185185
x = u[1]
@@ -190,5 +190,5 @@ end
190190

191191
prob = ODEProblem(lotka,[1.0,1.0],(0.0,1.0),[1.5,1.0,3.0,1.0])
192192

193-
de, vars, params = modelingtoolkitize(prob)
194-
ODEFunction(de, vars, params)(similar(prob.u0), prob.u0, prob.p, 0.1)
193+
de = modelingtoolkitize(prob)
194+
ODEFunction(de)(similar(prob.u0), prob.u0, prob.p, 0.1)

0 commit comments

Comments
 (0)