Previous topic

Scikits.odes Solvers

Next topic

Post-Process Variables

This Page

Solution

class pybamm.Solution(t, y, t_event, y_event, termination)[source]

Class containing the solution of, and various attributes associated with, a PyBaMM model.

Parameters:
  • t (numpy.array, size (n,)) – A one-dimensional array containing the times at which the solution is evaluated
  • y (numpy.array, size (m, n)) – A two-dimensional array containing the values of the solution. y[i, :] is the vector of solutions at time t[i].
  • t_event (numpy.array, size (1,)) – A zero-dimensional array containing the time at which the event happens.
  • y_event (numpy.array, size (m,)) – A one-dimensional array containing the value of the solution at the time when the event happens.
  • termination (str) – String to indicate why the solution terminated
append(solution)[source]

Appends solution.t and solution.y onto self.t and self.y. Note: this process removes the initial time and state of solution to avoid duplicate times and states being stored (self.t[-1] is equal to solution.t[0], and self.y[:, -1] is equal to solution.y[:, 0]).

t

Times at which the solution is evaluated

t_event

Time at which the event happens

termination

Reason for termination

y

Values of the solution

y_event

Value of the solution at the time of the event