Overdetermined ODEProblem after upgrading from MTK v8.75.0 to MTK v9.72.0

Since there is only one differential equation, you only need one initial condition.

That second condition is extra information. There’s only one condition to solve for but two conditions.

u0 = [
    C2.Δv => 7209,
]

That would fix it. You might want to do:

prob = ODEProblem(sys, u0, (0, 10), guesses = [R2.Δv => 1671])

basically, help the system by giving a guess for the algebraic value, but it’s not necessary and it may not be used.

MTK v8 used to not be smart enough to validate this. It would automatically treat the non-differential value R2.Δv => 1671 as a guess, but this confused users because sometimes they would see it change and say “but I told it I wanted this!”

So in MTK v9, we guarantee that if you say “this value is 1.2354”, then it will be that value. If it can’t be that value, we will error. We guarantee that all statements and equations will be respected or error if they cannot simultaneously. If you’re trying to pass information to help the Newton method guess a good starting point, that’s separted as guess so that it’s explicitly not an equation that is guaranteed. That’s the major breaking change of v9, force that all equations are respected. In the end, it gives much cleaner explanations of what each term means, but it does mean that some things that seem to have worked in v8 will have broke in v9 (though I stress “seemed” because if you check sol[1] you’ll see R2.Δv => 1671 didn’t hold, it just wasn’t clear that initial values on algebraic variables were interpreted as guesses).

1 Like