pybop.costs.design_costs#

Classes#

DesignCost

Overwrites and extends BaseCost class for design-related cost functions.

GravimetricEnergyDensity

Represents the gravimetric energy density of a battery cell, calculated based

VolumetricEnergyDensity

Represents the volumetric energy density of a battery cell, calculated based

Module Contents#

class pybop.costs.design_costs.DesignCost(problem, update_capacity=False)[source]#

Bases: pybop.costs.base_cost.BaseCost

Overwrites and extends BaseCost class for design-related cost functions.

Inherits all parameters and attributes from BaseCost.

Additional Attributes#

problemobject

The associated problem containing model and evaluation methods.

parameter_setobject)

The set of parameters from the problem’s model.

dtfloat

The time step size used in the simulation.

abstract _evaluate(inputs: pybop.parameters.parameter.Inputs, grad=None)[source]#

Computes the value of the cost function.

This method must be implemented by subclasses.

Parameters:
  • inputs (Inputs) – The parameters for which to compute the cost.

  • grad (array, optional) – Gradient information, not used in this method.

Raises:

NotImplementedError – If the method has not been implemented by the subclass.

update_simulation_data(inputs: pybop.parameters.parameter.Inputs)[source]#

Updates the simulation data based on the initial parameter values.

Parameters:

inputs (Inputs) – The initial parameter values for the simulation.

class pybop.costs.design_costs.GravimetricEnergyDensity(problem, update_capacity=False)[source]#

Bases: DesignCost

Represents the gravimetric energy density of a battery cell, calculated based on a normalised discharge from upper to lower voltage limits. The goal is to maximise the energy density, which is achieved by setting minimising = False in the optimiser settings.

Inherits all parameters and attributes from DesignCost.

_evaluate(inputs: pybop.parameters.parameter.Inputs, grad=None)[source]#

Computes the cost function for the energy density.

Parameters:
  • inputs (Inputs) – The parameters for which to compute the cost.

  • grad (array, optional) – Gradient information, not used in this method.

Returns:

The gravimetric energy density or -infinity in case of infeasible parameters.

Return type:

float

class pybop.costs.design_costs.VolumetricEnergyDensity(problem, update_capacity=False)[source]#

Bases: DesignCost

Represents the volumetric energy density of a battery cell, calculated based on a normalised discharge from upper to lower voltage limits. The goal is to maximise the energy density, which is achieved by setting minimising = False in the optimiser settings.

Inherits all parameters and attributes from DesignCost.

_evaluate(inputs: pybop.parameters.parameter.Inputs, grad=None)[source]#

Computes the cost function for the energy density.

Parameters:
  • inputs (Inputs) – The parameters for which to compute the cost.

  • grad (array, optional) – Gradient information, not used in this method.

Returns:

The volumetric energy density or -infinity in case of infeasible parameters.

Return type:

float