How to change ode solver settings for a Simbiology model?

4 次查看(过去 30 天)
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!

采纳的回答

Arthur Goldsipe
Arthur Goldsipe 2013-8-2
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 个评论
Zoltan Tuza
Zoltan Tuza 2013-8-9
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

请先登录,再进行评论。

更多回答(0 个)

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Scan Parameter Ranges 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by