.. 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 Click :ref:`here ` 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:: default from __future__ import print_function 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 31-39 .. code-block:: default 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 40-42 Axial design ------------ .. GENERATED FROM PYTHON SOURCE LINES 44-50 .. code-block:: default 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 51-52 Scale and to get desired location. .. GENERATED FROM PYTHON SOURCE LINES 54-59 .. code-block:: default 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 60-63 Factorial design ---------------- .. GENERATED FROM PYTHON SOURCE LINES 65-72 .. code-block:: default 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 73-75 Composite design ---------------- .. GENERATED FROM PYTHON SOURCE LINES 77-84 .. code-block:: default 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 85-88 Grid design ----------- .. GENERATED FROM PYTHON SOURCE LINES 90-98 .. code-block:: default 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 .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.492 seconds) .. _sphx_glr_download_auto_reliability_sensitivity_design_of_experiments_plot_deterministic_design.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_deterministic_design.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_deterministic_design.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_