Skip to main content

Fatigue Damage Spectrum (FDS) and Extreme Response Spectrum (ERS)

Project description

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')
References:

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

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

fatigueds-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

fatigueds-0.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file fatigueds-0.3.0.tar.gz.

File metadata

  • Download URL: fatigueds-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for fatigueds-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fc012951488847dcc755cef01957570ea8350e3c7f87ddc10e834dc80224e914
MD5 c5e1b3dfe6eef00f40d2c9d15dbd2ce5
BLAKE2b-256 742cfc1cfe6c67348c84edccbb3d1400fe4dc055a5bb2c883ad07e969339f8ca

See more details on using hashes here.

File details

Details for the file fatigueds-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fatigueds-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for fatigueds-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02458f707472bad2f4246002113443f9464eb9f9fb1e57a9f3df6092c2d96deb
MD5 0fac6fc4cc20ff2bd8bdaaaf82184c96
BLAKE2b-256 46bd174348a320605f102b7618d9c734fbef4a1862126a5184bab05dca6dbb7d

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