Skip to content

Note

Click here to download the full example code

Usage of the SensitivityTool

SensitivityTool provides methods for sensitivity analysis. BendingTestAnalytical is used to illustrate the use of this tool.

Import the packages

%%

from __future__ import annotations

import logging

from vimseo import EXAMPLE_RUNS_DIR
from vimseo.api import activate_logger
from vimseo.api import create_model
from vimseo.core.model_settings import IntegratedModelSettings
from vimseo.tools.sensitivity.sensitivity import SensitivityTool
from vimseo.tools.space.space_tool import SpaceTool

activate_logger(level=logging.INFO)

Analysis definition

Let's start instantiate a model:

model_name = "BendingTestAnalytical"
load_case = "Cantilever"
model = create_model(
    model_name,
    load_case,
    model_options=IntegratedModelSettings(
        directory_archive_root=EXAMPLE_RUNS_DIR / "archive/sensitivity",
        directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/sensitivity",
        cache_file_path=EXAMPLE_RUNS_DIR
        / f"caches/sensitivity/{model_name}_{load_case}_cache.hdf",
    ),
)

Out:

    INFO - 16:52:52: Found 40 entries in the cache file : /home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/model_runs/caches/sensitivity/BendingTestAnalytical_Cantilever_cache.hdf node : node

Create a parameter space

Based on the above, we create a parameter space. In this example, all the parameters are defined by Uniform distributions. The parameter spaces are built with the help of the SpaceTool. By default, a parameter space per load case is generated (if load_cases=None):

space_tool = SpaceTool(working_directory="SpaceTool_results")
print(space_tool.get_available_space_builders())

Out:

['FromCenterAndCov', 'FromMinAndMax', 'FromModelCenterAndCov', 'FromModelMinAndMax', 'SpaceBuilder']

First, consider all input variables of the model except "relative_dplt_location".

retained_variables = model.get_input_data_names()
retained_variables.remove("relative_dplt_location")
space_tool.execute(
    distribution_name="OTTriangularDistribution",
    space_builder_name="FromModelCenterAndCov",
    variable_names=retained_variables,
    use_default_values_as_center=True,
    model=model,
    cov=0.05,
)

Out:

    INFO - 16:52:52: Working directory is /home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/09_sensitivity_analysis/SpaceTool_results
/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/pydantic/main.py:209: DeprecationWarning:

Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)


SpaceToolResult(metadata=ToolResultMetadata(generic={'datetime': '11-05-2026_16-52-52', 'version': '0.1.7.dev11+g45528c259'}, misc={}, settings={'distribution_name': 'OTTriangularDistribution', 'space_builder_name': 'FromModelCenterAndCov', 'minimum_values': None, 'maximum_values': None, 'center_value_expr': '', 'use_default_values_as_center': True, 'variable_names': ['length', 'width', 'height', 'imposed_dplt', 'young_modulus', 'nu_p'], 'center_values': None, 'cov': 0.05, 'truncate_to_model_bounds': True, 'lower_bounds': None, 'upper_bounds': None, 'size': 1}, report={}, model=None), parameter_space=Parameter space:
+---------------+-------------+-------------------+-------------+-------+-----------------------------------------------------------+--------------------+
| Name          | Lower bound |       Value       | Upper bound | Type  |                    Initial distribution                   | Transformation(x)= |
+---------------+-------------+-------------------+-------------+-------+-----------------------------------------------------------+--------------------+
| young_modulus |    199500   | 210000.0000000001 |    220500   | float | Triangular(lower=199500.0, mode=210000.0, upper=220500.0) |      Trunc(x)      |
| nu_p          |    0.285    |        0.3        |    0.315    | float |       Triangular(lower=0.285, mode=0.3, upper=0.315)      |         x          |
| length        |     570     | 600.0000000000003 |     630     | float |      Triangular(lower=570.0, mode=600.0, upper=630.0)     |      Trunc(x)      |
| width         |     28.5    | 30.00000000000004 |     31.5    | float |       Triangular(lower=28.5, mode=30.0, upper=31.5)       |      Trunc(x)      |
| height        |      38     | 40.00000000000004 |      42     | float |       Triangular(lower=38.0, mode=40.0, upper=42.0)       |      Trunc(x)      |
| imposed_dplt  |    -5.25    |         -5        |    -4.75    | float |      Triangular(lower=-5.25, mode=-5.0, upper=-4.75)      |         x          |
+---------------+-------------+-------------------+-------------+-------+-----------------------------------------------------------+--------------------+)

