You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example fails (but passes with the commented line uncommented):
using Test
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DifferentialEquations
@variablesx(t)
@named sys =ODESystem([D(x) ~0], t; initialization_eqs = [x ~1.0]) # test fails with this uncommented#@named sys = ODESystem([D(x) ~ 0], t; defaults = [x => 1.0]) # test passes with this uncommented
ssys =structural_simplify(sys)
prob1 =ODEProblem(ssys, [], (0.0, 1.0), [])
prob2 =remake(prob1, u0 = [x =>2.0])
sol2 =solve(prob2)
@test sol2[x][begin] ==2.0
The text was updated successfully, but these errors were encountered:
I can kind of understand why. If I say that x ~ 1.0 during initialization, it would be inconsistent to override that with x => 2.0 in remake. But then I think remake could throw an error to avoid ambiguity.
This should fail with an initialization failure. @AayushSabharwal I think we discussed this one, the initialization problem needs to be rebuilt if the choices for the initial conditions change.
This example fails (but passes with the commented line uncommented):
The text was updated successfully, but these errors were encountered: