Magnus solver slow compared with Tsitouras for linear state independent ODE

First of all, you need adaptive=false here to force fixed dt on Tsit5. You only set the initial dt.

The Magnus methods are non-adaptive so the tolerance does not effect them. Their error is determined by the dt.

The Magnus methods will could use some more optimization. But I think for very small cases it will be hard for them to outperform the highly optimized RK methods. Where they shine is not in terms of performance but instead enforcing that certain constraints are satisfied, like positivity.

1 Like