Variables¶
The variables module provides classes for adding design variables to PyBaMM models, enabling computation of design metrics like energy density and capacity.
Base Class¶
- class ionworkspipeline.data_fits.models.variables.BaseVariable(name: str, model: BaseModel, parameter_values: ParameterValues)¶
A base class for adding a variable to a PyBaMM model.
Parameters¶
- namestr
The name for the variable. Must be unique within the model’s variables.
- modelpybamm.BaseModel
The PyBaMM model to add the variable to.
- parameter_valuespybamm.ParameterValues
Parameter values for the model.
Extends:
abc.ABC- abstractmethod add() None¶
Add the variable to the model.
This method must be implemented by subclasses to define how the specific variable is added to the model.
- add_cell_mass() None¶
Add the cell mass to this variable.
- property name: str¶
Get the variable name.
Design Variables¶
- class ionworkspipeline.data_fits.models.variables.GravimetricEnergyDensity(name: str, model: BaseModel, parameter_values: ParameterValues)¶
Add gravimetric energy density to PyBaMM model.
This variable computes the energy density per unit mass of the cell, calculated as the time integral of power divided by cell mass.
Units: kWh/kg
Parameters¶
- namestr
The name for the variable. Must be unique within the model’s variables.
- modelpybamm.BaseModel
The PyBaMM model to add the variable to.
- parameter_valuespybamm.ParameterValues
Parameter values for the model.
Extends:
ionworkspipeline.data_fits.models.variables.variables.BaseVariable- add() None¶
Add gravimetric energy density variable to the model.
The calculation requires ‘Cell mass [kg]’ parameter. If not present, it will be computed using the CellMass calculation.
- class ionworkspipeline.data_fits.models.variables.VolumetricEnergyDensity(name: str, model: BaseModel, parameter_values: ParameterValues)¶
Add volumetric energy density to PyBaMM model.
This variable computes the energy density per unit volume of the cell, calculated as the time integral of power divided by cell volume.
Units: Wh/L
Parameters¶
- namestr
The name for the variable. Must be unique within the model’s variables.
- modelpybamm.BaseModel
The PyBaMM model to add the variable to.
- parameter_valuespybamm.ParameterValues
Parameter values for the model.
Extends:
ionworkspipeline.data_fits.models.variables.variables.BaseVariable- add() None¶
Add volumetric energy density variable to the model.
The calculation requires cell volume, computed from electrode dimensions.
- class ionworkspipeline.data_fits.models.variables.SpecificCapacity(name: str, model: BaseModel, parameter_values: ParameterValues)¶
Add specific capacity to PyBaMM model.
This variable computes the capacity per unit mass of the cell.
Units: Ah/kg
Parameters¶
- namestr
The name for the variable. Must be unique within the model’s variables.
- modelpybamm.BaseModel
The PyBaMM model to add the variable to.
- parameter_valuespybamm.ParameterValues
Parameter values for the model.
Extends:
ionworkspipeline.data_fits.models.variables.variables.BaseVariable- add() None¶
Add specific capacity variable to the model.
- class ionworkspipeline.data_fits.models.variables.CoulombicStateOfCharge(name: str, model: BaseModel, parameter_values: ParameterValues)¶
Adds a simple state-of-charge to PyBaMM model.
This variable computes the state-of-charge as a normalized quantity based on cumulative current flow and cell capacity. SOC is calculated as initial_soc - (cumulative discharge capacity) / (total cell capacity).
Units: dimensionless (0-1 range)
Parameters¶
- namestr
The name for the variable. Must be unique within the model’s variables.
- modelpybamm.BaseModel
The PyBaMM model to add the variable to.
- parameter_valuespybamm.ParameterValues
Parameter values for the model.
Extends:
ionworkspipeline.data_fits.models.variables.variables.BaseVariable- add() None¶
Add state-of-charge variable to the model.
The calculation requires the ‘Nominal cell capacity [A.h]’ and ‘Discharge capacity [A.h]’ parameters to track cumulative state-of-charge.