The failure_probability module

class pylife.strength.failure_probability.FailureProbability(strength_median, strength_std)[source]

Strength representation to calculate failure probabilities

The strength is represented as a log normal distribution of strength_median and strength_std.

Failure probabilities can be calculated for a given load or load distribution.

Parameters:
  • strength_median (array_like, shape (N, )) – The median value of the strength
  • strength_std (array_like, shape (N, )) – The standard deviation of the strength

Note

We assume that the load and the strength are statistically distributed values. In case the load is higher than the strength we get failure. So if we consider a quantile of our load distribution of a probability p_load, the probability of failure due to a load of this quantile is p_load times the probability that the strength lies within this quantile or below.

So in order to calculate the total failure probability, we need to integrate the load’s pdf times the strength’ cdf from -inf to +inf.

pf_arbitrary_load(load_values, load_pdf)[source]

Calculates the failure probability for an arbitrary load

Parameters:
  • load_values (array_like, shape (N,)) – The load values of the load distribution
  • load_pdf (array_like, shape (N, )) – The probability density values for the load_value values to occur
Returns:

failure probability

Return type:

numpy.ndarray or float

pf_norm_load(load_median, load_std, lower_limit=None, upper_limit=None)[source]

Failure probability for a log normal distributed load

Parameters:
  • load_median (array_like, shape (N,) consistent with class parameters) – The median of the load distribution for which the failure probability is calculated.
  • load_std (array_like, shape (N,) consistent with class parameters) – The standard deviation of the load distribution
  • lower_limit (float, optional) – The lower limit of the integration, default None
  • upper_limit (float, optional) – The upper limit of the integration, default None
Returns:

failure probability

Return type:

numpy.ndarray or float

Notes

The log normal distribution of the load is determined by the load parameters. Only load distribution between lower_limit and upper_limit is considered.

For small values for load_std this function gives the same result as pf_simple_load.

Note

The load and strength distributions are transformed in a way, that the median of the load distribution is zero. This guarantees that in any case we can provide a set of relevant points to take into account for the integration.

pf_simple_load(load)[source]

Failure probability for a simple load value

Parameters:load (array_like, shape (N,) consistent with class parameters) – The load of for which the failure probability is calculated.
Returns:failure probability
Return type:numpy.ndarray or float

Notes

This is the case of a non statistical load. So failure occurs if the strength is below the given load, i.e. the strength’ cdf at the load.