MATLAB: Issue in Simbiology Stochastic Simulations

SimBiologysimulationsstochastic

I am able to run stochastic simulations on very small and simple models and it works okay, but if I add more than 5-10 components, it takes much more time and often just freezes my computer. Have anyone ever run into similar issues? If so, do you have any insights that you could share with me?

Best Answer

Which stochastic solver are you using? If you're using 'ssa', then you will probably see simulation times increase with the number of molecules in the system. This is more likely to be the issue than the total number of unique species in the model.
First, I recommend setting the MaximumWallClock option any time you have trouble with long running simulations. This allows you to stop the simulation after an approximate amount of "real world" (or "wall clock") time. You can then inspect the simulation results and see why the simulations are taking so long.
In this case, you might find that one reason the simulations are taking so long is that you are logging many results at very small time intervals (due to the large number of molecules in the system). If that's the case, you can see if reducing the amount of data logging can speed up your simulations sufficiently. For example, you can set LogDecimation to 10 to report every 10th time point.
If 'ssa' still takes too long after setting LogDecimation, then I recommend switching to one of the tau-leap solvers. The implicit solver ('impltau') is usually the fastest of the 3 options. You can read more about how to choose a stochastic solver here.
-Arthur