Hello,
I am modelling soil bacteria degrading substrates with a spatially explicit model (i.e. a grid with one colony of bacteria in each grid cell). I have 15 equations to describe dynamics in each grid cell and I first consider a 10x10 grid. The model runs perfectly for this setup but, when I increase the grid size, the solver becomes less and less stable and aborts simulations “Warning: Instability detected. Aborting”. For instance, for a 32x32 grid, none of my simulations run until the end. The coding of the model shall be fine because:
- List item Mass balance is respected and the system is modelled as a chemostat, which means that no state variable can grow exponentially. It behaves normally for a 3x3 or 10x10 grid.
- List item Interactions in the grid only occur between the four neighbours, which means that increasing the size of the grid does not increases the calculation time per grid cell.
- List item The system does not seem to be stiff because I carefully chose the units of parameters for their value to be not larger than 100. However I am not 100% confident on this point…
To what I understand, abortion is caused by the algorithm producing diverging trajectories. I tried to lower the relative and absolute errors or to test other solvers such as Rosenbrock23() or Rodas5P() instead of the default Tsit5() as suggested by previous posts but this did not solve my problem. I suspect I did not choose the appropriate algorithm or options for such a large system but I did not manage to identify any solution in the documentation…
Thanks for helping!