MATLAB Answers

Why are my SimBiology simulations freezing in bigger and complex models?

3 views (last 30 days)
I have a big and complicated model in SimBiology and when am running a simulation, it freezes. I have ran simple examples from the documentation and they run just fine.
Why are my SimBiology simulations freezing in bigger and complex models? Can it be a mathematical instability in my model?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Oct 2021
Edited: MathWorks Support Team on 26 Oct 2021
It is quite possible that you have constructed a complex model that takes an extremely long time to simulate, in which case the expected behaviour is that MATLAB will remain busy until the simulation is complete or you interrupt the simulation.
If simulating from the command line, then you should be able to interrupt by pressing Control-C. If simulating within the SimBiology Desktop app, then you should be able to interrupt by clicking on the stop button.
Running extremely long simulations may use a lot of memory, as more and more simulation results are stored in memory. If the memory usage starts to exceed the available physical RAM, then MATLAB can become unresponsive as memory is swapped between physical RAM and disk. One simple you can do is to monitor the amount of memory that MATLAB is using.
In order to monitor the progress of a simulation is to perform the simulation in SimBiology Desktop app with a "live plot" that shows the results of each simulation time step as it is calculated. This should allow you to see if and how the simulation is making progress. You can find more information about that in the documentation page about "Configuring Live Plots" in:
.
Also, a general recommendation when simulating complex models is to set the "MaximumWallClock" option to a reasonable time limit. This should cause the simulation to end after the specific real-world time has elapsed. That should prevent excessively long simulations. You can find more information about that option in the documentation page in
.
If we understand correctly what is meant by "mathematical instability", then SimBiology could get stuck in an extremely long-running simulation without reporting any errors. This is not something that we can easily check for. Once again, we encourage to set "MaximumWallClock" during fitting to avoid such long-running simulations. Otherwise, SimBiology is essentially doing what it is asked to do and is attempting an extremely long-running simulation.

More Answers (1)

Praveen Kumar M
Praveen Kumar M on 17 Jun 2019
One important piece of information required over here is the configuration of your computer ? You can also tell about the OS in which it runs. These info will help in additionally getting a view point about the possibilty of simulation.

Communities

More Answers in the  SimBiology Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!