src.pydasa.elements.parameter ============================= .. py:module:: src.pydasa.elements.parameter .. autoapi-nested-parse:: Module parameter.py =========================================== Module for representing **Variable** entities in Dimensional Analysis for *PyDASA*. Classes: **Variable**: Represents a Variable with dimensional properties, value ranges, and validation. *IMPORTANT:* Based on the theory from: # H.Gorter, *Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen* Classes ------- .. autoapisummary:: src.pydasa.elements.parameter.Variable Module Contents --------------- .. py:class:: Variable Bases: :py:obj:`pydasa.elements.specs.ConceptualSpecs`, :py:obj:`pydasa.elements.specs.SymbolicSpecs`, :py:obj:`pydasa.elements.specs.NumericalSpecs`, :py:obj:`pydasa.elements.specs.StatisticalSpecs` **Variable** class for Dimensional Analysis in *PyDASA*. A comprehensive implementation that combines Parameter and Variable functionality for use in dimensional analysis calculations, simulations, and sensitivity analysis. This class composes four philosophical perspectives through multiple inheritance: - **ConceptualSpecs**: Identity and classification (what IS this variable?) - **SymbolicSpecs**: Mathematical representation (how do we WRITE it?) - **NumericalSpecs**: Computational values (what VALUES can it take?) - **StatisticalSpecs**: Probabilistic modeling (how do we MODEL uncertainty?) All attributes, properties, and methods are inherited from the spec classes. This class only provides integration logic and utility methods. .. attribute:: # From Foundation :type: via ConceptualSpecs .. attribute:: _name User-friendly name of the variable. :type: str .. attribute:: description Brief summary of the variable. :type: str .. attribute:: _idx Index/precedence in the dimensional matrix. :type: int .. attribute:: _sym Symbol representation (LaTeX or alphanumeric). :type: str .. attribute:: _alias Python-compatible alias for use in code. :type: str .. attribute:: _fwk Frameworks context (PHYSICAL, COMPUTATION, SOFTWARE, CUSTOM). :type: str .. attribute:: # From ConceptualSpecs - Identity and Classification .. attribute:: _cat Category (INPUT, OUT, CTRL). :type: str .. attribute:: _schema Reference to the dimensional framework or FDUs list. :type: Schema .. attribute:: relevant Flag indicating if variable is relevant for analysis. :type: bool .. attribute:: # From SymbolicSpecs - Dimensional Properties .. attribute:: _dims Dimensional expression (e.g., "L*T^-1"). :type: str .. attribute:: _units Units of measure (e.g., "m/s"). :type: str .. attribute:: _sym_exp Sympy-compatible expression. :type: str .. attribute:: _dim_col Dimensional column for matrix operations. :type: List[int] .. attribute:: # From SymbolicSpecs - Standardized Dimensional Properties .. attribute:: _std_dims Standardized dimensional expression. :type: str .. attribute:: _std_units Standardized units of measure. :type: str .. attribute:: # From NumericalSpecs - Value Ranges :type: Original Units .. attribute:: _min Minimum value in original units. :type: float .. attribute:: _max Maximum value in original units. :type: float .. attribute:: _mean Mean value in original units. :type: float .. attribute:: _dev Standard deviation in original units. :type: float .. attribute:: # From NumericalSpecs - Value Ranges :type: Standardized Units .. attribute:: _std_min Minimum value in standard units. :type: float .. attribute:: _std_max Maximum value in standard units. :type: float .. attribute:: _std_mean Mean value in standard units. :type: float .. attribute:: _std_dev Standard deviation in standard units. :type: float .. attribute:: _step Step size for simulations. :type: float .. attribute:: _std_range Range array for analysis. :type: np.ndarray .. attribute:: # From StatisticalSpecs - Distribution Specifications .. attribute:: _dist_type Type of distribution (e.g., 'uniform', 'normal'). :type: str .. attribute:: _dist_params Parameters for the distribution. :type: Dict[str, Any] .. attribute:: _depends List of variable names that this variable depends on. :type: List[str] .. attribute:: _dist_func Callable representing the distribution function. :type: Callable .. py:method:: __post_init__() *__post_init__()* Initializes the variable and validates its properties. Performs validation of core properties and processes dimensional expressions. Sets up range arrays if all required values are provided. :raises ValueError: If dimensional expression is invalid. .. py:method:: clear() *clear()* Reset all attributes to default values. Resets all variable properties to their initial state by calling clear() on all composed perspective classes. .. py:method:: to_dict() *to_dict()* Convert variable to dictionary representation. :returns: Dictionary representation of variable. :rtype: Dict[str, Any] .. py:method:: from_dict(data) :classmethod: *from_dict()* Create variable from dictionary representation. :param data: Dictionary representation of variable. :type data: Dict[str, Any] :returns: New variable instance. :rtype: Variable