pybop.costs.design_cost#

Classes#

DesignCost

Base design cost.

Module Contents#

class pybop.costs.design_cost.DesignCost(target: str)[source]#

Bases: pybop.costs.base_cost.BaseCost

Base 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(sol: pybop.simulators.base_simulator.Solution | pybop._utils.FailedSolution, inputs: pybop.parameters.parameter.Inputs | None = None, calculate_sensitivities: bool = False) float[source]#

Returns the value of the cost variable.

Parameters:
  • sol (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

domain = 'Time [s]'[source]#
minimising = False[source]#
target[source]#