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
Note: my system is not overdetermined! I can see this because for one, the InitializationProblem build and solves just fine. Also I can simply remove u0 without incident...
julia> prob =ODEProblem(sys, [], (0, 0))
ODEProblem with uType Vector{Float64} and tType Int64. In-place:true
timespan: (0, 0)
u0:6-element Vector{Float64}:0.00.00.00.00.00.0
The text was updated successfully, but these errors were encountered:
This isn't an interface bug. In the first example, there is a single variable x, and the initial equation x ~ 0 from the default. Passing this solution to ODEProblem doesn't emit a warning because there are no algebraic variables, and all differential variables have an initial condition.
In your second example, there are differential and algebraic variables. ModelingToolkit.InitializationProblem(sys, 0.0) is fully determined because:
Two of the differential variables (x and dx) have defaults which act as initial equations
The other two differential variables (rho_1 and rho_2) can be solved from the observed equations for p_1 and p_2, where p_1 and p_2 have defaults
The remaining four variables in the simplified system (drho_1, drho_2, dm_1, dm_2) are algebraic and solvable from the corresponding equations.
When providing the solution from initprob to ODEProblem, the ODEProblem thinks it has 8 initial conditions, four of which are for algebraic variables. It has to ensure that the algebraic equations are satisfied, so it makes an InitializationProblem from the 8 initial conditions + 4 algebraic equations and thus is overdetermined. Since the 8 initial conditions are consistent, it will successfully solve. However, it is still an overdetermined system.
Where x => 1.0 is a default. The initialization system is:
x ~1.0
x^3+ y^3~3
Which solves to [x => 1.0, y => cbrt(2)]. If you provide this initial condition to ODEProblem, it will still create an InitializationProblem to verify the algebraic equations. Thus, it creates the system
x ~1.0
y ~cbrt(2)
x^3+ y^3~3
which is a valid initialization, but overdetermined nonetheless.
If I use
InitializationProblem
to pre-calculate au0
for a simple problem, this works without incident...However, for a more complex problem, for some reason I do not get the same behavior...
Note: my system is not overdetermined! I can see this because for one, the
InitializationProblem
build and solves just fine. Also I can simply removeu0
without incident...The text was updated successfully, but these errors were encountered: