| Title: | Reliability Analysis Methods for Structural Engineering |
|---|---|
| Description: | Calculate the failure probability of civil engineering problems with Level I up to Level III Methods. Have fun and enjoy. References: Spaethe (1991, ISBN:3-211-82348-4) "Die Sicherheit tragender Baukonstruktionen", AU,BECK (2001) "Estimation of small failure probabilities in high dimensions by subset simulation." <doi:10.1016/S0266-8920(01)00019-4>, Breitung (1989) "Asymptotic approximations for probability integrals." <doi:10.1016/0266-8920(89)90024-6>. |
| Authors: | Konstantin Nille-Hauf [aut], Tânia Feiri [aut], Marcus Ricker [aut], Til Lux [aut, cre] |
| Maintainer: | Til Lux <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.9.6 |
| Built: | 2026-05-22 09:09:27 UTC |
| Source: | https://github.com/cran/TesiproV |
The Package provides three main types of objects:
Objects for modeling base variables
Objects for modeling limit state functions and systems of them
Objects for modeling solving algorithms
By creating and combining those objects, one is able to model quite complex problems in terms of structural reliablity calculation. For normally distributed variables there might be an workflow to calculate correlated problems (but no systems then). There is also implemented a new distribution (logStudentT, often used for conrete compression strength) to show how one can implement your very own or maybe combined multi modal distribution and use it with TesiproV.
PROB_BASEVAR, PROB_DETVAR, PARAM_BASEVAR, PARAM_DETVAR
SYS_LSF, PROB_SYS, PARAM_SYS
PROB_MACHINE
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Useful links:
First-Order Reliability Method (FORM) for the approximation of failure probabilities in structural reliability analysis.
The FORM estimates the probability of failure by transforming the basic random variables into standard normal space and approximating the limit-state function by a first-order (linear) Taylor expansion at the design point.
The reliability index is defined as the minimum distance from the origin to the limit-state surface in standard normal space. The probability of failure is then approximated using the standard normal cumulative distribution function.
FORM( lsf, lDistr, n_optim = 10, loctol = 0.01, optim_type = "rackfies", debug.level = 0 )FORM( lsf, lDistr, n_optim = 10, loctol = 0.01, optim_type = "rackfies", debug.level = 0 )
lsf |
Objective function representing the limit-state, e.g. |
lDistr |
List of distribution objects created by TesiproV. Supplied automatically by a SYS_ object - do not provide manually. |
n_optim |
Number of optimization cycles (not required for Lagrangian algorithms). |
loctol |
Local tolerance for convergence of the solver algorithm. |
optim_type |
Optimization type: '"auglag"' (Augmented Lagrangian) or '"rackfies"' (Rackwitz-Fiessler iterative scheme). |
debug.level |
Verbosity level: 0 = silent, 1 = basic info, 2 = detailed output. |
A list containing: * 'beta' - Hasofer-Lind reliability index * 'pf' - probability of failure * 'x_points' - design point in physical space * 'dy' - gradient vector at design point
(C) 2021-2026 K. Nille-Hauf, J.P. Schulze-Ardey, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Hasofer, A. M., & Lind, N. C. (1974). An exact and invariant first-order reliability format. Journal of the Engineering Mechanics Division, ASCE, 100(1), 111-121.
Rackwitz, R., & Fieszler, B. (1978). Structural reliability under combined random load sequences. Computers & Structures, 9(5), 489-494.
This file contains internal helper functions used by the main function ['MC_IS()'] to perform Monte Carlo simulations with importance sampling.
The helpers defined here support: * random number generation and cluster setup, * creation of recorder objects for iterative logging, * single limit state simulation routine ('MC_IS_single()'), * conversion of recorded data to data frames after completion.
Additional helper sets will be provided for system calculations (serial and parallel systems) in separate files.
These functions are not intended to be called directly by users. They are exported internally to allow modular access within the package.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
[TesiproV::MC_IS()] for the public interface that calls these helpers.
Density, distribution function, quantile function and random generation for the log-Student t distribution.
dlt(x, hyper.param) plt(q, hyper.param) qlt(p, hyper.param) rlt(n_vals, hyper.param)dlt(x, hyper.param) plt(q, hyper.param) qlt(p, hyper.param) rlt(n_vals, hyper.param)
x, q
|
Vector of quantiles. |
hyper.param |
Numeric vector |
p |
Vector of probabilities. |
n_vals |
Number of random values to generate. |
The cumulative distribution function is given by
where denotes the cumulative distribution
function of a log-Student t distribution with degrees of freedom.
The log-Student t distribution arises as the marginal
distribution of a log-normal distributed variable with conjugate
log-normal-gamma prior uncertainty in and .
The hyperparameter vector hyper.param is defined as
where
is the mean value of an equivalent sample of size ,
is the empirical standard deviation of an equivalent sample
of size ,
denotes the degrees of freedom of the Student t distribution.
For details see: https://www.jcss-lc.org/publications/jcsspmc/concrete.pdf
dlt() returns the density.
plt() returns the distribution function.
qlt() returns the quantile function.
rlt() generates random deviates.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
hp <- c(3.4, 0.14, 3, 10) #' dlt(0.5, hp)hp <- c(3.4, 0.14, 3, 10) #' dlt(0.5, hp)
Crude Monte Carlo simulation (MC_CRUDE) method for the estimation of failure probabilities in structural reliability analysis.
The crude Monte Carlo method estimates the probability of failure by direct sampling of the basic random variables and evaluation of the limit-state function.
The failure probability is estimated as
Although conceptually simple and unbiased, the method becomes computationally inefficient for very small failure probabilities, as a large number of samples is required to obtain stable estimates.
MC_CRUDE( lsf, lDistr, cov_user = 0.05, n_batch = 10000, n_max = 1e+07, use_threads = parallel::detectCores(), backend = c("future", "parallel"), dataRecord = TRUE, debug.level = 0, seed = NULL )MC_CRUDE( lsf, lDistr, cov_user = 0.05, n_batch = 10000, n_max = 1e+07, use_threads = parallel::detectCores(), backend = c("future", "parallel"), dataRecord = TRUE, debug.level = 0, seed = NULL )
lsf |
Limit-state function. Must follow the LSF interface specification described in the "Limit-State Function (LSF) Interface" section below. |
lDistr |
List of distribution objects as returned by |
cov_user |
Target coefficient of variation to be achieved. |
n_batch |
Batch size per iteration (used for parallel computation). |
n_max |
Maximum number of Monte Carlo samples (stopping criterion). |
use_threads |
Number of parallel threads. Set to 1 for single-core execution. Parallel execution is not supported on Windows. |
backend |
Parallel backend, either |
dataRecord |
Logical; if |
debug.level |
Integer controlling verbosity (0 = silent, 2 = detailed output). |
seed |
Optional integer value for reproducible random numbers. |
MC_CRUDE returns an object containing the following elements:
method: Character string identifying the method ("MCC").
beta: Estimated reliability index .
pf: Estimated probability of failure.
var: Estimated variance of the Monte Carlo estimator.
cov_mc: Estimated coefficient of variation of pf.
cov_user: Target coefficient of variation specified by the user.
n_mc: Total number of Monte Carlo samples generated.
n_max: Maximum allowed number of samples.
n_batch: Batch size per iteration.
n_threads: Number of threads used.
runtime: CPU time returned by proc.time().
data: Optional data frame containing intermediate results
(only if dataRecord = TRUE).
The argument lsf must define a valid limit-state function
using one of the following supported signatures:
function(x)A single numeric vector x containing all basic variables
in the order defined in lDistr.
Example:
lsf <- function(x) {
x[1] - sum((x[-1]^2) / seq_along(x)[-1])
}
function(Z, Fy, M, ...)Explicitly named scalar arguments corresponding to the variable names defined in the probabilistic model.
Example:
lsf <- function(Z, Fy, M) {
Z * Fy - M
}
The following form is not supported:
function(...)
Using ... as the sole argument may lead to inconsistent
behaviour across different reliability algorithms and is therefore
prohibited.
For maximum robustness and cross-method compatibility,
the vector form function(x) is recommended.
On Windows systems, it is recommended to use
backend = "future" for multi-core parallelization.
The "parallel" backend does not support forking on Windows.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Spaethe, G. (1991). Die Sicherheit tragender Baukonstruktionen. Springer.'
Performs Monte Carlo simulation with Importance Sampling (IS) to estimate structural failure probabilities for single limit state functions or systems of limit state functions.
The method reduces the variance of crude Monte Carlo by sampling from a shifted (or multimodal) density in standard normal space and correcting via likelihood ratios. For systems, a multimodal sampling density based on FORM design points is used (cf. Melchers & Beck, Chapter 5).
The implementation supports:
Single limit state functions (FORM-based IS shift)
Serial and parallel systems (union / intersection events)
Multimodal sampling densities for system reliability
Optional adaptive mixture weights (adaptive )
Parallel execution (via future or parallel)
Deterministic reproducibility via fixed seeds
Automatic detection of vectorized limit-state functions
MC_IS( lsf, lDistr, cov_user = 0.05, n_batch = 5000, n_max = 1e+06, use_threads = 4, backend = NULL, sys_type = "serial", dataRecord = TRUE, beta_l = 100, densityType = "norm", dps = NULL, debug.level = 0, seed = NULL, adaptive_alpha = FALSE, alpha_update_rate = 0.1, adaptive_batch = FALSE, batch_control = list(), min_adapt_samples = 10000, alpha_min = 0.02, stability_mode = c("robust", "fast") )MC_IS( lsf, lDistr, cov_user = 0.05, n_batch = 5000, n_max = 1e+06, use_threads = 4, backend = NULL, sys_type = "serial", dataRecord = TRUE, beta_l = 100, densityType = "norm", dps = NULL, debug.level = 0, seed = NULL, adaptive_alpha = FALSE, alpha_update_rate = 0.1, adaptive_batch = FALSE, batch_control = list(), min_adapt_samples = 10000, alpha_min = 0.02, stability_mode = c("robust", "fast") )
lsf |
A single limit-state function |
lDistr |
List of marginal distribution objects (funlists with |
cov_user |
Target coefficient of variation (CoV) for the Monte Carlo estimator. Simulation stops once this threshold is reached. |
n_batch |
Number of samples generated per iteration. |
n_max |
Maximum total number of samples (upper stopping limit). |
use_threads |
Number of worker threads (for parallel execution). |
backend |
Parallel backend, either |
sys_type |
Character string, either |
dataRecord |
Logical; if |
beta_l |
Optional threshold; limit states with |
densityType |
Sampling density type (currently |
dps |
Optional vector of design points in physical space; if supplied, FORM analysis is skipped. |
debug.level |
Integer verbosity level (0 = silent, 1 = summary, 2 = detailed). |
seed |
Optional integer seed for reproducible random numbers. |
adaptive_alpha |
Logical; if |
alpha_update_rate |
Damping factor |
adaptive_batch |
Logical; if TRUE, the batch size is adapted dynamically based on the current effective sample size (ESS) and target RSE. |
batch_control |
List controlling adaptive batch behaviour:
|
min_adapt_samples |
Integer. Minimum total number of MC samples required before adaptive mixtures are updated. The adaption mechanism is activated only after this threshold has been exceeded to ensure statistically stable estimates. |
alpha_min |
Numeric scalar in |
stability_mode |
Character string specifying the numerical stabilization strategy used for importance sampling weight accumulation.
Both modes are mathematically equivalent for typical
reliability problems. The |
Single limit state case:
The importance sampling density is constructed in standard normal space
using the FORM design point . Samples are generated from
and transformed to physical space.
System case:
For a system with limit states , the failure event is
(serial system) or
(parallel system).
The sampling density follows Melchers & Beck (Eq. 5.26):
where are the FORM design points in standard normal space and
are mixture weights.
By default, mixture weights are proportional to individual failure probabilities:
If adaptive_alpha = TRUE, mixture weights are updated iteratively
based on weighted failure frequency estimates:
where is given by alpha_update_rate.
The failure probability is estimated using a self-normalized IS estimator:
with likelihood ratio
Numerical stability is ensured via global log-weight stabilization.
Stopping Criterion
The simulation terminates when both:
The estimated coefficient of variation (CoV) falls below cov_user, and
The effective sample size (ESS) exceeds a minimum threshold.
For parallel systems with very small failure probabilities, the ESS-based safeguard prevents premature termination due to unstable variance estimates.
Numerical stability
The default "robust" mode performs global log-domain
accumulation of importance sampling weights using a
log-sum-exp formulation. This avoids overflow and underflow
effects in high-dimensional or rare-event settings.
The alternative "fast" mode uses shifted exponentiation
at the batch level and is computationally equivalent for most
engineering reliability problems.
Automatic detection of vectorized limit-state functions
For performance reasons, the algorithm automatically checks whether the supplied limit-state function (LSF) supports vectorized evaluation.
A short internal test is performed before the simulation starts. If the LSF accepts a matrix of input samples and returns a numeric vector of matching length, it is evaluated in fully vectorized form:
Otherwise, the algorithm falls back to row-wise evaluation using
apply().
This mechanism is fully automatic and backward compatible. Users do not need to modify existing scalar LSF definitions.
For computationally expensive LSFs (e.g., nonlinear models or surrogate FEM models), vectorized evaluation can significantly improve performance.
Parallel execution and future plan handling
When backend = "future" is used, the function respects the currently
active future plan.
If no parallel plan has been set by the user (i.e., the active plan is sequential), a temporary plan is created internally using:
multicore on Unix-like systems,
multisession on Windows.
The original plan is automatically restored after completion of the simulation.
If the user has already defined a parallel strategy via
future::plan(), it will not be modified.
This design ensures CRAN compliance while preserving full flexibility for advanced users.
Reproducibility
Reproducible results across different numbers of cores are ensured through:
L'Ecuyer-CMRG random number streams,
deterministic master sampling,
worker-invariant parallel chunking,
controlled seed propagation.
If seed is supplied, results are reproducible regardless of the
number of worker threads.
MC_IS returns an object containing the following elements:
method - method identifier
pf - estimated failure probability
beta - reliability index
var - variance estimate
cov_mc - coefficient of variation
n_mc - number of samples used
ESS - effective sample size
ESS_modes - effective sample size per mixture component (system case)
data - optional iteration history (if dataRecord = TRUE)
The argument lsf must define a valid limit-state function
using one of the following supported signatures:
function(x)A single numeric vector x containing all basic variables
in the order defined in lDistr.
This form is fully compatible with vectorized evaluation in Monte Carlo and importance sampling algorithms.
function(Z, Fy, M, ...)Explicitly named scalar arguments corresponding to the variable names defined in the probabilistic model.
The use of function(...) as the sole argument is not supported.
Such usage may cause inconsistent behaviour between FORM-based and
Monte Carlo-based reliability methods.
The vector form function(x) is recommended for
best performance and consistency.
On Windows systems, it is recommended to use
backend = "future" for multi-core parallelization.
The "parallel" backend does not support forking on Windows.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Ditlevsen, O., & Madsen, H. O. (1996). Structural Reliability Methods. Wiley.
Melchers, R. E., & Beck, A. T. (2018). Structural Reliability Analysis and Prediction. Wiley.
Spaethe, G. (1991). Die Sicherheit tragender Baukonstruktionen. Springer.
MonteCarlo with Subset-Sampling (MC_SubSam) method for the estimation of small failure probabilities in structural reliability analysis.
Subset Simulation is an advanced Monte Carlo technique that expresses a rare failure event as a sequence of intermediate conditional events with higher probabilities.
The method combines conditional sampling with Markov Chain Monte Carlo (MCMC) techniques to efficiently estimate very small probabilities of failure, which would be computationally expensive to obtain using crude Monte Carlo simulation.
MC_SubSam( lsf, lDistr, Nsubset = 1e+05, p0 = 0.1, MaxSubsets = 10, Alpha = 0.05, variance = "uniform", debug.level = 0, seed = NULL )MC_SubSam( lsf, lDistr, Nsubset = 1e+05, p0 = 0.1, MaxSubsets = 10, Alpha = 0.05, variance = "uniform", debug.level = 0, seed = NULL )
lsf |
limit-state function |
lDistr |
list of basevariables in input space |
Nsubset |
number of samples in each simulation level |
p0 |
level probability or conditional probability |
MaxSubsets |
maximum number of simulation levels that are used to terminate the simulation procedure to avoid infinite loop when the target domain cannot be reached |
Alpha |
confidence level |
variance |
gaussian, uniform |
debug.level |
If 0 no additional info if 2 high output during calculation |
seed |
Optional integer value. If specified, sets a fixed seed for reproducible random numbers (useful for testing). |
MC_SubSam returns an object containing the following elements:
beta: Estimated reliability index.
pf: Estimated probability of failure.
betaCI: Confidence interval of the reliability index.
pfCI: Confidence interval of the probability of failure.
CoV: Coefficient of variation of the estimator.
NumOfSubsets: Number of Markov chains (subsets).
NumOfEvalLSF_nom: Nominal number of limit-state function evaluations
(Markov chains / iterations).
NumOfEvalLSF_eff: Effective number of limit-state function evaluations.
runtime: Total runtime of the function.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Au, S. K., & Beck, J. L. (2001). Estimation of small failure probabilities in high dimensions by subset simulation. Probabilistic Engineering Mechanics, 16(4), 263-277.
Marelli, S., & Sudret, B. (2014). UQLab: A framework for uncertainty quantification in Matlab. In Proceedings of the 2nd International Conference on Vulnerability, Risk Analysis and Management (ICVRAM2014), Liverpool, United Kingdom, 2554-2563.
Mean-Value First-Order Second-Moment (MVFOSM) method for the approximation of failure probabilities in structural reliability analysis.
The MVFOSM method linearises the limit-state function at the mean values of the basic random variables and estimates the reliability index and probability of failure based on first-order moment information.
This classical approach provides a computationally efficient approximation but may be inaccurate for strongly nonlinear limit-state functions.
MVFOSM(lsf, lDistr, h = 1e-04, isExpression = FALSE, debug.level)MVFOSM(lsf, lDistr, h = 1e-04, isExpression = FALSE, debug.level)
lsf |
LSF Definition, can be Expression or Function. Defined by the FLAG isExpression (see below) |
lDistr |
List of Distributions |
h |
If isExpression is False, than Finite Difference Method is used for partial deviation. h is the Windowsize |
isExpression |
Boolean, If TRUE lsf has to be typeof expression, otherwise lsf has to be type of function() |
debug.level |
If 0 no additional info if 2 high output during calculation |
MVFOSM returns an object containing the following elements:
beta: Estimated reliability index.
pf: Estimated probability of failure.
design.point: Design point in the original -space.
alphas: Direction cosines (importance factors) in the standard normal space.
runtime: Total runtime of the algorithm.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Freudenthal, A. M. (1956). Safety and the probability of structural failure. Transactions of the American Society of Civil Engineers, 121, 1337-1397.
Extends 'PROB_BASEVAR' so that one of the distribution parameters (Mean, Sd or DistributionType) can be **swept** over a user-defined vector of values.
The method 'nextParam()' advances 'pos' (circularly) and updates the basic fields ('Mean', 'Sd', 'DistributionType', 'DistributionParameters') before calling 'prepare()' again. 'getCurrentParam()' returns the *last* value that was used (convenient for readable run names).
ParamValuesNumeric vector holding the values that will be assigned during the sweep.
ParamTypeWhich parameter is varied: '"Mean"', '"Sd"' or '"DistributionType"'.
posCurrent index inside 'ParamValues' (used internally).
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
pvar <- PARAM_BASEVAR( Name = "E_mod", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30e3, 35e3, 40e3) ) pvar$nextParam() # sets Mean = 30.000 and prepares the distribution pvar$getCurrentParam()pvar <- PARAM_BASEVAR( Name = "E_mod", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30e3, 35e3, 40e3) ) pvar$nextParam() # sets Mean = 30.000 and prepares the distribution pvar$getCurrentParam()
Like 'PROB_DETVAR' but the deterministic value itself can be swept. The class inherits from 'PROB_BASEVAR' and therefore re-uses the same transformation machinery.
ParamValuesVector of deterministic values that will be assigned sequentially in a parametric sweep.
posCurrent index (used internally).
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
pdet <- PARAM_DETVAR( Name = "E_mod", ParamValues = c(30e3, 35e3, 40e3) ) pdet$nextParam() # sets Mean = 30.000, Sd = Mean/1e7 and prepares pdet$getCurrentParam()pdet <- PARAM_DETVAR( Name = "E_mod", ParamValues = c(30e3, 35e3, 40e3) ) pdet$nextParam() # sets Mean = 30.000, Sd = Mean/1e7 and prepares pdet$getCurrentParam()
Identical to 'SYS_LSF' but inherits from it to make the class hierarchy clear when a parametric study is performed. No additional fields or methods are required.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Stores the distribution model for a basic random variable that can be used in any limit-state function. The class knows how to transform between *mean / standard deviation* and the native distribution parameters.
The method 'prepare()' calculates missing parameters and checks for consistency. 'getlDistr()' returns a list containing *four* functions ('d', 'p', 'q', 'r') together with meta-information; the result is cached to avoid repeated 'loadNamespace()' calls.
IdInteger identifier (position inside the LSF vector).
NameHuman-readable name (e.g. '"f_ck"').
DescriptionShort textual description.
DistributionTypeDistribution identifier ('"norm"', '"lnorm"', '"slnorm"', '"gumbel"', '"gamma"', '"exp"', '"beta"', '"st"', '"binom"','"emp"', '"unif"', '"weibull"', '"lt"').
MeanMean value of the variable.
SdStandard deviation.
CovCoefficient of variation ('Sd / Mean').
x0Shifting parameter (used for shifted log-normal distribution '"slnorm"').
PackageName of the R package that provides the density functions ('"stats"', '"evd"', '"EnvStats"' or '"brms"').
DistributionParametersNumeric vector with the *native* distribution parameters (e.g. 'c(mu, sigma)' for a normal).
.cachePrivate environment that stores cached density functions (used internally, **do not** access from user code).
prepare()Performs transformations between mean/sd and distribution parameters. Ensures that Mean, Sd and Cov are consistent and valid.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
## Normal random variable -------------------------------------------------- var1 <- PROB_BASEVAR( Name = "f_ck", DistributionType = "norm", Mean = 30, Sd = 1 ) var1$prepare() ## Gumbel random variable (package `evd`) ---------------------------------- var2 <- PROB_BASEVAR( Name = "M", DistributionType = "gumbel", Package = "evd", Mean = 2000, Sd = 200 ) var2$prepare()## Normal random variable -------------------------------------------------- var1 <- PROB_BASEVAR( Name = "f_ck", DistributionType = "norm", Mean = 30, Sd = 1 ) var1$prepare() ## Gumbel random variable (package `evd`) ---------------------------------- var2 <- PROB_BASEVAR( Name = "M", DistributionType = "gumbel", Package = "evd", Mean = 2000, Sd = 200 ) var2$prepare()
A convenience subclass of 'PROB_BASEVAR' that represents a deterministic value (i.e. a variable with practically zero variance). The object is automatically converted to a normal distribution with an infinitesimal standard deviation ('Sd = Mean / 1e7').
Inherits all fields of 'PROB_BASEVAR' (see that documentation for a full list).
ValueThe deterministic value used internally as Mean.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
det <- PROB_DETVAR(Name = "E_mod", Value = 30e3) det$prepare()det <- PROB_DETVAR(Name = "E_mod", Value = 30e3) det$prepare()
Stores the definition of a reliability method (FORM, SORM, Monte-Carlo, etc.) that can be executed by 'SYS_PROB' or 'SYS_PARAM'. The actual algorithm is called via the character string 'fCall' (e.g. '"FORM"' or '"MC_IS"'). Optional arguments are passed through the list 'options'.
The helper method 'getMethodLevel()' returns an integer that indicates the *complexity* of the method (1 = first-order, 2 = second-order, 3 = Monte-Carlo).
nameDescriptive name of the machine (appears in reports).
fCallFunction name that implements the algorithm (must be available in the package namespace, e.g. 'FORM', 'SORM', 'MC_CRUDE', 'MC_IS', 'MC_SubSam').
optionsAdditional options for the algorithm (list, e.g. 'list(n_max = 1e6, cov_user = 0.05)').
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
## FORM machine ------------------------------------------------------------ form_rf <- PROB_MACHINE( name = "FORM - Rack-Fies", fCall = "FORM", options = list(n_optim = 20, loctol = 1e-3, optim_type = "rackfies") ) ## Monte-Carlo importance sampling ----------------------------------------- mcis <- PROB_MACHINE( name = "MC-IS", fCall = "MC_IS", options = list(cov_user = 0.05, n_max = 3e5, seed = 1234) )## FORM machine ------------------------------------------------------------ form_rf <- PROB_MACHINE( name = "FORM - Rack-Fies", fCall = "FORM", options = list(n_optim = 20, loctol = 1e-3, optim_type = "rackfies") ) ## Monte-Carlo importance sampling ----------------------------------------- mcis <- PROB_MACHINE( name = "MC-IS", fCall = "MC_IS", options = list(cov_user = 0.05, n_max = 3e5, seed = 1234) )
Second-Order Reliability Method (SORM) for the approximation of failure probabilities in structural reliability analysis.
The SORM extends the First-Order Reliability Method (FORM) by incorporating second-order information of the limit-state function at the design point. By accounting for local curvature effects, SORM generally provides more accurate failure probability estimates for nonlinear limit-state functions.
The method evaluates the principal curvatures of the limit-state surface in standard normal space and applies an asymptotic correction to the FORM probability of failure.
SORM(lsf, lDistr, debug.level = 0)SORM(lsf, lDistr, debug.level = 0)
lsf |
objective function with limit state function in form of
|
lDistr |
list ob distribiutions regarding the distribution object of TesiproV |
debug.level |
If 0 no additional info if 2 high output during calculation |
SORM returns an object containing the following elements:
beta: Hasofer-Lind reliability index.
pf: Estimated probability of failure.
u_points: Design point(s) in the standard normal space (-space).
dy: Gradient(s) of the limit-state function at the design point.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
Breitung, K. (1989). Asymptotic approximations for probability integrals. Probabilistic Engineering Mechanics, 4(4), 187-190.
Cai, G. Q., & Elishakoff, I. (1994). Refined second-order reliability analysis. Structural Safety, 14(4), 267-276.
Hohenbichler, M., Gollwitzer, S., Kruse, W., & Rackwitz, R. (1987). New light on first- and second-order reliability methods. Structural Safety, 4, 267-284.
Tvedt, L. (1990). Distribution of quadratic forms in normal space - Applications to structural reliability. Journal of Engineering Mechanics, 116(6), 1183-1197.
Marelli, S., & Sudret, B. (2014). UQLab: A framework for uncertainty quantification in Matlab. In Proceedings of the 2nd International Conference on Vulnerability, Risk Analysis and Management (ICVRAM2014), Liverpool, United Kingdom, 2554-2563.
Lacaze, S., & Missoum, S. (2015). CODES: A toolbox for computational design (Version 1.0). Retrieved from http://www.codes.arizona.edu/toolbox/
Wu, X. Z. (2017). Implementing statistical fitting and reliability analysis for geotechnical engineering problems in R. Georisk: Assessment and Management of Risk for Engineered Systems and Geohazards, 11(2), 173-188.
Density, distribution function, quantile function and random generation for the Student t distribution.
dst(x, hyper.param) pst(q, hyper.param) qst(p, hyper.param) rst(n_vals, hyper.param)dst(x, hyper.param) pst(q, hyper.param) qst(p, hyper.param) rst(n_vals, hyper.param)
x, q
|
Vector of quantiles. |
hyper.param |
Numeric vector |
p |
Vector of probabilities. |
n_vals |
Number of random values to generate. |
The cumulative distribution function is given by
where denotes the cumulative distribution
function of a Student t distribution with degrees of freedom.
The Student t distribution arises as the marginal
distribution of a normal distributed variable with conjugate
normal-gamma prior uncertainty in and .
The hyperparameter vector hyper.param is defined as
where
is the mean value of an equivalent sample of size ,
is the empirical standard deviation of an equivalent sample
of size ,
denotes the degrees of freedom of the Student t distribution.
For details see: https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/TDist
dst() returns the density.
pst() returns the distribution function.
qst() returns the quantile function.
rst() generates random deviates.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
hp <- c(40, 4, 3, 10) dst(0.5, hp)hp <- c(40, 4, 3, 10) dst(0.5, hp)
A reference-class that stores a user-defined limit-state function. The function can be written either as an **expression** ('expr') or as a **regular R function** ('func'). All random variables that appear in the function must be supplied in the 'vars' list as 'PROB_BASEVAR' objects.
The method 'getLSF()' returns a **closure** that expects a numeric vector 'x' (ordered exactly like 'vars') and evaluates the limit-state function.
For consistency across FORM and Monte Carlo reliability methods,
limit-state functions must either accept a single numeric vector
argument or explicitly named scalar arguments.
The use of function(...) is not supported.
nameOptional human-readable name of the limit-state function.
exprSymbolic expression (e.g. 'expression(f_ck - d_nom)') that is later converted to a callable function via 'ExpressionToFunction()'.
funcActual R function implementing the limit-state equation. May be 'NULL' until defined by user or converted from 'expr'.
varsList of 'PROB_BASEVAR' objects that provide the random variables.
ExpressionToFunction()Transforms a valid expression into a objective function. Need the set of Variables with correct spelled names and IDs
check()Checks all variables. You dont need to execute this, since the system object will do anyway.
A limit-state function must follow one of the two supported interface patterns:
function(x)A single numeric vector argument x containing all
basic variables in the order specified in vars.
Example:
lsf$func <- function(x) {
x[1] - sum((x[-1]^2) / seq_along(x)[-1])
}
function(Z, Fy, M, ...)Explicitly named scalar arguments corresponding to the
variable names defined in vars.
Example:
lsf$func <- function(Z, Fy, M) {
Z * Fy - M
}
The following form is not supported:
function(...)
Using ... as the sole argument leads to inconsistent
behaviour between FORM-based and Monte Carlo-based reliability
methods and is therefore prohibited.
For maximum robustness and compatibility across all reliability
algorithms, the use of the vector form function(x) is
recommended.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
vars <- list( PROB_BASEVAR(Name = "f_ck", DistributionType = "norm", Mean = 30, Sd = 1), PROB_BASEVAR(Name = "d_nom", DistributionType = "norm", Mean = 0.2, Sd = 0.01) ) lsf <- SYS_LSF(name = "Bending resistance", vars = vars) lsf$ExpressionToFunction()vars <- list( PROB_BASEVAR(Name = "f_ck", DistributionType = "norm", Mean = 30, Sd = 1), PROB_BASEVAR(Name = "d_nom", DistributionType = "norm", Mean = 0.2, Sd = 0.01) ) lsf <- SYS_LSF(name = "Bending resistance", vars = vars) lsf$ExpressionToFunction()
Extends 'SYS_PROB' to perform a **parametric sweep** over one or more 'PARAM_BASEVAR' objects. For each combination of parameter values a full reliability analysis is executed and the results are stored in 'beta_params' and 'res_params'.
The method 'runMachines()' is almost identical to the one in 'SYS_PROB', but it loops over **all** parameter values, creates a readable run name, and stores the whole result hierarchy.
beta_paramsList of -matrices (one matrix per parameter run).
res_paramsList of detailed result objects (one per run).
nParamsNumeric vector: number of parameter values for each 'PARAM_BASEVAR'.
nLsfsNumber of limit-state functions in the system.
nMachinesNumber of analysis machines (methods) used.
printResults(path = "")TesiproV can create a report file with all the necessary data for you. If you provide a path (or filename, without ending) it will store the data there, otherwise it will report to the console. Set the path via setwd() or check it via getwd().
runMachines()Starts solving all given problems (sys_input) with all given algorithms (probMachines). First checks that all analysis methods are loaded before validating limit-state functions.
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
# Simple 2-parameter sweep ------------------------------------------------ # two random variables that will be varied pv1 <- PARAM_BASEVAR( Name = "E_mod", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30e3, 35e3, 40e3) ) pv2 <- PARAM_BASEVAR( Name = "f_ck", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30, 35, 40) ) lsf <- SYS_LSF(vars = list(pv1, pv2), name = "Bending") ps <- SYS_PARAM( sys_input = list(lsf), probMachines = list(PROB_MACHINE(name = "FORM", fCall = "FORM")), sys_type = "serial" ) ## Not run: ps$runMachines() ps$beta_params # matrix of \eqn{\beta}-values for every run ## End(Not run)# Simple 2-parameter sweep ------------------------------------------------ # two random variables that will be varied pv1 <- PARAM_BASEVAR( Name = "E_mod", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30e3, 35e3, 40e3) ) pv2 <- PARAM_BASEVAR( Name = "f_ck", DistributionType = "norm", ParamType = "Mean", ParamValues = c(30, 35, 40) ) lsf <- SYS_LSF(vars = list(pv1, pv2), name = "Bending") ps <- SYS_PARAM( sys_input = list(lsf), probMachines = list(PROB_MACHINE(name = "FORM", fCall = "FORM")), sys_type = "serial" ) ## Not run: ps$runMachines() ps$beta_params # matrix of \eqn{\beta}-values for every run ## End(Not run)
The SYS_PROB class represents a probabilistic system
consisting of one or more limit-state functions (SYS_LSF)
and a set of reliability algorithms (PROB_MACHINE).
It allows the execution of reliability analyses for serial or parallel systems, aggregation of single limit-state results, and system-level probability evaluation.
Each limit-state function may include multiple random variables
(PROB_BASEVAR) with different probability distributions.
The transformation between mean/standard deviation and the
native distribution parameters is handled automatically.
Normal ("norm"):
mean = , standard deviation = .
Parameters: mean, sd.
Lognormal ("lnorm"):
defined by mean and sd .
Parameters:
,
.
shifted Lognormal ("slnorm"):
defined by Mean , Sd and .
Parameters:
,
.
Gumbel ("gumbel", package "evd"):
location-scale type I extreme value distribution.
Parameters:
location = ,
where is the Euler-Mascheroni constant,
and
.
Gamma ("gamma"):
shape-scale parameterization.
Parameters:
,
.
Exponential ("exp"):
rate or scale .
Parameter:
.
Beta ("beta"):
bounded on .
Parameters:
,
,
with
.
Weibull ("weibull"):
shape and scale .
Parameters:
empirical approximation
,
.
Empirical ("emp"):
non-parametric distribution defined by observed sample.
Parameter: obs = numeric vector of observations.
The empirical CDF is constructed from the ordered sample.
Duplicate values are allowed but may trigger a warning.
Student t ("st"):
marginal density of a normal-gamma model describing uncertainty
in and .
Hyperparameters:
.
Log-Student t ("lt"):
marginal density of a log-normal-gamma model describing uncertainty
in and .
Hyperparameters:
.
The types '"binom"' and '"unif"' are reserved for future extensions. The package automatically checks consistency between mean, standard deviation and coefficient of variation.
Methods available in this class:
* '$runMachines()' - executes all solution algorithms for each limit state function. * '$calculateSystemProbability()' - computes system reliability using bounds or Monte Carlo based methods ('MC_IS', 'MC_CRUDE', 'MC_SubSam'). * '$printResults()' - prints a detailed report to console or file. * '$saveProject(level)' - saves results at different detail levels. * '$plotGraph(plotType)' - experimental plotting routine for simulation performance.
The class is built on setRefClass and therefore uses mutable fields.
All objects ('PROB_BASEVAR', 'SYS_LSF', ...) are expected to be already
**checked** (via the 'check()' method) before they are passed to 'SYS_PROB'.
sys_inputList of 'SYS_LSF' objects - the individual limit-state functions.
sys_typeCharacter string that defines whether the system is *serial* or *parallel* (not yet implemented).
probMachinesList of 'PROB_MACHINE' objects - the analysis methods.
res_singleList of results per machine for each limit-state function.
res_sysList of results for the system-level reliability calculation.
beta_singleMatrix of -values obtained from the single-problem analyses.
beta_sysMatrix of -values obtained from the system reliability calculations.
params_sysList that stores the parameter sets used in Monte-Carlo runs.
debug.levelNumeric verbosity level (0 = silent, 1 = basic, 2 = detailed).
calculateSystemProbability(calcType = "simpleBounds", params = list())Calculates the system probablity if more than one lsf is given and a system_type (serial or parallel) is set. If calcType is empty (or simpleBounds), only simpleBounds are applied to further calculation of single soultions. If calcType is MCIS, than a Monte Carlo Importance Sampling Method is used (only for parallel systems available). If calcType is MCC, than a Crude Monte Carlo Simulation is used. If calcType is MCSUS, than the Subset Sampling Algorithm ll be used. You can pass arguments to methods via the params field, while the argument has to be a named list (for example check the vignette).
plotGraph(plotType = "sim.performance")not finally implemented. Do not use.
printResults(path = "")TesiproV can create a report file with all the necessary data for you. If you provide a path (or filename, without ending) it will store the data there, otherwise it will report to the console. Set the path via setwd() or check it via getwd().
runMachines()Starts solving all given problems (sys_input) with all given algorithms (probMachines). First checks that all analysis methods are loaded before validating limit-state functions.
saveProject(level, filename = "tesiprov_project")You can save your calculation project with saveProject(). There are four different levels of detail to save 1st Level: Only the beta values 2nd Level: The result Objects of single or systemcalculation 3th Level: All The Probablity System Object, including limit state functions, machines and solutions 4th Level: An image of your entire workspace
(C) 2021-2026 K. Nille-Hauf, T. Feiri, M. Ricker, T. Lux – Hochschule Biberach (until 2022), TU Dortmund University - Chair of Structural Concrete (since 2023)
ps <- SYS_PROB( sys_input = list(SYS_LSF(), SYS_LSF()), probMachines = list(PROB_MACHINE()), sys_type = "serial" ) ## Not run: ps$runMachines() ps$beta_sys ps$res_sys ps$printResults("example_1") ps$saveProject(4, "example_1") ## End(Not run)ps <- SYS_PROB( sys_input = list(SYS_LSF(), SYS_LSF()), probMachines = list(PROB_MACHINE()), sys_type = "serial" ) ## Not run: ps$runMachines() ps$beta_sys ps$res_sys ps$printResults("example_1") ps$saveProject(4, "example_1") ## End(Not run)