cideMOD.cell.dimensional_analysis
Classes
|
This class performs the dimensional analysis. |
- class cideMOD.cell.dimensional_analysis.DimensionalAnalysis(cell: CellParser, model_options)[source]
Bases:
objectThis class performs the dimensional analysis. First obtains the reference parameters and then compute the dimensionless numbers that arise from the dimensional analysis. It also allows to scale and unscale some variables.
- Parameters:
cell (CellParser) – Parser of the cell dictionary.
model_options (BaseModelOptions) – Object containing the simulation options.
- scale_variable(name: str, value)[source]
This method scales the given variable.
- Parameters:
name (str) – Name of the variable to be scaled.
value (Any) – Value to be scaled.
- Returns:
Scaled value of the variable.
- Return type:
Any
Examples
>>> models.scale_variable('c_e', 1000) 0
- scale_variables(variables: dict)[source]
This method scales the given variables.
- Parameters:
variables (Dict[str, Any]) – Dictionary containing the names and the values of the variables to be scaled.
- Returns:
Dictionary containing the scaled variables.
- Return type:
dict
Examples
>>> variables = {'c_e': 1000, 'c_s_a': 28700} >>> models.scale_variables(variables) {'c_e': 0, 'c_s_a': 1}
- unscale_variable(name: str, value)[source]
This method unscales the given variable.
- Parameters:
name (str) – Name of the variable to be unscaled.
value (Any) – Value to be unscaled.
- Returns:
Unscaled value of the variable.
- Return type:
Any
Examples
>>> models.unscale_variable('c_e', 0) 1000
- unscale_variables(variables: dict)[source]
This method unscales the given variables.
- Parameters:
variables (Dict[str, Any]) – Dictionary containing the names and the values of the variables to be unscaled.
- Returns:
Dictionary containing the unscaled variables.
- Return type:
dict
Examples
>>> variables = {'c_e': 0, 'c_s_a': 1} >>> models.unscale_variables(variables) {'c_e': 1000, 'c_s_a': 28700}