Пример #1
0
# The next step is to estimate the principal curvatures of the osculating paraboloid.
#
# For any regular function :math:`g` the curvature :math:`\kappa(x_0)` at the point :math:`x_0` in cartesian coordinates reads as
#
# .. math::
#
#    \kappa(x_0) = \frac{g''(x_0)}{(1+[g'(x_0)]^2)^{3/2}}.
#
# For the oscilating parabola of concern we use the gradient and hessian previously computed :
#
curvature = (d2u0[0, 0, 0]) / (1 + (du0[0, 0])**2)**(3 / 2)
print("Curvature (analytic formula) = ", curvature)

# %%
# We build the SORM algorithm and run it :
algoSORM = ot.SORM(solver, event, distX.getMean())
algoSORM.run()

# %%
# The SORM result is obtained with the `getResult` method :
resultSORM = algoSORM.getResult()

# %%
# The principal curvatures of the osculating paraboloid at the design point is obtained by the
# `getSortedCurvatures` method :
print("Curvature (estimated) = ", resultSORM.getSortedCurvatures()[1])

# %%
# Once the curvature is obtained there are several ways of approximating the failure probability :math:`P_f`. OpenTURNS implements the Breitung, Hohenbichler and Tvedt estimates.
#
# For instance, the Breitung approximation gives
marginalSensitivity, otherSensitivity = result.drawEventProbabilitySensitivity()
marginalSensitivity.setLegends(["E","F","L","I"])
marginalSensitivity.setLegendPosition('bottom')
view = viewer.View(marginalSensitivity)

# %%
# Error history
optimResult = result.getOptimizationResult()
graphErrors = optimResult.drawErrorHistory()
graphErrors.setLegendPosition('bottom')
graphErrors.setYMargin(0.0)
view = viewer.View(graphErrors)

# %%
# Get additional results with SORM
algo = ot.SORM(optimAlgo, event, distribution.getMean())
algo.run()
sorm_result = algo.getResult()

# %%
# Reliability index with Breitung approximation
sorm_result.getGeneralisedReliabilityIndexBreitung()

# %%
# ... with Hohenbichler approximation
sorm_result.getGeneralisedReliabilityIndexHohenbichler()

# %%
# .. with Tvedt approximation
sorm_result.getGeneralisedReliabilityIndexTvedt()
Пример #3
0
print("Number of evaluations of the limit-state function: %s" %
      g.getInputHistory().getSize())

# In[28]:

_ = View(FORM_result.drawImportanceFactors())

# ## *Second-order reliability method* (SORM)

# In[29]:

g.clearHistory()

# In[30]:

SORM_algo = ot.SORM(mpfp_search_algorithm, event,
                    FORM_result.getPhysicalSpaceDesignPoint())
SORM_algo.run()
SORM_result = SORM_algo.getResult()

# In[31]:

print("Breitung reliability index: %.2f" %
      SORM_result.getGeneralisedReliabilityIndexBreitung())
print("Breitung second-order approximation of the probability: %.3e" %
      SORM_result.getEventProbabilityBreitung())
print("Number of evaluations of the limit-state function: %s" %
      g.getInputHistory().getSize())

# # *Most-probable-failure-point*-based importance sampling

# In[32]: