14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- r''' Scale up a load sequence to incorporate safety factors for FKM
17
+ """ Scale up a load sequence to incorporate safety factors for FKM
18
18
nonlinear lifetime assessment.
19
19
20
- Given a pandas Series of load values, return a scaled version where the safety has been incorporated.
21
- The series is scaled by a constant value :math:`\gamma_L`, which models the distribution of the load,
22
- the severity of the failure (modeled by :math:`P_A`) and the considered load probability of either
23
- :math:`P_L=2.5 \%` or :math:`P_L=50 \%`.
20
+ Given a pandas Series of load values, return a scaled version where the safety
21
+ has been incorporated. The series is scaled by a constant value
22
+ :math:`\gamma_L`, which models the distribution of the load, the severity of
23
+ the failure (modeled by :math:`P_A`) and the considered load probability of
24
+ either :math:`P_L=2.5 \%` or :math:`P_L=50 \%`.
24
25
25
- The FKM nonlinear guideline defines three possible methods to consider the statistical distribution of the load:
26
+ The FKM nonlinear guideline defines three possible methods to consider the
27
+ statistical distribution of the load:
26
28
27
29
* a normal distribution with given standard deviation, $s_L$
28
30
* a logarithmic-normal distribution with given standard deviation $LSD_s$
29
- * an unknown distribution, use the constant factor :math:`\gamma_L=1.1` for $P_L = 2.5\%$
31
+ * an unknown distribution, use the constant factor :math:`\gamma_L=1.1` for
32
+ $P_L = 2.5\%$
30
33
31
- For these three methods, there exist the three accessors `fkm_safety_normal_from_stddev`, `fkm_safety_lognormal_from_stddev`,
32
- and `fkm_safety_blanket`.
34
+ For these three methods, there exist the three accessors
35
+ `fkm_safety_normal_from_stddev`, `fkm_safety_lognormal_from_stddev`, and
36
+ `fkm_safety_blanket`.
33
37
34
- The resulting scaling factor can be retrieved with ``.gamma_L(input_parameters)``, the scaled load series can be obtained
35
- with ``.scaled_load_sequence(input_parameters)``.
38
+ The resulting scaling factor can be retrieved with
39
+ ``.gamma_L(input_parameters)``, the scaled load series can be obtained with
40
+ ``.scaled_load_sequence(input_parameters)``.
36
41
37
42
Examples
38
43
--------
39
- Assuming ``load_sequence`` is a pandas Series of load values and ``input_parameters`` is a series containing the required
40
- parameters, apply the three possible scaling methods as follows:
41
44
45
+ >>> input_parameters = pd.Series({"P_A": 1e-5, "P_L": 50, "s_L": 10, "LSD_s": 1e-2,})
46
+ >>> load_sequence = pd.Series([100.0, 150.0, 200.0], name="load")
42
47
>>> # uses input_parameters.s_L, input_parameters.P_L, input_parameters.P_A
43
- >>> scaled_load_sequence = load_sequence.fkm_safety_normal_from_stddev.scaled_load_sequence(input_parameters)
48
+ >>> load_sequence.fkm_safety_normal_from_stddev.scaled_load_sequence(input_parameters)
49
+ 0 114.9450
50
+ 1 172.4175
51
+ 2 229.8900
52
+ Name: load, dtype: float64
44
53
45
54
>>> # uses input_parameters.s_L, input_parameters.P_L, input_parameters.P_A
46
- >>> scaled_load_sequence = load_sequence.fkm_safety_lognormal_from_stddev.scaled_load_sequence(input_parameters)
55
+ >>> load_sequence.fkm_safety_lognormal_from_stddev.scaled_load_sequence(input_parameters)
56
+ 0 107.124794
57
+ 1 160.687191
58
+ 2 214.249588
59
+ Name: load, dtype: float64
47
60
48
61
>>> # uses input_parameters.P_L
49
- >>> scaled_load_sequence = load_sequence.fkm_safety_blanket.scaled_load_sequence(input_parameters)
62
+ >>> load_sequence.fkm_safety_blanket.scaled_load_sequence(input_parameters)
63
+ 0 100.0
64
+ 1 150.0
65
+ 2 200.0
66
+ Name: load, dtype: float64
50
67
51
- '''
68
+ """
52
69
53
70
__author__ = "Benjamin Maier"
54
71
__maintainer__ = __author__
60
77
@pd .api .extensions .register_dataframe_accessor ("fkm_load_sequence" )
61
78
@pd .api .extensions .register_series_accessor ("fkm_load_sequence" )
62
79
class FKMLoadSequence (PylifeSignal ):
63
- ''' Base class used by the safety scaling method. It is used to compute the beta parameter
80
+ """ Base class used by the safety scaling method. It is used to compute the beta parameter
64
81
and to scale the load sequence by a constant gamma_L.
65
82
66
83
This class can be used from user code to scale a load sequence, potentially on a mesh with other fields set for every node.
@@ -86,7 +103,7 @@ class FKMLoadSequence(PylifeSignal):
86
103
87
104
# scale the load sequence by the factor 2, note that col2 is not scaled
88
105
mesh.fkm_load_sequence.scaled_by_constant(2)
89
- '''
106
+ """
90
107
91
108
def scaled_by_constant (self , gamma_L ):
92
109
"""
@@ -226,7 +243,7 @@ def _get_beta(self, input_parameters):
226
243
@pd .api .extensions .register_dataframe_accessor ("fkm_safety_normal_from_stddev" )
227
244
@pd .api .extensions .register_series_accessor ("fkm_safety_normal_from_stddev" )
228
245
class FKMLoadDistributionNormal (FKMLoadSequence ):
229
- r''' Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
246
+ r""" Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
230
247
as used in FKM nonlinear lifetime assessments.
231
248
232
249
The loads are assumed to follow a **normal distribution** with standard deviation :math:`s_L`.
@@ -239,7 +256,7 @@ class FKMLoadDistributionNormal(FKMLoadSequence):
239
256
See also
240
257
--------
241
258
:class:`AbstractFKMLoadDistribution`: accesses meshes with connectivity information
242
- '''
259
+ """
243
260
244
261
def gamma_L (self , input_parameters ):
245
262
r"""Compute the scaling factor :math:`\gamma_L=(L_\text{max} + \alpha_L) / L_\text{max}`.
@@ -324,7 +341,7 @@ def scaled_load_sequence(self, input_parameters):
324
341
@pd .api .extensions .register_dataframe_accessor ("fkm_safety_lognormal_from_stddev" )
325
342
@pd .api .extensions .register_series_accessor ("fkm_safety_lognormal_from_stddev" )
326
343
class FKMLoadDistributionLognormal (FKMLoadSequence ):
327
- r''' Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
344
+ r""" Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
328
345
as used in FKM nonlinear lifetime assessments.
329
346
330
347
The loads are assumed to follow a **lognormal distribution** with standard deviation :math:`LSD_s`.
@@ -337,7 +354,7 @@ class FKMLoadDistributionLognormal(FKMLoadSequence):
337
354
See also
338
355
--------
339
356
:class:`AbstractFKMLoadDistribution`: accesses meshes with connectivity information
340
- '''
357
+ """
341
358
342
359
def gamma_L (self , input_parameters ):
343
360
r"""Compute the scaling factor :math:`\gamma_L`.
@@ -413,7 +430,7 @@ def scaled_load_sequence(self, input_parameters):
413
430
@pd .api .extensions .register_dataframe_accessor ("fkm_safety_blanket" )
414
431
@pd .api .extensions .register_series_accessor ("fkm_safety_blanket" )
415
432
class FKMLoadDistributionBlanket (FKMLoadSequence ):
416
- r''' Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
433
+ r""" Series accessor to get a scaled up load series, i.e., a list of load values with included load safety,
417
434
as used in FKM nonlinear lifetime assessments.
418
435
419
436
The distribution of loads is unknown, therefore a scaling factor of :math:`\gamma_L` = 1.1 is assumed.
@@ -426,7 +443,7 @@ class FKMLoadDistributionBlanket(FKMLoadSequence):
426
443
See also
427
444
--------
428
445
:class:`AbstractFKMLoadDistribution`: accesses meshes with connectivity information
429
- '''
446
+ """
430
447
431
448
def gamma_L (self , input_parameters ):
432
449
r"""Compute the scaling factor :math:`\gamma_L`.
0 commit comments