The fkm_load_distribution module

Scale up a load sequence to incorporate safety factors for FKM nonlinear lifetime assessment.

Given a pandas Series of load values, return a scaled version where the safety has been incorporated. The series is scaled by a constant value \(\gamma_L\), which models the distribution of the load, the severity of the failure (modeled by \(P_A\)) and the considered load probability of either \(P_L=2.5 \%\) or \(P_L=50 \%\).

The FKM nonlinear guideline defines three possible methods to consider the statistical distribution of the load:

  • a normal distribution with given standard deviation, $s_L$

  • a logarithmic-normal distribution with given standard deviation $LSD_s$

  • an unknown distribution, use the constant factor \(\gamma_L=1.1\) for $P_L = 2.5%$

For these three methods, there exist the three accessors fkm_safety_normal_from_stddev, fkm_safety_lognormal_from_stddev, and fkm_safety_blanket.

The resulting scaling factor can be retrieved with .gamma_L(input_parameters), the scaled load series can be obtained with .scaled_load_sequence(input_parameters).

Examples

Assuming load_sequence is a pandas Series of load values and input_parameters is a series containing the required parameters, apply the three possible scaling methods as follows:

>>> # uses input_parameters.s_L, input_parameters.P_L, input_parameters.P_A
>>> scaled_load_sequence = load_sequence.fkm_safety_normal_from_stddev.scaled_load_sequence(input_parameters)
>>> # uses input_parameters.s_L, input_parameters.P_L, input_parameters.P_A
>>> scaled_load_sequence = load_sequence.fkm_safety_lognormal_from_stddev.scaled_load_sequence(input_parameters)
>>> # uses input_parameters.P_L
>>> scaled_load_sequence = load_sequence.fkm_safety_blanket.scaled_load_sequence(input_parameters)
class pylife.strength.fkm_load_distribution.FKMLoadDistributionBlanket(pandas_obj)[source]
Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,

as used in FKM nonlinear lifetime assessments.

The distribution of loads is unknown, therefore a scaling factor of \(\gamma_L\) = 1.1 is assumed. This is only used for \(P_L = 2.5\%\). As an alternative, we can use no scaling for the load distribution at all, corresponding to \(\gamma_L\) = 1 and \(P_L = 50\%\)

For more information, see 2.3.2.3 of the FKM nonlinear guideline.

See also

AbstractFKMLoadDistribution

accesses meshes with connectivity information

gamma_L(input_parameters)[source]

Compute the scaling factor \(\gamma_L\).

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, has to be on of {2.5, 50}. (de: Ausfallwahrscheinlichkeit)

Raises:

ValueError – If not all parameters which are required were given.

Returns:

gamma_L – The resulting scaling factor.

Return type:

float

scaled_load_sequence(input_parameters)[source]

The scaled load sequence according to the given parameters.

The following parameters are used: LSD_s, P_L, P_A.

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, one of {2.5, 50}

Raises:

ValueError – If not all parameters which are required were given.

Returns:

The input series where all values have been scaled by \(\gamma_L\), see 2.3.2.2 of the FKM nonlinear guideline.

Return type:

pandas Series

class pylife.strength.fkm_load_distribution.FKMLoadDistributionLognormal(pandas_obj)[source]
Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,

as used in FKM nonlinear lifetime assessments.

The loads are assumed to follow a lognormal distribution with standard deviation \(LSD_s\). To incorporate safety, reduce the values of the load series from \(P_L = 50\%\) up to the given load probability \(P_L\) and the given failure probability \(P_A\).

For more information, see 2.3.2.2 of the FKM nonlinear guideline.

See also

AbstractFKMLoadDistribution

accesses meshes with connectivity information

gamma_L(input_parameters)[source]

Compute the scaling factor \(\gamma_L\).

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.LSD_s: standard deviation of the lognormal distribution

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, one of {2.5, 50}

  • input_parameters.P_A: probability in [%], one of {1e-7, 1e-6, 1e-5, 7.2e-5, 1e-3, 2.3e-1, 0.5} (de: Ausfallwahrscheinlichkeit)

Raises:

ValueError – If not all parameters that are required were given.

Returns:

gamma_L – The resulting scaling factor.

Return type:

float

scaled_load_sequence(input_parameters)[source]

The scaled load sequence according to the given parameters.

The following parameters are used: LSD_s, P_L, P_A.

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.LSD_s: standard deviation of the lognormal distribution

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, one of {2.5, 50}

  • input_parameters.P_A: probability in [%], one of {1e-7, 1e-6, 1e-5, 7.2e-5, 1e-3, 2.3e-1, 0.5} (de: Ausfallwahrscheinlichkeit)

Raises:

ValueError – If not all parameters which are required were given.

Returns:

The input series where all values have been scaled by \(\gamma_L\), see 2.3.2.2 of the FKM nonlinear guideline.

Return type:

pandas Series

class pylife.strength.fkm_load_distribution.FKMLoadDistributionNormal(pandas_obj)[source]
Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,

