.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/reliability/sorm/SORM_nonlinear_function.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 or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_reliability_sorm_SORM_nonlinear_function.py: 4. SORM - Nonlinear function - Two Random variables ===================================================== In the fourth example we have the limit state to be a nonlinear function of two (:math:`d=2`) random variables .. math:: g(X_1, X_2) = X_1X_1 - 80 where :math:`X_1` follows a normal distribution with mean :math:`\mu_{X_1}=20` and standard deviation :math:`\sigma_{X_1}=7` and :math:`X_2` follows a lognormal distribution with mean :math:`\mu_{X_2}=7` and standard deviation :math:`\sigma_{X_2}=1.4`. .. GENERATED FROM PYTHON SOURCE LINES 16-17 Initially we have to import the necessary modules. .. GENERATED FROM PYTHON SOURCE LINES 20-47 .. code-block:: default import numpy as np from UQpy.run_model.RunModel import RunModel from UQpy.run_model.model_execution.PythonModel import PythonModel from UQpy.distributions import Normal from UQpy.reliability import FORM from UQpy.reliability import SORM from UQpy.distributions import Lognormal m0 = 7 v0 = 1.4 mu = np.log(m0) - np.log(np.sqrt(1 + (v0 / m0) ** 2)) scale = np.exp(mu) s = np.sqrt(np.log(1 + (v0 / m0) ** 2)) loc_ = 0.0 dist1 = Normal(loc=20., scale=2) dist2 = Lognormal(s=s, loc=0.0, scale=scale) model = PythonModel(model_script='local_model4.py', model_object_name="example4") RunModelObject4 = RunModel(model=model) form = FORM(distributions=[dist1, dist2], runmodel_object=RunModelObject4) form.run() sorm = SORM(form_object=form) # print results print('SORM probability of failure: %s' % sorm.failure_probability) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_reliability_sorm_SORM_nonlinear_function.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/SURGroup/UQpy/master?urlpath=lab/tree/notebooks/auto_examples/reliability/sorm/SORM_nonlinear_function.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: SORM_nonlinear_function.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: SORM_nonlinear_function.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_