pybop.costs.design_cost#
Classes#
Base design cost. |
Module Contents#
- class pybop.costs.design_cost.DesignCost(target: str)[source]#
Bases:
pybop.costs.base_cost.BaseCostBase design cost.
Note that design costs are maximised by default. Change to minimising by setting the attribute minimising=True.
- Parameters:
target (str) – The name of the target variable.
- evaluate(solution: pybop.simulators.base_simulator.Solution | pybop.simulators.failed_solution.FailedSolution, inputs: pybop.parameters.parameter.Inputs | None = None, calculate_sensitivities: bool = False) float[source]#
Returns the value of the cost variable.
- Parameters:
solution (pybop.Solution | pybamm.Solution) – The simulation result.
inputs (Inputs, optional) – Input parameters (default: None).
calculate_sensitivities (bool) – Whether to also return the sensitivities (default: False).
- Returns:
The value of the output variable.
- Return type:
float
- minimising = False#