pybop.costs.design_costs#
Classes#
Overwrites and extends BaseCost class for design-related cost functions. |
|
Represents the gravimetric energy density of a battery cell, calculated based |
|
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.BaseCostOverwrites 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(x, grad=None)[source]#
Computes the value of the cost function.
This method must be implemented by subclasses.
- Parameters:
x (array) – The parameter set 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.
- class pybop.costs.design_costs.GravimetricEnergyDensity(problem, update_capacity=False)[source]#
Bases:
DesignCostRepresents 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 minimizing the negative energy density reported by this class.
Inherits all parameters and attributes from
DesignCost.- _evaluate(x, grad=None)[source]#
Computes the cost function for the energy density.
- Parameters:
x (array) – The parameter set for which to compute the cost.
grad (array, optional) – Gradient information, not used in this method.
- Returns:
The negative 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:
DesignCostRepresents 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 minimizing the negative energy density reported by this class.
Inherits all parameters and attributes from
DesignCost.- _evaluate(x, grad=None)[source]#
Computes the cost function for the energy density.
- Parameters:
x (array) – The parameter set for which to compute the cost.
grad (array, optional) – Gradient information, not used in this method.
- Returns:
The negative volumetric energy density or infinity in case of infeasible parameters.
- Return type:
float