Then, specifically for "relative_dplt_location".

space_tool.execute(
    distribution_name="OTTriangularDistribution",
    space_builder_name="FromCenterAndCov",
    center_values={"relative_dplt_location": 0.9},
    cov=0.05,
)
print(space_tool.parameter_space)

Out:

    INFO - 16:52:52: Working directory is /home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/09_sensitivity_analysis/SpaceTool_results
/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/pydantic/main.py:209: DeprecationWarning:

Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

Uncertain space:
+------------------------+-------------------------------------------------------------+--------------------+
|          Name          |                     Initial distribution                    | Transformation(x)= |
+------------------------+-------------------------------------------------------------+--------------------+
|     young_modulus      |  Triangular(lower=199500.0, mode=210000.0, upper=220500.0)  |      Trunc(x)      |
|          nu_p          |        Triangular(lower=0.285, mode=0.3, upper=0.315)       |         x          |
|         length         |       Triangular(lower=570.0, mode=600.0, upper=630.0)      |      Trunc(x)      |
|         width          |        Triangular(lower=28.5, mode=30.0, upper=31.5)        |      Trunc(x)      |
|         height         |        Triangular(lower=38.0, mode=40.0, upper=42.0)        |      Trunc(x)      |
|      imposed_dplt      |       Triangular(lower=-5.25, mode=-5.0, upper=-4.75)       |         x          |
| relative_dplt_location | Triangular(lower=0.855, mode=0.9, upper=0.9450000000000001) |         x          |
+------------------------+-------------------------------------------------------------+--------------------+

Using the SensitivityTool

First, the tool must be instantiated.

tool = SensitivityTool(working_directory="sensitivity_tool_results")

The :class:~.SensitivityTool must be executed to generate the Design of Experiments. By default, it creates the sensitivity analysis through the |gemseo| API, computes sensitivity analysis indices and, generates a radar plot with the results. The execution returns either a dictionary or a pandas dataframe (if argument as_df=True).

output_names = ["reaction_forces", "dplt_at_force_location", "maximum_dplt"]
sensitivity_indices = tool.execute(
    model=model,
    parameter_space=space_tool.parameter_space,
    sensitivity_algo="MorrisAnalysis",
    output_names=output_names,
    n_replicates=5,
).indices
tool.save_results()

print(tool.result)

