Solve a discretised model, using sundials with the KLU sparse linear solver.
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).
A method to set the absolute tolerances in the solver by state variable. This method attaches a vector of tolerance to the model. (i.e. model.atol)
variables_with_tols (dict) – A dictionary with keys that are strings indicating the variable you wish to set the tolerance of and values that are the tolerances.
model (pybamm.BaseModel
) – The model that is going to be solved.
A method to set the tolerances in the atol vector of a specific state variable. This method modifies self.atol
state_vec (pybamm.StateVector
) – The state vector to apply to the tolerance to
tol (float) – The tolerance value
Unpack model, perform checks, and calculate jacobian.
model (pybamm.BaseModel
) – The model whose solution to calculate. Must have attributes rhs and
initial_conditions
inputs (dict, optional) – Any input parameters to pass to the model when solving
t_eval (numeric type, optional) – The times (in seconds) at which to compute the solution