STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.pipeline.numerical_robustness.DimensionalValidator Class Reference

Public Member Functions

bool validate_equation (cls, Dict[str, float] left_side, Dict[str, float] right_side)

Static Public Attributes

dict DIMENSIONS

Detailed Description

Validates dimensional consistency of physical quantities

Definition at line 28 of file numerical_robustness.py.

Member Function Documentation

◆ validate_equation()

bool engine.pipeline.numerical_robustness.DimensionalValidator.validate_equation ( cls,
Dict[str, float] left_side,
Dict[str, float] right_side )
Validate that left_side and right_side have same dimensions.

Parameters:
-----------
left_side : dict
    {quantity_name: value} where quantity_name is a key in DIMENSIONS
right_side : dict
    Same format as left_side
    
Returns:
--------
is_valid : bool

Definition at line 51 of file numerical_robustness.py.

References DIMENSIONS.

Member Data Documentation

◆ DIMENSIONS

dict engine.pipeline.numerical_robustness.DimensionalValidator.DIMENSIONS
static
Initial value:
= {
"length": [1, 0, 0, 0, 0, 0, 0],
"mass": [0, 1, 0, 0, 0, 0, 0],
"time": [0, 0, 1, 0, 0, 0, 0],
"temperature": [0, 0, 0, 1, 0, 0, 0],
"pressure": [-1, 1, -2, 0, 0, 0, 0], # Pa = kg/(m·s²)
"density": [-3, 1, 0, 0, 0, 0, 0], # kg/m³
"velocity": [1, 0, -1, 0, 0, 0, 0], # m/s
"force": [1, 1, -2, 0, 0, 0, 0], # N = kg·m/s²
"energy": [2, 1, -2, 0, 0, 0, 0], # J = kg·m²/s²
"power": [2, 1, -3, 0, 0, 0, 0], # W = kg·m²/s³
"mass_flow": [0, 1, -1, 0, 0, 0, 0], # kg/s
"heat_flux": [0, 1, -3, 0, 0, 0, 0], # W/m² = kg/s³
"viscosity": [-1, 1, -1, 0, 0, 0, 0], # Pa·s = kg/(m·s)
"thermal_conductivity": [1, 1, -3, -1, 0, 0, 0], # W/(m·K)
"specific_heat": [2, 0, -2, -1, 0, 0, 0], # J/(kg·K)
}

Definition at line 32 of file numerical_robustness.py.

Referenced by validate_equation().


The documentation for this class was generated from the following file: