Reliability#

This module contains all reliability related functionality.

The entry point for performing a reliability analysis is probabilistic_library.project.ReliabilityProject. A model can be attached to a reliability project, then stochastic variables, correlation matrix and settings are provided. When the reliability project is run, a DesignPoint is generated, which contains the results of the reliability analysis.

class Alpha(id=None, known_variables=None)[source]#

Bases: FrozenObject

Contribution of a stochastic variable to a design point

The contribution consists of two indicators, the influence of the uncertainty of the stochastic variable to the design point and the physical value of the variable in the design point.

property alpha: float#

Alpha value, the contribution of the uncertainty of the variable

property alpha_correlated: float#

Alpha value after transformation for correlation, used to determine the physical value ‘x’

property identifier: str#

Identifying string of the variable or, in case of an array variable, accompanied with its index number

property index: int#

Index number of the variable, if it is defined as an array variable

property influence_factor: float#

Influence factor of the uncertainty of the variable This value equals alpha squared. All influence factors of a design point sum up to 1.

property u: float#

U-value of the variable in the design point

property variable: Stochast#

Stochastic variable to which this alpha value refers

property x: float#

Physical value of the variable in the design point

class CombineSettings[source]#

Bases: FrozenObject

Settings for combining design points These settings are used by the probabilistic_library.project.CombineProject

property combine_type: CombineType#

Type of combining design points (series, parallel)

property combiner_method: CombinerMethod#

Algorithm which performs the combination of design points

class CombineType(value)[source]#

Bases: Enum

Enumeration which defines how design points are combined

parallel = 'parallel'#

AND port, the result of the combination is the probability that all of the failure conditions will happen.

series = 'series'#

OR port, the result of the combination is the probability that one of the failure conditions will happen

class CombinerMethod(value)[source]#

Bases: Enum

Enumeration which defines the algorithm to combine design points

directional_sampling = 'directional_sampling'#
hohenbichler = 'hohenbichler'#
hohenbichler_form = 'hohenbichler_form'#
importance_sampling = 'importance_sampling'#
class CompareType(value)[source]#

Bases: Enum

Enumeration which defines a comparison type

greater_than = 'greater_than'#
less_than = 'less_than'#
class DesignPoint(id=None, known_variables=None, known_design_points=None)[source]#

Bases: FrozenObject

Result of a reliability analysis, containing the reliability index and contributions of stochastic variables.

The main result of a reliability analysis is a reliability index, which can be transformed to a probability of failure. Also contributions of stochastic variables are given in the list of alphas.

Convergence information, number of samples, iterations or directions are given too. Depending on settings, samples, messages and convergence information during the calculation are reported too. If intermediate design points were generated, for example by adaptive importance sampling, they are reported in the contributing design points list.

The design point can further be used to combine it with other design points or upscale it to make a section design point applicable to a system

property alphas: list[Alpha]#

List of contributions per stochastic variable to this design point

The alphas indicate the contribution of the uncertainty of the stochastic variable to the design point. They also contain the value of the variable in the design point.

For each variable in the reliability project variables an alpha variable is present in this list. In case of an array variable, for each array entry an alpha value is present.

property contributing_design_points: list[DesignPoint]#

List of intermediate design points

They can refer to loops in importance sampling or in FORM, when several relaxation loops are allowed. When a starting point was used and generated, this will also be part of the contributing design point.

property convergence: float#

Achieved convergence with the reliability algorithm

get_plot_alphas()[source]#

Gets a plot object of the alphas in the form a pie-diagram

Return type:

<module ‘matplotlib.pyplot’ from ‘/home/runner/.cache/pypoetry/virtualenvs/probabilistic-library-UeuwKTS6-py3.11/lib/python3.11/site-packages/matplotlib/pyplot.py’>

get_plot_convergence()[source]#

Gets a plot object of the convergence against the iteration or sample index. Only available when Settings.save_convergence was set

Return type:

<module ‘matplotlib.pyplot’ from ‘/home/runner/.cache/pypoetry/virtualenvs/probabilistic-library-UeuwKTS6-py3.11/lib/python3.11/site-packages/matplotlib/pyplot.py’>

get_plot_realizations(var_x=None, var_y=None)[source]#

Gets a plot object of a scatter-plot of realizations performed by the reliability analysis. The color indicates failure or non-failure. The x-y coordinates correspond with realization input values. Only available when Settings.save_realizations was set in the settings.

Parameters:
  • var_x (str | Stochast, optional) – The stochastic variable to use for the x-axis, if omitted the variable with the greatest influence factor is used

  • var_y (str | Stochast, optional) – The stochastic variable to use for the y-axis, if omitted the variable with the one but greatest influence factor is used

Return type:

<module ‘matplotlib.pyplot’ from ‘/home/runner/.cache/pypoetry/virtualenvs/probabilistic-library-UeuwKTS6-py3.11/lib/python3.11/site-packages/matplotlib/pyplot.py’>

get_variables()[source]#

Gets a list of all stochastic variables in this design point or contributing design points

Return type:

list[Stochast]

property identifier: str#

Identifying text of the design point, generated by the reliability algorithm

property ids: DesignPointIds#

Additional information

property is_converged: bool#

Indicates whether convergence is reached

property messages: list[Message]#

List of messages generated by the reliability algorithm. Depends on the setting Settings.save_messages whether this list is provided

plot_alphas()[source]#

Shows a plot of the alphas in the form a pie-diagram

plot_convergence()[source]#

Shows a plot of the convergence against the iteration or sample index. Only available when Settings.save_convergence was set

plot_realizations(var_x=None, var_y=None)[source]#

Shows a scatter-plot of realizations performed by the reliability analysis. The color indicates failure or non-failure. The x-y coordinates correspond with realization input values. Only available when Settings.save_realizations was set in the settings.

Parameters:
  • var_x (str | Stochast, optional) – The stochastic variable to use for the x-axis, if omitted the variable with the greatest influence factor is used

  • var_y (str | Stochast, optional) – The stochastic variable to use for the y-axis, if omitted the variable with the one but greatest influence factor is used

print(decimals=4)[source]#

Prints the design point, including convergence, list of alphas and contributing design points

Parameters:

decimals (int, optional) – The number of decimals to print

property probability_failure: float#

Probability of failure, related to the reliability index

property realizations: list[Evaluation]#

List of samples calculated by the reliability algorithm. Depends on the setting Settings.save_realizations whether this list is provided

property reliability_index: float#

Reliability index, calculated by the reliability algorithm

property reliability_results: list[ReliabilityResult]#

List of convergence reports during the reliability analysis. Depends on the setting Settings.save_convergence whether this list is provided

property total_directions: int#

The total number of directions, used by the directional sampling algorithm

property total_iterations: int#

The total number of iterations, used by FORM

property total_model_runs: int#

The total number of samples

class DesignPointIds[source]#

Bases: FrozenObject

Base class for additional design point information

class DesignPointMethod(value)[source]#

Bases: Enum

Enumeration which defines how the design point is determined

center_of_angles = 'center_of_angles'#
center_of_gravity = 'center_of_gravity'#
nearest_to_mean = 'nearest_to_mean'#
class ExcludingCombineSettings[source]#

Bases: FrozenObject

Settings for combining design points exclusively These settings are used by the probabilistic_library.project.ExcludingCombineProject

property combiner_method: ExcludingCombinerMethod#

Algorithm which performs the exclusive combination of design points

class ExcludingCombinerMethod(value)[source]#

Bases: Enum

Enumeration which defines the algorithm to combine excluding design points

hohenbichler = 'hohenbichler_excluding'#
weighted_sum = 'weighted_sum'#
class FragilityCurve(id=None)[source]#

Bases: FrozenObject

Curve with a number of x-values, for which a reliability is defined

A fragility curve is similar to a probabilistic_library.statistic.Stochast with distribution type cdf_curve. A fragility curve has an additional method integrate to calculate the reliability, when the distribution of the x-values is known.

```mermaid classDiagram

class FragilityValue{

+x: float +reliability_index: float +design_point : DesignPoint

} class DesignPoint{ } class FragilityCurve{

+”derived properties” : float +integrand : Stochast +integrate() : DesignPoint

} class FragilityCurveProject{

+integrand Stochast +fragility_curve FragilityCurve +run()

} FragilityValue “*” <– FragilityCurve DesignPoint <– FragilityValue DesignPoint <– FragilityCurveProject FragilityCurve <– FragilityCurveProject

```

copy_from(source)[source]#

Copies the properties from a source fragility curve.

Parameters:

source (FragilityCurve) – The fragility curve to copy the properties from

property deviation: float#

Gets the standard deviation of the fragility curve

property fragility_values: list[FragilityValue]#

List of fragility values. Each fragility value defines a reliability index for an x-value.

Preferably the design point from which the reliability index is taken should be specified too, which improves the integrate calculation

get_cdf(x)[source]#

