src.pydasa.workflows.phenomena ============================== .. py:module:: src.pydasa.workflows.phenomena .. autoapi-nested-parse:: Module phenomena.py =========================================== Module for **AnalysisEngine** to orchestrate dimensional analysis workflows in *PyDASA*. This module provides the **AnalysisEngine** class serves as the main entry point and workflow for *PyDASA's* dimensional analysis capabilities setting up the dimensional domain, solving the dimensional matrix, and generate coefficients. Classes: **AnalysisEngine**: Main workflow class for dimensional analysis and coefficient generation. *IMPORTANT:* Based on the theory from: # H.Gorter, *Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen* Classes ------- .. autoapisummary:: src.pydasa.workflows.phenomena.AnalysisEngine Module Contents --------------- .. py:class:: AnalysisEngine Bases: :py:obj:`pydasa.core.basic.Foundation`, :py:obj:`pydasa.workflows.basic.WorkflowBase` **AnalysisEngine** class for orchestrating dimensional analysis workflows in *PyDASA*. Main entry point to solve the dimensional matrix and generate the dimensionless coefficients. :param Foundation: Inherits common validation logic. :type Foundation: Foundation :param WorkflowBase: Inherits workflow basic functionalities. :type WorkflowBase: WorkflowBase .. attribute:: # From Foundation _name (str): User-friendly name of the problem. description (str): Brief summary of the problem. _idx (int): Index/precedence of the problem. _sym (str): Symbol representation (LaTeX or alphanumeric). _alias (str): Python-compatible alias for use in code. _fwk (str): Frameworks context (PHYSICAL, COMPUTATION, SOFTWARE, CUSTOM). .. attribute:: # From Workflows _variables (Dict[str, Variable]): All variables in the model. _schema (Optional[Schema]): Dimensional framework schema. _coefficients (Dict[str, Coefficient]): All coefficients in the model. _results (Dict[str, Dict[str, Any]]): Consolidated results from workflow. _is_solved (bool): Flag indicating if the workflow has been solved. .. attribute:: # For the Analysis Engine _model (Optional[Matrix]): Dimensional matrix for analysis. .. py:attribute:: _model :type: Optional[pydasa.dimensional.model.Matrix] :value: None Dimensional matrix for Buckingham Pi analysis. .. py:property:: matrix :type: Optional[pydasa.dimensional.model.Matrix] *matrix* Get the dimensional matrix. :returns: Dimensional matrix. :rtype: Optional[Matrix] .. py:method:: create_matrix(**kwargs) *create_matrix()* Create and configure dimensional matrix for the model. :param \*\*kwargs: Optional keyword arguments to pass to Matrix constructor. :returns: Configured dimensional matrix. :rtype: Matrix :raises ValueError: If variables are not set. :raises TypeError: If schema is not set. .. py:method:: solve() *solve()* Solve the dimensional matrix and generate coefficients. Performs dimensional analysis using the Buckingham Pi theorem to generate dimensionless coefficients. :returns: Dictionary of generated coefficients. :rtype: Dict[str, Coefficient] :raises ValueError: If matrix is not created. :raises RuntimeError: If solving fails. .. py:method:: run_analysis() *run_analysis()* Execute complete dimensional analysis workflow. Convenience method that runs the entire workflow: create matrix and solve. :returns: Dictionary with the Dimensional Analysis results with coefficient details in nested dictionaries. :rtype: Dict[str, Any] .. py:method:: derive_coefficient(expr, symbol = '', name = '', description = '', idx = -1) *derive_coefficient()* Derive a new coefficient from existing ones. :param expr: LaTeX expression defining the new coefficient in terms of existing ones. :type expr: str :param symbol: Symbol representation (LaTeX or alphanumeric) for the derived coefficient. Defaults to "" to keep the original (e.g., Pi_{0}). :type symbol: str, optional :param name: User-friendly name for the derived coefficient. Defaults to "". :type name: str, optional :param description: Description of the derived coefficient. Defaults to "". :type description: str, optional :param idx: Index/precedence of the derived coefficient. Defaults to -1. :type idx: int, optional :raises ValueError: If matrix is not created. :raises ValueError: If matrix is not solved. :raises ValueError: If the expression for the derived coefficient is invalid. :raises RuntimeError: If derivation fails. :returns: The newly derived coefficient. :rtype: Coefficient .. py:method:: calculate_coefficients(setpoints = None) *calculate_coefficients()* Calculate numerical values for all coefficients based on current variable setpoints. :param setpoints: Dictionary of variable symbols and their numerical setpoint values. Defaults to None. :type setpoints: Optional[Dict[str, float]], optional :raises ValueError: If matrix is not created. :raises ValueError: If matrix is not solved. :returns: Dictionary of coefficient symbols and their calculated numerical values. :rtype: Dict[str, float] .. py:method:: reset() *reset()* Reset the solver state, all the results, KEEPING only the input variables. .. py:method:: clear() *clear()* Reset all attributes to default values. Clears all solver properties to their initial state, INCLUDING variables. .. py:method:: to_dict() *to_dict()* Convert solver state to dictionary. :returns: Dictionary representation of solver state. :rtype: Dict[str, Any] .. py:method:: from_dict(data) :classmethod: *from_dict()* Create a AnalysisEngine instance from a dictionary. :param data: Dictionary containing the solver's state. :type data: Dict[str, Any] :returns: New instance of AnalysisEngine. :rtype: AnalysisEngine