Solvers
Solver(simulation, t_end)
Bases: ABC
Base class for system integrators. All subclasses must implement a run
method.
PARAMETER | DESCRIPTION |
---|---|
simulation
|
an instance of
TYPE:
|
t_end
|
positive integer at which to stop the simulation.
TYPE:
|
Source code in psymple/simulate/solvers/solver.py
ContinuousIntegrator(simulation, t_end)
Bases: Solver
An interface to scipy.integrate.solve_ivp
. The input from the simulation object is manipulated
into a form acceptable by the scipy
solver and run.
Using another solver
The attribute _callable
created on instantiation is a function with signature (t,y)
which
is a form accepted by, or easily coerced into, many other python-implemented ODE solvers.
PARAMETER | DESCRIPTION |
---|---|
simulation
|
an instance of
TYPE:
|
t_end
|
positive integer at which to stop the simulation.
TYPE:
|
Source code in psymple/simulate/solvers/scipy_integrator.py
run()
Run the solver according to its parameters.
Source code in psymple/simulate/solvers/scipy_integrator.py
DiscreteIntegrator(simulation, t_end, n_steps)
Bases: Solver
A forward Euler method integrator.
Warning
This is a very rudimentary solver, and performs no accuracy checks or optimisation. It is primarily intended for prototyping or unit testing certain features since its behaviour is fully controlled.
PARAMETER | DESCRIPTION |
---|---|
simulation
|
an instance of
TYPE:
|
t_end
|
positive integer at which to stop the simulation.
TYPE:
|
n_steps
|
the number of substeps to compute per time unit.
TYPE:
|