Out:

    INFO - 16:52:52: Working directory is /home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/09_sensitivity_analysis/sensitivity_tool_results
 WARNING - 16:52:52: No coupling in MDA, switching chain_linearize to True.
    INFO - 16:52:52:  
    INFO - 16:52:52: *** Start MorrisAnalysisSamplingPhase execution ***
    INFO - 16:52:52: MorrisAnalysisSamplingPhase
    INFO - 16:52:52:    Disciplines: Model BendingTestAnalytical:  An analytical model for the bending of a parallelepipedic beam
    INFO - 16:52:52: 
    INFO - 16:52:52: Load case:
    INFO - 16:52:52:    Load case Cantilever: A cantilever load case.
    INFO - 16:52:52:    
    INFO - 16:52:52:    Boundary condition variables:
    INFO - 16:52:52:    ['imposed_dplt', 'relative_dplt_location']
    INFO - 16:52:52:    
    INFO - 16:52:52:    Plot parameters:
    INFO - 16:52:52:    {
    INFO - 16:52:52:     "curves": []
    INFO - 16:52:52: }
    INFO - 16:52:52:    Load:
    INFO - 16:52:52:    Load(direction='', sign='', type='')
    INFO - 16:52:52: 
    INFO - 16:52:52: Default values:
    INFO - 16:52:52:    
    INFO - 16:52:52:    Default geometrical variables:
    INFO - 16:52:52:    {"height": [40.0], "length": [600.0], "width": [30.0]}
    INFO - 16:52:52:    
    INFO - 16:52:52:    Default numerical variables:
    INFO - 16:52:52:    {}
    INFO - 16:52:52:    
    INFO - 16:52:52:    Default boundary conditions variables:
    INFO - 16:52:52:    {"imposed_dplt": [-5.0], "relative_dplt_location": [1.0]}
    INFO - 16:52:52:    
    INFO - 16:52:52:    Default material variables:
    INFO - 16:52:52:    {"nu_p": [0.3], "young_modulus": [210000.0]}
    INFO - 16:52:52: model_inputs:
    INFO - 16:52:52:    [
    INFO - 16:52:52:     "length",
    INFO - 16:52:52:     "width",
    INFO - 16:52:52:     "height",
    INFO - 16:52:52:     "imposed_dplt",
    INFO - 16:52:52:     "relative_dplt_location",
    INFO - 16:52:52:     "young_modulus",
    INFO - 16:52:52:     "nu_p"
    INFO - 16:52:52: ]
    INFO - 16:52:52: model_outputs:
    INFO - 16:52:52:    [
    INFO - 16:52:52:     "reaction_forces",
    INFO - 16:52:52:     "maximum_dplt",
    INFO - 16:52:52:     "dplt_grid",
    INFO - 16:52:52:     "location_max_dplt",
    INFO - 16:52:52:     "dplt",
    INFO - 16:52:52:     "moment",
    INFO - 16:52:52:     "moment_grid",
    INFO - 16:52:52:     "dplt_at_force_location",
    INFO - 16:52:52:     "error_code",
    INFO - 16:52:52:     "model",
    INFO - 16:52:52:     "load_case",
    INFO - 16:52:52:     "description",
    INFO - 16:52:52:     "job_name",
    INFO - 16:52:52:     "persistent_result_files",
    INFO - 16:52:52:     "n_cpus",
    INFO - 16:52:52:     "date",
    INFO - 16:52:52:     "cpu_time",
    INFO - 16:52:52:     "user",
    INFO - 16:52:52:     "machine",
    INFO - 16:52:52:     "vims_git_version",
    INFO - 16:52:52:     "directory_archive_root",
    INFO - 16:52:52:     "directory_archive_job",
    INFO - 16:52:52:     "directory_scratch_root",
    INFO - 16:52:52:     "directory_scratch_job"
    INFO - 16:52:52: ]
    INFO - 16:52:52:    MDO formulation: MDF
    INFO - 16:52:52: Running the algorithm MorrisDOE:
    INFO - 16:52:52:      2%|         | 1/40 [00:00<00:00, 64.82 it/sec]
    INFO - 16:52:52:      5%|         | 2/40 [00:00<00:00, 84.15 it/sec]
    INFO - 16:52:52:      8%|         | 3/40 [00:00<00:00, 94.38 it/sec]
    INFO - 16:52:52:     10%|         | 4/40 [00:00<00:00, 100.12 it/sec]
    INFO - 16:52:52:     12%|█▎        | 5/40 [00:00<00:00, 104.41 it/sec]
    INFO - 16:52:52:     15%|█▌        | 6/40 [00:00<00:00, 107.79 it/sec]
    INFO - 16:52:52:     18%|█▊        | 7/40 [00:00<00:00, 110.36 it/sec]
    INFO - 16:52:52:     20%|██        | 8/40 [00:00<00:00, 111.70 it/sec]
    INFO - 16:52:52:     22%|██▎       | 9/40 [00:00<00:00, 112.98 it/sec]
    INFO - 16:52:52:     25%|██▌       | 10/40 [00:00<00:00, 114.07 it/sec]
    INFO - 16:52:52:     28%|██▊       | 11/40 [00:00<00:00, 114.90 it/sec]
    INFO - 16:52:52:     30%|███       | 12/40 [00:00<00:00, 115.85 it/sec]
    INFO - 16:52:52:     32%|███▎      | 13/40 [00:00<00:00, 116.36 it/sec]
    INFO - 16:52:52:     35%|███▌      | 14/40 [00:00<00:00, 116.79 it/sec]
    INFO - 16:52:52:     38%|███▊      | 15/40 [00:00<00:00, 116.90 it/sec]
    INFO - 16:52:52:     40%|████      | 16/40 [00:00<00:00, 117.17 it/sec]
    INFO - 16:52:52:     42%|████▎     | 17/40 [00:00<00:00, 117.21 it/sec]
    INFO - 16:52:52:     45%|████▌     | 18/40 [00:00<00:00, 117.51 it/sec]
    INFO - 16:52:52:     48%|████▊     | 19/40 [00:00<00:00, 117.62 it/sec]
    INFO - 16:52:52:     50%|█████     | 20/40 [00:00<00:00, 117.79 it/sec]
    INFO - 16:52:52:     52%|█████▎    | 21/40 [00:00<00:00, 117.93 it/sec]
    INFO - 16:52:52:     55%|█████▌    | 22/40 [00:00<00:00, 118.22 it/sec]
    INFO - 16:52:52:     57%|█████▊    | 23/40 [00:00<00:00, 118.26 it/sec]
    INFO - 16:52:52:     60%|██████    | 24/40 [00:00<00:00, 118.20 it/sec]
    INFO - 16:52:52:     62%|██████▎   | 25/40 [00:00<00:00, 117.73 it/sec]
    INFO - 16:52:52:     65%|██████▌   | 26/40 [00:00<00:00, 117.38 it/sec]
    INFO - 16:52:52:     68%|██████▊   | 27/40 [00:00<00:00, 116.89 it/sec]
    INFO - 16:52:52:     70%|███████   | 28/40 [00:00<00:00, 116.82 it/sec]
    INFO - 16:52:52:     72%|███████▎  | 29/40 [00:00<00:00, 116.74 it/sec]
    INFO - 16:52:52:     75%|███████▌  | 30/40 [00:00<00:00, 116.68 it/sec]
    INFO - 16:52:52:     78%|███████▊  | 31/40 [00:00<00:00, 116.73 it/sec]
    INFO - 16:52:52:     80%|████████  | 32/40 [00:00<00:00, 116.82 it/sec]
    INFO - 16:52:52:     82%|████████▎ | 33/40 [00:00<00:00, 117.03 it/sec]
    INFO - 16:52:52:     85%|████████▌ | 34/40 [00:00<00:00, 117.03 it/sec]
    INFO - 16:52:52:     88%|████████▊ | 35/40 [00:00<00:00, 117.07 it/sec]
    INFO - 16:52:52:     90%|█████████ | 36/40 [00:00<00:00, 117.29 it/sec]
    INFO - 16:52:52:     92%|█████████▎| 37/40 [00:00<00:00, 117.44 it/sec]
    INFO - 16:52:52:     95%|█████████▌| 38/40 [00:00<00:00, 117.51 it/sec]
    INFO - 16:52:52:     98%|█████████▊| 39/40 [00:00<00:00, 117.65 it/sec]
    INFO - 16:52:52:    100%|██████████| 40/40 [00:00<00:00, 117.86 it/sec]
    INFO - 16:52:52: *** End MorrisAnalysisSamplingPhase execution (time: 0:00:00.346206) ***
