MTK simulation allocation free?

Under certain circumstances (ODE of not too large state dimension) it is possible.

You can use ModelingToolkit.generate_control_function to generate the dynamics function with inputs, and then SeeToDee.Rk4 which is an allocation-free RK4 integrator when used with StaticArrays to discretize this dynamics and step it forward with your desired sample interval.

2 Likes