src.pydasa.dimensional.buckingham ================================= .. py:module:: src.pydasa.dimensional.buckingham .. autoapi-nested-parse:: Module vashchy.py =========================================== Module for representing Dimensionless Coefficients in Dimensional Analysis for *PyDASA*. This module provides the Coefficient class which models dimensionless numbers used in Vaschy-Buckingham's Pi-theorem for dimensional analysis. Classes: **Coefficient**: Represents a dimensionless coefficient with properties, validation, and symbolic expression. *IMPORTANT:* Based on the theory from: # H.Gorter, *Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen* Classes ------- .. autoapisummary:: src.pydasa.dimensional.buckingham.Coefficient Module Contents --------------- .. py:class:: Coefficient Bases: :py:obj:`pydasa.core.basic.Foundation`, :py:obj:`pydasa.elements.specs.numerical.BoundsSpecs` **Coefficient** class for Dimensional Analysis in *PyDASA*. A comprehensive implementation that represents dimensionless coefficients (Pi numbers) used in the Vaschy-Buckingham Pi-theorem method. Inherits From: Foundation: Base class providing symbol validation and framework context. BoundsSpecs: Provides numerical bounds and ranges (setpoint, min, max, mean, dev). .. attribute:: # From Foundation name (str): User-friendly name of the dimensionless coefficient. description (str): Brief summary of the dimensionless coefficient. _idx (int): Index/precedence in the dimensional matrix. _sym (str): Symbol representation (LaTeX or alphanumeric). _alias (str): Python-compatible alias for use in code. _fwk (str): Frameworks context (PHYSICAL, COMPUTATION, SOFTWARE, CUSTOM). :type: inherited .. attribute:: # From BoundsSpecs _setpoint (Optional[float]): Specific value/point of interest (always in standardized units). _min (Optional[float]): Minimum value (always in standardized units). _max (Optional[float]): Maximum value (always in standardized units). _mean (Optional[float]): Average value (always in standardized units). _dev (Optional[float]): Standard deviation (always in standardized units). :type: inherited .. attribute:: # Coefficient-Specific Attributes _cat (str): Category (COMPUTED, DERIVED). relevance (bool): Flag indicating if coefficient is relevant for analysis. _variables (Dict[str, Variable]): Variable symbols used in coefficient construction. _dim_col (List[int]): Dimensional column for matrix operations. _pivot_lt (List[int]): Pivot indices in dimensional matrix. _pi_expr (str): Symbolic expression of the coefficient. var_dims (Dict[str, int]): Dimensional variable exponents. _step (Optional[float]): Step size for simulations (always in standardized units). _data (np.ndarray): Array of coefficient values for analysis. .. py:attribute:: _cat :type: str :value: 'COMPUTED' Category of the coefficient (COMPUTED, DERIVED). .. py:attribute:: _variables :type: Dict[str, pydasa.elements.parameter.Variable] Variables symbols used in the coefficient. .. py:attribute:: _dim_col :type: List[int] :value: [] Dimensional column for matrix operations. .. py:attribute:: var_dims :type: Dict[str, int] Dimensional variable exponents in coefficient. .. py:attribute:: _pivot_lt :type: Optional[List[int]] :value: [] Pivot indices in dimensional matrix. .. py:attribute:: _pi_expr :type: Optional[str] :value: None Symbolic expression of coefficient. .. py:attribute:: _min :type: Optional[float] :value: None Standardized minimum value of the dimensionless coefficient. .. py:attribute:: _max :type: Optional[float] :value: None Standardized maximum value of the dimensionless coefficient. .. py:attribute:: _mean :type: Optional[float] :value: None Standardized average value of the dimensionless coefficient. .. py:attribute:: _dev :type: Optional[float] :value: None Standardized standard deviation of the dimensionless coefficient. .. py:attribute:: _step :type: Optional[float] :value: 0.001 Step size for simulations, always in standardized units. .. py:attribute:: _data :type: numpy.typing.NDArray[numpy.float64] Data array for the dimensionless coefficient for analysis. .. py:attribute:: relevance :type: bool :value: True Flag indicating if coefficient is relevant for analysis. .. py:method:: _build_expression(var_lt, dim_col) *_build_expression()* Builds LaTeX expression for coefficient. :param var_lt: List of variable symbols. :type var_lt: List[str] :param dim_col: List of dimensional exponents. :type dim_col: List[int] :raises ValueError: If variable list and dimensional column have different lengths. :returns: LaTeX expression and variable exponents. :rtype: tuple[str, Dict[str, int]] .. py:property:: cat :type: str *cat* Get the coefficient category. :returns: Category (COMPUTED, DERIVED). :rtype: str .. py:property:: variables :type: Dict[str, pydasa.elements.parameter.Variable] *variables* Get the variable symbols dictionary. :returns: Variables symbols dictionary. :rtype: Dict[str, Variable] .. py:property:: dim_col :type: List[int] *dim_col* Get the dimensional column. :returns: Dimensional column. :rtype: List[int] .. py:property:: pivot_lt :type: Optional[List[int]] *pivot_lt* Get the pivot indices list. :returns: Pivot indices list. :rtype: Optional[List[int]] .. py:property:: pi_expr :type: Optional[str] *pi_expr* Get the coefficient expression. :returns: Coefficient expression. :rtype: Optional[str] .. py:property:: step :type: Optional[float] *step* Get standardized step size. :returns: Step size (always standardized). :rtype: Optional[float] .. py:property:: data :type: numpy.typing.NDArray[numpy.float64] *data* Get standardized data array. :returns: Data array for range (always standardized). :rtype: NDArray[np.float64] .. py:method:: calculate_setpoint(vars = None) *calculate_setpoint()* Calculate coefficient setpoint value based on provided variable setpoints. If no variables are provided uses the ones stored in the variables standardized attribute. :param vars: Variable setpoints dictionary. :type vars: Optional[Dict[str, float]] :raises ValueError: If variable setpoints are missing or invalid. :raises ValueError: If number of variable setpoints does not match coefficient variables. .. py:method:: generate_data() *generate_data()* Generate a linear standardized data array from min, max, using step value. :raises ValueError: If needed values are missing. .. py:method:: get_data() *get_data()* Get data array from the dimensionless coefficient and its variables. :returns: Data dictionary with 'symbol': data_list entries. :rtype: Dict[str, List] .. py:method:: clear() *clear()* Reset all attributes to default values. Resets all coefficient properties to their initial state. .. 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