/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/gemseo/uncertainty/sensitivity/morris_analysis.py:294: RuntimeWarning:

invalid value encountered in divide

    INFO - 16:52:52: Saving result to /home/sebastien.bocquet/PycharmProjects/vimseo/docs/runnable_examples/09_sensitivity_analysis/sensitivity_tool_results/SensitivityTool_result.hdf5
    INFO - 16:52:52: PICKLE fallback: key='analysis', type=<class 'gemseo.uncertainty.sensitivity.morris_analysis.MorrisAnalysis'>, value=<gemseo.uncertainty.sensitivity.morris_analysis.MorrisAnalysis object at 0x7f270463fb50>
Results of a sensitivity analysis.
{
    "generic": {
        "datetime": "11-05-2026_16-52-52",
        "version": "0.1.7.dev11+g45528c259"
    },
    "misc": {},
    "model": {
        "curves": [
            [
                "dplt_grid",
                "dplt"
            ],
            [
                "moment_grid",
                "moment"
            ]
        ],
        "dataflow": {
            "PostBendingTestAnalytical_Cantilever": {
                "inputs": [
                    "dplt",
                    "dplt_grid",
                    "moment",
                    "moment_grid",
                    "imposed_dplt_location",
                    "reaction_forces"
                ],
                "outputs": [
                    "reaction_forces",
                    "maximum_dplt",
                    "dplt_grid",
                    "location_max_dplt",
                    "dplt",
                    "moment",
                    "moment_grid",
                    "dplt_at_force_location",
                    "error_code"
                ]
            },
            "PreBendingTestAnalytical_Cantilever": {
                "inputs": [
                    "length",
                    "width",
                    "height",
                    "imposed_dplt",
                    "relative_dplt_location",
                    "young_modulus",
                    "nu_p"
                ],
                "outputs": [
                    "imposed_dplt_location",
                    "quadratic_moment",
                    "reaction_forces",
                    "moment",
                    "moment_grid",
                    "solver",
                    "boundary"
                ]
            },
            "RunBendingTestAnalytical": {
                "inputs": [
                    "imposed_dplt_location",
                    "quadratic_moment",
                    "reaction_forces",
                    "moment",
                    "moment_grid",
                    "solver",
                    "boundary",
                    "length",
                    "width",
                    "height",
                    "imposed_dplt",
                    "relative_dplt_location",
                    "young_modulus",
                    "nu_p"
                ],
                "outputs": [
                    "dplt",
                    "dplt_grid",
                    "moment",
                    "moment_grid",
                    "imposed_dplt_location",
                    "reaction_forces"
                ]
            },
            "model_inputs": [
                "length",
                "width",
                "height",
                "imposed_dplt",
                "relative_dplt_location",
                "young_modulus",
                "nu_p"
            ],
            "model_outputs": [
                "reaction_forces",
                "maximum_dplt",
                "dplt_grid",
                "location_max_dplt",
                "dplt",
                "moment",
                "moment_grid",
                "dplt_at_force_location",
                "error_code",
                "model",
                "load_case",
                "description",
                "job_name",
                "persistent_result_files",
                "n_cpus",
                "date",
                "cpu_time",
                "user",
                "machine",
                "vims_git_version",
                "directory_archive_root",
                "directory_archive_job",
                "directory_scratch_root",
                "directory_scratch_job"
            ],
            "subroutine_names": []
        },
        "default_inputs": {
            "boundary conditions variables": {
                "imposed_dplt": [
                    -5.0
                ],
                "relative_dplt_location": [
                    1.0
                ]
            },
            "geometrical variables": {
                "height": [
                    40.0
                ],
                "length": [
                    600.0
                ],
                "width": [
                    30.0
                ]
            },
            "material variables": {
                "nu_p": [
                    0.3
                ],
                "young_modulus": [
                    210000.0
                ]
            },
            "numerical variables": {}
        },
        "load_case": {
            "bc_variable_names": [
                "imposed_dplt",
                "relative_dplt_location"
            ],
            "domain": "Beam",
            "load": {
                "direction": "",
                "sign": "",
                "type": ""
            },
            "name": "Cantilever",
            "plot_parameters": {
                "curves": []
            },
            "summary": "A cantilever load case."
        },
        "name": "BendingTestAnalytical",
        "summary": " An analytical model for the bending of a parallelepipedic beam",
        "verbose": false
    },
    "report": {
        "output_names": [
            "reaction_forces",
            "dplt_at_force_location",
            "maximum_dplt"
        ]
    },
    "settings": {
        "n_replicates": 5,
        "n_samples": 0,
        "output_names": [
            "reaction_forces",
            "dplt_at_force_location",
            "maximum_dplt"
        ],
        "sensitivity_algo": "MorrisAnalysis"
    }
}