as used in FKM nonlinear lifetime assessments.

The loads are assumed to follow a normal distribution with standard deviation \(s_L\). To incorporate safety, reduce the values of the load series from \(P_L = 50\%\) up to the given load probability \(P_L\) and the given failure probability \(P_A\).

For more information, see 2.3.2.1 of the FKM nonlinear guideline.

See also

AbstractFKMLoadDistribution

accesses meshes with connectivity information

gamma_L(input_parameters)[source]

Compute the scaling factor \(\gamma_L=(L_\text{max} + \alpha_L) / L_\text{max}\). Note that for load sequences on multiple nodes (i.e. on a full mesh), \(L_\text{max}\) is the maximum load over all nodes and load steps, not different for different nodes.

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.s_L: standard deviation of the normal distribution

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, one of {2.5, 50}

  • input_parameters.P_A: probability in [%], one of {1e-7, 1e-6, 1e-5, 7.2e-5, 1e-3, 2.3e-1, 0.5} (de: Ausfallwahrscheinlichkeit)

  • input_parameters.max_load_independently_for_nodes: optional, whether the scaling should be performed independently at every node (True), or uniformly over all nodes (False). The default value is False.

Raises:

ValueError – If not all parameters that are required were given.

Returns:

gamma_L – The resulting scaling factor.

Return type:

float

scaled_load_sequence(input_parameters)[source]

The scaled load sequence according to the given parameters.

The following parameters are used: s_L, P_L, P_A.

Parameters:

input_parameters (pandas Series) –

The parameters to specify the upscaling method.

  • input_parameters.s_L: standard deviation of the normal distribution

  • input_parameters.P_L: probability in [%] of the load for which to do the assessment, one of {2.5, 50}

  • input_parameters.P_A: probability in [%], one of {1e-7, 1e-6, 1e-5, 7.2e-5, 1e-3, 2.3e-1, 0.5} (de: Ausfallwahrscheinlichkeit)

Raises:

ValueError – If not all parameters that are required were given.

Returns:

The input series where all values have been scaled by \(\gamma_L\), see 2.3.2.1 of the FKM nonlinear guideline.

Return type:

pandas Series

class pylife.strength.fkm_load_distribution.FKMLoadSequence(pandas_obj)[source]

Base class used by the safety scaling method. It is used to compute the beta parameter and to scale the load sequence by a constant gamma_L.

This class can be used from user code to scale a load sequence, potentially on a mesh with other fields set for every node. In such a case, the other fields are not modified.

Example

import pandas as pd
import pylife.strength.fkm_load_distribution

# create an example load sequence with stress (S_v) and an arbitrary other column (col2)
mesh = pd.DataFrame(
    index=pd.MultiIndex.from_product([range(2), range(4)], names=["load_step", "node_id"]),
    data={
        "S_v": [10, 20, -10, -20, 30, 60, 40, 80],
        "col2":  [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
    })
print(mesh)

# scale the load sequence by the factor 2, note that col2 is not scaled
mesh.fkm_load_sequence.scaled_by_constant(2)
                   S_v  col2
load_step node_id           
0         0         10   0.2
          1         20   0.3
          2        -10   0.4
          3        -20   0.5
1         0         30   0.6
          1         60   0.7
          2         40   0.8
          3         80   0.9
S_v col2
load_step node_id
0 0 20 0.2
1 40 0.3
2 -20 0.4
3 -40 0.5
1 0 60 0.6
1 120 0.7
2 80 0.8
3 160 0.9
maximum_absolute_load(max_load_independently_for_nodes=False)[source]

Get the maximum absolute load over all nodes and load steps.

This is implemented for pd.Series (where the index is just the index of the load step), pd.DataFrame with one column (where the index is a MultiIndex of load_step and node_id), and pd.DataFrame with multiple columns with the load is given in the first column.

Parameters:

max_load_independently_for_nodes (bool, optional) – If the maximum absolute should be computed separately for every node. If set to False, a single maximum value is computed over all nodes. The default is False, which means the whole mesh will be assessed by the same maximum load. This, however, means that calculating the FKM nonlinear assessment for the whole mesh at once yields a different result than calculating the assessment for every single node one after each other. (When doing it all at once, the maximum absolute load used for the failure probability is the maximum of the loads at every node, when doing it only for a single node, the maximum absolute load value may be lower.)

Returns:

L_max – The maximum absolute load.

Return type:

float

scaled_by_constant(gamma_L)[source]

Scales the load sequence by the given constant gamma_L. This method basically computes gamma_L * self._obj. The data in self._obj is either a pandas.Series, a pandas.DataFrame with a single column or a pandas.DataFrame with multiple columns (usually two for stress and stress gradient). In the case of a Series or only one column, it simply scales all values by the factor gamma_L. In the case of a DataFrame with multiple columns, it only scales the first column by the factor gamma_L and keeps the other columns unchanged.

Returns a scaled copy of the data.

Parameters:

gamma_L (float) – scaling factor for the load sequence.

Return type:

The scaled load sequence.