A damage equivalent load calculator for Python written in Rust.
Project description
RustFatigue
RustFatigue is a lightweight Python package designed to calculate only one thing - the Damage Equivalent Load (DEL) from time series load data. DEL is an important metric in fatigue analysis, frequently used in the wind turbine industry and other engineering fields to estimate cumulative damage under variable loading conditions.
The core computation is implemented in Rust for high performance, wrapped with a Python interface for seamless integration into Python workflows.
Installation
pip install rust-fatigue
Usage
This package provides a single function which returns the DEL of a signal:
damage_equiv_load(signal: list[float], m: float, neq: int, half: bool=True) -> float
signal
: List or NumPy array of load values.m
: Wöhler (fatigue) exponent.neq
: Number of equivalent full-cycles.half
: Whether to count residual cycles as half-cycles (True, default) or full cycles (False).
Example
from rustfatigue import damage_equiv_load
# Example load signal
signal = [1, 2, 3, 4, 5, 6]
wohler = 4
Ncycles = 20
# Calculate Damage Equivalent Load
DEL = damage_equiv_load(signal, wohler, Ncycles)
print(f"Damage Equivalent Load: {DEL}")
# Damage Equivalent Load: 2.224235024089319
By default, residual cycles are counted as half-cycles (which is standard practice).
If you prefer a more conservative estimate by counting residuals as full cycles, set half=False
:
DEL = damage_equiv_load(signal, wohler, Ncycles, half=False)
Theory
The calculation of Damage Equivalent Load (DEL) in this package involves three main steps:
1) Peak and Trough Finding
The input time series load signal is scanned to identify local maxima (peaks) and minima (troughs). This results in a compressed signal that contains only these reversal points, significantly reducing the data size while retaining the essential fatigue-driving features.
2) Rainflow Counting
The sequence of peaks and troughs is processed using a rainflow counting algorithm. This algorithm decomposes the load history into discrete load cycles by matching turning points. The result is a set of half-cycle ranges — each representing a peak-to-peak stress difference. In this package, Rainflow counting is performed in two steps.
- Full cycle ranges (i.e. two matching half-cycles) are identified using the four point method.
- Any remaining unpaired turning points are counted as half cycles - or optionally as full-cycles for a more conservative estimate.
3) Damage Equivalent Load Calculation
From the rainflow output, the DEL is computed using the Wöhler (S–N) exponent $m$ and a target number of equivalent cycles $N_{\text{eq}}$. The calculation assumes that fatigue damage follows a power law, and each cycle contributes damage proportional to its range raised to the power $m$. The DEL $L_{\text{eq}}$ is the constant-amplitude load that would cause the same cumulative damage over $N_{\text{eq}}$ cycles:
$$ L_{\text{eq}} = \left( \frac{1}{2}\frac{\sum_{i} L_i^m}{N_{\text{eq}}} \right)^{\frac{1}{m}} $$
Where
- $L_i$ = range (peak-to-peak) of the $i$-th half-cycle
- $N_{\text{eq}}$ = number of equivalent full cycles
- $m$ = Wöhler (fatigue) exponent
- The factor $1/2$ accounts for the conversion from half-cycles to full cycles
In many textbooks and industry tools, cycle ranges are binned, and there is an additional weighting on $L_i$ to distinguish between half and full cycles. By contrast, this implementation uses no binning and operates directly on half-cycles, where a full cycle is simply represented by two matching half-cycle. This is mathematically equivalent to using an infinite number of bins and avoids the loss of precision introduced by histogram-based methods.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file rust_fatigue-0.1.7.tar.gz
.
File metadata
- Download URL: rust_fatigue-0.1.7.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8c54395c9c449edddb0e90be51897d80980045f8b9834c249586059dccaf7867
|
|
MD5 |
6d2c39ffdc2a6630048cdffd3c49a269
|
|
BLAKE2b-256 |
60533942cd11c81531b7285001487231a2049e1161ed81fce6d9557a667953dd
|
File details
Details for the file rust_fatigue-0.1.7-cp313-cp313-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 124.8 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d044f57bff6413c1e8833c30592ec7da3bee63020f453f8b6a18a3d586ee0f17
|
|
MD5 |
c41ea3fe917ecbc24e19eff8bc30d055
|
|
BLAKE2b-256 |
8c74eb12ee0dd75ba51834e7becf99475ae8bbc29fe94e3c170b09a867a52cb8
|
File details
Details for the file rust_fatigue-0.1.7-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 125.4 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d42730d8458fd3119eb1e7f782b70576f09f919bbbaa8758aa4ce5264622a508
|
|
MD5 |
1c3bc1981bd9c5ec2eb9c01950ba8a70
|
|
BLAKE2b-256 |
00d7892ef55688889e41ad741faf568af7df16e728e772ae917c7cfaa798095c
|
File details
Details for the file rust_fatigue-0.1.7-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 125.5 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a9dbb98b3b41491371dcb8d95bec7dd12a4d46ac8e0e29e416c2971f1dddd695
|
|
MD5 |
13269f5cc7db6379914abee02503925e
|
|
BLAKE2b-256 |
68f37ff566bd116d2976a7bde78185906221472cfd66ce052708a1bc25f6067a
|
File details
Details for the file rust_fatigue-0.1.7-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 125.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
e73ebf96b05b3cb8d82d022a414377f9f590215a2c9fd32f8b17c664a6b33ff4
|
|
MD5 |
acebca0ac0577a22eb41b7c95b3f2ac1
|
|
BLAKE2b-256 |
7bcafe770a9380f7a11329b43d322d87443edf899aed4e421300f28b9caf75fe
|
File details
Details for the file rust_fatigue-0.1.7-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 126.1 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b482981aa63985ff7886cc7e7c75cf8b88b6eeb26b0b8f41318f68169308e53e
|
|
MD5 |
a8960d300567edd5ef14d845454f31d3
|
|
BLAKE2b-256 |
b2783973a3b275a27ce7c60bea065ae8c12427ecf19ab4820f4b2adcd2e968fd
|
File details
Details for the file rust_fatigue-0.1.7-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: rust_fatigue-0.1.7-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 125.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
99018111738662974c33e40263518903f4e1f0e002192f3accd49826f4ca62bc
|
|
MD5 |
e819185d5e9ac826e301a972e67991a7
|
|
BLAKE2b-256 |
8cb4c9bc70f74cf2557a4358a5a268fc01d3f89fde21caf768257770562fb010
|