The utils.functions module#

Provide fatigue statistics helper functions.

pylife.utils.functions.rossow_cumfreqs(N)[source]#

Estimate cumulative frequencies according to Rossow.

Use this estimator to assign plotting positions to sorted fatigue test samples before fitting them in probability paper. The estimate gives the probability that the next observation is below the i-th value of N sorted samples [Rossow1964].

Parameters:

N (int) – Sample size of the statistical population.

Returns:

Estimated cumulative frequencies for the N sorted samples.

Return type:

numpy.ndarray

Notes

For one-based sample ranks \(i = 1, \ldots, N\), Rossow’s estimator computes the cumulative frequency as

\[P_i = \frac{3 i - 1}{3 N + 1}\]

The estimates are symmetric around 0.5 and sum to N / 2.

References

[Rossow1964]

Rossow, E., “Statistics of Metal Fatigue in Engineering”, page 16.

Examples

>>> from pylife.utils.functions import rossow_cumfreqs
>>> rossow_cumfreqs(1)
array([0.5])
>>> rossow_cumfreqs(3)
array([0.2, 0.5, 0.8])
>>> round(float(rossow_cumfreqs(4).sum()), 6)
2.0
pylife.utils.functions.scattering_range_to_std(T)[source]#

Convert a fatigue scattering range to a log-standard deviation.

The scattering range T is the ratio of the 90 % quantile to the 10 % quantile of a log-normal distribution, as used for TS and TN in DIN 50100:2016-12. The returned standard deviation is the normal standard deviation of the base-10 logarithm of the quantity.

Parameters:

T (float) – Scattering range as the 90 %/10 % quantile ratio of a log-normal distribution.

Returns:

Standard deviation in log10 units corresponding to T.

Return type:

float

See also

pylife.utils.functions.std_to_scattering_range

Convert a log10 standard deviation to a scattering range.

Notes

The conversion follows from the symmetric 10 % and 90 % quantiles of a normal distribution in log10 space:

\[\sigma_{\log_{10}} = \frac{\log_{10}(T)}{2 \Phi^{-1}(0.9)}\]

where \(\Phi^{-1}\) is the inverse standard normal cumulative distribution function.

Examples

>>> from pylife.utils.functions import scattering_range_to_std, std_to_scattering_range
>>> round(float(scattering_range_to_std(10.0)), 6)
0.390152
>>> round(float(std_to_scattering_range(scattering_range_to_std(1.25))), 6)
1.25
pylife.utils.functions.std_to_scattering_range(std)[source]#

Convert a log-standard deviation to a fatigue scattering range.

The scattering range T is the ratio of the 90 % quantile to the 10 % quantile of a log-normal distribution, as used for TS and TN in DIN 50100:2016-12. The input std is the standard deviation of the base-10 logarithm of the quantity.

Parameters:

std (float) – Standard deviation in log10 units.

Returns:

Scattering range as the 90 %/10 % quantile ratio of a log-normal distribution.

Return type:

float

See also

pylife.utils.functions.scattering_range_to_std

Convert a scattering range to a log10 standard deviation.

Notes

The conversion is the inverse of pylife.utils.functions.scattering_range_to_std():

\[T = 10^{2 \Phi^{-1}(0.9) \sigma_{\log_{10}}}\]

where \(\Phi^{-1}\) is the inverse standard normal cumulative distribution function.

Examples

>>> from pylife.utils.functions import scattering_range_to_std, std_to_scattering_range
>>> round(float(std_to_scattering_range(0.39015207303618954)), 6)
10.0
>>> round(float(scattering_range_to_std(std_to_scattering_range(0.2))), 6)
0.2