pybop._problem#
Classes#
Base class for defining a problem within the PyBOP framework, compatible with PINTS. |
|
Problem class for design optimization problems. |
|
Problem class for fitting (parameter estimation) problems. |
Module Contents#
- class pybop._problem.BaseProblem(parameters, model=None, check_model=True, signal=['Voltage [V]'], additional_variables=[], 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).
signal (List[str]) – The signal to observe.
additional_variables (List[str], optional) – Additional variables to observe and store in the solution (default: []).
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.
- class pybop._problem.DesignProblem(model, parameters, experiment, check_model=True, signal=['Voltage [V]'], additional_variables=[], init_soc=None, x0=None)[source]#
Bases:
BaseProblemProblem 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.
check_model (bool, optional) – Flag to indicate if the model parameters should be checked for feasibility each iteration (default: True).
signal (str, optional) – The signal to fit (default: “Voltage [V]”).
additional_variables (List[str], optional) – Additional variables to observe and store in the solution (default additions are: [“Time [s]”, “Current [A]”]).
init_soc (float, optional) – Initial state of charge (default: None).
x0 (np.ndarray, optional) – Initial parameter values (default: None).
- class pybop._problem.FittingProblem(model, parameters, dataset, check_model=True, signal=['Voltage [V]'], additional_variables=[], init_soc=None, x0=None)[source]#
Bases:
BaseProblemProblem 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 (Dataset) – Dataset object containing the data to fit the model to.
signal (str, optional) – The variable used for fitting (default: “Voltage [V]”).
additional_variables (List[str], optional) – Additional variables to observe and store in the solution (default additions are: [“Time [s]”]).
init_soc (float, optional) – Initial state of charge (default: None).
x0 (np.ndarray, optional) – Initial parameter values (default: None).
- 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.
- Returns:
y – The model output y(t) simulated with inputs x.
- Return type:
np.ndarray
- 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.
- Returns:
A tuple containing the simulation result y(t) and the sensitivities dy/dx(t) evaluated with given inputs x.
- Return type:
tuple