I'm frequently using systems of ODEs to simulate the dynamics of ecological communities. The number of equations is large: from hundreds to thousands, and running times are sometimes desperately long. The diversity of species’ characteristics implies that some of them have dynamics which are orders of magnitude faster than others: like the difference between a bacteria and a tree. The ‘faster’ species require tighter tolerances which, in turn, result in smaller time steps, but that is usually unnecessarily small for the ‘slower’ species, which are essentially constants (or very slowly varying) at that time scale (e.g. hours vs. months or years) and could use much larger tolerances and longer time-steps. I guess this, if possible, would save computing time, which is the goal here. So, my question is: is there any way to set at least two different tolerances for different groups of equations in a system of ODEs? Or any other way to get around this problem? I use MATLAB R2017b.
MATLAB: Is there any way to use multiple tolerances in ODE solvers
computing timeMATLABodespeedtime steptolerance
Best Answer