Skip to content

Unexpectedly slow simulation with zvode #927

@TorkelE

Description

@TorkelE

I have a simple model I want to simulate. I try the various solvers lsoda zvode and vode. For some reason, the lsod solver is waaay faster than the other two. Like, thing are fine because I can simualte quickly, but I wanted to check whenever I was doing something wrong causing the slow down.

Here is the code:

import sys, os, numpy, libsbml, gillespy2
import timeit
import numpy
from gillespy2 import ODESolver, ODECSolver

model_multistate = gillespy2.core.import_SBML('../Data/multistate.xml')[0]

leng = 1000
%time model_multistate.run(solver=ODESolver,t=leng,increment=leng/50.,integrator='vode',integrator_options={"nsteps":1000000})
%time model_multistate.run(solver=ODESolver,t=leng,increment=leng/50.,integrator='zvode',integrator_options={"nsteps":1000000})
%time model_multistate.run(solver=ODESolver,t=leng,increment=leng/50.,integrator='lsoda',integrator_options={"nsteps":100000})
0

Here is a screenshot of the output:
image
(lsoda 100 times faster)

I am attaching the model (renamed as .txt file to make GitHub happy)
multistate.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions