src.pydasa.workflows.influence ============================== .. py:module:: src.pydasa.workflows.influence .. autoapi-nested-parse:: Module influence.py =========================================== Module for **SensitivityAnalysis** to manage sensitivity analysis in *PyDASA* This module provides the SensitivityAnalysis class for coordinating multiple sensitivity analyses and generating reports on which variables have the most significant impact on dimensionless coefficients. Classes: **SensitivityAnalysis**: Manages sensitivity analyses for multiple coefficients, processes results, and generates reports on variable impacts. *IMPORTANT:* Based on the theory from: # H.Gorter, *Dimensionalanalyse: Eine Theoririe der physikalischen Dimensionen mit Anwendungen* Classes ------- .. autoapisummary:: src.pydasa.workflows.influence.SensitivityAnalysis Module Contents --------------- .. py:class:: SensitivityAnalysis Bases: :py:obj:`pydasa.core.basic.Foundation`, :py:obj:`pydasa.workflows.basic.WorkflowBase` **SensitivityAnalysis** class for managing multiple sensitivity analyses in *PyDASA*. Coordinates sensitivity analyses for multiple coefficients, processes their results, and generates comprehensive reports on variable impacts. :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 sensitivity analysis. description (str): Brief summary of the sensitivity analysis. _idx (int): Index/precedence of the sensitivity analysis. _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: Identification and Classification .. attribute:: # From WorkflowBase _variables (Dict[str, Variable]): All available parameters/variables in the model (*Variable*). Accepts Variable instances or dicts. _schema (Optional[Schema]): Dimensional framework schema for the workflow. After __post_init__, this will always be a Schema instance. _coefficients (Dict[str, Coefficient]): All available coefficients in the model (*Coefficient*). Accepts Coefficient instances or dicts. _results (Dict[str, Dict[str, Any]]): Consolidated results from sensitivity analyses. _is_solved (bool): Flag indicating if the sensitivity analysis workflow has been completed. :type: Common Workflow Components .. attribute:: # Specific to SensitivityAnalysis _cat (str): Category of sensitivity analysis (SYM, NUM, HYB). _analyses (Dict[str, Sensitivity]): All sensitivity analyses performed for each coefficient. .. py:attribute:: _cat :type: str :value: 'SYM' Category of sensitivity analysis workflow (SYM, NUM). .. py:attribute:: _analyses :type: Dict[str, pydasa.analysis.scenario.Sensitivity] Dictionary of sensitivity analyses performed in the workflow. .. py:method:: _create_analyses() *_create_analyses()* Creates sensitivity analyses for each coefficient. Sets up Sensitivity objects for each coefficient to be analyzed. .. py:method:: _get_variable_value(var_sym, val_type = 'mean') *_get_variable_value()* Gets a value for a variable based on value type. :param var_sym: Symbol of the variable. :type var_sym: str :param val_type: Type of value to return (mean, min, max). Defaults to "mean". :type val_type: str, optional :returns: Variable value. :rtype: float :raises ValueError: If the variable is not found. :raises ValueError: If the value type is invalid. .. py:method:: analyze_symbolic(val_type = 'mean') *analyze_symbolic()* Performs symbolic sensitivity analysis. Analyzes each coefficient using symbolic differentiation at specified values. :param val_type: Type of value to use (mean, min, max). Defaults to "mean". :type val_type: str, optional :returns: Sensitivity results by coefficient and variable. :rtype: Dict[str, Dict[str, float]] .. py:method:: analyze_numeric(n_samples = 1000) *analyze_numeric()* Performs numerical sensitivity analysis. Analyzes each coefficient using Fourier Amplitude Sensitivity Test (FAST). :param n_samples: Number of samples to use. Defaults to 1000. :type n_samples: int, optional :returns: Sensitivity results by coefficient. :rtype: Dict[str, Dict[str, Any]] .. py:property:: cat :type: str *cat* Get the analysis category. :returns: Category (SYM, NUM, HYB). :rtype: str .. py:property:: analyses :type: Dict[str, pydasa.analysis.scenario.Sensitivity] *analyses* Get the dictionary of sensitivity analyses. :returns: Dictionary of sensitivity analyses. :rtype: Dict[str, Sensitivity] .. py:method:: reset() *reset()* Reset the analysis state while preserving input configuration. Clears coefficients, results, analyses, and solved state while keeping variables and schema. .. py:method:: clear() *clear()* Reset all attributes to default values. Resets all analysis properties to their initial state, including variables, coefficients, and results from WorkflowBase. .. py:method:: to_dict() *to_dict()* Convert sensitivity analysis to dictionary representation. :returns: Dictionary representation of sensitivity analysis. :rtype: Dict[str, Any] .. py:method:: from_dict(data) :classmethod: *from_dict()* Create sensitivity analysis from dictionary representation. :param data: Dictionary representation of sensitivity analysis. :type data: Dict[str, Any] :returns: New sensitivity analysis instance. :rtype: SensitivityAnalysis