pybop._problem#

Module Contents#

Classes#

BaseProblem

Base class for defining a problem within the PyBOP framework, compatible with PINTS.

DesignProblem

Problem class for design optimization problems.

FittingProblem

Problem class for fitting (parameter estimation) problems.

class pybop._problem.BaseProblem(parameters, model=None, check_model=True, signal=['Voltage [V]'], init_soc=None, x0=None)[source]#

Base class for defining a problem within the PyBOP framework, compatible with PINTS.

Parameters:
  • parameters (list) – List of parameters for the problem.

  • model (object, optional) – The model to be used for the problem (default: None).

  • check_model (bool, optional) – Flag to indicate if the model should be checked (default: True).

  • init_soc (float, optional) – Initial state of charge (default: None).

  • x0 (np.ndarray, optional) – Initial parameter values (default: None).

abstract evaluate(x)[source]#

Evaluate the model with the given parameters and return the signal.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.

Raises:

NotImplementedError – This method must be implemented by subclasses.

abstract evaluateS1(x)[source]#

Evaluate the model with the given parameters and return the signal and its derivatives.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.

Raises:

NotImplementedError – This method must be implemented by subclasses.

target()[source]#

Return the target dataset.

Returns:

The target dataset array.

Return type:

np.ndarray

time_data()[source]#

Returns the time data.

Returns:

The time array.

Return type:

np.ndarray

class pybop._problem.DesignProblem(model, parameters, experiment, check_model=True, signal=['Voltage [V]'], init_soc=None, x0=None)[source]#

Bases: BaseProblem

Problem class for design optimization problems.

Extends BaseProblem with specifics for applying a model to an experimental design.

Parameters:
  • model (object) – The model to apply the design to.

  • parameters (list) – List of parameters for the problem.

  • experiment (object) – The experimental setup to apply the model to.

evaluate(x)[source]#

Evaluate the model with the given parameters and return the signal.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.

evaluateS1(x)[source]#

Evaluate the model with the given parameters and return the signal and its derivatives.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.

class pybop._problem.FittingProblem(model, parameters, dataset, check_model=True, signal=['Voltage [V]'], init_soc=None, x0=None)[source]#

Bases: BaseProblem

Problem class for fitting (parameter estimation) problems.

Extends BaseProblem with specifics for fitting a model to a dataset.

Parameters:
  • model (object) – The model to fit.

  • parameters (list) – List of parameters for the problem.

  • dataset (list) – List of data objects to fit the model to.

  • signal (str, optional) – The signal to fit (default: “Voltage [V]”).

evaluate(x)[source]#

Evaluate the model with the given parameters and return the signal.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.

evaluateS1(x)[source]#

Evaluate the model with the given parameters and return the signal and its derivatives.

Parameters:

x (np.ndarray) – Parameter values to evaluate the model at.