Gets the CDF value of the fragility curve

Parameters:

x (float) – X-value for which the CDF is requested

Return type:

float

get_pdf(x)[source]#

Gets the PDF value of the fragility curve

Parameters:

x (float) – X-value for which the PDF is requested

Return type:

float

get_quantile(quantile)[source]#

Gets the value belonging to a given quantile

Parameters:

quantile (float.) – Quantile for which the x-value is requested, must be between 0 and 1 (exclusive)

Return type:

float

get_special_values()[source]#

Gets a list of special x-values, which is useful for plotting

Return type:

list[float]

get_u_from_x(x)[source]#

Gets the u-value at a given x-value of the fragility curve

Parameters:

x (float) – X-value for which the u-value is requested

Return type:

float

get_x_from_u(u)[source]#

Gets the x-value at a given u-value of the fragility curve

Parameters:

u (float.) – U-value for which the x-value is requested

Return type:

float

integrate(integrand)[source]#

Calculates the reliability index of the fragility curve if the distribution of the x-values in the fragility_values is given. Results in a design point.

The calculation is performed by integration over the possible x-values. If the design points in the fragility values are given, the alpha values in the resulting design point are based on the design points in the fragility_values.

Parameters:

integrand (Stochast.) – Stochastic variable describing the distribution of the x-values in the ‘fragility_values’

Return type:

DesignPoint

property mean: float#

Gets the mean of the fragility curve

property name: str#

Identifying name of the fragility curve

property variation: float#

Gets the variation coefficient of the fragility curve

class FragilityCurveProject[source]#

Bases: FrozenObject

Project to calculate the reliability of a fragility curve when the distribution of the x-values of the fragility_valus of the fragility curve is known.

This class is used internally by the FragilityCurve.integrate method.

property design_point: DesignPoint#

Resulting design point

property fragility_curve: FragilityCurve#

fragility curve to be integrated

property integrand: Stochast#

Stochastic variable describing the distribution of the x-values in the FragilityCurve.fragility_values

run()[source]#

Performs the integration

class GradientType(value)[source]#

Bases: Enum

Enumeration which defines how a gradient is calculated

double = 'double'#
single = 'single'#
class LimitStateFunction(id=None)[source]#

Bases: FrozenObject

Defines how model output is transformed to a z-value, which is used by reliability analyses.

A reliability algorithm only uses a z-value, where a value < 0 indicates failure and a value >= 0 indicates no failure. A model produces several output values in the form of an array, where each array value is related to an output parameter of the model. This class allows the user to select an output parameter and compare it against a critical value.

A limit state function should be added to a reliability project. If not added, the reliability algorithm uses the first value of the model output array and interprets it as the z-value.

property compare_type: CompareType#

The way the output parameter is compared with a critical value (greater than, less than)

property critical_value: float#

The critical value with which the output parameter is compared This can be a numerical value or another model parameter (input or output)

property parameter: str#

The output probabilistic_library.project.ModelParameter to be used

class MessageType(value)[source]#

Bases: Enum

Indicates the severity of a message Only in case of message type ‘error’ a calculation is not allowed or has failed

debug = 'debug'#
error = 'error'#
info = 'info'#
warning = 'warning'#
class ReliabilityMethod(value)[source]#

Bases: Enum

Enumeration which defines the algorithm to perform a reliability analysis

adaptive_importance_sampling = 'adaptive_importance_sampling'#
cobyla_reliability = 'cobyla_reliability'#
crude_monte_carlo = 'crude_monte_carlo'#
directional_sampling = 'directional_sampling'#
directional_sampling_then_form = 'directional_sampling_then_form'#
form = 'form'#
form_then_directional_sampling = 'form_then_directional_sampling'#
importance_sampling = 'importance_sampling'#
latin_hypercube = 'latin_hypercube'#
numerical_bisection = 'numerical_bisection'#
numerical_integration = 'numerical_integration'#
subset_simulation = 'subset_simulation'#
class ReliabilityResult(id=None)[source]#

Bases: FrozenObject

Contains the intermediate reliability index and convergence during a reliability analysis

property convergence: float#

Intermediate convergence index in the reliability analysis

property index: int#

Index of a realization or iteration in the reliability analysis to which the reliability index and convergence belong

property reliability_index: float#

Intermediate reliability index in the reliability analysis

class SampleMethod(value)[source]#

Bases: Enum

Enumeration which defines how samples are generated in the subset simulation algorithm

