Skip to content

Commit

Permalink
Merge pull request #75 from dpzhuX/docs
Browse files Browse the repository at this point in the history
docs/updated fdr to fdm
  • Loading branch information
Dorothydingzx authored Jan 26, 2023
2 parents cb54cc9 + 96a756f commit 36104a3
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 104 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ All notable changes to this project will be documented in this file.
- (rrm) `fosm` was changed to `mvalFOSM`
- (rrm) `formHLRF` was changed to `hlrfFORM`
- (rrm) `formCOPT` was changed to `coptFORM`
- (fdr) fatigue damage rule was changed to (fdm) fatigue damage model
- (utils) `sequencePeakAndValleys` was changed to `sequencePeakValleyFilter`
- (utils) `FitterForSnCurve` was changed to `SnCurveFitter`

### Fixed

## [ 0.3.0 ] - 2023-01-08

### Added
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ See the package document for more details and examples.

## Contents

* Fatigue damage rule
* Palmgren-miner damage rule
* Naive Palmgren-miner damage rule
* Classic Palmgren-miner damage rule
* Fatigue damage model
* Palmgren-miner damage model
* Naive Palmgren-miner damage model
* Classic Palmgren-miner damage model

* Load correction and counting
* ASTM counting
Expand Down
6 changes: 3 additions & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Module API
==========

``fdr`` fatigue damage rule
---------------------------
``fdm`` fatigue damage model
----------------------------
.. toctree::
:maxdepth: 2

moduleApi/fdr
moduleApi/fdm

``lcc`` load correction and counting
------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions docs/source/fatigue damage model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fatigue damage model ( fdm )
======================================

.. toctree::
:maxdepth: 2

moduleCookbook/fdmPalmgrenMinerDamageModel
7 changes: 0 additions & 7 deletions docs/source/fatigue damage rule.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Contents
:maxdepth: 2
:caption: Cookbook:

fatigue damage rule
fatigue damage model
load correction and counting
load sequence generator
load spectra and matrices
Expand Down
5 changes: 5 additions & 0 deletions docs/source/moduleApi/fdm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Palmgren-miner damage model
---------------------------

