Closed hersle closed 1 week ago
The reason is that unknowns(sys)
returns unwrapped symbolic variables, which are handled differently than wrapped symbolic variables when setting up the initialization system. This is shown by this simple example:
sys2 = ODESystem([D(x) ~ 0, D(y) ~ 0], t; defaults = [x => 1], initialization_eqs = [y ~ 2], name = :sys2) |> structural_simplify
prob2 = ODEProblem(sys2, [ModelingToolkit.unwrap(x) => 2], (0.0, 1.0), []; fully_determined = true)
It fails with the same error. But it runs if x
is not unwrapped.
Interesting. Yeah that's a subtle bug that would need some digging.
Interesting. Yeah that's a subtle bug that would need some digging.
This should work:
In
sys2
,ics2
should overrideics1
, sox = 2
instead of1
. But the initialization fails with