pybop.costs.design_costs#
Classes#
Overwrites and extends BaseCost class for design-related cost functions. |
|
Calculates the gravimetric energy density (specific energy) of a battery cell, |
|
Calculates the gravimetric power density (specific power) of a battery cell, |
|
Calculates the (volumetric) energy density of a battery cell, when applied to a |
|
Calculates the (volumetric) power density of a battery cell, when applied to a |
Module Contents#
- class pybop.costs.design_costs.DesignCost(problem)[source]#
Bases:
pybop.costs.base_cost.BaseCostOverwrites and extends BaseCost class for design-related cost functions.
Inherits all parameters and attributes from
BaseCost.
- class pybop.costs.design_costs.GravimetricEnergyDensity(problem)[source]#
Bases:
DesignCostCalculates the gravimetric energy density (specific energy) of a battery cell, when applied to a normalised discharge from upper to lower voltage limits. The goal of maximising the energy density is achieved with self.minimising=False.
The gravimetric energy density [Wh.kg-1] is calculated as
\[\frac{1}{3600 m} \int_{t=0}^{t=T} I(t) V(t) \mathrm{d}t\]where m is the cell mass, t is the time, T is the total time, I is the current and V is the voltage. The factor of 1/3600 is included to convert from seconds to hours.
Inherits all parameters and attributes from
DesignCost.- compute(y: dict, dy: numpy.ndarray | None = None) float[source]#
Computes the cost function for the given predictions.
- Parameters:
y (dict) – The dictionary of predictions with keys designating the signals for fitting.
dy (np.ndarray, optional) – The corresponding gradient with respect to the parameters for each signal. Note: not used in design optimisation classes.
- Returns:
The gravimetric energy density or -infinity in case of infeasible parameters.
- Return type:
float
- class pybop.costs.design_costs.GravimetricPowerDensity(problem, target_time: int | float = 3600)[source]#
Bases:
DesignCostCalculates the gravimetric power density (specific power) of a battery cell, when applied to a discharge from upper to lower voltage limits. The goal of maximising the power density is achieved with self.minimising=False.
The time-averaged gravimetric power density [W.kg-1] is calculated as
\[\frac{1}{3600 m T} \int_{t=0}^{t=T} I(t) V(t) \mathrm{d}t\]where m is the cell mass, t is the time, T is the total time, I is the current and V is the voltage. The factor of 1/3600 is included to convert from seconds to hours.
Inherits all parameters and attributes from
DesignCost.Additional parameters#
- target_timeint
The length of time (seconds) over which the power should be sustained.
- compute(y: dict, dy: numpy.ndarray | None = None) float[source]#
Computes the cost function for the given predictions.
- Parameters:
y (dict) – The dictionary of predictions with keys designating the signals for fitting.
dy (np.ndarray, optional) – The corresponding gradient with respect to the parameters for each signal. Note: not used in design optimisation classes.
- Returns:
The gravimetric power density or -infinity in case of infeasible parameters.
- Return type:
float
- class pybop.costs.design_costs.VolumetricEnergyDensity(problem)[source]#
Bases:
DesignCostCalculates the (volumetric) energy density of a battery cell, when applied to a normalised discharge from upper to lower voltage limits. The goal of maximising the energy density is achieved with self.minimising = False.
The volumetric energy density [Wh.m-3] is calculated as
\[\frac{1}{3600 v} \int_{t=0}^{t=T} I(t) V(t) \mathrm{d}t\]where v is the cell volume, t is the time, T is the total time, I is the current and V is the voltage. The factor of 1/3600 is included to convert from seconds to hours.
Inherits all parameters and attributes from
DesignCost.- compute(y: dict, dy: numpy.ndarray | None = None) float[source]#
Computes the cost function for the given predictions.
- Parameters:
y (dict) – The dictionary of predictions with keys designating the signals for fitting.
dy (np.ndarray, optional) – The corresponding gradient with respect to the parameters for each signal. Note: not used in design optimisation classes.
- Returns:
The volumetric energy density or -infinity in case of infeasible parameters.
- Return type:
float
- class pybop.costs.design_costs.VolumetricPowerDensity(problem, target_time: int | float = 3600)[source]#
Bases:
DesignCostCalculates the (volumetric) power density of a battery cell, when applied to a discharge from upper to lower voltage limits. The goal of maximising the power density is achieved with self.minimising=False.
The time-averaged volumetric power density [W.m-3] is calculated as
\[\frac{1}{3600 v T} \int_{t=0}^{t=T} I(t) V(t) \mathrm{d}t\]where v is the cell volume, t is the time, T is the total time, I is the current and V is the voltage. The factor of 1/3600 is included to convert from seconds to hours.
Inherits all parameters and attributes from
DesignCost.Additional parameters#
- target_timeint
The length of time (seconds) over which the power should be sustained.
- compute(y: dict, dy: numpy.ndarray | None = None) float[source]#
Computes the cost function for the given predictions.
- Parameters:
y (dict) – The dictionary of predictions with keys designating the signals for fitting.
dy (np.ndarray, optional) – The corresponding gradient with respect to the parameters for each signal. Note: not used in design optimisation classes.
- Returns:
The volumetric power density or -infinity in case of infeasible parameters.
- Return type:
float