adaptive_conditional = 'adaptive_conditional'#
markov_chain = 'markov_chain'#
class Settings(id_=None)[source]#

Bases: FrozenObject

Settings of a reliability algorithm

Settings of all reliability algorithms are combined in this class. Often settings only apply to a selected number of algorithms. Settings per variable are listed in stochast_settings.

The settings are divided into the following categories:

Algorithm settings: Settings which are used to control the algorithm, such as the number of allowed samples and the convergence criterion.

Runtime settings: Settings to control how model executions take place and which additional output to produce. These settings do not influence the calculated reliability index and alpha values.

property all_quadrants: bool#

Indicates whether all quadrants should be evaluated, only used by sphere search

property design_point_method: DesignPointMethod#

Defines the algorithm how the design point is derived

property epsilon_beta: float#

Convergence criterion for FORM, using the maximum allowed predicted uncertainty in reliability index

property fraction_failed: float#

Indicates the fraction of failed samples. Criterion for adaptive importance sampling whether to perform another importance sampling loop

property gradient_type: GradientType#

Method to determine the gradient of a model

property is_repeatable_random: bool#

Indicates whether in each run the same random samples will be generated

is_valid()[source]#

Indicates whether the settings are valid

Return type:

bool

property max_parallel_processes: int#

The number of parallel executions of model evaluations

The maximum number of steps in sphere search to determine the starting point

property maximum_directions: int#

The maximum number of directions to be used, only for directional sampling

property maximum_iterations: int#

The maximum number of iterations to be used

property maximum_samples: int#

The maximum number of samples to be used

property maximum_variance_loops: int#

Maximum number of importance sampling loops, used by adaptive importance sampling

property minimum_directions: int#

The minimum number of directions to be used, only for directional sampling

property minimum_iterations: int#

The minimum number of iterations to be used

property minimum_samples: int#

The minimum number of samples to be used

property minimum_variance_loops: int#

Minimum number of importance sampling loops, used by adaptive importance sampling

property random_seed: int#

Seed number for the random generator

property relaxation_factor: float#

Relaxation factor, used by FORM

property relaxation_loops: int#

Number of relaxation loops. In case of no convergence, the relaxation factor is decreased until convergence is found, used by FORM

property reliability_method: ReliabilityMethod#

Defines the reliability algorithm

property reuse_calculations: bool#

Indicates whether prior model results will be reused by the reliability analysis.

This will speed up calculations when several analyses are performed, for which the same realizations will have to be executed, for example a Crude Monte Carlo analysis with different limit state definitions. But when a modification to the model is made, which is beyond the scope of the model definition, this leads to undesired results

property sample_method: SampleMethod#

The way samples are generated for the subset simulation algorithm

property save_convergence: bool#

Indicates whether information about convergence of the reliability analysis should be saved If saved, convergence data will be part of the design point

property save_messages: bool#

Indicates whether messages generated by the reliability analysis will be saved If saved, messages will be part of the design point

property save_realizations: bool#

Indicates whether samples should be saved If saved, the samples will be part of the design point

property start_method: StartMethod#

Defines the starting point of the algorithm

property step_size: float#

Step size in finding the gradient of a model, defined in u-space

property stochast_settings: list[StochastSettings]#

List of settings specified per stochastic variable

validate()[source]#

Prints the validity of the settings

property variation_coefficient: float#

Convergence criterion, used by Monte Carlo family algorithms

class StartMethod(value)[source]#

Bases: Enum

Enumeration which defines the starting point of some reliability algorithms

fixed_value = 'fixed_value'#
one = 'one'#
class StochastSettings(variable)[source]#

Bases: FrozenObject

Defines reliability or uncertainty settings for a stochastic variable

These settings are part of reliability settings or uncertainty settings. When using a project, these settings are generated automatically.

property intervals: int#

The number of intervals for this stochastic variable, used by numerical integration

property is_initialization_allowed: bool#

Indicates whether the value in the starting point can be generated (true) or that the start_value is used (false)

property is_variance_allowed: bool#

Indicates whether the starting point is updated for this stochastic variable, used by adaptive importance sampling

property max_value: float#

The maximum value which will be assigned to the stochastic variable in an analysis

property min_value: float#

The minimum value which will be assigned to the stochastic variable in an analysis

property start_value: float#

The value of the starting point for this stochastic variable in an analysis

property variable: Stochast#

The stochastic variable to which these settings apply This value cannot be set. A project generates these settings automatically when a model is set to the project.

property variance_factor: float#

The variance factor for this stochastic variable, used by importance sampling