Note
Go to the end to download the full example code or to run this example in your browser via Binder
4. SORM - Nonlinear function - Two Random variables
In the fourth example we have the limit state to be a nonlinear function of two (\(d=2\)) random variables
\[g(X_1, X_2) = X_1X_1 - 80\]
where \(X_1\) follows a normal distribution with mean \(\mu_{X_1}=20\) and standard deviation \(\sigma_{X_1}=7\) and \(X_2\) follows a lognormal distribution with mean \(\mu_{X_2}=7\) and standard deviation \(\sigma_{X_2}=1.4\).
Initially we have to import the necessary modules.
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)
Total running time of the script: ( 0 minutes 0.000 seconds)