Skip to main content

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 two functions. The first returns the DEL of a signal:

damage_equiv_load(signal: list[float], m: float, neq: int, half: bool=True, max_closed=False) -> 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).
  • max_closed: Whether to begin the peak/trough search from the largest peak (default=False).

The second function returns the rainflow counting results of a signal in the form of a list of half cycle ranges:

rainflow_count(signal: list[float], half: bool=True) -> list[float]
  • signal: List or NumPy array of load values.
  • 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.

  1. Full cycle ranges (i.e. two matching half-cycles) are identified using the four point method.
  2. 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

rust_fatigue-0.1.8.tar.gz (28.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rust_fatigue-0.1.8-cp313-cp313-win_amd64.whl (723.6 kB view details)

Uploaded CPython 3.13Windows x86-64

rust_fatigue-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl (264.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

rust_fatigue-0.1.8-cp312-cp312-win_amd64.whl (725.0 kB view details)

Uploaded CPython 3.12Windows x86-64

rust_fatigue-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl (265.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

rust_fatigue-0.1.8-cp311-cp311-win_amd64.whl (724.4 kB view details)

Uploaded CPython 3.11Windows x86-64

rust_fatigue-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl (266.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

rust_fatigue-0.1.8-cp310-cp310-win_amd64.whl (725.2 kB view details)

Uploaded CPython 3.10Windows x86-64

rust_fatigue-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl (266.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

rust_fatigue-0.1.8-cp39-cp39-win_amd64.whl (726.8 kB view details)

Uploaded CPython 3.9Windows x86-64

rust_fatigue-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl (266.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

rust_fatigue-0.1.8-cp38-cp38-win_amd64.whl (725.2 kB view details)

Uploaded CPython 3.8Windows x86-64

rust_fatigue-0.1.8-cp38-cp38-manylinux_2_28_x86_64.whl (265.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

Details for the file rust_fatigue-0.1.8.tar.gz.

File metadata

  • Download URL: rust_fatigue-0.1.8.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rust_fatigue-0.1.8.tar.gz
Algorithm Hash digest
SHA256 4be564c1f6b6c9c876c5a1e5c712b4a19d5bc96529c6536ce10f557324c0df55
MD5 324b517c5905a5985d7bb07ff2ebd537
BLAKE2b-256 a0e09ccabdda4b5910d21105255565a307c6c7d023592b794dde74ae208553a8

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 610fb7103054030934bf7934b67637b26aa1a6f0a5103782a4cc5d11a42a361e
MD5 1cd056cd8f676446ad20714a7a0b2543
BLAKE2b-256 f22cedd8dc70b47d7d10df42ab0b3a28bea671c61702f821a3cf947576324005

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4d3be18eee3508116ee10e881c310a9c1abd451fe6f5aa5fabe3d865be97dce
MD5 4a79813c0aa6bd4ebb886f2b75424348
BLAKE2b-256 e2500598f5b3743e5eb758afdeaf23d74d8514e5a291643c3abc8aa10c06275f

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 791907eb065b7f4d9a965e028a265ee36f1307538ac8d51f25d64f3f10650788
MD5 a48eda57b58c6e2a7852252258fae76b
BLAKE2b-256 e49552c399e2f3978d459a6e2be30d2c051f780aaa7d34dd38e546f9eb59f3ad

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 541c7bd93b86b948508a9ad1153e0701b392b0bb881e7140d14b30da0b6022eb
MD5 14b6c4cbf3d70cddccca75c96138c5f2
BLAKE2b-256 598a037d29463393a1b83c34e170d8bd478f926fc1d14aaf8e1c234d7bdbdb77

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 039a3f8e996c5fee061e5b92604f1aa2d92a884be897e58247d1c68c2b518ad6
MD5 53b46a2beb758c7c5e36548d5fba1013
BLAKE2b-256 ccb052f5e41aacbe782f747d3012e433e3c8338c3054db270119a0f4c1308009

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97b8f2b60527355f1ae7f3b67e838e56c36beca5a3c3af5a1b1b5c08f488d317
MD5 61b3ded7e960ac1a754ac22b5527a514
BLAKE2b-256 f446c34ab535a93c2ac145e8383e61f28ecde576ecd51c349c2b071e73b9ecb1

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2a8f62034c43dcc16397481b4a998259cc83d3e1c233be81d14c807a3a19877e
MD5 b33d1668349ff8b128a3063fc2aa4df6
BLAKE2b-256 db0db9feb88fcfbc891713a1a83f056a11e9c7c7179b805305aa043fbf8276bb

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2f4437324deb5ed5d1e9b53d06d5ad71903fa941d8a8040ee3e35c9d12ba80ff
MD5 053a76d8563fcd61b146225056593213
BLAKE2b-256 e50cb920b88883d641da1896e7806b4d80af33c54eb9e446c837c64fb49e3004

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: rust_fatigue-0.1.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 726.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rust_fatigue-0.1.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a68b9411f57bf28298efe472c5e60ec8dd12e05cf2ea262f619bc7729f486663
MD5 33e1196209fd8ffc9c58e281019e7976
BLAKE2b-256 e11334be9cb0051f243bec25e2525c39149eb4c75656a1aeeeead422c4470ac4

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8eb5bbce70fa126aff8dd1a03567364d4b8520401152b9f5e38acfa0472cd7f
MD5 8a7043d8f97c59777a76a85237f80520
BLAKE2b-256 384608b5112344c25548af1ccad6d4da46766c3f480a34bfb104fe70674ff066

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: rust_fatigue-0.1.8-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 725.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rust_fatigue-0.1.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ca8de7941d166fc5d6366ef70cb5b27dcf0bf51b25ae9a7492d0031521992e21
MD5 1d831e854909bdc3c19ca254d02e0478
BLAKE2b-256 e94790d6cb6e6981183ec6719c2ea346ad5c2c16d603fca3eb74349f97d44df2

See more details on using hashes here.

File details

Details for the file rust_fatigue-0.1.8-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rust_fatigue-0.1.8-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 877b6ccccc59f256bb8db374e21d528ba1ccf71dbb883074c0c15a6a5c18a1cd
MD5 5a4250f6f856f25d9a22619054437d2a
BLAKE2b-256 b4b1480f27aa13eddedd02aa138c7992c0554647ca7825a62e8436e21e9da7f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page