Scikits.odes Solvers#

class pybamm.ScikitsOdeSolver(method='cvode', rtol=1e-06, atol=1e-06, extrap_tol=None, extra_options=None)[source]#

Solve a discretised model, using scikits.odes.

Parameters:
  • method (str, optional) – The method to use in solve_ivp (default is “BDF”)

  • rtol (float, optional) – The relative tolerance for the solver (default is 1e-6).

  • atol (float, optional) – The absolute tolerance for the solver (default is 1e-6).

  • extrap_tol (float, optional) – The tolerance to assert whether extrapolation occurs or not (default is 0).

  • extra_options (dict, optional) –

    Any options to pass to the solver. Please consult scikits.odes documentation for details. Some common keys:

    • ’linsolver’: can be ‘dense’ (= default), ‘lapackdense’, ‘spgmr’, ‘spbcgs’, ‘sptfqmr’

Extends: pybamm.solvers.base_solver.BaseSolver

class pybamm.ScikitsDaeSolver(method='ida', rtol=1e-06, atol=1e-06, root_method='casadi', root_tol=1e-06, extrap_tol=None, extra_options=None)[source]#

Solve a discretised model, using scikits.odes.

Parameters:
  • method (str, optional) – The method to use in solve_ivp (default is “BDF”)

  • rtol (float, optional) – The relative tolerance for the solver (default is 1e-6).

  • atol (float, optional) – The absolute tolerance for the solver (default is 1e-6).

  • root_method (str or pybamm algebraic solver class, optional) – The method to use to find initial conditions (for DAE solvers). If a solver class, must be an algebraic solver class. If “casadi”, the solver uses casadi’s Newton rootfinding algorithm to find initial conditions. Otherwise, the solver uses ‘scipy.optimize.root’ with method specified by ‘root_method’ (e.g. “lm”, “hybr”, …)

  • root_tol (float, optional) – The tolerance for the initial-condition solver (default is 1e-6).

  • extrap_tol (float, optional) – The tolerance to assert whether extrapolation occurs or not (default is 0).

  • extra_options (dict, optional) –

    Any options to pass to the solver. Please consult scikits.odes documentation for details. Some common keys:

    • ’max_steps’: maximum (int) number of steps the solver can take

Extends: pybamm.solvers.base_solver.BaseSolver