.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_inverse_form_cantilever_beam.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_examples_plot_inverse_form_cantilever_beam.py: Inverse FORM with a cantilever beam =================================== .. GENERATED FROM PYTHON SOURCE LINES 7-24 This example uses the cantilever beam model from the OpenTURNS use cases to demonstrate the :class:`~otrobopt.InverseFORM` algorithm. The beam tip displacement is given by: .. math:: d = \frac{F L^3}{3 E I} where :math:`E` is Young's modulus, :math:`F` is the load, :math:`L` is the length, and :math:`I` is the moment of inertia. We treat the length :math:`L` as a parameter to calibrate. Given a target reliability index :math:`\beta_t`, we seek the beam length such that the Hasofer-Lind reliability index of the failure event :math:`\{d > d_0\}` (displacement exceeding a threshold) equals :math:`\beta_t`. .. GENERATED FROM PYTHON SOURCE LINES 26-36 .. code-block:: Python import openturns as ot import otrobopt from openturns.usecases import cantilever_beam ot.RandomGenerator.SetSeed(0) # Load the cantilever beam use case cb = cantilever_beam.CantileverBeam() print(cb.model) .. rst-class:: sphx-glr-script-out .. code-block:: none [E,F,L,I]->[F*L^3/(3*E*I)] .. GENERATED FROM PYTHON SOURCE LINES 37-39 Freeze the beam length L (input index 2) as a parameter with initial value 2.55 m. The remaining random inputs are E, F, I. .. GENERATED FROM PYTHON SOURCE LINES 39-48 .. code-block:: Python g = ot.ParametricFunction(cb.model, [2], [2.55]) # Build the joint distribution of the random inputs (E, F, I) marginals = [cb.E, cb.F, cb.II] distribution = ot.JointDistribution(marginals) # Starting point: median values of the random inputs x0 = [dist.computeQuantile(0.5)[0] for dist in marginals] .. GENERATED FROM PYTHON SOURCE LINES 49-50 Define the failure event: displacement > 0.15 m. .. GENERATED FROM PYTHON SOURCE LINES 50-54 .. code-block:: Python vect = ot.RandomVector(distribution) output = ot.CompositeRandomVector(g, vect) event = ot.ThresholdEvent(output, ot.Greater(), 0.15) .. GENERATED FROM PYTHON SOURCE LINES 55-57 Run the inverse FORM algorithm with a target reliability index :math:`\beta_t = 3.0`. .. GENERATED FROM PYTHON SOURCE LINES 57-66 .. code-block:: Python algo = otrobopt.InverseFORM(event, 'L', x0) algo.setTargetBeta(3.0) algo.run() result = algo.getResult() print('Calibrated L =', result.getParameter()) print('Hasofer-Lind beta =', result.getHasoferReliabilityIndex()) print('Convergence criteria =', result.getConvergenceCriteria()) .. rst-class:: sphx-glr-script-out .. code-block:: none Calibrated L = [2.18001] Hasofer-Lind beta = 2.9999999999999996 Convergence criteria = [4,0,1.83978e-05,4.44089e-16] .. GENERATED FROM PYTHON SOURCE LINES 67-72 The calibrated length :math:`L^*` is the beam length that achieves the target reliability index :math:`\beta_t = 3.0` for the given failure threshold. If the initial length leads to a reliability above the target, the algorithm increases it (making the beam more flexible and thus less reliable), and vice versa. .. _sphx_glr_download_auto_examples_plot_inverse_form_cantilever_beam.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_inverse_form_cantilever_beam.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_inverse_form_cantilever_beam.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_inverse_form_cantilever_beam.zip `