.. automodule:: ffpack.fdm.minerModel
:members:
5 changes: 0 additions & 5 deletions docs/source/moduleApi/fdr.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
"id": "59a78634-b651-4aca-8d35-9eb18d2d0ebe",
"metadata": {},
"source": [
"## Palmgren-miner damage rule"
"## Palmgren-miner damage model"
]
},
{
"cell_type": "markdown",
"id": "829f716d-ed1d-4bb2-80b3-d2cb3f2db4c2",
"metadata": {},
"source": [
"Palmgren-miner damage rule also known as the linear damage rule is one of the famous damage rules used in the engineering field. Based on the Palmgren-miner's rule, the cumulative damage can be expressed by the following equation,\n",
"Palmgren-miner damage model also known as the linear damage model is one of the famous damage models used in the engineering field. Based on the Palmgren-miner's model, the cumulative damage can be expressed by the following equation,\n",
"\n",
"$$D = \\sum \\frac{C_i}{F_i}$$\n",
"\n",
"where $C_i$ and $F_i$ are the counting cycles and the failure cycles at a specific load level.\n",
"\n",
"In essence, the Palmgren-miner damage rule treats the fatigue damage on different load levels separately. Therefore, the total damage can be calculated by adding the damage from each load level. Although a discrepancy can be found between the experimental results and the Palmgren-miner damage rule, it is still widely used due to its simplicity.\n",
"In essence, the Palmgren-miner damage model treats the fatigue damage on different load levels separately. Therefore, the total damage can be calculated by adding the damage from each load level. Although a discrepancy can be found between the experimental results and the Palmgren-miner damage model, it is still widely used due to its simplicity.\n",
"\n",
"Reference: \n",
"\n",
Expand All @@ -32,17 +32,17 @@
"id": "3ed8bda0-48fa-4c3f-8f60-11cff92c965e",
"metadata": {},
"source": [
"### Naive Palmgren-miner damage rule"
"### Naive Palmgren-miner damage model"
]
},
{
"cell_type": "markdown",
"id": "6fdf4826-ebd3-4447-b70e-20e6525f2073",
"metadata": {},
"source": [
"Function `minerDamageRuleNaive` implements the native Palmgren-miner damage rule.\n",
"Function `minerDamageModelNaive` implements the native Palmgren-miner damage model.\n",
"\n",
"The naive Palmgren-miner damage rule refers to the damage calculation directly based on the aforementioned equation. When we know the counting cycles and failure cycles at each level, then the total damage can be calculated by summing the damage from all load levels."
"The naive Palmgren-miner damage model refers to the damage calculation directly based on the aforementioned equation. When we know the counting cycles and failure cycles at each level, then the total damage can be calculated by summing the damage from all load levels."
]
},
{
Expand All @@ -63,10 +63,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function minerDamageRuleNaive in module ffpack.fdr.minerRule:\n",
"Help on function minerDamageModelNaive in module ffpack.fdm.minerModel:\n",
"\n",
"minerDamageRuleNaive(fatigueData)\n",
" Naive Palmgren-miner damage rule directly calcuates the damage results.\n",
"minerDamageModelNaive(fatigueData)\n",
" Naive Palmgren-miner damage model directly calcuates the damage results.\n",
" \n",
" Parameters\n",
" ----------\n",
Expand All @@ -79,7 +79,7 @@
" Returns\n",
" -------\n",
" rst: scalar\n",
" Fatigue damage calculated based on the Palmgren-miner rule\n",
" Fatigue damage calculated based on the Palmgren-miner model\n",
" \n",
" Raises\n",
" ------\n",
Expand All @@ -92,16 +92,16 @@
" \n",
" Examples\n",
" --------\n",
" >>> from ffpack.fdr import minerDamageRuleNaive\n",
" >>> from ffpack.fdm import minerDamageModelNaive\n",
" >>> fatigueData = [ [ 10, 100 ], [ 200, 2000 ] ]\n",
" >>> rst = minerDamageRuleNaive( fatigueData )\n",
" >>> rst = minerDamageModelNaive( fatigueData )\n",
"\n"
]
}
],
"source": [
"from ffpack.fdr import minerDamageRuleNaive\n",
"help( minerDamageRuleNaive )"
"from ffpack.fdm import minerDamageModelNaive\n",
"help( minerDamageModelNaive )"
]
},
{
Expand All @@ -121,7 +121,7 @@
"source": [
"nmdrFatigueData = [ [ 10, 100 ], [ 200, 2000 ] ]\n",
"\n",
"nmdrResults = minerDamageRuleNaive( nmdrFatigueData )"
"nmdrResults = minerDamageModelNaive( nmdrFatigueData )"
]
},
{
Expand All @@ -147,17 +147,17 @@
"id": "81c2578b-63af-4db0-815d-293c7663d1ae",
"metadata": {},
"source": [
"### Classic Palmgren-miner damage rule"
"### Classic Palmgren-miner damage model"
]
},
{
"cell_type": "markdown",
"id": "fe2000e7-f368-4788-9e22-d5cd038b85d9",
"metadata": {},
"source": [
"Function `minerDamageRuleClassic` implements the classic Palmgren-miner damage rule.\n",
"Function `minerDamageModelClassic` implements the classic Palmgren-miner damage model.\n",
"\n",
"The classic Palmgren-miner damage rule can calculate the total damage based on the experimental SN curve. Since the load level for counting cycles might be unavailable for failure cycles, the experimental SN curve will be fitted first and determine the failure cycles at the same load level.\n",
"The classic Palmgren-miner damage model can calculate the total damage based on the experimental SN curve. Since the load level for counting cycles might be unavailable for failure cycles, the experimental SN curve will be fitted first and determine the failure cycles at the same load level.\n",
"\n",
"**Notes**\n",
"\n",
Expand All @@ -182,10 +182,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function minerDamageRuleClassic in module ffpack.fdr.minerRule:\n",
"Help on function minerDamageModelClassic in module ffpack.fdm.minerModel:\n",
"\n",
"minerDamageRuleClassic(lccData, snData, fatigueLimit)\n",
" Classical Palmgren-miner damage rule calculates the damage results based on the SN curve.\n",
"minerDamageModelClassic(lccData, snData, fatigueLimit)\n",
" Classical Palmgren-miner damage model calculates the damage results \n",
" based on the SN curve.\n",
" \n",
" Parameters\n",
" ----------\n",
Expand All @@ -203,7 +204,7 @@
" Returns\n",
" -------\n",
" rst: scalar\n",
" Fatigue damage calculated based on the Palmgren-miner rule\n",
" Fatigue damage calculated based on the Palmgren-miner model.\n",
" \n",
" Raises\n",
" ------\n",
Expand All @@ -213,18 +214,18 @@
" \n",
" Examples\n",
" --------\n",
" >>> from ffpack.fdr import minerDamageRuleClassic\n",
" >>> from ffpack.fdr import minerDamageModelClassic\n",
" >>> lccData = [ [ 1, 100 ], [ 2, 10 ] ]\n",
" >>> snData = [ [ 10, 3 ], [ 1000, 1 ] ]\n",
" >>> fatigueLimit = 0.5\n",
" >>> rst = minerDamageRuleClassic( lccData, snData, fatigueLimit )\n",
" >>> rst = minerDamageModelClassic( lccData, snData, fatigueLimit )\n",
"\n"
]
}
],
"source": [
"from ffpack.fdr import minerDamageRuleClassic\n",
"help( minerDamageRuleClassic )"
"from ffpack.fdm import minerDamageModelClassic\n",
"help( minerDamageModelClassic )"
]
},
{
Expand All @@ -246,7 +247,7 @@
"cmdrSnData = [ [ 10, 3 ], [ 1000, 1 ] ]\n",
"cmdrFatigueLimit = 0.5\n",
"\n",
"cmdrResults = minerDamageRuleClassic( cmdrLccData, cmdrSnData, cmdrFatigueLimit )"
"cmdrResults = minerDamageModelClassic( cmdrLccData, cmdrSnData, cmdrFatigueLimit )"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions src/ffpack/fdm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .minerModel import *
28 changes: 15 additions & 13 deletions src/ffpack/fdr/minerRule.py → src/ffpack/fdm/minerModel.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python3

'''
Palmgren-Miner damage rule is one of the famous fatigue damage rules for
fatigue estimation. The rule is defined in a simple and intuitive way and
Palmgren-Miner damage model is one of the famous fatigue damage models for
fatigue estimation. The model is defined in a simple and intuitive way and
it is very popular now.
Reference: Miner, M.A., 1945. Cumulative damage in fatigue.
Expand All @@ -11,9 +11,9 @@
import numpy as np
from ffpack import utils

def minerDamageRuleNaive( fatigueData ):
def minerDamageModelNaive( fatigueData ):
'''
Naive Palmgren-miner damage rule directly calcuates the damage results.
Naive Palmgren-miner damage model directly calcuates the damage results.
Parameters
----------
Expand All @@ -26,7 +26,7 @@ def minerDamageRuleNaive( fatigueData ):
Returns
-------
rst: scalar
Fatigue damage calculated based on the Palmgren-miner rule
Fatigue damage calculated based on the Palmgren-miner model
Raises
------
Expand All @@ -39,9 +39,9 @@ def minerDamageRuleNaive( fatigueData ):
Examples
--------
>>> from ffpack.fdr import minerDamageRuleNaive
>>> from ffpack.fdm import minerDamageModelNaive
>>> fatigueData = [ [ 10, 100 ], [ 200, 2000 ] ]
>>> rst = minerDamageRuleNaive( fatigueData )
>>> rst = minerDamageModelNaive( fatigueData )
'''
# Edge case check
fatigueData = np.array( fatigueData )
Expand All @@ -57,14 +57,16 @@ def minerDamageRuleNaive( fatigueData ):
if p[ 1 ] <= 0:
raise ValueError( "Failure cycles should be larger than 0" )
if p[ 0 ] > p[ 1 ]:
raise ValueError( "Failure cycles should be larger than or equal counting cycles" )
raise ValueError( "Failure cycles should be larger than "
"or equal counting cycles" )

return np.sum( fatigueData[ :, 0 ] / fatigueData[ :, 1 ] )


def minerDamageRuleClassic( lccData, snData, fatigueLimit ):
def minerDamageModelClassic( lccData, snData, fatigueLimit ):
'''
Classical Palmgren-miner damage rule calculates the damage results based on the SN curve.
Classical Palmgren-miner damage model calculates the damage results
based on the SN curve.
Parameters
----------
Expand All @@ -82,7 +84,7 @@ def minerDamageRuleClassic( lccData, snData, fatigueLimit ):
Returns
-------
rst: scalar
Fatigue damage calculated based on the Palmgren-miner rule
Fatigue damage calculated based on the Palmgren-miner model.
Raises
------
Expand All @@ -92,11 +94,11 @@ def minerDamageRuleClassic( lccData, snData, fatigueLimit ):
Examples
--------
>>> from ffpack.fdr import minerDamageRuleClassic
>>> from ffpack.fdr import minerDamageModelClassic
>>> lccData = [ [ 1, 100 ], [ 2, 10 ] ]
>>> snData = [ [ 10, 3 ], [ 1000, 1 ] ]
>>> fatigueLimit = 0.5
>>> rst = minerDamageRuleClassic( lccData, snData, fatigueLimit )
>>> rst = minerDamageModelClassic( lccData, snData, fatigueLimit )
'''
# Edge case check
lccData = np.array( lccData )
Expand Down
1 change: 0 additions & 1 deletion src/ffpack/fdr/__init__.py

This file was deleted.

Loading

0 comments on commit 36104a3

Please sign in to comment.