Debugging MTK with residuals

I have some ModelingToolkit simulation that yields dubious results. No numerical error; just some quantity that becomes negative when it shouldn’t. I have to assume that one of my equations is wrong. Perhaps there is a contradiction? One way of finding out would be to check if, for all equations in my model, the lhs and rhs are within numerical tolerance. Is there an easy way of doing that in MTK?

Not yet. This is being done here where a deeper verbosity system can allow for specifying certain things to log during a run:

1 Like