Previous topic

Solutions

Next topic

Experiments

This Page

Post-Process Variables

class pybamm.ProcessedVariable(base_variable, solution, known_evals=None, warn=True)[source]

An object that can be evaluated at arbitrary (scalars or vectors) t and x, and returns the (interpolated) value of the base variable at that t and x.

Parameters:
  • base_variable (pybamm.Symbol) – A base variable with a method evaluate(t,y) that returns the value of that variable. Note that this can be any kind of node in the expression tree, not just a pybamm.Variable. When evaluated, returns an array of size (m,n)
  • solution (pybamm.Solution) – The solution object to be used to create the processed variables
  • known_evals (dict) – Dictionary of known evaluations, to be used to speed up finding the solution
  • warn (bool, optional) – Whether to raise warnings when trying to evaluate time and length scales. Default is True.
call_1D(t, x, r, z)[source]

Evaluate a 1D variable

call_2D(t, x, r, y, z)[source]

Evaluate a 2D variable

data

Same as entries, but different name

get_spatial_scale(name, domain=None)[source]

Returns the spatial scale for a named spatial variable

initialise_2D()[source]

Initialise a 2D object that depends on x and r, or x and z.

class pybamm.ProcessedSymbolicVariable(base_variable, solution)[source]

An object that can be evaluated at arbitrary (scalars or vectors) t and x, and returns the (interpolated) value of the base variable at that t and x.

Parameters:
  • base_variable (pybamm.Symbol) – A base variable with a method evaluate(t,y) that returns the value of that variable. Note that this can be any kind of node in the expression tree, not just a pybamm.Variable. When evaluated, returns an array of size (m,n)
  • solution (pybamm.Solution) – The solution object to be used to create the processed variables
data

Same as entries, but different name

initialise_0D()[source]

Create a 0D variable

initialise_1D()[source]

Create a 1D variable

sensitivity(inputs=None, check_inputs=True)[source]

Returns the sensitivity of the variable to the symbolic inputs at the specified input values

Parameters:inputs (dict) – The inputs at which to evaluate the variable.
value(inputs=None, check_inputs=True)[source]

Returns the value of the variable at the specified input values

Parameters:inputs (dict) – The inputs at which to evaluate the variable.
value_and_sensitivity(inputs=None)[source]

Returns the value of the variable and its sensitivity to the symbolic inputs at the specified input values

Parameters:inputs (dict) – The inputs at which to evaluate the variable.