Note
Click here to download the full example code
1) Usage of the Uncertainty Quantification¶
The :class:~.StatisticsTool provides methods for quantifying uncertainties
on a model output.
The :class:~.BendingTestAnalytical is used to illustrate the use of this tool.
from __future__ import annotations
import logging
from pprint import pprint
from gemseo.datasets.dataset import Dataset
from gemseo.post.dataset.scatter import Scatter
from matplotlib import pyplot as plt
from numpy import array
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.doe.doe import DOETool
from vimseo.tools.space.space_tool import SpaceTool
from vimseo.tools.statistics.statistics_tool import StatisticsTool
activate_logger(level=logging.INFO)
model_name = "BendingTestAnalytical"
load_case = "Cantilever"
model = create_model(
model_name,
load_case,
model_options=IntegratedModelSettings(
directory_archive_root=EXAMPLE_RUNS_DIR / "archive/uq",
directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/uq",
cache_file_path=EXAMPLE_RUNS_DIR
/ f"caches/uq/{model_name}_{load_case}_cache.hdf",
),
)
Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\genson\schema\strategies\base.py:42: UserWarning:
Schema incompatible. Keyword 'description' has conflicting values ('Value of the reaction forces at the imposed displacement location' vs. ''). Using 'Value of the reaction forces at the imposed displacement location'
It is possible to change a default input of the model.
model.default_input_data.update({"imposed_dplt": array([-15.0])})
2. Define the uncertain space¶
In addition to the model,
we need to define the uncertain space over which statistics will be computed.
The uncertainty is filled with independent random variables.
This operation is performed with the :class:~.SpaceTool.
Several builders can be used to construct the distributions.
space_tool = SpaceTool(working_directory="SpaceTool_results")
print(space_tool.get_available_space_builders())
Out:
['FromCenterAndCov', 'FromMinAndMax', 'FromModelCenterAndCov', 'FromModelMinAndMax', 'SpaceBuilder']
The model can be used as input such that the bounds of the model input variables
or the central value of its input variable intervals can be used to build
the probability distributions of the random variables.
Here the uncertain space is built from the model, using the central value of its
input variable intervals. A coefficient of variation is used to define the width
of the distribution, which is :math:\pm cov * central\_value.
We consider independent random variables triangularly distributed:
.. note::
A triangular distribution is a probability distribution defined by a lower bound, a mode and an upper bound:
.. figure:: /_examples/uq/_static/triangular_distribution.png
Probability density function of the random variable *friction*
distributed as a triangular distribution :math:`\mathcal{T}(0.1, 0.2, 0.3)`.
Here, the space of parameters is built in two steps. First, considering 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 - 09:45:57: Working directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\11_uncertainty_quantification\SpaceTool_results
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\pydantic\main.py:253: 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': '28-10-2026_09-45-57', 'version': '0.1.8.dev0+g5ba602a7e.d20261028'}, 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 | -15.75 | -15 | -14.25 | float | Triangular(lower=-15.75, mode=-15.0, upper=-14.25) | 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,
)
parameter_space = space_tool.parameter_space
Out:
INFO - 09:45:57: Working directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\11_uncertainty_quantification\SpaceTool_results
Other distributions can be used and the available ones can be listed with:
print(space_tool.get_available_distributions())
Out:
('OTUniformDistribution', 'OTTriangularDistribution', 'OTNormalDistribution')
.. note::
For a one-shot use,
we can also instantiate a uncertain space
directly from :class:ParameterSpace.
.. code::
from gemseo.api import create_parameter_space
parameter_space = create_parameter_space()
for (name, minimum, mode, maximum) in [
("plate_len", 210, 214.3, 220.0),
("plate_wid", 50.5, 50.8, 51.0),
("plate_thick", 2.9, 3.0, 3.1),
("friction", 0.1, 0.2, 0.3),
("boundary", 57000.0, 60000.0, 63000.0),
("huth_factor", 0.95, 1., 1.05),
("preload", -10500., -10000., -9500.)
]:
parameter_space.add_random_variable(
name,
"OTTriangularDistribution",
minimum=minimum,
maximum=maximum,
mode=mode
)
In this case, we can use any distribution of
OpenTURNS <https://openturns.github.io/openturns/latest/user_manual/
probabilistic_modelling.html>
and
SciPy <https://docs.scipy.org/doc/scipy/reference/
stats.html#probability-distributions>.
Discover this uncertain space and check its content by printing it:
print(parameter_space)
Out:
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=-15.75, mode=-15.0, upper=-14.25) | x |
| relative_dplt_location | Triangular(lower=0.855, mode=0.9, upper=0.9450000000000001) | x |
+------------------------+-------------------------------------------------------------+--------------------+
We can also sample this uncertain space:
three_samples = parameter_space.compute_samples(3, as_dict=True)
print("Three samples in the parameter space", three_samples)
Out:
Three samples in the parameter space [{'young_modulus': array([210516.88831882]), 'nu_p': array([0.29960532]), 'length': array([586.21006641]), 'width': array([28.80434091]), 'height': array([40.09594002]), 'imposed_dplt': array([-14.72569875]), 'relative_dplt_location': array([0.91464202])}, {'young_modulus': array([210712.2653891]), 'nu_p': array([0.30235434]), 'length': array([610.99460534]), 'width': array([29.51159661]), 'height': array([39.0704446]), 'imposed_dplt': array([-15.28305219]), 'relative_dplt_location': array([0.86620871])}, {'young_modulus': array([209439.41470779]), 'nu_p': array([0.29295192]), 'length': array([589.52132908]), 'width': array([30.31094036]), 'height': array([39.21836595]), 'imposed_dplt': array([-15.04014776]), 'relative_dplt_location': array([0.87377835])}]
3. Post-process¶
Lastly, we can generate some visualizations from 200 realizations of the input variables:
dataset = Dataset.from_array(
parameter_space.compute_samples(200), parameter_space.uncertain_variables
)
|gemseo| provides several plots in package gemseo.post.dataset.
Here, these 200 realizations for a pair of variables are shown in a scatter plot:
scatter_plot = Scatter(
dataset,
x="length",
y="width",
)
fig = scatter_plot.execute(
show=True,
save=False,
directory_path=space_tool.working_directory,
file_format="html",
)
fig
Out:
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="a69209c2-f02d-4348-ad2e-68c5c1ac2455" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("a69209c2-f02d-4348-ad2e-68c5c1ac2455")) { Plotly.newPlot( "a69209c2-f02d-4348-ad2e-68c5c1ac2455", [{"marker":{"color":"blue"},"mode":"markers","showlegend":false,"x":[596.3683215579451,602.1625768159857,605.713233996612,593.093881530551,601.2620861875007,594.0471344934028,602.1118073731368,591.8837527131487,597.2493921815209,608.6673996749415,614.2842318308839,608.8068310480653,575.9395303960218,609.55968030168,626.0739203332569,594.611876369478,592.3370500513951,615.4171701438756,599.5433481234105,591.5041572846852,621.7246179004369,616.077975626425,600.6512590438251,608.5784948337435,580.1326754581671,584.056519611409,589.8373090401276,587.5342893617765,616.4812447498434,598.7620428583745,589.5128750556419,617.9621149821786,583.5227779576488,600.8841540402948,588.7636088681269,577.7200281339206,628.0270086715452,598.694135525867,592.5704293045712,622.3566771594444,601.6982093701388,590.9895352798342,611.1161317564632,607.1355981652596,614.6382966126127,598.8480863879813,575.7398325728432,587.9755718627916,590.8285794345201,606.628023342045,589.5567168677774,617.3275949631616,585.7204059477876,595.5841495118675,618.3939281525488,595.9601982627394,583.0034801491113,606.5453193163258,580.9151192754572,591.2739869193448,588.6557197948337,599.6818725529572,612.5951472096342,592.7320114362761,621.7994884472041,594.7532731719326,584.1115551601231,611.4796369258808,594.1629210621068,589.613888540388,613.2495598615997,615.0629196198483,584.577919201791,580.7825248790265,622.0776354527634,595.2274153692242,609.221895922682,604.1829806095652,610.8838453849276,595.5699261382126,598.2670256311345,613.694362669257,606.3144939815339,610.0407292817192,574.710325721687,599.37144003219,609.3902081442908,598.3270886410859,598.6805357047226,613.5529800220534,603.6890467483137,613.7368661596257,605.2168887381431,598.3011066288881,610.6019263187935,594.1287304537083,606.6740418563737,607.4627201663353,614.1057552747592,602.137873928282,580.6952590574606,573.9672096361043,592.7878145101693,600.8588229553093,620.6866899556155,616.9258629139831,601.5321311807335,598.0943114861763,598.3562518564482,608.6368044798014,610.4189061576167,608.4079100387653,605.9371722752286,609.9910924781223,607.2443926281164,588.8135307594781,613.952277983133,604.221669864826,604.6419298889017,605.7494853485612,611.4621768753875,589.2527115727403,607.1071205409705,600.0028627169855,600.7370808882148,604.9094535905327,594.8155866965463,601.176134142457,622.1610295138266,602.003728528345,584.6294676746181,593.7243903185152,598.565755966081,596.8489654246589,608.3291408564781,592.4215068541376,593.5593399733375,605.3090121821751,587.022138559586,607.3008141256075,592.9620392927477,599.7031312641419,584.5530483759906,603.3221835576329,608.1457793747402,609.6085787425571,584.0159193479542,599.4310638241008,582.7933671688877,621.4341703867126,594.9251365634766,593.580606726378,611.5348379197329,607.7320947156984,585.3675540327946,603.77564146101,588.078924399221,605.3600257498564,601.3964793913303,590.3540372241102,603.071660478736,616.0186010987719,617.0287316892682,600.7469642879962,609.8571518393857,592.659426171869,604.3818683567093,610.6593436472327,598.404126127786,609.4176544318606,605.3816532312443,589.7302874743369,593.9932842403584,615.1396377534169,591.3736898330219,575.2753167574524,573.6859371196811,576.0642949356751,597.8577298685757,599.9492745920625,599.252426458406,613.8284929541193,588.0802184408069,614.4618464877146,615.9736374987211,586.463975034066,594.4709804320769,587.7609989476467,619.715452495847,617.7528543191702,616.1947178320748,581.5374588243994,585.6446934314184,610.7402752663315,604.2109248194818,596.8909966840582,600.95085792135,606.7258477590657,607.9679525875955,585.9042089330969],"y":[29.34223941777626,30.552551086619907,30.059298273449524,30.67323289625094,31.259442612109755,30.333824083581163,29.813086628834412,30.168031039155366,29.940024552891042,29.404421128271128,30.20146777327815,28.722097552327682,30.173922091221208,30.331431444727418,30.31564737278711,28.64809543637689,29.12147815489531,30.828901159507595,29.28899554175509,29.12088870407166,30.24282714282765,30.242060413205483,29.66002723458082,28.94022267622491,30.992585540702382,30.587362207489292,30.667671316610726,28.673130816714018,29.19924158138549,28.994158557775084,30.379027496972817,30.670735901045,29.323661055376476,28.938416785774184,29.687770886853677,30.284289519626753,29.745224421683147,29.907673775090814,29.95264810990997,30.85525062501335,28.854154635189104,28.798337763584744,30.465712631801136,30.55949809093725,29.33099087609945,29.2619021408563,29.78799337013741,29.85819796611481,30.12360841564506,29.51782531284271,30.980061636460412,30.092097390706073,29.020637025094818,29.84216776554695,30.503604456608556,29.421167477156377,29.12819523970208,29.392018196934877,29.957119282081244,29.88029333844539,30.308611520122156,30.70813860742054,29.972475484181498,30.81687037290104,30.33669933135403,30.072894154968715,31.020526179945115,30.685763502920224,29.940815497727893,29.96106854995099,31.019236275613675,30.762926302281798,30.151403931779107,29.407457694595042,29.517322118698267,29.815699632694834,30.21980686876288,29.815037782963905,31.370232322212107,30.149061601520177,31.20121324143502,29.74626159626137,30.24369294871573,29.917685200004136,30.371278490079536,30.828159009299455,29.440780913435066,30.113661751744104,29.185529951155925,29.655963055378763,30.03206371881942,30.505870023078117,29.925505509824234,30.10996122130844,30.23536691905123,28.969974907698294,31.16474617303887,30.03241764885734,30.09933602785105,30.453201171059717,30.3145835563927,29.55359070454644,29.662847621141427,30.284176642970944,30.66721262302164,31.160465933778482,30.099979208305076,29.02505871189538,30.428192804221588,30.39623685489123,30.474929944963428,29.1193810620648,29.32373495127505,30.618918302202047,29.534852004372954,29.547406449649873,30.561440840439335,30.879812230705934,28.751681968024435,29.66795262562109,30.789718420542584,29.23524997586329,29.17940473864834,30.94903071762161,30.989902267070388,29.078135879699097,30.08362677904315,29.06683530372908,30.190247311456176,30.037747554951043,30.26437491839489,29.000223074247792,30.559782645340096,29.18566707182363,29.1138654441157,30.057220394091903,30.22596401235461,31.06314608921283,29.296117099947235,30.563660647279995,28.7701152605769,30.65290058688673,29.61129542327598,29.271143463662874,29.303799086273035,29.7424608269028,29.994700651820867,29.977376442171114,29.24321390860852,30.02635195755849,30.854095348764464,30.220432647807602,29.855673530706643,30.016258004819644,29.64293076850402,30.538182081783624,30.123851131441025,29.184242680149428,30.29232411320348,30.234790087368445,30.799820044898567,30.728548844845196,29.531712420216948,30.908912038975057,30.377075238224744,30.320413833684857,30.39025401057772,28.944653549031813,30.858962058367233,30.605766121087445,30.85440272594025,29.25264634063892,30.053637286384372,30.58210462075953,31.1308637453656,30.965216635015093,29.841118322548205,29.21140651804252,29.901500257445228,28.846885241337183,29.47805078499894,28.902282544494113,29.245752037334253,29.94668637678587,30.11500724473821,30.21478030992221,30.236460087746142,29.131246565623297,30.046933463994275,30.168969264589386,29.827152726576927,29.83620696268594,28.92006374597702,29.244203635717227,30.36746657047859,30.090004249302602,28.754032457390952,29.50754320615651,30.52953592167851,29.979562376441226],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"title":{"text":""},"xaxis":{"title":{"text":"length"}},"yaxis":{"title":{"text":"width"}}}, {"responsive": true} ) }; </script> </div>'}
[Figure({
'data': [{'marker': {'color': 'blue'},
'mode': 'markers',
'showlegend': False,
'type': 'scatter',
'x': array([596.36832156, 602.16257682, 605.713234 , 593.09388153, 601.26208619,
594.04713449, 602.11180737, 591.88375271, 597.24939218, 608.66739967,
614.28423183, 608.80683105, 575.9395304 , 609.5596803 , 626.07392033,
594.61187637, 592.33705005, 615.41717014, 599.54334812, 591.50415728,
621.7246179 , 616.07797563, 600.65125904, 608.57849483, 580.13267546,
584.05651961, 589.83730904, 587.53428936, 616.48124475, 598.76204286,
589.51287506, 617.96211498, 583.52277796, 600.88415404, 588.76360887,
577.72002813, 628.02700867, 598.69413553, 592.5704293 , 622.35667716,
601.69820937, 590.98953528, 611.11613176, 607.13559817, 614.63829661,
598.84808639, 575.73983257, 587.97557186, 590.82857943, 606.62802334,
589.55671687, 617.32759496, 585.72040595, 595.58414951, 618.39392815,
595.96019826, 583.00348015, 606.54531932, 580.91511928, 591.27398692,
588.65571979, 599.68187255, 612.59514721, 592.73201144, 621.79948845,
594.75327317, 584.11155516, 611.47963693, 594.16292106, 589.61388854,
613.24955986, 615.06291962, 584.5779192 , 580.78252488, 622.07763545,
595.22741537, 609.22189592, 604.18298061, 610.88384538, 595.56992614,
598.26702563, 613.69436267, 606.31449398, 610.04072928, 574.71032572,
599.37144003, 609.39020814, 598.32708864, 598.6805357 , 613.55298002,
603.68904675, 613.73686616, 605.21688874, 598.30110663, 610.60192632,
594.12873045, 606.67404186, 607.46272017, 614.10575527, 602.13787393,
580.69525906, 573.96720964, 592.78781451, 600.85882296, 620.68668996,
616.92586291, 601.53213118, 598.09431149, 598.35625186, 608.63680448,
610.41890616, 608.40791004, 605.93717228, 609.99109248, 607.24439263,
588.81353076, 613.95227798, 604.22166986, 604.64192989, 605.74948535,
611.46217688, 589.25271157, 607.10712054, 600.00286272, 600.73708089,
604.90945359, 594.8155867 , 601.17613414, 622.16102951, 602.00372853,
584.62946767, 593.72439032, 598.56575597, 596.84896542, 608.32914086,
592.42150685, 593.55933997, 605.30901218, 587.02213856, 607.30081413,
592.96203929, 599.70313126, 584.55304838, 603.32218356, 608.14577937,
609.60857874, 584.01591935, 599.43106382, 582.79336717, 621.43417039,
594.92513656, 593.58060673, 611.53483792, 607.73209472, 585.36755403,
603.77564146, 588.0789244 , 605.36002575, 601.39647939, 590.35403722,
603.07166048, 616.0186011 , 617.02873169, 600.74696429, 609.85715184,
592.65942617, 604.38186836, 610.65934365, 598.40412613, 609.41765443,
605.38165323, 589.73028747, 593.99328424, 615.13963775, 591.37368983,
575.27531676, 573.68593712, 576.06429494, 597.85772987, 599.94927459,
599.25242646, 613.82849295, 588.08021844, 614.46184649, 615.9736375 ,
586.46397503, 594.47098043, 587.76099895, 619.7154525 , 617.75285432,
616.19471783, 581.53745882, 585.64469343, 610.74027527, 604.21092482,
596.89099668, 600.95085792, 606.72584776, 607.96795259, 585.90420893]),
'y': array([29.34223942, 30.55255109, 30.05929827, 30.6732329 , 31.25944261,
30.33382408, 29.81308663, 30.16803104, 29.94002455, 29.40442113,
30.20146777, 28.72209755, 30.17392209, 30.33143144, 30.31564737,
28.64809544, 29.12147815, 30.82890116, 29.28899554, 29.1208887 ,
30.24282714, 30.24206041, 29.66002723, 28.94022268, 30.99258554,
30.58736221, 30.66767132, 28.67313082, 29.19924158, 28.99415856,
30.3790275 , 30.6707359 , 29.32366106, 28.93841679, 29.68777089,
30.28428952, 29.74522442, 29.90767378, 29.95264811, 30.85525063,
28.85415464, 28.79833776, 30.46571263, 30.55949809, 29.33099088,
29.26190214, 29.78799337, 29.85819797, 30.12360842, 29.51782531,
30.98006164, 30.09209739, 29.02063703, 29.84216777, 30.50360446,
29.42116748, 29.12819524, 29.3920182 , 29.95711928, 29.88029334,
30.30861152, 30.70813861, 29.97247548, 30.81687037, 30.33669933,
30.07289415, 31.02052618, 30.6857635 , 29.9408155 , 29.96106855,
31.01923628, 30.7629263 , 30.15140393, 29.40745769, 29.51732212,
29.81569963, 30.21980687, 29.81503778, 31.37023232, 30.1490616 ,
31.20121324, 29.7462616 , 30.24369295, 29.9176852 , 30.37127849,
30.82815901, 29.44078091, 30.11366175, 29.18552995, 29.65596306,
30.03206372, 30.50587002, 29.92550551, 30.10996122, 30.23536692,
28.96997491, 31.16474617, 30.03241765, 30.09933603, 30.45320117,
30.31458356, 29.5535907 , 29.66284762, 30.28417664, 30.66721262,
31.16046593, 30.09997921, 29.02505871, 30.4281928 , 30.39623685,
30.47492994, 29.11938106, 29.32373495, 30.6189183 , 29.534852 ,
29.54740645, 30.56144084, 30.87981223, 28.75168197, 29.66795263,
30.78971842, 29.23524998, 29.17940474, 30.94903072, 30.98990227,
29.07813588, 30.08362678, 29.0668353 , 30.19024731, 30.03774755,
30.26437492, 29.00022307, 30.55978265, 29.18566707, 29.11386544,
30.05722039, 30.22596401, 31.06314609, 29.2961171 , 30.56366065,
28.77011526, 30.65290059, 29.61129542, 29.27114346, 29.30379909,
29.74246083, 29.99470065, 29.97737644, 29.24321391, 30.02635196,
30.85409535, 30.22043265, 29.85567353, 30.016258 , 29.64293077,
30.53818208, 30.12385113, 29.18424268, 30.29232411, 30.23479009,
30.79982004, 30.72854884, 29.53171242, 30.90891204, 30.37707524,
30.32041383, 30.39025401, 28.94465355, 30.85896206, 30.60576612,
30.85440273, 29.25264634, 30.05363729, 30.58210462, 31.13086375,
30.96521664, 29.84111832, 29.21140652, 29.90150026, 28.84688524,
29.47805078, 28.90228254, 29.24575204, 29.94668638, 30.11500724,
30.21478031, 30.23646009, 29.13124657, 30.04693346, 30.16896926,
29.82715273, 29.83620696, 28.92006375, 29.24420364, 30.36746657,
30.09000425, 28.75403246, 29.50754321, 30.52953592, 29.97956238])}],
'layout': {'template': '...',
'title': {'text': ''},
'xaxis': {'title': {'text': 'length'}},
'yaxis': {'title': {'text': 'width'}}}
})]
Dedicated plots from |v| tools can also be used.
For instance, the :class:~.SpaceTool provides a scatter matrix plot
where the diagonal blocks represent the histograms of the random variables
while the other blocks represents the value of a variable versus another.
space_tool.plot_results(space_tool.result, save=False, show=True, n_samples=200)
# Workaround for HTML rendering, instead of ``show=True``
plt.show()

Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\gemseo\utils\matplotlib_figure.py:126: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
C:/Users/sebastien.bocquet/Dev/vd017/docs/runnable_examples/11_uncertainty_quantification/plot_01_uq.py:201: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
.. seealso::
Examples of visualization tools <https://gemseo.readthedocs.io/en/stable/examples/dataset/index.html>__
to post-process a :class:~.gemseo.datasets.dataset.Dataset.
3. Sample the model¶
Then,
we generate 100 input-output samples of the model
by sampling the discipline with the :class:~.DOETool executed from a design of
experiments (DOE). The :class:~.DOETool is based on :class:~.gemseo.core.doe_scenario.DOEScenario
To place the samples over the input space, we can use an optimal
latin hypercube sampling (LHS) <https://en.wikipedia.org/wiki/Latin_hypercube_sampling>__ technique.
.. note::
The LHS technique implemented by "OT_LHS" or "lhs" is stochastic:
given a number of samples :math:N and an input space of dimension :math:d,
executing it twice will lead to two different series of samples.
Here, we are looking for the series of samples that best covers the input space
(we talk about space-filling DOE);
for that,
we use "OT_OPT_LHS" relying on a global optimization algorithm
(simulated annealing).
doe_tool = DOETool(working_directory="doe_tool_results")
output_names = ["reaction_forces"]
dataset = doe_tool.execute(
model=model,
parameter_space=parameter_space,
output_names=output_names,
algo="OT_OPT_LHS",
n_samples=100,
).dataset
Out:
INFO - 09:46:00: Working directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\11_uncertainty_quantification\doe_tool_results
INFO - 09:46:00: *** Start DOE_BendingTestAnalytical_Cantilever_OT_OPT_LHS_100 execution ***
INFO - 09:46:00: DOE_BendingTestAnalytical_Cantilever_OT_OPT_LHS_100
INFO - 09:46:00: Disciplines: Model BendingTestAnalytical: An analytical model for the bending of a parallelepipedic beam
INFO - 09:46:00:
INFO - 09:46:00: Load case:
INFO - 09:46:00: Load case Cantilever: A cantilever load case.
INFO - 09:46:00: Domain: Beam
INFO - 09:46:00:
INFO - 09:46:00: Boundary condition variables: imposed_dplt, relative_dplt_location
INFO - 09:46:00:
INFO - 09:46:00: Default values:
INFO - 09:46:00:
INFO - 09:46:00: Default geometrical variables:
INFO - 09:46:00: height = [40.00000000000004]
INFO - 09:46:00: length = [600.0000000000003]
INFO - 09:46:00: width = [30.000000000000036]
INFO - 09:46:00:
INFO - 09:46:00: Default boundary conditions variables:
INFO - 09:46:00: imposed_dplt = [-15.0]
INFO - 09:46:00: relative_dplt_location = [0.9]
INFO - 09:46:00:
INFO - 09:46:00: Default material variables:
INFO - 09:46:00: nu_p = [0.3]
INFO - 09:46:00: young_modulus = [210000.00000000006]
INFO - 09:46:00:
INFO - 09:46:00: Model inputs: height, imposed_dplt, length, nu_p, relative_dplt_location, width, young_modulus
INFO - 09:46:00: Model outputs: cpu_time, date, description, directory_archive_job, directory_archive_root, directory_scratch_job, directory_scratch_root, dplt, dplt_at_force_location, dplt_grid, error_code, job_name, load_case, location_max_dplt, machine, maximum_dplt, model, moment, moment_grid, n_cpus, persistent_result_files, reaction_forces, user, vims_git_version
INFO - 09:46:00: MDO formulation: DisciplinaryOpt
INFO - 09:46:00: Optimization problem:
INFO - 09:46:00: minimize reaction_forces(young_modulus, nu_p, length, width, height, imposed_dplt, relative_dplt_location)
INFO - 09:46:00: with respect to height, imposed_dplt, length, nu_p, relative_dplt_location, width, young_modulus
INFO - 09:46:00: over the design space:
INFO - 09:46:00: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:00: | Name | Initial distribution | Transformation(x)= |
INFO - 09:46:00: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:00: | young_modulus | Triangular(lower=199500.0, mode=210000.0, upper=220500.0) | Trunc(x) |
INFO - 09:46:00: | nu_p | Triangular(lower=0.285, mode=0.3, upper=0.315) | x |
INFO - 09:46:00: | length | Triangular(lower=570.0, mode=600.0, upper=630.0) | Trunc(x) |
INFO - 09:46:00: | width | Triangular(lower=28.5, mode=30.0, upper=31.5) | Trunc(x) |
INFO - 09:46:00: | height | Triangular(lower=38.0, mode=40.0, upper=42.0) | Trunc(x) |
INFO - 09:46:00: | imposed_dplt | Triangular(lower=-15.75, mode=-15.0, upper=-14.25) | x |
INFO - 09:46:00: | relative_dplt_location | Triangular(lower=0.855, mode=0.9, upper=0.9450000000000001) | x |
INFO - 09:46:00: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:00: Solving optimization problem with algorithm OT_OPT_LHS:
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\1.
INFO - 09:46:00: 1%| | 1/100 [00:00<00:09, 10.33 it/sec, feas=True, obj=-9.37e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\2.
INFO - 09:46:00: 2%|▏ | 2/100 [00:00<00:07, 13.12 it/sec, feas=True, obj=-9.07e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\3.
INFO - 09:46:00: 3%|▎ | 3/100 [00:00<00:06, 14.84 it/sec, feas=True, obj=-1.1e+4]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\4.
INFO - 09:46:00: 4%|▍ | 4/100 [00:00<00:06, 15.32 it/sec, feas=True, obj=-8.2e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\5.
INFO - 09:46:00: 5%|▌ | 5/100 [00:00<00:05, 15.95 it/sec, feas=True, obj=-9.45e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\6.
INFO - 09:46:00: 6%|▌ | 6/100 [00:00<00:05, 16.21 it/sec, feas=True, obj=-9.11e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\7.
INFO - 09:46:00: 7%|▋ | 7/100 [00:00<00:05, 16.10 it/sec, feas=True, obj=-8.51e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\8.
INFO - 09:46:00: 8%|▊ | 8/100 [00:00<00:05, 16.28 it/sec, feas=True, obj=-8.03e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\9.
INFO - 09:46:00: 9%|▉ | 9/100 [00:00<00:05, 16.65 it/sec, feas=True, obj=-9.3e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\10.
INFO - 09:46:00: 10%|█ | 10/100 [00:00<00:05, 17.20 it/sec, feas=True, obj=-7.85e+3]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\11.
INFO - 09:46:00: 11%|█ | 11/100 [00:00<00:05, 17.28 it/sec, feas=True, obj=-1.02e+4]
INFO - 09:46:00: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\12.
INFO - 09:46:01: 12%|█▏ | 12/100 [00:00<00:05, 17.25 it/sec, feas=True, obj=-8.24e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\13.
INFO - 09:46:01: 13%|█▎ | 13/100 [00:00<00:04, 17.43 it/sec, feas=True, obj=-1e+4]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\14.
INFO - 09:46:01: 14%|█▍ | 14/100 [00:00<00:04, 17.57 it/sec, feas=True, obj=-9.05e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\15.
INFO - 09:46:01: 15%|█▌ | 15/100 [00:00<00:04, 17.65 it/sec, feas=True, obj=-9.73e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\16.
INFO - 09:46:01: 16%|█▌ | 16/100 [00:00<00:04, 17.80 it/sec, feas=True, obj=-8.26e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\17.
INFO - 09:46:01: 17%|█▋ | 17/100 [00:00<00:04, 17.95 it/sec, feas=True, obj=-9.72e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\18.
INFO - 09:46:01: 18%|█▊ | 18/100 [00:01<00:04, 17.87 it/sec, feas=True, obj=-8.27e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\19.
INFO - 09:46:01: 19%|█▉ | 19/100 [00:01<00:04, 17.87 it/sec, feas=True, obj=-9.32e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\20.
INFO - 09:46:01: 20%|██ | 20/100 [00:01<00:04, 17.97 it/sec, feas=True, obj=-9.74e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\21.
INFO - 09:46:01: 21%|██ | 21/100 [00:01<00:04, 17.96 it/sec, feas=True, obj=-1.06e+4]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\22.
INFO - 09:46:01: 22%|██▏ | 22/100 [00:01<00:04, 17.93 it/sec, feas=True, obj=-8.66e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\23.
INFO - 09:46:01: 23%|██▎ | 23/100 [00:01<00:04, 17.79 it/sec, feas=True, obj=-8.83e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\24.
INFO - 09:46:01: 24%|██▍ | 24/100 [00:01<00:04, 17.83 it/sec, feas=True, obj=-8.79e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\25.
INFO - 09:46:01: 25%|██▌ | 25/100 [00:01<00:04, 17.97 it/sec, feas=True, obj=-1.13e+4]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\26.
INFO - 09:46:01: 26%|██▌ | 26/100 [00:01<00:04, 18.05 it/sec, feas=True, obj=-9.27e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\27.
INFO - 09:46:01: 27%|██▋ | 27/100 [00:01<00:04, 18.14 it/sec, feas=True, obj=-8.01e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\28.
INFO - 09:46:01: 28%|██▊ | 28/100 [00:01<00:03, 18.13 it/sec, feas=True, obj=-9.87e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\29.
INFO - 09:46:01: 29%|██▉ | 29/100 [00:01<00:03, 18.07 it/sec, feas=True, obj=-9.84e+3]
INFO - 09:46:01: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\30.
INFO - 09:46:02: 30%|███ | 30/100 [00:01<00:03, 18.05 it/sec, feas=True, obj=-1.11e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\31.
INFO - 09:46:02: 31%|███ | 31/100 [00:01<00:03, 17.87 it/sec, feas=True, obj=-8.74e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\32.
INFO - 09:46:02: 32%|███▏ | 32/100 [00:01<00:03, 17.91 it/sec, feas=True, obj=-7.77e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\33.
INFO - 09:46:02: 33%|███▎ | 33/100 [00:01<00:03, 17.85 it/sec, feas=True, obj=-1.02e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\34.
INFO - 09:46:02: 34%|███▍ | 34/100 [00:01<00:03, 17.78 it/sec, feas=True, obj=-9.89e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\35.
INFO - 09:46:02: 35%|███▌ | 35/100 [00:01<00:03, 17.79 it/sec, feas=True, obj=-1.01e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\36.
INFO - 09:46:02: 36%|███▌ | 36/100 [00:02<00:03, 17.81 it/sec, feas=True, obj=-1.04e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\37.
INFO - 09:46:02: 37%|███▋ | 37/100 [00:02<00:03, 17.82 it/sec, feas=True, obj=-1.22e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\38.
INFO - 09:46:02: 38%|███▊ | 38/100 [00:02<00:03, 17.76 it/sec, feas=True, obj=-1.05e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\39.
INFO - 09:46:02: 39%|███▉ | 39/100 [00:02<00:03, 17.69 it/sec, feas=True, obj=-9.66e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\40.
INFO - 09:46:02: 40%|████ | 40/100 [00:02<00:03, 17.50 it/sec, feas=True, obj=-1.09e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\41.
INFO - 09:46:02: 41%|████ | 41/100 [00:02<00:03, 17.48 it/sec, feas=True, obj=-1.14e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\42.
INFO - 09:46:02: 42%|████▏ | 42/100 [00:02<00:03, 17.40 it/sec, feas=True, obj=-9.71e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\43.
INFO - 09:46:02: 43%|████▎ | 43/100 [00:02<00:03, 17.37 it/sec, feas=True, obj=-1.07e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\44.
INFO - 09:46:02: 44%|████▍ | 44/100 [00:02<00:03, 17.37 it/sec, feas=True, obj=-9.63e+3]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\45.
INFO - 09:46:02: 45%|████▌ | 45/100 [00:02<00:03, 17.37 it/sec, feas=True, obj=-1.17e+4]
INFO - 09:46:02: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\46.
INFO - 09:46:02: 46%|████▌ | 46/100 [00:02<00:03, 17.37 it/sec, feas=True, obj=-1.1e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\47.
INFO - 09:46:03: 47%|████▋ | 47/100 [00:02<00:03, 17.37 it/sec, feas=True, obj=-9.43e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\48.
INFO - 09:46:03: 48%|████▊ | 48/100 [00:02<00:02, 17.37 it/sec, feas=True, obj=-1e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\49.
INFO - 09:46:03: 49%|████▉ | 49/100 [00:02<00:02, 17.39 it/sec, feas=True, obj=-9.99e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\50.
INFO - 09:46:03: 50%|█████ | 50/100 [00:02<00:02, 17.40 it/sec, feas=True, obj=-8.61e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\51.
INFO - 09:46:03: 51%|█████ | 51/100 [00:02<00:02, 17.45 it/sec, feas=True, obj=-9.75e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\52.
INFO - 09:46:03: 52%|█████▏ | 52/100 [00:02<00:02, 17.45 it/sec, feas=True, obj=-8.97e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\53.
INFO - 09:46:03: 53%|█████▎ | 53/100 [00:03<00:02, 17.45 it/sec, feas=True, obj=-9.97e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\54.
INFO - 09:46:03: 54%|█████▍ | 54/100 [00:03<00:02, 17.44 it/sec, feas=True, obj=-1.02e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\55.
INFO - 09:46:03: 55%|█████▌ | 55/100 [00:03<00:02, 17.40 it/sec, feas=True, obj=-1.02e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\56.
INFO - 09:46:03: 56%|█████▌ | 56/100 [00:03<00:02, 17.38 it/sec, feas=True, obj=-9.45e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\57.
INFO - 09:46:03: 57%|█████▋ | 57/100 [00:03<00:02, 17.35 it/sec, feas=True, obj=-1.07e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\58.
INFO - 09:46:03: 58%|█████▊ | 58/100 [00:03<00:02, 17.32 it/sec, feas=True, obj=-8.46e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\59.
INFO - 09:46:03: 59%|█████▉ | 59/100 [00:03<00:02, 17.29 it/sec, feas=True, obj=-9.61e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\60.
INFO - 09:46:03: 60%|██████ | 60/100 [00:03<00:02, 17.26 it/sec, feas=True, obj=-9.29e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\61.
INFO - 09:46:03: 61%|██████ | 61/100 [00:03<00:02, 17.25 it/sec, feas=True, obj=-7.4e+3]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\62.
INFO - 09:46:03: 62%|██████▏ | 62/100 [00:03<00:02, 17.22 it/sec, feas=True, obj=-1.21e+4]
INFO - 09:46:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\63.
INFO - 09:46:04: 63%|██████▎ | 63/100 [00:03<00:02, 17.16 it/sec, feas=True, obj=-9.36e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\64.
INFO - 09:46:04: 64%|██████▍ | 64/100 [00:03<00:02, 17.12 it/sec, feas=True, obj=-1.06e+4]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\65.
INFO - 09:46:04: 65%|██████▌ | 65/100 [00:03<00:02, 17.13 it/sec, feas=True, obj=-9.85e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\66.
INFO - 09:46:04: 66%|██████▌ | 66/100 [00:03<00:01, 17.06 it/sec, feas=True, obj=-8.67e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\67.
INFO - 09:46:04: 67%|██████▋ | 67/100 [00:03<00:01, 17.04 it/sec, feas=True, obj=-9.66e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\68.
INFO - 09:46:04: 68%|██████▊ | 68/100 [00:03<00:01, 17.02 it/sec, feas=True, obj=-9.53e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\69.
INFO - 09:46:04: 69%|██████▉ | 69/100 [00:04<00:01, 16.97 it/sec, feas=True, obj=-1.21e+4]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\70.
INFO - 09:46:04: 70%|███████ | 70/100 [00:04<00:01, 16.87 it/sec, feas=True, obj=-1.01e+4]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\71.
INFO - 09:46:04: 71%|███████ | 71/100 [00:04<00:01, 16.85 it/sec, feas=True, obj=-8.71e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\72.
INFO - 09:46:04: 72%|███████▏ | 72/100 [00:04<00:01, 16.87 it/sec, feas=True, obj=-1.17e+4]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\73.
INFO - 09:46:04: 73%|███████▎ | 73/100 [00:04<00:01, 16.78 it/sec, feas=True, obj=-1.04e+4]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\74.
INFO - 09:46:04: 74%|███████▍ | 74/100 [00:04<00:01, 16.71 it/sec, feas=True, obj=-9.74e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\75.
INFO - 09:46:04: 75%|███████▌ | 75/100 [00:04<00:01, 16.62 it/sec, feas=True, obj=-8.81e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\76.
INFO - 09:46:04: 76%|███████▌ | 76/100 [00:04<00:01, 16.58 it/sec, feas=True, obj=-9.55e+3]
INFO - 09:46:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\77.
INFO - 09:46:05: 77%|███████▋ | 77/100 [00:04<00:01, 16.52 it/sec, feas=True, obj=-9.78e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\78.
INFO - 09:46:05: 78%|███████▊ | 78/100 [00:04<00:01, 16.46 it/sec, feas=True, obj=-9.81e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\79.
INFO - 09:46:05: 79%|███████▉ | 79/100 [00:04<00:01, 16.42 it/sec, feas=True, obj=-1.06e+4]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\80.
INFO - 09:46:05: 80%|████████ | 80/100 [00:04<00:01, 16.37 it/sec, feas=True, obj=-1.1e+4]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\81.
INFO - 09:46:05: 81%|████████ | 81/100 [00:04<00:01, 16.30 it/sec, feas=True, obj=-9.65e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\82.
INFO - 09:46:05: 82%|████████▏ | 82/100 [00:05<00:01, 16.26 it/sec, feas=True, obj=-9.51e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\83.
INFO - 09:46:05: 83%|████████▎ | 83/100 [00:05<00:01, 16.26 it/sec, feas=True, obj=-9.38e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\84.
INFO - 09:46:05: 84%|████████▍ | 84/100 [00:05<00:00, 16.25 it/sec, feas=True, obj=-8.64e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\85.
INFO - 09:46:05: 85%|████████▌ | 85/100 [00:05<00:00, 16.18 it/sec, feas=True, obj=-1.26e+4]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\86.
INFO - 09:46:05: 86%|████████▌ | 86/100 [00:05<00:00, 16.11 it/sec, feas=True, obj=-8.64e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\87.
INFO - 09:46:05: 87%|████████▋ | 87/100 [00:05<00:00, 16.13 it/sec, feas=True, obj=-9.26e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\88.
INFO - 09:46:05: 88%|████████▊ | 88/100 [00:05<00:00, 16.08 it/sec, feas=True, obj=-8.99e+3]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\89.
INFO - 09:46:05: 89%|████████▉ | 89/100 [00:05<00:00, 16.08 it/sec, feas=True, obj=-1.09e+4]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\90.
INFO - 09:46:05: 90%|█████████ | 90/100 [00:05<00:00, 16.03 it/sec, feas=True, obj=-1.07e+4]
INFO - 09:46:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\91.
INFO - 09:46:06: 91%|█████████ | 91/100 [00:05<00:00, 15.97 it/sec, feas=True, obj=-8.82e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\92.
INFO - 09:46:06: 92%|█████████▏| 92/100 [00:05<00:00, 15.99 it/sec, feas=True, obj=-1.09e+4]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\93.
INFO - 09:46:06: 93%|█████████▎| 93/100 [00:05<00:00, 15.95 it/sec, feas=True, obj=-1.05e+4]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\94.
INFO - 09:46:06: 94%|█████████▍| 94/100 [00:05<00:00, 15.87 it/sec, feas=True, obj=-8.26e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\95.
INFO - 09:46:06: 95%|█████████▌| 95/100 [00:06<00:00, 15.77 it/sec, feas=True, obj=-7.9e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\96.
INFO - 09:46:06: 96%|█████████▌| 96/100 [00:06<00:00, 15.75 it/sec, feas=True, obj=-9.61e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\97.
INFO - 09:46:06: 97%|█████████▋| 97/100 [00:06<00:00, 15.69 it/sec, feas=True, obj=-7.71e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\98.
INFO - 09:46:06: 98%|█████████▊| 98/100 [00:06<00:00, 15.60 it/sec, feas=True, obj=-9.1e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\99.
INFO - 09:46:06: 99%|█████████▉| 99/100 [00:06<00:00, 15.53 it/sec, feas=True, obj=-8.73e+3]
INFO - 09:46:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\uq\BendingTestAnalytical\Cantilever\100.
INFO - 09:46:06: 100%|██████████| 100/100 [00:06<00:00, 15.52 it/sec, feas=True, obj=-9.39e+3]
INFO - 09:46:06: Optimization result:
INFO - 09:46:06: Optimizer info:
INFO - 09:46:06: Status: None
INFO - 09:46:06: Message: None
INFO - 09:46:06: Solution:
INFO - 09:46:06: Objective: -12628.333932773296
INFO - 09:46:06: Design space:
INFO - 09:46:06: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:06: | Name | Initial distribution | Transformation(x)= |
INFO - 09:46:06: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:06: | young_modulus | Triangular(lower=199500.0, mode=210000.0, upper=220500.0) | Trunc(x) |
INFO - 09:46:06: | nu_p | Triangular(lower=0.285, mode=0.3, upper=0.315) | x |
INFO - 09:46:06: | length | Triangular(lower=570.0, mode=600.0, upper=630.0) | Trunc(x) |
INFO - 09:46:06: | width | Triangular(lower=28.5, mode=30.0, upper=31.5) | Trunc(x) |
INFO - 09:46:06: | height | Triangular(lower=38.0, mode=40.0, upper=42.0) | Trunc(x) |
INFO - 09:46:06: | imposed_dplt | Triangular(lower=-15.75, mode=-15.0, upper=-14.25) | x |
INFO - 09:46:06: | relative_dplt_location | Triangular(lower=0.855, mode=0.9, upper=0.9450000000000001) | x |
INFO - 09:46:06: +------------------------+-------------------------------------------------------------+--------------------+
INFO - 09:46:06: *** End DOE_BendingTestAnalytical_Cantilever_OT_OPT_LHS_100 execution ***
The Dataset containing the DOE result is a
Pandas <https://pandas.pydata.org>__
DataFrame.
People used to Pandas can go much further in terms of data analysis
(filtering, plotting, sorting, ...).
print(dataset.describe())
dataset.to_csv(doe_tool.working_directory / "data.csv", sep=";")
Out:
GROUP inputs ... outputs
VARIABLE young_modulus nu_p ... relative_dplt_location reaction_forces
COMPONENT 0 0 ... 0 0
count 100.000000 100.000000 ... 100.000000 100.000000
mean 210005.511999 0.299994 ... 0.899975 -9662.162514
std 4324.978485 0.006135 ... 0.018516 1074.715533
min 200581.178400 0.286398 ... 0.857272 -12628.333933
25% 206998.379499 0.295729 ... 0.886844 -10251.378923
50% 210002.198295 0.300027 ... 0.900006 -9641.605037
75% 213057.306879 0.304340 ... 0.912774 -8826.880678
max 220348.631497 0.313206 ... 0.941171 -7395.834046
[8 rows x 8 columns]
4. Compute statistics¶
The :class:~.StatisticsTool relies on |gemseo| to compute statistics
on a sampling. It allows to test several probability distributions
to find the one that best fits to the output distribution according
to a fitting criterion and a selection criterion.
Then, based on this synthetic distribution, several statistics indicators
can be computed like mean value, standard deviation or percentiles.
Select the output variable on which statistics are computed.
output_name = output_names[0]
The following options are used by default:
pprint(StatisticsTool().options)
Out:
{'confidence': 0.95,
'coverage': 0.05,
'dataset': None,
'fitting_criterion': 'Kolmogorov',
'level': 0.05,
'selection_criterion': 'best',
'tested_distributions': ['Uniform',
'Normal',
'LogNormal',
'Exponential',
'WeibullMin'],
'variable_names': []}
Default options can be overriden through the :meth:~.StatisticsTool.execute method.
Here the confidence value is modified.
statistic_tool = StatisticsTool(working_directory="statistics_tool_results")
results = statistic_tool.execute(
dataset=dataset,
variable_names=[output_name],
confidence=0.98,
)
print(results)
Out:
INFO - 09:46:07: Working directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\11_uncertainty_quantification\statistics_tool_results
INFO - 09:46:07: | Set goodness-of-fit criterion: Kolmogorov.
INFO - 09:46:07: | Set significance level of hypothesis test: 0.05.
INFO - 09:46:07: Fit different distributions (Uniform, Normal, LogNormal, Exponential, WeibullMin) per variable and compute the goodness-of-fit criterion.
INFO - 09:46:07: | Fit different distributions for reaction_forces.
INFO - 09:46:07: Select the best distribution for each variable.
INFO - 09:46:07: | The best distribution for reaction_forces[0] is WeibullMin(5697.668947135426, 5.736996642463106, -14933.629246230477).
Results of a Statistics analysis.
{
"generic": {
"datetime": "28-10-2026_09-46-07",
"version": "0.1.8.dev0+g5ba602a7e.d20261028"
},
"misc": {},
"model": null,
"report": {},
"settings": {
"confidence": 0.98,
"coverage": 0.05,
"fitting_criterion": "Kolmogorov",
"level": 0.05,
"selection_criterion": "best",
"tested_distributions": [
"Uniform",
"Normal",
"LogNormal",
"Exponential",
"WeibullMin"
],
"variable_names": [
"reaction_forces"
]
}
}
Best fitting distribution:
+-----------------------------------------------------------------------+
| reaction_forces |
+-----------------------------------------------------------------------+
| WeibullMin(5697.668947135426, 5.736996642463106, -14933.629246230477) |
+-----------------------------------------------------------------------+
Fitting matrix (goodness-of-fit measures):
+-----------------+-----------------------+--------------------+--------------------+-----------------------+--------------------+------------+
| Variable | Uniform | Normal | LogNormal | Exponential | WeibullMin | Selection |
+-----------------+-----------------------+--------------------+--------------------+-----------------------+--------------------+------------+
| reaction_forces | 5.713485287443856e-05 | 0.7680985200194305 | 0.7746323177782352 | 4.558305418956353e-11 | 0.8917679356269116 | WeibullMin |
+-----------------+-----------------------+--------------------+--------------------+-----------------------+--------------------+------------+
Statistics indicators:
OrderedDict({'maximum': {'reaction_forces': array([inf])}, 'minimum': {'reaction_forces': array([-14933.62924623])}, 'range': {'reaction_forces': array([inf])}, 'mean': {'reaction_forces': array([-9660.98586508])}, 'median': {'reaction_forces': array([-9588.57719798])}, 'compute_standard_deviation': {'reaction_forces': array([1064.73584445])}, 'variance': {'reaction_forces': array([1133662.41846637])}, 'percentile_5': {'reaction_forces': array([-11538.53804296])}, 'percentile_10': {'reaction_forces': array([-11084.67365457])}, 'percentile_25': {'reaction_forces': array([-10348.18096076])}, 'percentile_50': {'reaction_forces': array([-9588.57719798])}, 'percentile_75': {'reaction_forces': array([-8902.15269671])}, 'percentile_90': {'reaction_forces': array([-8344.40897979])}, 'percentile_95': {'reaction_forces': array([-8035.1219178])}, 'tolerance_interval': {'reaction_forces': [Bounds(lower=array([-9872.25352515]), upper=array([-9294.21362656]))]}, 'a_value': {'reaction_forces': array([[-12461.47306015]])}, 'b_value': {'reaction_forces': array([[-11202.39862376]])}})
The fitted synthetic distribution can be plotted.
statistic_tool.plot_results(results, variable=output_name, save=False, show=True)

Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\gemseo\utils\matplotlib_figure.py:126: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
<Figure size 1200x600 with 2 Axes>
Total running time of the script: ( 0 minutes 10.523 seconds)
Download Python source code: plot_01_uq.py