pystra.sorm.Sorm#
- class Sorm(stochastic_model=None, limit_state=None, analysis_options=None, form=None)[source]#
Bases:
AnalysisObjectSecond Order Reliability Method (SORM).
Approximates the failure surface in standard normal space using a quadratic surface, improving on the linear FORM approximation. Two approaches are available:
Curve-fitting (
fit_type='cf', default): computes the Hessian of the limit state function at the design point, extracts principal curvatures as eigenvalues, and applies the Breitung formula.Point-fitting (
fit_type='pf'): locates fitting points directly on the failure surface on both sides of each principal axis using Newton iteration, then computes curvatures from their positions. This yields asymmetric curvatures (different on the positive and negative sides of each axis).Both methods report the Breitung [Breitung1984] and the Hohenbichler-Rackwitz [Hohenbichler1988] failure probabilities and generalised reliability indices.
- Parameters:
stochastic_model (StochasticModel, optional) – The stochastic model with random variables and correlations.
limit_state (LimitState, optional) – The limit state function.
analysis_options (AnalysisOptions, optional) – Options controlling the analysis.
form (Form, optional) – A pre-computed FORM result. If
None, FORM is run automatically.
- betaHL#
Hasofer-Lind reliability index (from FORM).
- Type:
float or ndarray
- kappa#
Principal curvatures. For curve-fitting, a 1-D array of length
nrv - 1. For point-fitting, the sorted average of the positive and negative curvatures.- Type:
ndarray
- kappa_pf#
Asymmetric curvatures from point-fitting, shape
(2, nrv - 1)with rows[kappa_minus, kappa_plus].Nonefor curve-fitting.- Type:
ndarray or None
- fit_type#
The fitting method used:
'cf','pf', orNoneif not yet run.- Type:
str or None
- pf2_breitung#
Failure probability from the Breitung approximation.
- Type:
float or ndarray
- betag_breitung#
Generalised reliability index from the Breitung approximation.
- Type:
float or ndarray
- pf2_breitung_m#
Failure probability from the modified Breitung (Hohenbichler-Rackwitz).
- Type:
float or ndarray
- betag_breitung_m#
Generalised reliability index from the modified Breitung.
- Type:
float or ndarray
Class constructor
Methods
Computes the matrix of second derivatives using forward finite difference, using the evaluation of the gradient already done for FORM, at the design point
For use in computing the Hessian without altering the FORM object.
Creates an orthonormal matrix using the modified Gram-Schmidt process.
Initialise the Nataf transformation before the analysis loop.
Computes the rotation matrix of the standard normal coordinate space where the design point is located at Beta along the last axis.
Calculates the probability of failure and generalized reliability index using [Breitung1984] formula.
Calculates the probability of failure and generalized reliability index using Brietung's formula ([Breitung1984]) as modified by Hohenbichler and Rackwitz [Hohenbichler1988].
Run SORM analysis.
Run SORM analysis using curve fitting
Run SORM analysis using point-fitting.
Print detailed FORM/SORM comparison to the console.
Print a compact summary of the SORM results.
- run(fit_type='cf')[source]#
Run SORM analysis.
- Parameters:
fit_type ({'cf', 'pf'}, optional) –
Fitting method to use (default
'cf'):'cf'— Curve-fitting via Hessian eigenvalues.'pf'— Point-fitting via Newton iteration on the failure surface.
- Raises:
ValueError – If fit_type is not
'cf'or'pf'.
- run_pointfit()[source]#
Run SORM analysis using point-fitting.
Finds fitting points on the limit state surface on both the positive and negative sides of each principal axis in the rotated standard normal space. Curvatures are computed from the positions of these points, producing asymmetric curvatures that are stored in
kappa_pf.The generalized Breitung formula for asymmetric curvatures is:
\[p_{f2} = \Phi(-\beta) \prod_{i=1}^{n-1} \frac{1}{2} \left[ (1 + \beta \kappa_i^+)^{-1/2} + (1 + \beta \kappa_i^-)^{-1/2} \right]\]Notes
Based on the point-fitting implementation contributed by Henry Nguyen (Monash University, PR #65).
See also
run_curvefitAlternative SORM approach using Hessian eigenvalues.
- pf_breitung(beta, kappa)[source]#
Calculates the probability of failure and generalized reliability index using [Breitung1984] formula. This formula is good for higher values of beta.
- pf_breitung_m(beta, kappa)[source]#
Calculates the probability of failure and generalized reliability index using Brietung’s formula ([Breitung1984]) as modified by Hohenbichler and Rackwitz [Hohenbichler1988]. This formula is better for lower values of beta.
- computeHessian(diff_type=None)[source]#
Computes the matrix of second derivatives using forward finite difference, using the evaluation of the gradient already done for FORM, at the design point
Could use numdifftools as external library instead
- evaluateLSF(x, calc_gradient=False, u_space=True)[source]#
For use in computing the Hessian without altering the FORM object. Considers the coord transform so the limit state function is evaluated in physical coordinates, but gradient returned in u-space.
This code already in FORM, and a more integrated approach would put this in a base class for common use.
- orthonormal_matrix()[source]#
Computes the rotation matrix of the standard normal coordinate space where the design point is located at Beta along the last axis.
- gram_schmidt(A)[source]#
Creates an orthonormal matrix using the modified Gram-Schmidt process. Note that QR decomposition doesn’t work for this application; while it does return an orthonormal matrix, the signs are different to the modified Gram Schmidt. The signs should be arbitrary, but the resulting rotation matrix does care cabout the signs of the Q, since it is based on the correct direction of the beta vector [Madsen1986]
- init_run()#
Initialise the Nataf transformation before the analysis loop.
Computes the modified (Nataf) correlation matrix and its factorisation. Must be called at the start of every
run()method in subclasses.