pybop.models.empirical.base_ecm#

Classes#

ECircuitModel

Overwrites and extends BaseModel class for circuit-based PyBaMM models.

Module Contents#

class pybop.models.empirical.base_ecm.ECircuitModel(pybamm_model, name='Empirical Base Model', parameter_set=None, geometry=None, submesh_types=None, var_pts=None, spatial_methods=None, solver=None, check_params=None, eis=False, **model_kwargs)[source]#

Bases: pybop.models.base_model.BaseModel

Overwrites and extends BaseModel class for circuit-based PyBaMM models.

Parameters:
  • pybamm_model (pybamm.BaseModel) – A subclass of the pybamm Base Model.

  • name (str, optional) – The name for the model instance, defaulting to “Empirical Base Model”.

  • parameter_set (pybamm.ParameterValues or dict, optional) – The parameters for the model. If None, default parameters provided by PyBaMM are used.

  • geometry (dict, optional) – The geometry definitions for the model. If None, default geometry from PyBaMM is used.

  • submesh_types (dict, optional) – The types of submeshes to use. If None, default submesh types from PyBaMM are used.

  • var_pts (dict, optional) – The discretization points for each variable in the model. If None, default points from PyBaMM are used.

  • spatial_methods (dict, optional) – The spatial methods used for discretization. If None, default spatial methods from PyBaMM are used.

  • solver (pybamm.Solver, optional) – The solver to use for simulating the model. If None, the default solver from PyBaMM is used.

  • **model_kwargs (optional) –

    Valid PyBaMM model option keys and their values. For example, build : bool, optional

    If True, the model is built upon creation (default: False).

    optionsdict, optional

    A dictionary of options to customise the behaviour of the PyBaMM model.

_check_params(inputs: pybop.models.base_model.Inputs, parameter_set: pybop.parameters.parameter_set.ParameterSet, allow_infeasible_solutions: bool = True)[source]#

Check the compatibility of the model parameters.

Parameters:
  • inputs (Inputs) – The input parameters for the simulation.

  • parameter_set (pybop.ParameterSet) – A PyBOP parameter set object or a dictionary containing the parameter values.

  • allow_infeasible_solutions (bool, optional) – If True, infeasible parameter values will be allowed in the optimisation (default: True).

Returns:

A boolean which signifies whether the parameters are compatible.

Return type:

bool

_set_initial_state(initial_state: dict, inputs: pybop.models.base_model.Inputs | None = None)[source]#

Set the initial state of charge or concentrations for the battery model.

Parameters:
  • initial_state (dict) – A valid initial state, e.g. the initial state of charge or open-circuit voltage.

  • inputs (Inputs) – The input parameters to be used when building the model.

get_initial_state(initial_value, parameter_values=None, param=None, options=None, tol=1e-06, inputs=None)[source]#

Calculate the initial state of charge given an open-circuit voltage, voltage limits and the open-circuit voltage function defined by the parameter set.

Parameters:
  • initial_value (float) – Target initial value. If float, interpreted as SOC, must be between 0 and 1. If string e.g. “4 V”, interpreted as voltage, must be between V_min and V_max.

  • parameter_values (pybamm.ParameterValues) – The parameter values class that will be used for the simulation. Required for calculating appropriate initial stoichiometries.

  • param (pybamm.LithiumIonParameters, optional) – The symbolic parameter set to use for the simulation. If not provided, the default parameter set will be used.

  • options (dict-like, optional) – A dictionary of options to be passed to the model, see pybamm.BatteryModelOptions.

  • tol (float, optional) – The tolerance for the solver used to compute the initial stoichiometries. A lower value results in higher precision but may increase computation time. Default is 1e-6.

Returns:

The initial state of charge

Return type:

initial_soc

_built_initial_soc = None[source]#
_built_model = None[source]#
_disc = None[source]#
_geometry[source]#
_mesh = None[source]#
_model_with_set_params = None[source]#
_parameter_set[source]#
_solver[source]#
_spatial_methods[source]#
_submesh_types[source]#
_unprocessed_model[source]#
_unprocessed_parameter_set[source]#
_var_pts[source]#
default_parameter_values[source]#
geometric_parameters[source]#
pybamm_model[source]#