Input variables by decreasing order of influence:
   For output reaction_forces: ['length', 'height', 'relative_dplt_location', 'imposed_dplt', 'width', 'young_modulus', 'nu_p'].
   For output dplt_at_force_location: ['imposed_dplt', 'relative_dplt_location', 'length', 'height', 'width', 'young_modulus', 'nu_p'].
   For output maximum_dplt: ['relative_dplt_location', 'imposed_dplt', 'length', 'width', 'height', 'young_modulus', 'nu_p'].
Sensitivity indices:
   Index mu
      reaction_forces: [{'young_modulus': array([-13.43064013]), 'nu_p': array([0.]), 'length': array([58.60982709]), 'width': array([-14.47192315]), 'height': array([-13.80474496]), 'imposed_dplt': array([16.55844226]), 'relative_dplt_location': array([49.1739949])}]
      dplt_at_force_location: [{'young_modulus': array([-1.42108547e-15]), 'nu_p': array([0.]), 'length': array([-1.01049536e-05]), 'width': array([-7.10542736e-16]), 'height': array([1.95399252e-15]), 'imposed_dplt': array([0.02475083]), 'relative_dplt_location': array([-0.00022711])}]
      maximum_dplt: [{'young_modulus': array([-1.24344979e-15]), 'nu_p': array([0.]), 'length': array([9.25911667e-06]), 'width': array([-8.8817842e-16]), 'height': array([1.59872116e-15]), 'imposed_dplt': array([0.02923962]), 'relative_dplt_location': array([0.04288046])}]
   Index mu_star
      reaction_forces: [{'young_modulus': array([13.43064013]), 'nu_p': array([0.]), 'length': array([58.60982709]), 'width': array([14.47192315]), 'height': array([55.10011756]), 'imposed_dplt': array([16.55844226]), 'relative_dplt_location': array([49.1739949])}]
      dplt_at_force_location: [{'young_modulus': array([1.42108547e-15]), 'nu_p': array([0.]), 'length': array([1.24849806e-05]), 'width': array([1.77635684e-15]), 'height': array([1.95399252e-15]), 'imposed_dplt': array([0.02475083]), 'relative_dplt_location': array([0.00024446])}]
      maximum_dplt: [{'young_modulus': array([1.24344979e-15]), 'nu_p': array([0.]), 'length': array([1.94426342e-05]), 'width': array([1.59872116e-15]), 'height': array([1.59872116e-15]), 'imposed_dplt': array([0.02923962]), 'relative_dplt_location': array([0.04288046])}]
   Index sigma
      reaction_forces: [{'young_modulus': array([3.67260496]), 'nu_p': array([0.]), 'length': array([49.90184971]), 'width': array([5.76286543]), 'height': array([61.55049071]), 'imposed_dplt': array([9.26333405]), 'relative_dplt_location': array([26.92516706])}]
      dplt_at_force_location: [{'young_modulus': array([1.64732556e-15]), 'nu_p': array([0.]), 'length': array([2.32090004e-05]), 'width': array([1.8966301e-15]), 'height': array([1.42108547e-15]), 'imposed_dplt': array([0.01246174]), 'relative_dplt_location': array([0.00045632])}]
      maximum_dplt: [{'young_modulus': array([4.35116786e-16]), 'nu_p': array([0.]), 'length': array([3.15207404e-05]), 'width': array([2.10181376e-15]), 'height': array([1.62805794e-15]), 'imposed_dplt': array([0.01555085]), 'relative_dplt_location': array([0.0245328])}]
   Index relative_sigma
      reaction_forces: [{'young_modulus': array([0.27344973]), 'nu_p': array([nan]), 'length': array([0.85142462]), 'width': array([0.39821006]), 'height': array([1.11706641]), 'imposed_dplt': array([0.5594327]), 'relative_dplt_location': array([0.54754891])}]
      dplt_at_force_location: [{'young_modulus': array([1.15920231]), 'nu_p': array([nan]), 'length': array([1.85895367]), 'width': array([1.06770783]), 'height': array([0.72727273]), 'imposed_dplt': array([0.50348774]), 'relative_dplt_location': array([1.86663484])}]
      maximum_dplt: [{'young_modulus': array([0.34992711]), 'nu_p': array([nan]), 'length': array([1.62121758]), 'width': array([1.3146844]), 'height': array([1.01835015]), 'imposed_dplt': array([0.53184165]), 'relative_dplt_location': array([0.57212065])}]
   Index min
      reaction_forces: [{'young_modulus': array([9.2905588]), 'nu_p': array([0.]), 'length': array([24.01397044]), 'width': array([8.21014976]), 'height': array([23.25186439]), 'imposed_dplt': array([8.39985622]), 'relative_dplt_location': array([26.91142661])}]
      dplt_at_force_location: [{'young_modulus': array([0.]), 'nu_p': array([0.]), 'length': array([2.84046129e-08]), 'width': array([8.8817842e-16]), 'height': array([0.]), 'imposed_dplt': array([0.01297183]), 'relative_dplt_location': array([9.02381733e-06])}]
      maximum_dplt: [{'young_modulus': array([8.8817842e-16]), 'nu_p': array([0.]), 'length': array([1.89089638e-06]), 'width': array([0.]), 'height': array([0.]), 'imposed_dplt': array([0.01527829]), 'relative_dplt_location': array([0.0216497])}]
   Index max
      reaction_forces: [{'young_modulus': array([18.38485335]), 'nu_p': array([0.]), 'length': array([157.00575767]), 'width': array([22.81785918]), 'height': array([103.23843151]), 'imposed_dplt': array([31.42358486]), 'relative_dplt_location': array([83.35034553])}]
      dplt_at_force_location: [{'young_modulus': array([4.4408921e-15]), 'nu_p': array([0.]), 'length': array([5.63319641e-05]), 'width': array([3.55271368e-15]), 'height': array([3.55271368e-15]), 'imposed_dplt': array([0.04443667]), 'relative_dplt_location': array([0.00113868])}]
      maximum_dplt: [{'young_modulus': array([1.77635684e-15]), 'nu_p': array([0.]), 'length': array([7.17543771e-05]), 'width': array([4.4408921e-15]), 'height': array([3.55271368e-15]), 'imposed_dplt': array([0.054728]), 'relative_dplt_location': array([0.07790166])}]

