Examples

Isoprobabilistic Transformation

Nataf Transformation

# Generate a random vector X with correlated marginal random variables X₁ and X₂:
X₁  = generaterv("Gamma", "M", [10, 1.5])
X₂  = generaterv("Gumbel", "M", [15, 2.5])
X   = [X₁, X₂]

# Define the correlation matrix:
ρˣ = [1 0.90; 0.90 1]

# Perform the Nataf Transformation by defining a "NatafTransformation" object:
NatafObject = NatafTransformation(X, ρˣ)

# Generate 1000 samples of the random vector X in X-, Z-, and U-spaces:
XSamples, USamples, ZSamples = samplerv(NatafObject, 1000, ITS())

Monte Carlo Simulations

# Generate a random vector X with correlated marginal random variables:
M₁  = generaterv("Normal", "M", [250, 250 * 0.3])
M₂  = generaterv("Normal", "M", [125, 125 * 0.3])
P   = generaterv("Gumbel", "M", [2500, 2500 * 0.2])
Y   = generaterv("Weibull", "M", [40000, 40000 * 0.1])
X   = [M₁, M₂, P, Y]
ρˣ  = [1 0.5 0.3 0; 0.5 1 0.3 0; 0.3 0.3 1 0; 0 0 0 1]

# Define a limit state function:
a   = 0.190
s₁  = 0.030
s₂  = 0.015
g(x) = 1 - x[1] / (s₁ * x[4]) - x[2] / (s₂ * x[4]) - (x[3] / (a * x[4])) ^ 2

# Define a reliability problem:
Problem = ReliabilityProblem(X, ρˣ, g)

# Perform the reliability analysis using curve-fitting SORM:
Solution = analyze(Problem, MCS())
println("MCS:")
println("PoF: $(Solution.PoF)")
MCS:
PoF: 0.009312

First-Order Reliability Methods

Mean-Centered First-Order Second-Moment Method

# Generate a random vector X with correlated marginal random variables:
X₁  = generaterv("Normal", "Moments", [10, 2])
X₂  = generaterv("Normal", "Moments", [20, 5])
X   = [X₁, X₂]
ρˣ  = [1 0.5; 0.5 1]

# Define two equivalent limit state functions:
g₁(x) = x[1] ^ 2 - 2 * x[2]
g₂(x) = 1 - 2 * x[2] / x[1] ^ 2

# Define reliability problems:
Problem₁ = ReliabilityProblem(X, ρˣ, g₁)
Problem₂ = ReliabilityProblem(X, ρˣ, g₂)

# Perform the reliability analysis:
Solution₁ = analyze(Problem₁, FORM(MCFOSM()))
Solution₂ = analyze(Problem₂, FORM(MCFOSM()))
println("MCFOSM:")
println("β from g₁: $(Solution₁.β)")
println("β from g₂: $(Solution₂.β)")
MCFOSM:
β from g₁: 1.6641005886756874
β from g₂: 4.285714285714286

Improved Hasofer-Lind-Rackwitz-Fiessler Method

# Generate a random vector X with correlated marginal random variables:
X₁  = generaterv("Normal", "Moments", [10, 2])
X₂  = generaterv("Normal", "Moments", [20, 5])
X   = [X₁, X₂]
ρˣ  = [1 0.5; 0.5 1]

# Define two equivalent limit state functions:
g₁(x) = x[1] ^ 2 - 2 * x[2]
g₂(x) = 1 - 2 * x[2] / x[1] ^ 2

# Define reliability problems:
Problem₁ = ReliabilityProblem(X, ρˣ, g₁)
Problem₂ = ReliabilityProblem(X, ρˣ, g₂)

# Perform the reliability analysis:
Solution₁ = analyze(Problem₁, FORM(iHLRF()))
Solution₂ = analyze(Problem₂, FORM(iHLRF()))
println("FORM:")
println("β from g₁: $(Solution₁.β)")
println("β from g₂: $(Solution₂.β)")
FORM:
β from g₁: 2.108339767222378
β from g₂: 2.108339767222378

Second-Order Reliability Methods

Curve-Fitting Method

