DAE simulation fails even when all derivatives are zero

Looking at your system of equations, I can see that the 2 equations with cation1m are actually the same. You need to swap out one of these equations with some new information for the numerical solver to work.

I wrote a list of debugging tips for MTK here: Debugging difficult stiff ODE/DAE models · ModelingToolkit Course It’s a bit out of date since the new releases of MTK, but the ideas are still valid.

Hopefully something there may be of some help. This stuff is always very challenging, hope you can find a small system that works and helps you move the ball forward.

4 Likes