.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_reliability_sensitivity/design_of_experiments/plot_deterministic_design.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_reliability_sensitivity_design_of_experiments_plot_deterministic_design.py: Deterministic design of experiments =================================== .. GENERATED FROM PYTHON SOURCE LINES 6-18 In this example we present the available deterministic design of experiments. Four types of deterministic design of experiments are available: - `Axial` - `Factorial` - `Composite` - `Box` Each type of deterministic design is discretized differently according to a number of levels. Functionally speaking, a design is a `Sample` that lies within the unit cube :math:`(0,1)^d` and can be scaled and moved to cover the desired box. .. GENERATED FROM PYTHON SOURCE LINES 20-27 .. code-block:: Python import openturns as ot import openturns.viewer as viewer from matplotlib import pylab as plt ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 28-29 We will use the following function to plot bi-dimensional samples. .. GENERATED FROM PYTHON SOURCE LINES 32-40 .. code-block:: Python def drawBidimensionalSample(sample, title): n = sample.getSize() graph = ot.Graph("%s, size=%d" % (title, n), "X1", "X2", True, "") cloud = ot.Cloud(sample) graph.add(cloud) return graph .. GENERATED FROM PYTHON SOURCE LINES 41-43 Axial design ------------ .. GENERATED FROM PYTHON SOURCE LINES 45-51 .. code-block:: Python levels = [1.0, 1.5, 3.0] experiment = ot.Axial(2, levels) sample = experiment.generate() graph = drawBidimensionalSample(sample, "Axial") view = viewer.View(graph) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_001.png :alt: Axial, size=13 :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 52-53 Scale and to get desired location. .. GENERATED FROM PYTHON SOURCE LINES 55-60 .. code-block:: Python sample *= 2.0 sample += [5.0, 8.0] graph = drawBidimensionalSample(sample, "Axial") view = viewer.View(graph) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_002.png :alt: Axial, size=13 :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 61-64 Factorial design ---------------- .. GENERATED FROM PYTHON SOURCE LINES 66-73 .. code-block:: Python experiment = ot.Factorial(2, levels) sample = experiment.generate() sample *= 2.0 sample += [5.0, 8.0] graph = drawBidimensionalSample(sample, "Factorial") view = viewer.View(graph) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_003.png :alt: Factorial, size=13 :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 74-76 Composite design ---------------- .. GENERATED FROM PYTHON SOURCE LINES 78-85 .. code-block:: Python experiment = ot.Composite(2, levels) sample = experiment.generate() sample *= 2.0 sample += [5.0, 8.0] graph = drawBidimensionalSample(sample, "Composite") view = viewer.View(graph) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_004.png :alt: Composite, size=25 :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 86-89 Grid design ----------- .. GENERATED FROM PYTHON SOURCE LINES 91-99 .. code-block:: Python levels = [3, 4] experiment = ot.Box(levels) sample = experiment.generate() sample *= 2.0 sample += [5.0, 8.0] graph = drawBidimensionalSample(sample, "Box") view = viewer.View(graph) plt.show() .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_005.png :alt: Box, size=30 :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_deterministic_design_005.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_reliability_sensitivity_design_of_experiments_plot_deterministic_design.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_deterministic_design.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_deterministic_design.py `