pybop.models.empirical#

Submodules#

Classes#

ECircuitModel

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

Thevenin

The Thevenin class represents an equivalent circuit model based on the Thevenin model in PyBaMM.

Package Contents#

class pybop.models.empirical.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

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#
_built_model = None#
_disc = None#
_geometry#
_mesh = None#
_model_with_set_params = None#
_parameter_set#
_solver#
_spatial_methods#
_submesh_types#
_unprocessed_model#
_unprocessed_parameter_set#
_var_pts#
default_parameter_values#
geometric_parameters#
model_options#
pybamm_model#
class pybop.models.empirical.Thevenin(name='Equivalent Circuit Thevenin Model', eis=False, **model_kwargs)[source]#

Bases: pybop.models.empirical.base_ecm.ECircuitModel

The Thevenin class represents an equivalent circuit model based on the Thevenin model in PyBaMM.

This class encapsulates the PyBaMM equivalent circuit Thevenin model, providing an interface to define the parameters, geometry, submesh types, variable points, spatial methods, and solver to be used for simulations.

Parameters:
  • name (str, optional) – A name for the model instance. Defaults to “Equivalent Circuit Thevenin Model”.

  • **model_kwargs (optional) –

    Valid PyBaMM model option keys and their values, for example: parameter_set : pybamm.ParameterValues or dict, optional

    The parameters for the model. If None, default parameters provided by PyBaMM are used.

    geometrydict, optional

    The geometry definitions for the model. If None, default geometry from PyBaMM is used.

    submesh_typesdict, optional

    The types of submeshes to use. If None, default submesh types from PyBaMM are used.

    var_ptsdict, optional

    The discretization points for each variable in the model. If None, default points from PyBaMM are used.

    spatial_methodsdict, optional

    The spatial methods used for discretization. If None, default spatial methods from PyBaMM are used.

    solverpybamm.Solver, optional

    The solver to use for simulating the model. If None, the default solver from PyBaMM is used.

    buildbool, 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.