Skip to main content
FatigueDS

FatigueDS

Calculating Extreme Response Spectrum (ERS) and Fatigue Damage Spectrum (FDS) of signals. Calculations are supported for sine, sine-sweep, and random signals (defined using PSD or time history). The underlying theory is based on [1].

See the documentation for more information.

Installation

Use pip to install it by:

$ pip install FatigueDS

Usage

Some short examples of how to use the package are given below for different types of signals.

Random signals (PSD)

Here is an example of determining the ERS and FDS of a random signal, defined in the frequency domain (PSD):

Generate sample signal PSD:

import numpy as np
import pyExSi as es

# generate random signal
fs = 5000  # sampling frequency [Hz]
time = 1  # time duration [s]
freq_flat = np.arange(0, fs / 2, 1 / time)  # frequency vector
freq_lower = 200  # PSD lower frequency limit  [Hz]
freq_upper = 1000  # PSD upper frequency limit [Hz]
PSD_flat = es.get_psd(freq_flat, freq_lower, freq_upper, variance=800)  # one-sided flat-shaped PSD

Use the package:

import FatigueDS

# instantiate the Spectrum class
# set the frequency range (start, stop, step) and damping ratio
load_spectrum = FatigueDS.Spectrum(freq_data=(100, 1100, 20), damp=0.05)

# set the random load
load_spectrum.set_random_load((PSD_flat, freq_flat), unit='ms2', T=3600)  # input is PSD array and frequency array

# calculate the ERS and FDS
load_spectrum.get_ers()
load_spectrum.get_fds(k=10, C=1e80, p=6.3 * 1e10)

# plot the results
load_spectrum.plot_ers()
load_spectrum.plot_fds()

# or access the results directly
ers = load_spectrum.ers
fds = load_spectrum.fds
f = load_spectrum.f0_range  # frequency vector

Random signals (time history)

Here is an example of determining the ERS and FDS of a random signal, defined in the time domain. For time domain, two methods are available:
  • Convolution (directly from time history, using rainflow counting)

  • PSD averaging (converting time history to PSD and then to ERS and FDS)

Import random time history data:

import numpy as np

_time_data = np.load('test_data/test_time_history.npy', allow_pickle=True)
time_history_data = _time_data[:,1]
t = _time_data[:,0]
dt = t[2] - t[1]

Use the package:

import FatigueDS

# instantiate the Spectrum classes
load_spectrum_1 = FatigueDS.Spectrum(freq_data=(20, 200, 5))  # convolution
load_spectrum_2 = FatigueDS.Spectrum(freq_data=(20, 200, 5))  # psd averaging

# set the random loads (input is time history array and time step)
load_spectrum_1.set_random_load((time_history_data, dt), unit='g', method='convolution')
load_spectrum_2.set_random_load((time_history_data, dt), unit='g', method='psd_averaging', bins=10)

# calculate the ERS and FDS
load_spectrum_1.get_ers()
load_spectrum_1.get_fds(k=10, C=1e80, p=6.3 * 1e10)

load_spectrum_2.get_ers()
load_spectrum_2.get_fds(k=10, C=1e80, p=6.3 * 1e10)

# plot the results

load_spectrum_1.plot_ers(label='Time history (convolution)')
load_spectrum_2.plot_ers(new_figure=False, label='Time history (PSD averaging)')

load_spectrum_1.plot_fds(label='Time history (convolution)')
load_spectrum_2.plot_fds(new_figure=False, label='Time history (PSD averaging)')

# or access the results directly

ers_1 = load_spectrum_1.ers
fds_1 = load_spectrum_1.fds
f_1 = load_spectrum_1.f0_range  # frequency vector

ers_2 = load_spectrum_2.ers
fds_2 = load_spectrum_2.fds
f_2 = load_spectrum_2.f0_range  # frequency vector

Sine and sine-sweep signals

Here is an example of determining the ERS and FDS of a sine and sine-sweep signal:

import numpy as np
import FatigueDS
import matplotlib.pyplot as plt

# instantiate classes
load_spectrum_sine = FatigueDS.Spectrum(freq_data=(0, 2000, 5), damp=0.1)  # sine
load_spectrum_sine_sweep = FatigueDS.Spectrum(freq_data=(0, 2000, 5), damp=0.1)  # sine sweep

# set the sine and sine-sweep loads
load_spectrum_sine.set_sine_load(sine_freq=500, amp=10, t_total=3600)  # t_total is is required only for FDS calculation.
load_spectrum_sine_sweep.set_sine_sweep_load(const_amp=[5, 10, 20], const_f_range=[20, 100, 500, 1000], exc_type='acc', sweep_type='log', sweep_rate=1)

# calculate the ERS and FDS
load_spectrum_sine.get_ers()
load_spectrum_sine_sweep.get_ers()

load_spectrum_sine.get_fds(k=10, C=1e80, p=6.3 * 1e10)
load_spectrum_sine_sweep.get_fds(k=10, C=1e80, p=6.3 * 1e10)

# plot the results
load_spectrum_sine.plot_ers(label='sine')
load_spectrum_sine.plot_fds(label='sine')

load_spectrum_sine_sweep.plot_ers(label='sine sweep')
load_spectrum_sine_sweep.plot_fds(label='sine sweep')

Mission synthesis

Mission synthesis gives one random vibration test PSD that has the same fatigue damage as all the events of a life cycle profile, in a shorter test duration [1]. Each event is a Spectrum with its ERS and FDS. The events must have the same freq_data, damping, material parameters and unit.

# truck and missile are Spectrum objects with get_ers() and get_fds() done
ms = FatigueDS.MissionSynthesis([truck, missile])
ms.invert(T_test=5 * 60)  # test PSD: ms.test_psd on ms.f0_range
ms.check_ers()            # compare the test ERS with the reference ERS

See the mission synthesis example (Example 11.2 of [1]: truck transport and missile flight).

References:

1. C. Lalanne, Mechanical Vibration and Shock: Specification development, London, England: ISTE Ltd and John Wiley & Sons, 2009

Metadata

Release files for FatigueDS 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FatigueDS 1.0.0
File Size Uploaded Provenance Actions
fatigueds-1.0.0.tar.gz 16.0 kB Without provenance Details for fatigueds-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for FatigueDS 1.0.0
File Interpreter ABI Platform Actions
fatigueds-1.0.0-py3-none-any.whl Python 3 none any Details for fatigueds-1.0.0-py3-none-any.whl

Total release size: 33.5 kB

Release files / fatigueds-1.0.0.tar.gz

Download URL fatigueds-1.0.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4f21db261c7014ba65c13030bdbf1ffd9199abe7d817a53869ac4749fc2b2d0
BLAKE2b-256 checksum
How to use checksums
0ce9303613ae5fc9655bb7abc2a8eb4584acb70463223ba4b9c3d5f85257ab8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / fatigueds-1.0.0-py3-none-any.whl

Download URL fatigueds-1.0.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b91a5539a72292b994f0840bad9cbe04159f5bcbfacd4b40df40e0ed4fe14c89
BLAKE2b-256 checksum
How to use checksums
cadf13be52c056453d235454d2260d6055559673ecc859fb11e7463d63f6e261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for FatigueDS 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page