sys-bio / roadrunner

libRoadRunner: A high-performance SBML simulator
http://libroadrunner.org/
Other
39 stars 24 forks source link

CV_CONV_FAILURE with BIOMD0000000409 #410

Closed matthiaskoenig closed 7 years ago

matthiaskoenig commented 7 years ago

I just found the following strange behavior: If I run the model with 1000 points everything works, if running with 1000 steps I get a convergence error.

In [10]: r = roadrunner.RoadRunner("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000409")

In [11]: s = r.simulate(start=0, end=50, points=1000)

In [12]: r = roadrunner.RoadRunner("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000409")

In [13]: s = r.simulate(start=0, end=50, steps=1000)
Error: CVODE Error: CV_CONV_FAILURE, Module: CVODE, Function: CVode, Message: At t = 42.0329 and h = 3.63424e-08, the corrector convergence test failed repeatedly or with |h| = hmin.
Error: rr::IntegratorException::IntegratorException(const string&, const string&)what: CVODE Error: CV_CONV_FAILURE: Convergence test failures occurred too many times (= MXNCF = 10) during one internal timestep or occurred with |h| = hmin., where: virtual double rr::CVODEIntegrator::integrate(double, double)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-13-b19bd0bd5253> in <module>()
----> 1 s = r.simulate(start=0, end=50, steps=1000)

~/envs/tellurium-web/lib/python3.5/site-packages/roadrunner/roadrunner.py in simulate(self, start, end, points, selections, steps)
   3576             o.steps = steps
   3577 
-> 3578         result = self._simulate(o)
   3579 
   3580         o.steps = originalSteps

~/envs/tellurium-web/lib/python3.5/site-packages/roadrunner/roadrunner.py in _simulate(self, opt)
   3330 
   3331     def _simulate(self, opt):
-> 3332         return _roadrunner.RoadRunner__simulate(self, opt)
   3333 
   3334     def getValue(self, *args):

RuntimeError: CVODE Error: CV_CONV_FAILURE: Convergence test failures occurred too many times (= MXNCF = 10) during one internal timestep or occurred with |h| = hmin.; In virtual double rr::CVODEIntegrator::integrate(double, double)
matthiaskoenig commented 7 years ago

Also for model BIOMD0000000208.

 task1[0] = model1.simulate(start=0.0, end=250.0, steps=1000)
  File "/home/mkoenig/envs/tellurium-web/lib/python3.5/site-packages/roadrunner/roadrunner.py", line 3578, in simulate
    result = self._simulate(o)
  File "/home/mkoenig/envs/tellurium-web/lib/python3.5/site-packages/roadrunner/roadrunner.py", line 3332, in _simulate
    return _roadrunner.RoadRunner__simulate(self, opt)
RuntimeError: CVODE Error: CV_CONV_FAILURE: Convergence test failures occurred too many times (= MXNCF = 10) during one internal timestep or occurred with |h| = hmin.; In virtual double rr::CVODEIntegrator::integrate(double, double)

omex.zip Simulations for both models run without issues on SEDML Webtools. I.e. the models should be integratable under the default roadrunner settings. See the attached combine archives which can be executed with SEDML webtools.

matthiaskoenig commented 7 years ago

I think something is wrong with the default tolerances in roadrunner. Seeing also some strange simulation artifacts in the following probably due to tolerances. See the spikes at around 300 in the tellurium output (which is sign for too loose tolerances by default), whereas SED-ML webtools show smooth curves. newplot_sedml-webtools newplot_te

Simulation based on attached combine archive: BIOMD0000000186_fig3a_sedml.zip

matthiaskoenig commented 7 years ago

I reinstalled tellurium and roadrunner with the latest packages and switching to the te* dependencies solved the issue. Can now integrate the models and getting smooth results for model 186. Not sure what was going on here.