4.4.7 pde.solvers.scipy module

Defines a solver using scipy.integrate

class ScipySolver(pde, backend='auto', **kwargs)[source]

Bases: SolverBase

PDE 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 instance describing the pde that needs to be solved

  • backend (str) – Determines how the function is created. Accepted values are ‘numpy` and ‘numba’. Alternatively, ‘auto’ lets the code decide for the most optimal backend.

  • **kwargs – All extra arguments are forwarded to scipy.integrate.solve_ivp().

info: dict[str, Any]
make_stepper(state, dt=None)[source]

return a stepper function

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.

Return type:

Callable[[FieldBase, float, float], float]

name = 'scipy'