4.5.10 pde.solvers.scipy module
Defines a solver using scipy.integrate
- class ScipySolver(pde: PDEBase, *, backend: str | pde.backends.base.BackendBase = 'auto', **kwargs)[source]
Bases:
SolverBasePDE solver using
scipy.integrate.solve_ivp().This class is a thin wrapper around
scipy.integrate.solve_ivp(). In particular, it supports all the methods implemented by this function and exposes its arguments, so details can be controlled.- Parameters:
pde (
PDEBase) – The partial differential equation that should be solvedbackend (str) – The backend used for numerical operations
**kwargs – All extra arguments are forwarded to
scipy.integrate.solve_ivp().
- property backend: BackendBase
The backend for this solver.
- Type:
- classmethod from_name(name: str, pde: PDEBase, **kwargs) SolverBase
Create a solver object from its registered name.
Solver classes are automatically registered when they inherit from
SolverBase. Note that this also requires that the respective python module containing the solver has been loaded before it is attempted to be used.
- make_stepper(state: TField, dt: float | None = None) StepperType[source]
Create the executable stepping function produced by this solver.
- Parameters:
state (
FieldBase) – An example for the state from which the grid and other information can be extracted.dt (float) – Initial time step for the simulation. If None, the solver will choose a suitable initial value.
- Returns:
Function that can be called to advance the state from time t_start to time t_end.