# Generate a random vector X with correlated marginal random variables:
M₁  = generaterv("Normal", "M", [250, 250 * 0.3])
M₂  = generaterv("Normal", "M", [125, 125 * 0.3])
P   = generaterv("Gumbel", "M", [2500, 2500 * 0.2])
Y   = generaterv("Weibull", "M", [40000, 40000 * 0.1])
X   = [M₁, M₂, P, Y]
ρˣ  = [1 0.5 0.3 0; 0.5 1 0.3 0; 0.3 0.3 1 0; 0 0 0 1]

# Define a limit state function:
a   = 0.190
s₁  = 0.030
s₂  = 0.015
g(x) = 1 - x[1] / (s₁ * x[4]) - x[2] / (s₂ * x[4]) - (x[3] / (a * x[4])) ^ 2

# Define a reliability problem:
Problem = ReliabilityProblem(X, ρˣ, g)

# Perform the reliability analysis using curve-fitting SORM:
Solution = analyze(Problem, SORM(CF()))
println("SORM:")
println("β from FORM: $(Solution.β₁)")
println("β from SORM: $(Solution.β₂[1]) (Hohenbichler and Rackwitz)")
println("β from SORM: $(Solution.β₂[2]) (Breitung)")
println("PoF from FORM: $(Solution.PoF₁)")
println("PoF from SORM: $(Solution.PoF₂[1]) (Hohenbichler and Rackwitz)")
println("PoF from SORM: $(Solution.PoF₂[2]) (Breitung)")
SORM:
β from FORM: 2.466021207388449
β from SORM: 2.3410266432353186 (Hohenbichler and Rackwitz)
β from SORM: 2.359553628778695 (Breitung)
PoF from FORM: 0.006831162248127732
PoF from SORM: 0.009615397348334088 (Hohenbichler and Rackwitz)
PoF from SORM: 0.009148468013105492 (Breitung)

Point-Fitting Method

# Generate a random vector X with correlated marginal random variables:
M₁  = generaterv("Normal", "M", [250, 250 * 0.3])
M₂  = generaterv("Normal", "M", [125, 125 * 0.3])
P   = generaterv("Gumbel", "M", [2500, 2500 * 0.2])
Y   = generaterv("Weibull", "M", [40000, 40000 * 0.1])
X   = [M₁, M₂, P, Y]
ρˣ  = [1 0.5 0.3 0; 0.5 1 0.3 0; 0.3 0.3 1 0; 0 0 0 1]

# Define a limit state function:
a   = 0.190
s₁  = 0.030
s₂  = 0.015
g(x) = 1 - x[1] / (s₁ * x[4]) - x[2] / (s₂ * x[4]) - (x[3] / (a * x[4])) ^ 2

# Define a reliability problem:
Problem = ReliabilityProblem(X, ρˣ, g)

# Perform the reliability analysis using curve-fitting SORM:
Solution = analyze(Problem, SORM(PF()))
println("SORM:")
println("β from FORM: $(Solution.β₁)")
println("β from SORM: $(Solution.β₂[1]) (Hohenbichler and Rackwitz)")
println("β from SORM: $(Solution.β₂[2]) (Breitung)")
println("PoF from FORM: $(Solution.PoF₁)")
println("PoF from SORM: $(Solution.PoF₂[1]) (Hohenbichler and Rackwitz)")
println("PoF from SORM: $(Solution.PoF₂[2]) (Breitung)")
SORM:
β from FORM: 2.466021207388449
β from SORM: 2.3536666008296554 (Hohenbichler and Rackwitz)
β from SORM: 2.36928554527003 (Breitung)
PoF from FORM: 0.006831162248127732
PoF from SORM: 0.009294637816433898 (Hohenbichler and Rackwitz)
PoF from SORM: 0.008911243806556333 (Breitung)

Subset Simulation Method

# Define a random vector of uncorrelated marginal distributions:
X₁  = generaterv("Exponential", "P", 1)
X₂  = generaterv("Exponential", "P", 1)
X   = [X₁, X₂]
ρˣ  = [1 0; 0 1]

# Define a limit state function:
g(x) = 10 - x[1] - x[2]

# Define reliability problems:
Problem = ReliabilityProblem(X, ρˣ, g)

# Perform the reliability analysis using SSM:
Solution = analyze(Problem, SSM())
println("SSM")
println("PoF from SSM: $(Solution.PoF)")
SSM
PoF from SSM: 0.0005001000000000001