Previous topic

Parameters

Next topic

Geometric Parameters

This Page

Base Parameter Values

class pybamm.ParameterValues(base_parameters={}, optional_parameters={})[source]

The parameter values for a simulation.

Parameters:
  • base_parameters (dict or string) – The base parameters If string, gets passed to read_parameters_csv to read a file.
  • optional_parameters (dict or string) – Optional parameters, overwrites base_parameters if there is a conflict If string, gets passed to read_parameters_csv to read a file.
process_geometry(geometry)[source]

Assign parameter values to a geometry (inplace).

Parameters:geometry (pybamm.Geometry) – Geometry specs to assign parameter values to
process_model(model, processing='process')[source]

Assign parameter values to a model. Currently inplace, could be changed to return a new model.

Parameters:
  • model (pybamm.BaseModel) – Model to assign parameter values for
  • processing (str, optional) –

    Flag to indicate how to process model (default ‘process’)

    • ’process’: Calls process_symbol() (walk through the symbol and replace any Parameter with a Value)
    • ’update’: Calls update_scalars() for use on already-processed model (update the value of any Scalars in the expression tree.)
Raises:

pybamm.ModelError – If an empty model is passed (model.rhs = {} and model.algebraic={})

process_symbol(symbol)[source]

Walk through the symbol and replace any Parameter with a Value. If a symbol has already been processed, the stored value is returned.

Parameters:symbol (pybamm.Symbol) – Symbol or Expression tree to set parameters for
Returns:symbol – Symbol with Parameter instances replaced by Value
Return type:pybamm.Symbol
read_parameters_csv(filename)[source]

Reads parameters from csv file into dict.

Parameters:filename (str) – The name of the csv file containing the parameters.
Returns:{name: value} pairs for the parameters.
Return type:dict
update([E, ]**F) → None. Update D from dict/iterable E and F.[source]

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

update_model(model, disc)[source]

Process a discretised model. Currently inplace, could be changed to return a new model.

Parameters:
update_scalars(symbol)[source]

Update the value of any Scalars in the expression tree.

Parameters:symbol (pybamm.Symbol) – Symbol or Expression tree to update
Returns:symbol – Symbol with Scalars updated
Return type:pybamm.Symbol