The MorrisAnalysis method is used by default for the sensitivity analysis, but there is also the option to use 'CorrelationAnalysis' or 'SobolAnalysis'

Plot the sensitivity of reaction_forces to the model inputs. Standard plots for each type of sensitivity analysis can be shown. Here, for a Morris analysis, a radar plot of the indices, and a (\(\sigma\), \(\mu_{star}\)) plot:

fig_sensitivity_reaction_forces = tool.plot_results(
    tool.result,
    output_names=output_names,
    show=True,
    save=False,
)

# And an interactive bar plot of the indices:
fig_sensitivity_reaction_forces["bar_plot"]
    MU_STARSampling: PYDOE_LHS(size=5) - Relative step: 0.05 - Output: reaction_forcesSampling: PYDOE_LHS(size=5) - Relative step: 0.05 - Output: dplt_at_force_locationSampling: PYDOE_LHS(size=5) - Relative step: 0.05 - Output: maximum_dplt

Out:

/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/gemseo/post/dataset/plots/_matplotlib/plot.py:87: UserWarning:

This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.

/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/gemseo/utils/matplotlib_figure.py:59: UserWarning:

FigureCanvasAgg is non-interactive, and thus cannot be shown

/home/sebastien.bocquet/PycharmProjects/vimseo/.tox/doc/lib/python3.11/site-packages/gemseo/utils/matplotlib_figure.py:59: UserWarning:

FigureCanvasAgg is non-interactive, and thus cannot be shown

Total running time of the script: ( 0 minutes 1.735 seconds)

Download Python source code: plot_example_SensitivityTool_StraightBeamModel.py

Download Jupyter notebook: plot_example_SensitivityTool_StraightBeamModel.ipynb

Gallery generated by mkdocs-gallery