How to change ode solver settings for a Simbiology model?

3 views (last 30 days)
Hi Everyone,
I have a large stiff reaction network in Simbiology, which runs smoothly in R2010a with ode15s solver. I tested the code in R2012b and R2013a where the ode solver fails (all of them). A "very detailed" error message says:
Error using SBCompiler.SimulationObject/simulate Integration Tolerance Not Met.
If I export this model into SBML and back to matlab as an ODE function (calling ode15s() function), it runs without a problem in R2013a (using default ODE 15s settings). I was wondering is there any way to change the relTol, absTol settings for Simbiology simulations (configset obj)? It seems that way the (absolute/relative) tolerance settings for ode15s() and Simbiology's ode15s call are different.
Thanks!

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 2 Aug 2013
Hi Zoltan,
Yes, there is a way to change several options related to the ODE solver, including the absolute and relative tolerances. If your SimBiology model is in a variable m1, you can view all the options like this:
get(m1.getconfigset('active').SolverOptions)
You can then set the options like this:
m1.getconfigset('active').SolverOptions.AbsoluteTolerance = 1e-5;
Note that a new ODE solver option was introduced in R2012b, AbsoluteToleranceStepSize, which often (but not always) improves the quality of the solution by adaptively adjusting the absolute tolerance during the simulation. You may also try setting that option to false and see if that improves the quality of the results for your particular model.
Finally, I wanted to point out another feature that you might find useful in this situation. In R2012b, you can get a text view of the ODEs that SimBiology creates for your model using the new getequations method. For example:
equations = m1.getequations
Good luck with your modeling!
-Arthur
  1 Comment
Zoltan Tuza
Zoltan Tuza on 9 Aug 2013
Hi Arthur,
Thanks for the detailed reply, it was very helpful! Turning off AbsoluteToleranceStepSize solved my problem. Now, I can run my model under Matlab 2013a as well.
Zoltan

Sign in to comment.

More Answers (0)

Communities

More Answers in the  SimBiology Community

Categories

Find more on Scan Parameter Ranges in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!