gotran.solver package

Submodules

gotran.solver.odesolver module

gotran.solver.odesolver.ODESolver(ode, method='scipy', **options)[source]

A generic ODE solver for solving problem of the types on the form,

\[\dot{y} = f(t,y), \quad y(t_0) = y_0.\]

Here one need to specific the backend which is either Scipy or Assimulo.

Arguments

ode : gotran.ODE or gotran.CellModel
The ode you want to solve in a gotran object
method : str
Solver method. Possible inputs are or ‘scipy’ (Default:’sundials’)
options : dict:
Options for the solver, see list_solver_options
exception gotran.solver.odesolver.ODESolverError[source]

Bases: Exception

class gotran.solver.odesolver.Solver(ode, **options)[source]

Bases: object

module
monitor(tsteps, results)[source]

Get monitored values

monitor_indices(*monitored)[source]
monitor_names
solve(*args, **kwargs)[source]

Solver ODE. See docs for the different solvers for solver specific arguments.

state_indices(*states)[source]
state_names
update_model_parameter()[source]

Update model parameters according to parameters in the cell model

gotran.solver.odesolver.check_method(method)[source]
gotran.solver.odesolver.generate_module(ode, monitored, **options)[source]

Generate a module to

gotran.solver.odesolver.timeout(timeout_seconds)[source]

gotran.solver.scipysolver module

class gotran.solver.scipysolver.ScipySolver(ode, **options)[source]

Bases: gotran.solver.odesolver.Solver

get_options()[source]
static list_solver_options()[source]

gotran.solver.sundialssolver module

To use install assimulo which is a python wrapper of the sundials solvers

conda install assimulo

class gotran.solver.sundialssolver.SundialsSolver(ode, method='cvode', **options)[source]

Bases: gotran.solver.odesolver.Solver

get_options()[source]

Get solver options for the current solver

static list_solver_options()[source]
problem
solver
exception gotran.solver.sundialssolver.SundialsNotInstalled[source]

Bases: Exception

gotran.solver.utils module

class gotran.solver.utils.suppress_stdout_stderr[source]

Bases: object

A context manager for doing a “deep suppression” of stdout and stderr in Python, i.e. will suppress all print, even if the print originates in a compiled C/Fortran sub-function. This will not suppress raised exceptions, since exceptions are printed to stderr just before a script exits, and after the context manager has exited (at least, I think that is why it lets exceptions through).

Module contents