diff --git a/FatigueDS/spectrum.py b/FatigueDS/spectrum.py index a7f94d4..9e9ca2b 100644 --- a/FatigueDS/spectrum.py +++ b/FatigueDS/spectrum.py @@ -1,3 +1,27 @@ +"""Extreme Response Spectrum (ERS) and Fatigue Damage Spectrum (FDS) of sine, +sine-sweep and random (PSD or time-history) signals. + +The theory implemented here follows C. Lalanne, *Mechanical Vibration and Shock +Analysis*, 2nd ed., ISTE Ltd / John Wiley & Sons, 2009 -- a five-volume set. The +equation and page numbers given in the docstrings and inline comments below refer +to the following volumes: + +References +---------- +.. [Lalanne1] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 1: + Sinusoidal Vibration*, 2nd ed., ISTE/Wiley, 2009. +.. [Lalanne3] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 3: + Random Vibration*, 2nd ed., ISTE/Wiley, 2009. +.. [Lalanne4] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 4: + Fatigue Damage*, 2nd ed., ISTE/Wiley, 2009. +.. [Lalanne5] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 5: + Specification Development*, 2nd ed., ISTE/Wiley, 2009. + +Notation note: the package renames Lalanne's material parameters ``b, K, C`` +(S-N slope, stress/relative-displacement proportionality, S-N constant) to +``k, p, C`` for consistency with the FLife package. +""" + import numpy as np import matplotlib.pyplot as plt import scipy.integrate @@ -8,6 +32,22 @@ from . import tools class Spectrum: + """Compute the ERS and FDS of a vibration signal for a range of natural + frequencies ``f0``. + + Workflow: instantiate with a frequency range and damping, set a load with one + of the ``set_*_load`` methods, then call :meth:`get_ers` and/or :meth:`get_fds`. + + The supported signal types map to the following theory (see the module-level + bibliography for the volume references): + + - sine: ERS [Lalanne5]_ eq. [1.7]; FDS [Lalanne5]_ eq. [3.19]. + - sine-sweep: ERS [Lalanne5]_ eqs. [1.31]-[1.33]; FDS [Lalanne5]_ eq. [3.65]. + - random (PSD): response RMS [Lalanne3]_ eq. [8.86]; ERS peak factor + [Lalanne3]_ ch. 7; FDS [Lalanne4]_ eq. [4.41] / [Lalanne5]_ eqs. [4.7]-[4.8]. + - random (time history): ERS from the SDOF response peak; FDS from rainflow + counting + Basquin-Miner [Lalanne4]_ eq. [4.6]. + """ def __init__(self, freq_data=(10, 2000, 5), damp=None, Q=10): """ @@ -221,18 +261,20 @@ def get_fds(self, k, C=1, p=1): before FDS calculation, because the FDS theory is based on SI base units. NOTE: - Naming of material parameters slightly differs from the notation in literature by Lalanne [1] (``b,C,K`` -> ``k,C,p``). + Naming of material parameters slightly differs from the notation in literature by Lalanne (``b,C,K`` -> ``k,C,p``). This is done due to the consistency with the established package in this ecosystem (FLife ). Alternative material parameters ------------------------------- - If you have parameters ``b`` and ``sigma_f`` from equation - ``sigma_a = sigma_f * (2*N)**b`` you can convert them to ``k`` and ``C`` using + If you have parameters ``b`` and ``sigma_f`` from equation + ``sigma_a = sigma_f * (2*N)**b`` you can convert them to ``k`` and ``C`` using the `tools.material_parameters_convert` function. References ---------- - 1. C. Lalanne, Mechanical Vibration and Shock: Specification development, London, England: ISTE Ltd and John Wiley & Sons, 2009 + The S-N (Basquin) law ``N s**k = C`` is [Lalanne4]_ eq. [1.13]. The per-signal + FDS formulae implemented by the internal ``_get_*_ers_fds`` methods are cited + on the relevant lines; see the module-level bibliography for the volumes. :param k: S-N curve slope from Basquin equation :param C: material constant from Basquin equation (default: C=1) @@ -317,6 +359,11 @@ def plot_fds(self, new_figure=True, grid=True, *args, **kwargs): def _get_sine_ers_fds(self, output=None): """ Internal function for calculating ERS and FDS of a sine signal. + + ERS: [Lalanne5]_ p.7, eq. [1.7] (general excitation type, R = E_m*Omega**a / |H|). + FDS: [Lalanne5]_ p.98, eq. [3.19] (single-frequency sinusoidal damage). + ``a`` is the excitation-type exponent (0 = acc, 1 = vel, 2 = disp) and + ``h = f/f0``. """ omega_0i = 2 * np.pi * self.f0_range @@ -324,8 +371,9 @@ def _get_sine_ers_fds(self, output=None): # Getting the ERS with self.get_ers() if output == 'ERS': + # [Lalanne5] p.7 eq [1.7]: steady-state SDOF response, R = omega_0**2 * z_m R_i = -self.amp * (omega_0i)**self.a / (np.sqrt((1 - (self.sine_freq / self.f0_range)**2)**2 + (self.sine_freq / (self.Q * self.f0_range))**2)) - return np.abs(R_i) + return np.abs(R_i) # Getting the FDS with self.get_fds() elif output == 'FDS': @@ -334,14 +382,25 @@ def _get_sine_ers_fds(self, output=None): raise ValueError('Missing parameter `t_total`.') h = self.sine_freq / self.f0_range + # [Lalanne5] p.98 eq [3.19]: D = K**b/C * f0*T * E_m**b * omega_0**(b(a-2)) * h**(ab+1) / [(1-h**2)**2 + (h/Q)**2]**(b/2) D_i = self.p**self.k / self.C * self.f0_range * self.t_total * self.amp**self.k * omega_0i**(self.k * (self.a - 2)) * h**(self.a * self.k + 1) / ((1 - h**2)**2 + (h / self.Q)**2)**(self.k / 2) return D_i def _get_sine_sweep_ers_fds(self, output=None): """ Internal function for calculating ERS and FDS of a sine sweep signal. + + ERS: piecewise peak response, [Lalanne5]_ p.16, eqs. [1.31] (resonance, + f1 <= f0 <= f2), [1.32] (f0 < f1) and [1.33] (f0 > f2). + FDS: swept-sine damage master integral, [Lalanne5]_ p.120, eq. [3.65], + with the dwell-weighting function M(h) from [Lalanne5]_ Table 3.2 + (linear: h**2/(h2-h1); logarithmic: h/ln(h2/h1)). Sweep-time and the + dh change of variable follow [Lalanne1]_ ch. 8 / [Lalanne5]_ p.103-114 + (linear rate in Hz/min, eq. [3.39]; logarithmic rate in oct./min). + Assumes the sweep is slow enough to reach steady state at each frequency + ([Lalanne5]_ p.103). """ - + R_i_all = np.zeros((len(self.f0_range), len(self.const_amp))) fds = np.zeros(len(self.f0_range)) ers = np.zeros(len(self.f0_range)) @@ -360,21 +419,23 @@ def _get_sine_sweep_ers_fds(self, output=None): if self.sweep_type is None: raise ValueError("You need to provide either ['linear','lin'] or ['logarithmic','log'] sweep_type.") elif self.sweep_type in ['lin', 'linear']: - tb = (self.const_f_range[-1] - self.const_f_range[0]) / self.sweep_rate * 60 # sinusoidal sweep time [s] -> from [Hz/min] - dh = (f2 - f1) * self.dt / (self.f0_range[i] * tb) + tb = (self.const_f_range[-1] - self.const_f_range[0]) / self.sweep_rate * 60 # sinusoidal sweep time [s] -> from [Hz/min] ([Lalanne1] ch.8) + dh = (f2 - f1) * self.dt / (self.f0_range[i] * tb) # [Lalanne5] p.104 eq [3.39] h = np.arange(h1, h2, dh) - M_h = h**2 / (h2 - h1) + M_h = h**2 / (h2 - h1) # linear dwell weighting M(h), [Lalanne5] Table 3.2 elif self.sweep_type in ['log', 'logarithmic']: - tb = 60 * np.log(self.const_f_range[-1] / self.const_f_range[0]) / (self.sweep_rate * np.log(2)) # logarithmic sweep time [s] -> from [oct./min] + tb = 60 * np.log(self.const_f_range[-1] / self.const_f_range[0]) / (self.sweep_rate * np.log(2)) # logarithmic sweep time [s] -> from [oct./min] ([Lalanne1] ch.8) t = np.arange(0, tb, self.dt) - T1 = tb / np.log(h2 / h1) + T1 = tb / np.log(h2 / h1) # log-sweep time constant, f(t)=f1*exp(t/T1) ([Lalanne5] p.114) f_t = f1 * np.exp(t / T1) dh = f1 / (T1 * self.f0_range[i]) * np.exp(t / T1) * self.dt h = f_t / self.f0_range[i] - M_h = h / (np.log(h2 / h1)) + M_h = h / (np.log(h2 / h1)) # exponential dwell weighting M(h), [Lalanne5] Table 3.2 else: raise ValueError(f"Invalid method `method`='{self.sweep_type}'. Supported sweep types: 'lin' and 'log'.") - + + # swept-sine FDS master integral, [Lalanne5] p.120 eq [3.65]: + # D = K**b/C * f0*tb * E_m**b * omega_0**(b(a-2)) * integral( M(h) h**(ab-1) / [(1-h**2)**2+(h/Q)**2]**(b/2) dh ) const = self.p**self.k / self.C * self.f0_range[i] * tb * amp**self.k * omega_0i**(self.k * (self.a - 2)) integral = scipy.integrate.trapezoid(M_h * h**(self.a * self.k - 1) / ((1 - h**2)**2 + (h / self.Q)**2)**(self.k / 2), x=h) fds[i] += const * integral @@ -382,12 +443,12 @@ def _get_sine_sweep_ers_fds(self, output=None): elif output == 'ERS': if self.f0_range[i] <= f1: Omega_1 = 2 * np.pi * f1 - R_i = Omega_1**self.a * amp / (np.sqrt((1 - h1**2)**2 + (h1 / self.Q)**2)) # page 32/501 eq. [1.22] + R_i = Omega_1**self.a * amp / (np.sqrt((1 - h1**2)**2 + (h1 / self.Q)**2)) # f0 < f1: [Lalanne5] p.16 eq [1.32] elif self.f0_range[i] >= f2: Omega_2 = 2 * np.pi * f2 - R_i = Omega_2**self.a * amp / (np.sqrt((1 - h2**2)**2 + (h2 / self.Q)**2)) # page 32/501 eq. [1.23] + R_i = Omega_2**self.a * amp / (np.sqrt((1 - h2**2)**2 + (h2 / self.Q)**2)) # f0 > f2: [Lalanne5] p.16 eq [1.33] else: - R_i = omega_0i**self.a * amp * self.Q # page 31/501 eq. [1.21] + R_i = omega_0i**self.a * amp * self.Q # f1 <= f0 <= f2 (resonance): [Lalanne5] p.16 eq [1.31] R_i_all[i, n] = R_i ers[i] = max(R_i_all[i, :]) @@ -400,16 +461,25 @@ def _get_sine_sweep_ers_fds(self, output=None): def _get_random_psd_ers_fds(self, output=None): """ Internal function for calculating ERS and FDS of a random signal in frequency domain. + + Response RMS (relative displacement / velocity / acceleration) is obtained from + the segmented-PSD closed form [Lalanne3]_ p.395, eq. [8.86] (the per-segment + I0/I2/I4 integrals are evaluated in ``tools.integrals_b``). The mean upward + zero-crossing rate ``n0`` is Rice's formula [Lalanne3]_ p.264, eq. [5.76]. + ERS uses the extreme-peak factor sqrt(2*ln(n0*T)) ([Lalanne3]_ ch. 7, + eq. [7.34]; ERS definition [Lalanne5]_ ch. 2). FDS uses the narrow-band + Rayleigh closed form [Lalanne4]_ p.144, eq. [4.41] = [Lalanne5]_ p.117, + eqs. [4.7]-[4.8]. """ - + fds = np.zeros(len(self.f0_range)) - ers = np.zeros(len(self.f0_range)) - - # constants - C0 = np.pi / (4 * self.damp) - C_disp = C0 * 1 / ((2 * np.pi)**4 * self.f0_range**3) - C_vel = C0 * 1 / ((2 * np.pi)**2 * self.f0_range) - C_acc = C0 * self.f0_range + ers = np.zeros(len(self.f0_range)) + + # constants -- f0-power prefactors of the segmented-PSD response RMS, [Lalanne3] eq [8.86] + C0 = np.pi / (4 * self.damp) # pi/(4*xi) prefactor common to all three RMS sums + C_disp = C0 * 1 / ((2 * np.pi)**4 * self.f0_range**3) # rel. displacement RMS**2 (uses I0) + C_vel = C0 * 1 / ((2 * np.pi)**2 * self.f0_range) # rel. velocity RMS**2 (uses I2) + C_acc = C0 * self.f0_range # rel. acceleration RMS**2 (uses I4) # rms sums z_rms_2 = tools.rms_sum(f_0=self.f0_range, psd_freq=self.psd_freq, psd_data=self.psd_data, damp=self.damp, motion='rel_disp') * C_disp @@ -424,28 +494,35 @@ def _get_random_psd_ers_fds(self, output=None): # ERS calculation if output == 'ERS': - n0 = 1 / np.pi * dz_rms / z_rms + n0 = 1 / (2 * np.pi) * dz_rms / z_rms # n0+ = (1/2pi)*sqrt(M2/M0), [Lalanne3] eq [5.76]; for a Q=10 narrow-band response n0+ = f0 ([Lalanne5] p.46, Ex 4.4) + # ERS = omega_0**2 * z_rms * peak factor, with peak factor sqrt(2*ln(n0*T)) ([Lalanne3] ch.7 eq [7.34]) ers = (2 * np.pi * self.f0_range)**2 * z_rms * np.sqrt(2 * np.log(n0 * self.T)) return ers - - # FDS calculation (damage according to Vol. 0, page 89/198, equation (A1-93)) + + # FDS calculation: narrow-band Rayleigh closed form, [Lalanne4] p.144 eq [4.41] = [Lalanne5] p.117 eqs [4.7]-[4.8] elif output == 'FDS': z_rms *= self.unit_scale dz_rms *= self.unit_scale - n0 = 1 / np.pi * dz_rms / z_rms + n0 = 1 / (2 * np.pi) * dz_rms / z_rms # n0+ = (1/2pi)*sqrt(M2/M0), [Lalanne3] eq [5.76]; for a Q=10 narrow-band response n0+ = f0 ([Lalanne5] p.46, Ex 4.4) + # D = K**b/C * n0*T * (sqrt(2)*z_rms)**b * Gamma(1 + b/2) fds = self.p**self.k / self.C * n0 * self.T * (z_rms * np.sqrt(2))**self.k * gamma(1 + self.k / 2) return fds def _get_random_time_ers_fds(self, output=None): """ - Internal function for calculating ERS and FDS of a sine random signal in time domain. + Internal function for calculating ERS and FDS of a random signal in the time domain. + + The SDOF relative-displacement response z(t) is obtained by convolution + (``tools.response_relative_displacement``). ERS is the peak response + ``max(z) * omega_0**2``. FDS sums Basquin-Miner damage over rainflow-counted + cycles, [Lalanne4]_ p.132, eq. [4.6] (full-cycle form, see below). """ if output == 'ERS': ers = np.zeros(len(self.f0_range)) - for i in tqdm(range(len(self.f0_range))): + for i in tqdm(range(len(self.f0_range))): z = tools.response_relative_displacement(self.time_data, self.dt, f_0=self.f0_range[i], damp=self.damp) - R_i = np.max(z) * (2 * np.pi * self.f0_range[i])**2 + R_i = np.max(z) * (2 * np.pi * self.f0_range[i])**2 # ERS = peak rel. displacement * omega_0**2 ers[i] = R_i return ers @@ -457,7 +534,9 @@ def _get_random_time_ers_fds(self, output=None): rf = rainflow.count_cycles(z) rf = np.asarray(rf) - cyc_sum = np.sum(rf[:,1] * 2 * (rf[:,0] / 2)**self.k) # *2 and /2 because rainflow returns cycles and ranges, fds theory is defined for half cycles and amplitudes + # rainflow count = full cycles, range/2 = amplitude; full-cycle Basquin-Miner damage. + # [Lalanne4] eq [4.6] is D = K**b/(2C) * sum(n_half * z_a**b); with full cycles n_full = n_half/2 this is D = K**b/C * sum(n_full * z_a**b). + cyc_sum = np.sum(rf[:,1] * (rf[:,0] / 2)**self.k) D_i = self.p**self.k / (self.C) * cyc_sum fds[i] = D_i return fds diff --git a/FatigueDS/tools.py b/FatigueDS/tools.py index 57dff2b..740ae27 100644 --- a/FatigueDS/tools.py +++ b/FatigueDS/tools.py @@ -1,3 +1,19 @@ +"""Helper functions for the FatigueDS :class:`~FatigueDS.spectrum.Spectrum` class: +frequency-range handling, the SDOF response RMS over a segmented PSD, the closed-form +spectral integrals, the time-domain SDOF response, and material-parameter conversion. + +References +---------- +.. [Lalanne3] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 3: + Random Vibration*, 2nd ed., ISTE/Wiley, 2009. +.. [Lalanne4] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 4: + Fatigue Damage*, 2nd ed., ISTE/Wiley, 2009. +.. [Lalanne5] C. Lalanne, *Mechanical Vibration and Shock Analysis, Vol. 5: + Specification Development*, 2nd ed., ISTE/Wiley, 2009. +.. [Thomson] W. T. Thomson, *Theory of Vibration with Applications*, 2nd ed., + Prentice-Hall, 1981. +""" + import numpy as np from scipy import signal from FLife.tools import basquin_to_sn @@ -40,8 +56,14 @@ def get_freq_range(self, freq_data): def rms_sum(f_0, psd_freq, psd_data, damp, motion='rel_disp'): """ - This function calculates the response RMS (either relative displacement, velocity or acceleration) for a given - natural frequency and damping ratio. + This function calculates the response RMS (either relative displacement, velocity or acceleration) for a given + natural frequency and damping ratio. + + The excitation PSD is treated as ``n`` horizontal straight-line segments and the + response mean square is accumulated segment by segment using the closed-form + integrals I0/I2/I4 (:func:`integrals_b`). This is the summation kernel of + [Lalanne3]_ p.395, eq. [8.86]; the ``pi/(4*xi)`` and ``f0``-power prefactors are + applied by the caller in ``spectrum.py``. :param f_0: system natural frequency [Hz] :param psd_freq: PSD frequency range [Hz] @@ -67,11 +89,8 @@ def rms_sum(f_0, psd_freq, psd_data, damp, motion='rel_disp'): h1 = f1[j] / f_0 h2 = f2[j] / f_0 - # Case where the excitation is defined by PSD comprising "n" straight line segments (Vol.3, equation [8.86]) - - - - + # Per-segment contribution G_j * [I_b(h2) - I_b(h1)], the summation kernel of + # [Lalanne3] p.395 eq [8.86] (rel_disp uses I0, rel_vel uses I2, rel_acc uses I4). if motion == 'rel_disp': z_rms = psd_data[j] * (integrals_b(h=h2, b=0, damp=damp) - integrals_b(h=h1, b=0, damp=damp)) rms_sum += z_rms @@ -90,42 +109,43 @@ def rms_sum(f_0, psd_freq, psd_data, damp, motion='rel_disp'): def integrals_b(h, b, damp): """ - This function calculates integrals I_b described in [3] and [4]. See equations (A1-74), (A1-75), (A1-76) in [3] - or [A6.20], [A6.22], [A6.24] in [4] or [8.52], [8.53], [8.54] [4]. + Closed-form evaluation of the dimensionless spectral integrals I0, I2 and I4 used in + the segmented-PSD response RMS (:func:`rms_sum`, [Lalanne3]_ eq. [8.86]). + + The closed forms are [Lalanne3]_ Appendix A6, p.544: I0 = eq. [A6.20], I2 = eq. + [A6.22], I4 = eq. [A6.24]. They are identical to eqs. (A1-74), (A1-75), (A1-76) in + [Lalanne5]_. ``alpha = 2*sqrt(1-xi**2)`` and ``beta = 2*(1-2*xi**2)`` ([Lalanne3]_ + eq. [8.37]). - Literature: - [3] Mechanical Environment Test Specification Development Method - Christian LALANNE - [4] Christian Lalanne(auth.) Random Vibration Mechanical Vibration and Shock Analysis, Volume 3, Second Edition - :param h: frequency ratio (frequency vs natural frequency) [/] - :param b: exponent b [/] + :param b: exponent b [/] (0, 2 or 4) :param damp: damping ratio [/] :return: I_b integral value """ - - # constants - alpha = 2 * np.sqrt(1 - damp**2) + + # constants ([Lalanne3] eq [8.37]) + alpha = 2 * np.sqrt(1 - damp**2) beta = 2 * (1 - 2 * damp**2) - + C0 = damp / (np.pi * alpha) C1 = (h**2 + alpha * h + 1)/(h**2 - alpha * h + 1) C2 = (2 * h + alpha) / (2 * damp) C3 = (2 * h - alpha) / (2 * damp) C4 = 4 * damp / np.pi C5 = np.arctan(C2) + np.arctan(C3) - + # integrals if b == 0: - Ib = C0 * np.log(C1) + 1 / np.pi * C5 # 84/198 eq. (A1-74) and 560/610 eq. [A6.20] - + Ib = C0 * np.log(C1) + 1 / np.pi * C5 # I0: [Lalanne3] p.544 eq [A6.20] (= [Lalanne5] eq (A1-74)) + elif b == 2: - Ib = C0*np.log(1 / C1) + 1 / np.pi * C5 # 84/198 eq. (A1-75) and 560/610 eq. [A6.22] - + Ib = C0*np.log(1 / C1) + 1 / np.pi * C5 # I2: [Lalanne3] p.544 eq [A6.22] (= [Lalanne5] eq (A1-75)); log argument reciprocated vs I0 + elif b == 4: - I0 = C0 * np.log(C1) + 1 / np.pi * C5 + I0 = C0 * np.log(C1) + 1 / np.pi * C5 I2 = -C0 * np.log(C1) + 1 / np.pi * C5 - Ib = C4 * h + beta * I2 - I0 # 84/198 eq. (A1-76) and 560/610 eq. [A6.24] + Ib = C4 * h + beta * I2 - I0 # I4: [Lalanne3] p.544 eq [A6.24] (= [Lalanne5] eq (A1-76)) else: raise ValueError(f"Invalid exponent ``b``='{b}'. Supported exponents: 0, 2 and 4.") @@ -135,12 +155,18 @@ def integrals_b(h, b, damp): def response_relative_displacement(time_data, dt, f_0, damp): """ - Returns relative response displacement of a linear SDOF system by performing the convolution of a signal and impulse response - function, defined in [1]. The function is used in calculation of the extreme response spectrum (ERS) of a random time signal. + Returns the relative response displacement of a linear SDOF system by convolving the + base-excitation signal with the system's unit-impulse response (Duhamel's integral). + Used to obtain the SDOF response for the time-domain ERS/FDS of a random signal. + + The impulse response used here is that of the *damped* SDOF system, + ``h(t) = -1/omega_d * exp(-xi*omega_0*t) * sin(omega_d*t)`` with + ``omega_d = omega_0*sqrt(1-xi**2)`` -- the damped generalisation of the impulse + response / convolution (Duhamel) integral in [Thomson]_ ch. 4 (impulse response and + convolution, eq. (4.2-5) gives the undamped case). The leading sign and the + ``1/omega_d`` factor give the relative displacement of the mass w.r.t. its base for a + unit base acceleration. - Literature: - [1] WILLIAM T. THOMSON, Theory of vibration with applications -> see page 111/512 equation (4.2-5) - :param time_data: signal time data [m/s^2] :param dt: time step [s] :param f_0: system natural frequency [Hz] @@ -184,6 +210,7 @@ def material_parameters_convert(sigma_f, b, range = False): """ Converts Basquin equation parameters ``sigma_f`` and ``b`` to fatigue life parameters ``C`` and ``k``, using a function from FLife package. Basic form of Basquin equation is used here: ``sigma_a = sigma_f* (2*N)**b``. The function converts to parameters from equation ``N * s**k = C`` + (the S-N / Basquin law, [Lalanne4]_ p.22, eqs. [1.13]-[1.15]). :param sigma_f: Fatigue strength coefficient [MPa**k]. diff --git a/tests/test_basic.py b/tests/test_basic.py index 4fb0575..afb2116 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -74,7 +74,7 @@ def test_random_time_psd_averaging(self): """ Test the random time history function with psd averaging""" _time_data = np.load('test_data/test_time_history.npy', allow_pickle=True) time_history_data = _time_data[:,1] - t = _time_data[:,0] + t = _time_data[:,0] dt = t[2] - t[1] load_spectrum_averaging = FatigueDS.Spectrum(freq_data=(20, 200, 5)) @@ -86,3 +86,29 @@ def test_random_time_psd_averaging(self): assert np.allclose(load_spectrum_averaging.fds, random_time_averaging_fds_true) +def test_narrowband_crossing_rate_equals_f0(): + """Absolute, literature-anchored check of the FDS/ERS cycle-rate convention. + + For a single-DOF oscillator (Q=10) excited by broadband (white) random vibration, + the response is narrow-band and its mean number of upward zero-crossings per + second equals the natural frequency f0 (Lalanne, *Specification Development*, + Vol.5 p.46: "n0 is equal to f0"; verified numerically in Vol.5 Example 4.4, where + a 10 Hz oscillator shows 50 up-crossings in 5 s -> 10 Hz). This is the quantity + n0+ used in the random ERS/FDS, so it pins down the (1/(2*pi)) factor in + n0+ = (1/(2*pi)) * (dz_rms/z_rms) and guards against the factor-of-2 error of + using 1/pi (which would yield ~2*f0). + """ + rng = np.random.default_rng(0) + fs = 2048.0 + dt = 1 / fs + acc = rng.standard_normal(int(120.0 * fs)) # broadband (white) excitation + damp = 1 / (2 * 10) # Q = 10 + + for f0 in (50.0, 100.0, 150.0, 200.0): + z = FatigueDS.tools.response_relative_displacement(acc, dt, f_0=f0, damp=damp) + z = z[len(z) // 20:] # drop start-up transient + n_up = np.count_nonzero((z[:-1] < 0) & (z[1:] >= 0)) + rate = n_up / (len(z) * dt) + assert np.isclose(rate, f0, rtol=0.02), f"f0={f0}: crossing rate {rate:.2f} != f0" + + diff --git a/tests/test_data.py b/tests/test_data.py index 5aa2e3b..d53f5f7 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,477 +1,616 @@ import numpy as np -sine_ers_true = np.array([4.00000000e-11, 1.00009951e-03, 4.00159263e-03, 9.00806669e-03, - 1.60255124e-02, 2.50623418e-02, 3.61294132e-02, 4.92400640e-02, - 6.44101506e-02, 8.16580965e-02, 1.01004948e-01, 1.22474441e-01, - 1.46093068e-01, 1.71890170e-01, 1.99898021e-01, 2.30151932e-01, - 2.62690368e-01, 2.97555069e-01, 3.34791187e-01, 3.74447440e-01, - 4.16576274e-01, 4.61234040e-01, 5.08481196e-01, 5.58382517e-01, - 6.11007327e-01, 6.66429756e-01, 7.24729014e-01, 7.85989693e-01, - 8.50302094e-01, 9.17762584e-01, 9.88473986e-01, 1.06254600e+00, - 1.14009568e+00, 1.22124792e+00, 1.30613601e+00, 1.39490226e+00, - 1.48769865e+00, 1.58468753e+00, 1.68604246e+00, 1.79194906e+00, - 1.90260598e+00, 2.01822592e+00, 2.13903688e+00, 2.26528336e+00, - 2.39722782e+00, 2.53515229e+00, 2.67936005e+00, 2.83017765e+00, - 2.98795702e+00, 3.15307790e+00, 3.32595053e+00, 3.50701868e+00, - 3.69676304e+00, 3.89570500e+00, 4.10441093e+00, 4.32349707e+00, - 4.55363492e+00, 4.79555754e+00, 5.05006654e+00, 5.31804017e+00, - 5.60044252e+00, 5.89833409e+00, 6.21288392e+00, 6.54538361e+00, - 6.89726356e+00, 7.27011180e+00, 7.66569594e+00, 8.08598889e+00, - 8.53319901e+00, 9.00980569e+00, 9.51860145e+00, 1.00627420e+01, - 1.06458062e+01, 1.12718674e+01, 1.19455804e+01, 1.26722861e+01, - 1.34581391e+01, 1.43102639e+01, 1.52369475e+01, 1.62478772e+01, - 1.73544366e+01, 1.85700754e+01, 1.99107735e+01, 2.13956264e+01, - 2.30475826e+01, 2.48943751e+01, 2.69696910e+01, 2.93146234e+01, - 3.19794311e+01, 3.50255669e+01, 3.85277710e+01, 4.25756329e+01, - 4.72731440e+01, 5.27328937e+01, 5.90578382e+01, 6.62971491e+01, - 7.43550842e+01, 8.28358146e+01, 9.08622691e+01, 9.70585875e+01, - 1.00000000e+02, 9.90574642e+01, 9.48323183e+01, 8.86617200e+01, - 8.18207684e+01, 7.51352916e+01, 6.90053276e+01, 6.35614212e+01, - 5.87974930e+01, 5.46505007e+01, 5.10407694e+01, 4.78900336e+01, - 4.51283287e+01, 4.26957508e+01, 4.05420560e+01, 3.86254883e+01, - 3.69114469e+01, 3.53712416e+01, 3.39810184e+01, 3.27208661e+01, - 3.15740887e+01, 3.05266172e+01, 2.95665364e+01, 2.86837047e+01, - 2.78694470e+01, 2.71163072e+01, 2.64178473e+01, 2.57684832e+01, - 2.51633512e+01, 2.45981977e+01, 2.40692881e+01, 2.35733313e+01, - 2.31074169e+01, 2.26689626e+01, 2.22556696e+01, 2.18654852e+01, - 2.14965716e+01, 2.11472782e+01, 2.08161189e+01, 2.05017525e+01, - 2.02029650e+01, 1.99186559e+01, 1.96478244e+01, 1.93895593e+01, - 1.91430286e+01, 1.89074716e+01, 1.86821912e+01, 1.84665477e+01, - 1.82599528e+01, 1.80618645e+01, 1.78717831e+01, 1.76892468e+01, - 1.75138282e+01, 1.73451314e+01, 1.71827891e+01, 1.70264598e+01, - 1.68758260e+01, 1.67305919e+01, 1.65904815e+01, 1.64552373e+01, - 1.63246185e+01, 1.61983997e+01, 1.60763700e+01, 1.59583314e+01, - 1.58440980e+01, 1.57334955e+01, 1.56263595e+01, 1.55225357e+01, - 1.54218784e+01, 1.53242505e+01, 1.52295223e+01, 1.51375717e+01, - 1.50482828e+01, 1.49615465e+01, 1.48772591e+01, 1.47953226e+01, - 1.47156441e+01, 1.46381353e+01, 1.45627124e+01, 1.44892961e+01, - 1.44178108e+01, 1.43481844e+01, 1.42803487e+01, 1.42142385e+01, - 1.41497918e+01, 1.40869493e+01, 1.40256547e+01, 1.39658541e+01, - 1.39074961e+01, 1.38505316e+01, 1.37949136e+01, 1.37405972e+01, - 1.36875396e+01, 1.36356995e+01, 1.35850376e+01, 1.35355163e+01, - 1.34870992e+01, 1.34397519e+01, 1.33934410e+01, 1.33481346e+01, - 1.33038021e+01, 1.32604141e+01, 1.32179422e+01, 1.31763594e+01, - 1.31356395e+01, 1.30957573e+01, 1.30566888e+01, 1.30184105e+01, - 1.29809000e+01, 1.29441359e+01, 1.29080973e+01, 1.28727640e+01, - 1.28381169e+01, 1.28041372e+01, 1.27708069e+01, 1.27381088e+01, - 1.27060259e+01, 1.26745421e+01, 1.26436419e+01, 1.26133100e+01, - 1.25835319e+01, 1.25542934e+01, 1.25255810e+01, 1.24973813e+01, - 1.24696817e+01, 1.24424697e+01, 1.24157334e+01, 1.23894612e+01, - 1.23636418e+01, 1.23382645e+01, 1.23133186e+01, 1.22887939e+01, - 1.22646806e+01, 1.22409690e+01, 1.22176498e+01, 1.21947141e+01, - 1.21721529e+01, 1.21499579e+01, 1.21281208e+01, 1.21066335e+01, - 1.20854883e+01, 1.20646775e+01, 1.20441940e+01, 1.20240305e+01, - 1.20041800e+01, 1.19846359e+01, 1.19653916e+01, 1.19464407e+01, - 1.19277770e+01, 1.19093945e+01, 1.18912874e+01, 1.18734498e+01, - 1.18558762e+01, 1.18385613e+01, 1.18214998e+01, 1.18046865e+01, - 1.17881164e+01, 1.17717847e+01, 1.17556867e+01, 1.17398176e+01, - 1.17241731e+01, 1.17087487e+01, 1.16935401e+01, 1.16785432e+01, - 1.16637539e+01, 1.16491682e+01, 1.16347823e+01, 1.16205924e+01, - 1.16065948e+01, 1.15927859e+01, 1.15791623e+01, 1.15657204e+01, - 1.15524569e+01, 1.15393686e+01, 1.15264523e+01, 1.15137049e+01, - 1.15011233e+01, 1.14887045e+01, 1.14764457e+01, 1.14643441e+01, - 1.14523968e+01, 1.14406011e+01, 1.14289544e+01, 1.14174541e+01, - 1.14060977e+01, 1.13948827e+01, 1.13838067e+01, 1.13728673e+01, - 1.13620622e+01, 1.13513891e+01, 1.13408459e+01, 1.13304303e+01, - 1.13201402e+01, 1.13099736e+01, 1.12999283e+01, 1.12900025e+01, - 1.12801942e+01, 1.12705015e+01, 1.12609224e+01, 1.12514553e+01, - 1.12420982e+01, 1.12328494e+01, 1.12237073e+01, 1.12146700e+01, - 1.12057361e+01, 1.11969038e+01, 1.11881715e+01, 1.11795378e+01, - 1.11710011e+01, 1.11625599e+01, 1.11542127e+01, 1.11459582e+01, - 1.11377948e+01, 1.11297213e+01, 1.11217362e+01, 1.11138383e+01, - 1.11060262e+01, 1.10982987e+01, 1.10906545e+01, 1.10830924e+01, - 1.10756112e+01, 1.10682096e+01, 1.10608866e+01, 1.10536410e+01, - 1.10464717e+01, 1.10393776e+01, 1.10323576e+01, 1.10254106e+01, - 1.10185357e+01, 1.10117318e+01, 1.10049978e+01, 1.09983328e+01, - 1.09917359e+01, 1.09852061e+01, 1.09787425e+01, 1.09723441e+01, - 1.09660101e+01, 1.09597395e+01, 1.09535316e+01, 1.09473853e+01, - 1.09413000e+01, 1.09352748e+01, 1.09293089e+01, 1.09234015e+01, - 1.09175517e+01, 1.09117589e+01, 1.09060223e+01, 1.09003412e+01, - 1.08947147e+01, 1.08891422e+01, 1.08836230e+01, 1.08781564e+01, - 1.08727418e+01, 1.08673783e+01, 1.08620654e+01, 1.08568025e+01, - 1.08515889e+01, 1.08464239e+01, 1.08413070e+01, 1.08362375e+01, - 1.08312148e+01, 1.08262384e+01, 1.08213077e+01, 1.08164220e+01, - 1.08115809e+01, 1.08067838e+01, 1.08020302e+01, 1.07973194e+01, - 1.07926511e+01, 1.07880246e+01, 1.07834394e+01, 1.07788951e+01, - 1.07743912e+01, 1.07699271e+01, 1.07655025e+01, 1.07611167e+01, - 1.07567694e+01, 1.07524601e+01, 1.07481884e+01, 1.07439537e+01, - 1.07397558e+01, 1.07355940e+01, 1.07314681e+01, 1.07273775e+01, - 1.07233219e+01, 1.07193009e+01, 1.07153141e+01, 1.07113611e+01, - 1.07074414e+01, 1.07035548e+01, 1.06997007e+01, 1.06958790e+01, - 1.06920891e+01, 1.06883308e+01, 1.06846036e+01, 1.06809073e+01, - 1.06772414e+01, 1.06736057e+01, 1.06699998e+01, 1.06664234e+01, - 1.06628761e+01]) +sine_ers_true = np.array([4.000000000016e-11, 1.000099509851e-03, 4.001592630672e-03, + 9.008066687294e-03, 1.602551241082e-02, 2.506234179202e-02, + 3.612941321441e-02, 4.924006400668e-02, 6.441015059645e-02, + 8.165809649059e-02, 1.010049483536e-01, 1.224744405034e-01, + 1.460930681943e-01, 1.718901701139e-01, 1.998980205755e-01, + 2.301519319541e-01, 2.626903679801e-01, 2.975550685814e-01, + 3.347911870430e-01, 3.744474403452e-01, 4.165762736367e-01, + 4.612340399092e-01, 5.084811960562e-01, 5.583825166347e-01, + 6.110073267903e-01, 6.664297559745e-01, 7.247290142609e-01, + 7.859896932718e-01, 8.503020939558e-01, 9.177625837098e-01, + 9.884739856291e-01, 1.062546002988e+00, 1.140095682426e+00, + 1.221247919714e+00, 1.306136012460e+00, 1.394902264624e+00, + 1.487698648325e+00, 1.584687529112e+00, 1.686042461632e+00, + 1.791949063558e+00, 1.902605976618e+00, 2.018225924784e+00, + 2.139036881003e+00, 2.265283355426e+00, 2.397227819879e+00, + 2.535152285416e+00, 2.679360052208e+00, 2.830177653837e+00, + 2.987957021349e+00, 3.153077896255e+00, 3.325950526189e+00, + 3.507018682187e+00, 3.696763042844e+00, 3.895704997923e+00, + 4.104410932799e+00, 4.323497065478e+00, 4.553634920379e+00, + 4.795557537921e+00, 5.050066536834e+00, 5.318040167608e+00, + 5.600442521583e+00, 5.898334091784e+00, 6.212883920160e+00, + 6.545383613089e+00, 6.897263564968e+00, 7.270111801261e+00, + 7.665695941033e+00, 8.085988889371e+00, 8.533199008044e+00, + 9.009805686141e+00, 9.518601451101e+00, 1.006274203793e+01, + 1.064580618766e+01, 1.127186739818e+01, 1.194558043171e+01, + 1.267228613331e+01, 1.345813908631e+01, 1.431026389342e+01, + 1.523694751546e+01, 1.624787723943e+01, 1.735443662549e+01, + 1.857007536575e+01, 1.991077354401e+01, 2.139562643034e+01, + 2.304758258691e+01, 2.489437507184e+01, 2.696969096810e+01, + 2.931462340616e+01, 3.197943109129e+01, 3.502556685194e+01, + 3.852777102651e+01, 4.257563289707e+01, 4.727314401161e+01, + 5.273289374822e+01, 5.905783822758e+01, 6.629714905649e+01, + 7.435508424832e+01, 8.283581463023e+01, 9.086226905418e+01, + 9.705858747377e+01, 1.000000000000e+02, 9.905746424975e+01, + 9.483231825348e+01, 8.866171995093e+01, 8.182076844088e+01, + 7.513529161748e+01, 6.900532763443e+01, 6.356142119338e+01, + 5.879749297750e+01, 5.465050070692e+01, 5.104076941376e+01, + 4.789003355516e+01, 4.512832870259e+01, 4.269575081083e+01, + 4.054205603075e+01, 3.862548830436e+01, 3.691144689517e+01, + 3.537124163351e+01, 3.398101839475e+01, 3.272086609922e+01, + 3.157408869505e+01, 3.052661716868e+01, 2.956653641940e+01, + 2.868370470025e+01, 2.786944699468e+01, 2.711630722733e+01, + 2.641784726303e+01, 2.576848316570e+01, 2.516335120758e+01, + 2.459819771430e+01, 2.406928808260e+01, 2.357333128533e+01, + 2.310741694183e+01, 2.266896262878e+01, 2.225566957402e+01, + 2.186548524340e+01, 2.149657161995e+01, 2.114727820428e+01, + 2.081611894650e+01, 2.050175246589e+01, 2.020296503004e+01, + 1.991865585959e+01, 1.964782439934e+01, 1.938955925854e+01, + 1.914302857245e+01, 1.890747157840e+01, 1.868219123280e+01, + 1.846654772309e+01, 1.825995275157e+01, 1.806186448660e+01, + 1.787178309276e+01, 1.768924676420e+01, 1.751382819686e+01, + 1.734513144417e+01, 1.718278910876e+01, 1.702645982909e+01, + 1.687582602588e+01, 1.673059187749e+01, 1.659048149780e+01, + 1.645523729336e+01, 1.632461847977e+01, 1.619839973950e+01, + 1.607637000580e+01, 1.595833135921e+01, 1.584409802453e+01, + 1.573349545805e+01, 1.562635951547e+01, 1.552253569256e+01, + 1.542187843107e+01, 1.532425048366e+01, 1.522952233191e+01, + 1.513757165246e+01, 1.504828282664e+01, 1.496154648950e+01, + 1.487725911476e+01, 1.479532263210e+01, 1.471564407429e+01, + 1.463813525108e+01, 1.456271244782e+01, 1.448929614652e+01, + 1.441781076748e+01, 1.434818442963e+01, 1.428034872824e+01, + 1.421423852832e+01, 1.414979177262e+01, 1.408694930287e+01, + 1.402565469340e+01, 1.396585409600e+01, 1.390749609521e+01, + 1.385053157322e+01, 1.379491358369e+01, 1.374059723369e+01, + 1.368753957333e+01, 1.363569949233e+01, 1.358503762318e+01, + 1.353551625031e+01, 1.348709922480e+01, 1.343975188446e+01, + 1.339344097855e+01, 1.334813459717e+01, 1.330380210475e+01, + 1.326041407750e+01, 1.321794224441e+01, 1.317635943178e+01, + 1.313563951080e+01, 1.309575734818e+01, 1.305668875947e+01, + 1.301841046505e+01, 1.298090004846e+01, 1.294413591708e+01, + 1.290809726491e+01, 1.287276403729e+01, 1.283811689756e+01, + 1.280413719546e+01, 1.277080693717e+01, 1.273810875690e+01, + 1.270602588991e+01, 1.267454214700e+01, 1.264364189014e+01, + 1.261331000947e+01, 1.258353190132e+01, 1.255429344740e+01, + 1.252558099493e+01, 1.249738133782e+01, 1.246968169866e+01, + 1.244246971165e+01, 1.241573340629e+01, 1.238946119184e+01, + 1.236364184254e+01, 1.233826448345e+01, 1.231331857703e+01, + 1.228879391020e+01, 1.226468058215e+01, 1.224096899254e+01, + 1.221764983035e+01, 1.219471406311e+01, 1.217215292673e+01, + 1.214995791565e+01, 1.212812077350e+01, 1.210663348412e+01, + 1.208548826299e+01, 1.206467754900e+01, 1.204419399656e+01, + 1.202403046810e+01, 1.200418002679e+01, 1.198463592965e+01, + 1.196539162084e+01, 1.194644072537e+01, 1.192777704287e+01, + 1.190939454183e+01, 1.189128735386e+01, 1.187344976834e+01, + 1.185587622717e+01, 1.183856131980e+01, 1.182149977842e+01, + 1.180468647333e+01, 1.178811640848e+01, 1.177178471726e+01, + 1.175568665830e+01, 1.173981761158e+01, 1.172417307461e+01, + 1.170874865874e+01, 1.169354008563e+01, 1.167854318390e+01, + 1.166375388577e+01, 1.164916822399e+01, 1.163478232871e+01, + 1.162059242462e+01, 1.160659482808e+01, 1.159278594440e+01, + 1.157916226520e+01, 1.156572036588e+01, 1.155245690318e+01, + 1.153936861277e+01, 1.152645230701e+01, 1.151370487273e+01, + 1.150112326909e+01, 1.148870452551e+01, 1.147644573971e+01, + 1.146434407578e+01, 1.145239676230e+01, 1.144060109057e+01, + 1.142895441283e+01, 1.141745414065e+01, 1.140609774323e+01, + 1.139488274587e+01, 1.138380672846e+01, 1.137286732394e+01, + 1.136206221695e+01, 1.135138914242e+01, 1.134084588422e+01, + 1.133043027387e+01, 1.132014018930e+01, 1.130997355364e+01, + 1.129992833400e+01, 1.129000254039e+01, 1.128019422456e+01, + 1.127050147896e+01, 1.126092243568e+01, 1.125145526547e+01, + 1.124209817673e+01, 1.123284941458e+01, 1.122370725993e+01, + 1.121467002861e+01, 1.120573607046e+01, 1.119690376855e+01, + 1.118817153829e+01, 1.117953782670e+01, 1.117100111161e+01, + 1.116255990093e+01, 1.115421273189e+01, 1.114595817037e+01, + 1.113779481021e+01, 1.112972127252e+01, 1.112173620507e+01, + 1.111383828162e+01, 1.110602620133e+01, 1.109829868819e+01, + 1.109065449039e+01, 1.108309237980e+01, 1.107561115141e+01, + 1.106820962277e+01, 1.106088663355e+01, 1.105364104494e+01, + 1.104647173923e+01, 1.103937761931e+01, 1.103235760821e+01, + 1.102541064864e+01, 1.101853570255e+01, 1.101173175072e+01, + 1.100499779235e+01, 1.099833284459e+01, 1.099173594225e+01, + 1.098520613730e+01, 1.097874249860e+01, 1.097234411146e+01, + 1.096601007733e+01, 1.095973951341e+01, 1.095353155237e+01, + 1.094738534196e+01, 1.094130004473e+01, 1.093527483770e+01, + 1.092930891206e+01, 1.092340147288e+01, 1.091755173880e+01, + 1.091175894175e+01, 1.090602232671e+01, 1.090034115138e+01, + 1.089471468598e+01, 1.088914221295e+01, 1.088362302671e+01, + 1.087815643342e+01, 1.087274175077e+01, 1.086737830767e+01, + 1.086206544412e+01, 1.085680251091e+01, 1.085158886945e+01, + 1.084642389154e+01, 1.084130695917e+01, 1.083623746431e+01, + 1.083121480874e+01, 1.082623840380e+01, 1.082130767028e+01, + 1.081642203818e+01, 1.081158094654e+01, 1.080678384328e+01, + 1.080203018503e+01, 1.079731943695e+01, 1.079265107256e+01, + 1.078802457361e+01, 1.078343942991e+01, 1.077889513914e+01, + 1.077439120677e+01, 1.076992714587e+01, 1.076550247697e+01, + 1.076111672792e+01, 1.075676943378e+01, 1.075246013667e+01, + 1.074818838560e+01, 1.074395373642e+01, 1.073975575164e+01, + 1.073559400033e+01, 1.073146805797e+01, 1.072737750637e+01, + 1.072332193357e+01, 1.071930093365e+01, 1.071531410670e+01, + 1.071136105869e+01, 1.070744140134e+01, 1.070355475205e+01, + 1.069970073376e+01, 1.069587897492e+01, 1.069208910931e+01, + 1.068833077600e+01, 1.068460361926e+01, 1.068090728842e+01, + 1.067724143785e+01, 1.067360572681e+01, 1.066999981941e+01, + 1.066642338450e+01, 1.066287609559e+01]) -sine_fds_true = np.array([1.92209026e-24, 1.92304679e-24, 1.92591978e-24, 1.93071955e-24, - 1.93746332e-24, 1.94617539e-24, 1.95688730e-24, 1.96963803e-24, - 1.98447431e-24, 2.00145092e-24, 2.02063110e-24, 2.04208703e-24, - 2.06590034e-24, 2.09216273e-24, 2.12097666e-24, 2.15245614e-24, - 2.18672765e-24, 2.22393109e-24, 2.26422100e-24, 2.30776775e-24, - 2.35475905e-24, 2.40540156e-24, 2.45992267e-24, 2.51857261e-24, - 2.58162674e-24, 2.64938816e-24, 2.72219067e-24, 2.80040208e-24, - 2.88442803e-24, 2.97471620e-24, 3.07176121e-24, 3.17611010e-24, - 3.28836866e-24, 3.40920851e-24, 3.53937539e-24, 3.67969846e-24, - 3.83110110e-24, 3.99461325e-24, 4.17138573e-24, 4.36270664e-24, - 4.57002050e-24, 4.79495034e-24, 5.03932349e-24, 5.30520160e-24, - 5.59491585e-24, 5.91110811e-24, 6.25677952e-24, 6.63534772e-24, - 7.05071461e-24, 7.50734679e-24, 8.01037151e-24, 8.56569121e-24, - 9.18012111e-24, 9.86155485e-24, 1.06191648e-23, 1.14636449e-23, - 1.24075077e-23, 1.34654463e-23, 1.46547814e-23, 1.59960123e-23, - 1.75135020e-23, 1.92363322e-23, 2.11993761e-23, 2.34446529e-23, - 2.60230471e-23, 2.89965053e-23, 3.24408607e-23, 3.64494897e-23, - 4.11380804e-23, 4.66508965e-23, 5.31690736e-23, 6.09216965e-23, - 7.02007239e-23, 8.13812830e-23, 9.49495400e-23, 1.11541376e-22, - 1.31996652e-22, 1.57436251e-22, 1.89372804e-22, 2.29871966e-22, - 2.81790604e-22, 3.49133821e-22, 4.37598595e-22, 5.55415361e-22, - 7.14673727e-22, 9.33449149e-22, 1.23927907e-21, 1.67495386e-21, - 2.30834503e-21, 3.24937305e-21, 4.67970099e-21, 6.90502758e-21, - 1.04464310e-20, 1.61939321e-20, 2.56379308e-20, 4.11161073e-20, - 6.57074779e-20, 1.01659314e-19, 1.45690392e-19, 1.83059244e-19, - 1.92209026e-19, 1.65957190e-19, 1.20935526e-19, 7.83578102e-20, - 4.76165751e-20, 2.82553486e-20, 1.67929980e-20, 1.01368728e-20, - 6.25648299e-21, 3.95803404e-21, 2.56704209e-21, 1.70517791e-21, - 1.15835000e-21, 8.03364467e-22, 5.67876782e-22, 4.08474819e-22, - 2.98537735e-22, 2.21394428e-22, 1.66393232e-22, 1.26598371e-22, - 9.74126686e-23, 7.57379379e-23, 5.94535417e-23, 4.70867675e-23, - 3.76009383e-23, 3.02570357e-23, 2.45219754e-23, 2.00069480e-23, - 1.64254198e-23, 1.35641666e-23, 1.12630621e-23, 9.40081745e-24, - 7.88481430e-24, 6.64378548e-24, 5.62249553e-24, 4.77784099e-24, - 4.07596742e-24, 3.49012113e-24, 2.99903627e-24, 2.58571529e-24, - 2.23650041e-24, 1.94036214e-24, 1.68835075e-24, 1.47317076e-24, - 1.28884917e-24, 1.13047519e-24, 9.93995199e-25, 8.76050202e-25, - 7.73846587e-25, 6.85052715e-25, 6.07715918e-25, 5.40195556e-25, - 4.81108826e-25, 4.29286713e-25, 3.83738054e-25, 3.43620121e-25, - 3.08214448e-25, 2.76906902e-25, 2.49171210e-25, 2.24555286e-25, - 2.02669853e-25, 1.83178956e-25, 1.65792011e-25, 1.50257143e-25, - 1.36355576e-25, 1.23896898e-25, 1.12715063e-25, 1.02664998e-25, - 9.36197199e-26, 8.54678822e-26, 7.81116793e-26, 7.14650552e-26, - 6.54521677e-26, 6.00060692e-26, 5.50675723e-26, 5.05842705e-26, - 4.65096933e-26, 4.28025746e-26, 3.94262186e-26, 3.63479493e-26, - 3.35386311e-26, 3.09722518e-26, 2.86255582e-26, 2.64777377e-26, - 2.45101400e-26, 2.27060324e-26, 2.10503853e-26, 1.95296840e-26, - 1.81317624e-26, 1.68456566e-26, 1.56614760e-26, 1.45702886e-26, - 1.35640203e-26, 1.26353651e-26, 1.17777059e-26, 1.09850437e-26, - 1.02519346e-26, 9.57343454e-27, 8.94504885e-27, 8.36268812e-27, - 7.82262843e-27, 7.32147583e-27, 6.85613457e-27, 6.42377861e-27, - 6.02182611e-27, 5.64791646e-27, 5.29988972e-27, 4.97576804e-27, - 4.67373902e-27, 4.39214065e-27, 4.12944777e-27, 3.88425978e-27, - 3.65528966e-27, 3.44135391e-27, 3.24136354e-27, 3.05431582e-27, - 2.87928693e-27, 2.71542517e-27, 2.56194484e-27, 2.41812073e-27, - 2.28328300e-27, 2.15681264e-27, 2.03813727e-27, 1.92672733e-27, - 1.82209256e-27, 1.72377889e-27, 1.63136553e-27, 1.54446227e-27, - 1.46270716e-27, 1.38576418e-27, 1.31332133e-27, 1.24508868e-27, - 1.18079672e-27, 1.12019481e-27, 1.06304971e-27, 1.00914428e-27, - 9.58276303e-28, 9.10257333e-28, 8.64911702e-28, 8.22075571e-28, - 7.81596068e-28, 7.43330491e-28, 7.07145576e-28, 6.72916818e-28, - 6.40527845e-28, 6.09869848e-28, 5.80841040e-28, 5.53346170e-28, - 5.27296068e-28, 5.02607220e-28, 4.79201382e-28, 4.57005219e-28, - 4.35949972e-28, 4.15971146e-28, 3.97008225e-28, 3.79004406e-28, - 3.61906351e-28, 3.45663960e-28, 3.30230154e-28, 3.15560682e-28, - 3.01613935e-28, 2.88350774e-28, 2.75734373e-28, 2.63730069e-28, - 2.52305225e-28, 2.41429104e-28, 2.31072746e-28, 2.21208856e-28, - 2.11811706e-28, 2.02857030e-28, 1.94321940e-28, 1.86184837e-28, - 1.78425336e-28, 1.71024190e-28, 1.63963220e-28, 1.57225254e-28, - 1.50794065e-28, 1.44654313e-28, 1.38791496e-28, 1.33191897e-28, - 1.27842540e-28, 1.22731147e-28, 1.17846095e-28, 1.13176381e-28, - 1.08711584e-28, 1.04441832e-28, 1.00357773e-28, 9.64505424e-29, - 9.27117366e-29, 8.91333874e-29, 8.57079372e-29, 8.24282161e-29, - 7.92874206e-29, 7.62790932e-29, 7.33971032e-29, 7.06356290e-29, - 6.79891411e-29, 6.54523866e-29, 6.30203735e-29, 6.06883575e-29, - 5.84518282e-29, 5.63064966e-29, 5.42482837e-29, 5.22733089e-29, - 5.03778801e-29, 4.85584833e-29, 4.68117735e-29, 4.51345661e-29, - 4.35238283e-29, 4.19766713e-29, 4.04903429e-29, 3.90622209e-29, - 3.76898059e-29, 3.63707154e-29, 3.51026777e-29, 3.38835266e-29, - 3.27111958e-29, 3.15837141e-29, 3.04992007e-29, 2.94558604e-29, - 2.84519800e-29, 2.74859235e-29, 2.65561288e-29, 2.56611042e-29, - 2.47994246e-29, 2.39697285e-29, 2.31707148e-29, 2.24011401e-29, - 2.16598157e-29, 2.09456053e-29, 2.02574221e-29, 1.95942269e-29, - 1.89550256e-29, 1.83388669e-29, 1.77448407e-29, 1.71720761e-29, - 1.66197393e-29, 1.60870322e-29, 1.55731904e-29, 1.50774821e-29, - 1.45992064e-29, 1.41376915e-29, 1.36922943e-29, 1.32623980e-29, - 1.28474118e-29, 1.24467694e-29, 1.20599277e-29, 1.16863660e-29, - 1.13255850e-29, 1.09771060e-29, 1.06404694e-29, 1.03152347e-29, - 1.00009788e-29, 9.69729601e-30, 9.40379674e-30, 9.12010708e-30, - 8.84586802e-30, 8.58073487e-30, 8.32437656e-30, 8.07647513e-30, - 7.83672515e-30, 7.60483317e-30, 7.38051722e-30, 7.16350634e-30, - 6.95354009e-30, 6.75036813e-30, 6.55374979e-30, 6.36345366e-30, - 6.17925722e-30, 6.00094646e-30, 5.82831551e-30, 5.66116635e-30, - 5.49930847e-30, 5.34255851e-30, 5.19074007e-30, 5.04368334e-30, - 4.90122486e-30, 4.76320729e-30, 4.62947911e-30, 4.49989444e-30, - 4.37431279e-30, 4.25259884e-30, 4.13462223e-30, 4.02025739e-30, - 3.90938333e-30, 3.80188346e-30, 3.69764542e-30, 3.59656093e-30, - 3.49852558e-30, 3.40343875e-30, 3.31120342e-30, 3.22172602e-30, - 3.13491634e-30, 3.05068736e-30, 2.96895514e-30, 2.88963872e-30, - 2.81265999e-30, 2.73794357e-30, 2.66541672e-30, 2.59500926e-30, - 2.52665344e-30]) +sine_fds_true = np.array([1.922090260873e-24, 1.923046785764e-24, 1.925919784010e-24, + 1.930719549752e-24, 1.937463319562e-24, 1.946175392746e-24, + 1.956887301694e-24, 1.969638034159e-24, 1.984474309970e-24, + 2.001450915331e-24, 2.020631098554e-24, 2.042087031821e-24, + 2.065900344418e-24, 2.092162733791e-24, 2.120976661839e-24, + 2.152456144994e-24, 2.186727648013e-24, 2.223931092840e-24, + 2.264220995688e-24, 2.307767747418e-24, 2.354759054553e-24, + 2.405401560902e-24, 2.459922672771e-24, 2.518572614225e-24, + 2.581626742956e-24, 2.649388162029e-24, 2.722190668318e-24, + 2.800402084903e-24, 2.884428032323e-24, 2.974716202481e-24, + 3.071761209542e-24, 3.176110104613e-24, 3.288368655711e-24, + 3.409208512061e-24, 3.539375392570e-24, 3.679698463220e-24, + 3.831101097894e-24, 3.994613252854e-24, 4.171385728135e-24, + 4.362706640985e-24, 4.570020499325e-24, 4.794950339539e-24, + 5.039323485805e-24, 5.305201601826e-24, 5.594915845086e-24, + 5.911108105200e-24, 6.256779519582e-24, 6.635347722033e-24, + 7.050714606313e-24, 7.507346794513e-24, 8.010371511513e-24, + 8.565691211030e-24, 9.180121113720e-24, 9.861554853550e-24, + 1.061916475108e-23, 1.146364492921e-23, 1.240750767507e-23, + 1.346544628902e-23, 1.465478135956e-23, 1.599601225163e-23, + 1.751350198983e-23, 1.923633220327e-23, 2.119937613124e-23, + 2.344465292703e-23, 2.602304713043e-23, 2.899650532440e-23, + 3.244086067918e-23, 3.644948969356e-23, 4.113808035145e-23, + 4.665089651111e-23, 5.316907359270e-23, 6.092169648854e-23, + 7.020072391491e-23, 8.138128302672e-23, 9.494953997686e-23, + 1.115413757288e-22, 1.319966523398e-22, 1.574362509867e-22, + 1.893728037947e-22, 2.298719663155e-22, 2.817906035438e-22, + 3.491338205529e-22, 4.375985950086e-22, 5.554153609575e-22, + 7.146737271999e-22, 9.334491485185e-22, 1.239279073761e-21, + 1.674953862552e-21, 2.308345031486e-21, 3.249373054725e-21, + 4.679700991309e-21, 6.905027584019e-21, 1.044643099669e-20, + 1.619393207699e-20, 2.563793082904e-20, 4.111610728025e-20, + 6.570747794712e-20, 1.016593136780e-19, 1.456903918250e-19, + 1.830592442822e-19, 1.922090260835e-19, 1.659571898178e-19, + 1.209355258682e-19, 7.835781022786e-20, 4.761657511909e-20, + 2.825534856247e-20, 1.679299801543e-20, 1.013687280916e-20, + 6.256482985685e-21, 3.958034043177e-21, 2.567042088141e-21, + 1.705177906556e-21, 1.158349996057e-21, 8.033644668219e-22, + 5.678767816881e-22, 4.084748187803e-22, 2.985377348442e-22, + 2.213944278204e-22, 1.663932317012e-22, 1.265983709863e-22, + 9.741266856378e-23, 7.573793787851e-23, 5.945354171897e-23, + 4.708676754723e-23, 3.760093831039e-23, 3.025703566352e-23, + 2.452197535887e-23, 2.000694801580e-23, 1.642541977554e-23, + 1.356416658661e-23, 1.126306213433e-23, 9.400817449365e-24, + 7.884814299696e-24, 6.643785478285e-24, 5.622495526025e-24, + 4.777840988881e-24, 4.075967424639e-24, 3.490121130659e-24, + 2.999036272079e-24, 2.585715291357e-24, 2.236500408854e-24, + 1.940362142925e-24, 1.688350747262e-24, 1.473170759242e-24, + 1.288849166481e-24, 1.130475193850e-24, 9.939951985468e-25, + 8.760502023096e-25, 7.738465868660e-25, 6.850527149426e-25, + 6.077159176314e-25, 5.401955559726e-25, 4.811088263358e-25, + 4.292867130128e-25, 3.837380542152e-25, 3.436201213850e-25, + 3.082144475533e-25, 2.769069016904e-25, 2.491712100598e-25, + 2.245552856811e-25, 2.026698531299e-25, 1.831789556360e-25, + 1.657920106285e-25, 1.502571429686e-25, 1.363555755629e-25, + 1.238968975415e-25, 1.127150627752e-25, 1.026649978447e-25, + 9.361971990246e-26, 8.546788221549e-26, 7.811167931052e-26, + 7.146505520164e-26, 6.545216765595e-26, 6.000606924232e-26, + 5.506757232871e-26, 5.058427049968e-26, 4.650969326125e-26, + 4.280257455076e-26, 3.942621860831e-26, 3.634794930177e-26, + 3.353863111790e-26, 3.097225180887e-26, 2.862555817633e-26, + 2.647773773097e-26, 2.451014002521e-26, 2.270603235170e-26, + 2.105038525827e-26, 1.952968397305e-26, 1.813176237961e-26, + 1.684565664759e-26, 1.566147602059e-26, 1.457028860243e-26, + 1.356402027281e-26, 1.263536511207e-26, 1.177770592838e-26, + 1.098504366412e-26, 1.025193461657e-26, 9.573434544234e-27, + 8.945048848015e-27, 8.362688118568e-27, 7.822628429212e-27, + 7.321475830583e-27, 6.856134569736e-27, 6.423778614275e-27, + 6.021826112554e-27, 5.647916464984e-27, 5.299889719878e-27, + 4.975768040853e-27, 4.673739022239e-27, 4.392140654666e-27, + 4.129447765656e-27, 3.884259779880e-27, 3.655289661227e-27, + 3.441353914201e-27, 3.241363535729e-27, 3.054315820403e-27, + 2.879286932777e-27, 2.715425169652e-27, 2.561944843550e-27, + 2.418120725930e-27, 2.283282995157e-27, 2.156812640030e-27, + 2.038137274779e-27, 1.926727326001e-27, 1.822092556074e-27, + 1.723778891172e-27, 1.631365525257e-27, 1.544462274273e-27, + 1.462707157354e-27, 1.385764184147e-27, 1.313321329398e-27, + 1.245088677805e-27, 1.180796723774e-27, 1.120194812210e-27, + 1.063049707778e-27, 1.009144281298e-27, 9.582763029624e-28, + 9.102573330825e-28, 8.649117018854e-28, 8.220755707089e-28, + 7.815960676209e-28, 7.433304911355e-28, 7.071455762728e-28, + 6.729168177260e-28, 6.405278453701e-28, 6.098698477715e-28, + 5.808410397407e-28, 5.533461703194e-28, 5.272960679098e-28, + 5.026072195390e-28, 4.792013815100e-28, 4.570052189309e-28, + 4.359499718234e-28, 4.159711457106e-28, 3.970082247584e-28, + 3.790044057089e-28, 3.619063509893e-28, 3.456639595149e-28, + 3.302301538262e-28, 3.155606823127e-28, 3.016139353767e-28, + 2.883507744831e-28, 2.757343731289e-28, 2.637300688388e-28, + 2.523052253692e-28, 2.414291043659e-28, 2.310727457791e-28, + 2.212088563957e-28, 2.118117058994e-28, 2.028570299119e-28, + 1.943219395136e-28, 1.861848367804e-28, 1.784253359063e-28, + 1.710241895169e-28, 1.639632198081e-28, 1.572252541705e-28, + 1.507940649860e-28, 1.446543133090e-28, 1.387914961610e-28, + 1.331918971917e-28, 1.278425404759e-28, 1.227311472328e-28, + 1.178460952686e-28, 1.131763809609e-28, 1.087115836117e-28, + 1.044418320133e-28, 1.003577730777e-28, 9.645054239510e-29, + 9.271173659290e-29, 8.913338737794e-29, 8.570793715209e-29, + 8.242821609901e-29, 7.928742064687e-29, 7.627909321875e-29, + 7.339710318809e-29, 7.063562896241e-29, 6.798914112379e-29, + 6.545238655924e-29, 6.302037351873e-29, 6.068835754295e-29, + 5.845182820631e-29, 5.630649662489e-29, 5.424828368185e-29, + 5.227330892631e-29, 5.037788010438e-29, 4.855848328379e-29, + 4.681177353616e-29, 4.513456614308e-29, 4.352382829452e-29, + 4.197667125011e-29, 4.049034293555e-29, 3.906222094838e-29, + 3.768980594882e-29, 3.637071541301e-29, 3.510267772739e-29, + 3.388352660419e-29, 3.271119579945e-29, 3.158371411600e-29, + 3.049920067483e-29, 2.945586043959e-29, 2.845197997959e-29, + 2.748592345772e-29, 2.655612883058e-29, 2.566110424869e-29, + 2.479942464561e-29, 2.396972850527e-29, 2.317071479760e-29, + 2.240114007309e-29, 2.165981570742e-29, 2.094560528785e-29, + 2.025742213365e-29, 1.959422694311e-29, 1.895502556026e-29, + 1.833886685485e-29, 1.774484070927e-29, 1.717207610683e-29, + 1.661973931580e-29, 1.608703216417e-29, 1.557319040021e-29, + 1.507748213428e-29, 1.459920635764e-29, 1.413769153412e-29, + 1.369229426080e-29, 1.326239799421e-29, 1.284741183841e-29, + 1.244676939197e-29, 1.205992765059e-29, 1.168636596262e-29, + 1.132558503465e-29, 1.097710598471e-29, 1.064046944052e-29, + 1.031523468064e-29, 1.000097881615e-29, 9.697296011054e-30, + 9.403796739165e-30, 9.120107075932e-30, 8.845868023222e-30, + 8.580734865550e-30, 8.324376556137e-30, 8.076475131327e-30, + 7.836725151971e-30, 7.604833170440e-30, 7.380517222006e-30, + 7.163506339417e-30, 6.953540089512e-30, 6.750368130826e-30, + 6.553749791149e-30, 6.363453664097e-30, 6.179257223760e-30, + 6.000946456576e-30, 5.828315509600e-30, 5.661166354386e-30, + 5.499308465742e-30, 5.342558514667e-30, 5.190740074770e-30, + 5.043683341576e-30, 4.901224864080e-30, 4.763207288003e-30, + 4.629479110186e-30, 4.499894443620e-30, 4.374312792609e-30, + 4.252598837601e-30, 4.134622229251e-30, 4.020257391275e-30, + 3.909383331714e-30, 3.801883462211e-30, 3.697645424937e-30, + 3.596560926829e-30, 3.498525580805e-30, 3.403438753634e-30, + 3.311203420178e-30, 3.221726023713e-30, 3.134916342049e-30, + 3.050687359212e-30, 2.968955142418e-30, 2.889638724131e-30, + 2.812659988950e-30, 2.737943565145e-30, 2.665416720611e-30, + 2.595009263071e-30, 2.526653444318e-30]) -sine_sweep_ers_true = np.array([1.25000000e-08, 3.33214878e-01, 1.66297526e+00, 6.33614307e+00, - 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, - 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, - 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, - 5.00000000e+01, 5.00000000e+01, 5.00000000e+01, 6.62971491e+01, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, 1.00000000e+02, - 1.00000000e+02, 1.05465787e+02, 1.18115676e+02, 1.32594298e+02, - 1.48710168e+02, 1.65671629e+02, 1.81724538e+02, 1.94117175e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, 2.00000000e+02, - 2.00000000e+02, 2.00007395e+02, 1.98114928e+02, 1.94557035e+02, - 1.89664637e+02, 1.83803684e+02, 1.77323440e+02, 1.70523781e+02, - 1.63641537e+02, 1.56850730e+02, 1.50270583e+02, 1.43976444e+02, - 1.38010655e+02, 1.32391937e+02, 1.27122842e+02, 1.22195365e+02, - 1.17594986e+02, 1.13303512e+02, 1.09301001e+02, 1.05567037e+02, - 1.02081539e+02, 9.88252610e+01, 9.57800671e+01, 9.29290668e+01, - 9.02566574e+01, 8.77485071e+01, 8.53915016e+01, 8.31736721e+01, - 8.10841121e+01, 7.91128924e+01, 7.72509766e+01, 7.54901400e+01, - 7.38228938e+01, 7.22424153e+01, 7.07424833e+01, 6.93174197e+01, - 6.79620368e+01, 6.66715894e+01, 6.54417322e+01, 6.42684807e+01, - 6.31481774e+01, 6.20774600e+01, 6.10532343e+01, 6.00726489e+01, - 5.91330728e+01, 5.82320757e+01, 5.73674094e+01, 5.65369922e+01, - 5.57388940e+01, 5.49713231e+01, 5.42326145e+01, 5.35212192e+01, - 5.28356945e+01, 5.21746954e+01, 5.15369663e+01, 5.09213343e+01, - 5.03267024e+01, 4.97520436e+01, 4.91963954e+01, 4.86588554e+01, - 4.81385762e+01, 4.76347615e+01, 4.71466626e+01, 4.66735747e+01, - 4.62148339e+01, 4.57698143e+01, 4.53379253e+01, 4.49186092e+01, - 4.45113391e+01, 4.41156168e+01, 4.37309705e+01, 4.33569537e+01, - 4.29931432e+01, 4.26391377e+01, 4.22945564e+01, 4.19590376e+01, - 4.16322379e+01, 4.13138306e+01, 4.10035049e+01, 4.07009653e+01, - 4.04059301e+01, 4.01181308e+01, 3.98373117e+01, 3.95632287e+01, - 3.92956488e+01, 3.90343496e+01, 3.87791185e+01, 3.85297525e+01, - 3.82860571e+01, 3.80478467e+01, 3.78149432e+01, 3.75871762e+01, - 3.73643825e+01, 3.71464056e+01, 3.69330954e+01, 3.67243081e+01, - 3.65199055e+01, 3.63197549e+01, 3.61237290e+01, 3.59317053e+01, - 3.57435662e+01, 3.55591985e+01, 3.53784935e+01, 3.52013464e+01, - 3.50276564e+01, 3.48573264e+01, 3.46902629e+01, 3.45263758e+01, - 3.43655782e+01, 3.42077864e+01, 3.40529197e+01, 3.39008999e+01, - 3.37516521e+01, 3.36051034e+01, 3.34611838e+01, 3.33198255e+01, - 3.31809630e+01, 3.30445331e+01, 3.29104746e+01, 3.27787283e+01, - 3.26492370e+01, 3.25219452e+01, 3.23967995e+01, 3.22737478e+01, - 3.21527400e+01, 3.20337274e+01, 3.19166627e+01, 3.18015004e+01, - 3.16881960e+01, 3.15767068e+01, 3.14669909e+01, 3.13590081e+01, - 3.12527190e+01, 3.11480858e+01, 3.10450714e+01, 3.09436400e+01, - 3.08437569e+01, 3.07453881e+01, 3.06485010e+01, 3.05530635e+01, - 3.04590447e+01, 3.03664144e+01, 3.02751433e+01, 3.01852030e+01, - 3.00965657e+01, 3.00092044e+01, 2.99230930e+01, 2.98382059e+01, - 2.97545182e+01, 2.96720059e+01, 2.95906453e+01, 2.95104135e+01, - 2.94312881e+01, 2.93532476e+01, 2.92762705e+01, 2.92003363e+01, - 2.91254249e+01, 2.90515166e+01, 2.89785923e+01, 2.89066333e+01, - 2.88356215e+01, 2.87655391e+01, 2.86963689e+01, 2.86280938e+01, - 2.85606975e+01, 2.84941638e+01, 2.84284771e+01, 2.83636220e+01, - 2.82995835e+01, 2.82363472e+01, 2.81738986e+01, 2.81122239e+01, - 2.80513094e+01, 2.79911418e+01, 2.79317082e+01, 2.78729958e+01, - 2.78149922e+01, 2.77576853e+01, 2.77010631e+01, 2.76451142e+01, - 2.75898272e+01, 2.75351909e+01, 2.74811945e+01, 2.74278274e+01, - 2.73750791e+01, 2.73229397e+01, 2.72713990e+01, 2.72204474e+01, - 2.71700752e+01, 2.71202733e+01, 2.70710325e+01, 2.70223438e+01, - 2.69741984e+01, 2.69265879e+01, 2.68795038e+01, 2.68329378e+01, - 2.67868820e+01, 2.67413283e+01, 2.66962692e+01, 2.66516970e+01, - 2.66076042e+01]) +sine_sweep_ers_true = np.array([1.250000003109e-08, 3.332148779873e-01, 1.662975263094e+00, + 6.336143066657e+00, 5.000000000000e+01, 5.000000000000e+01, + 5.000000000000e+01, 5.000000000000e+01, 5.000000000000e+01, + 5.000000000000e+01, 5.000000000000e+01, 5.000000000000e+01, + 5.000000000000e+01, 5.000000000000e+01, 5.000000000000e+01, + 5.000000000000e+01, 5.000000000000e+01, 5.000000000000e+01, + 5.000000000000e+01, 6.629714905649e+01, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.000000000000e+02, 1.000000000000e+02, 1.000000000000e+02, + 1.054657874964e+02, 1.181156764552e+02, 1.325942981130e+02, + 1.487101684966e+02, 1.656716292605e+02, 1.817245381084e+02, + 1.941171749475e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000000000000e+02, 2.000000000000e+02, 2.000000000000e+02, + 2.000073952137e+02, 1.981149284995e+02, 1.945570353485e+02, + 1.896646365070e+02, 1.838036836513e+02, 1.773234399019e+02, + 1.705237813115e+02, 1.636415368818e+02, 1.568507299561e+02, + 1.502705832350e+02, 1.439764442224e+02, 1.380106552689e+02, + 1.323919368046e+02, 1.271228423868e+02, 1.221953647128e+02, + 1.175949859550e+02, 1.133035122268e+02, 1.093010014138e+02, + 1.055670366398e+02, 1.020815388275e+02, 9.882526104179e+01, + 9.578006711033e+01, 9.292906675621e+01, 9.025665740519e+01, + 8.774850706935e+01, 8.539150162166e+01, 8.317367206260e+01, + 8.108411206149e+01, 7.911289241672e+01, 7.725097660873e+01, + 7.549013995766e+01, 7.382289379033e+01, 7.224241529411e+01, + 7.074248326701e+01, 6.931741967974e+01, 6.796203678949e+01, + 6.667158944787e+01, 6.544173219844e+01, 6.426848074647e+01, + 6.314817739011e+01, 6.207746002212e+01, 6.105323433735e+01, + 6.007264891046e+01, 5.913307283880e+01, 5.823207567483e+01, + 5.736740940049e+01, 5.653699222227e+01, 5.573889398936e+01, + 5.497132305924e+01, 5.423261445466e+01, 5.352121917313e+01, + 5.283569452605e+01, 5.217469539830e+01, 5.153696633139e+01, + 5.092133434422e+01, 5.032670241516e+01, 4.975204355759e+01, + 4.919639542861e+01, 4.865885541739e+01, 4.813857616520e+01, + 4.763476147475e+01, 4.714666257065e+01, 4.667357467730e+01, + 4.621483388366e+01, 4.576981426788e+01, 4.533792525756e+01, + 4.491860920354e+01, 4.451133914805e+01, 4.411561676929e+01, + 4.373097048680e+01, 4.335695371324e+01, 4.299314323991e+01, + 4.263913774418e+01, 4.229455640855e+01, 4.195903764169e+01, + 4.163223789301e+01, 4.131383055293e+01, 4.100350493177e+01, + 4.070096531086e+01, 4.040593006008e+01, 4.011813081648e+01, + 3.983731171918e+01, 3.956322869612e+01, 3.929564879868e+01, + 3.903434958051e+01, 3.877911851708e+01, 3.852975246311e+01, + 3.828605714489e+01, 3.804784668496e+01, 3.781494315680e+01, + 3.758717616740e+01, 3.736438246560e+01, 3.714640557451e+01, + 3.693309544619e+01, 3.672430813714e+01, 3.651990550313e+01, + 3.631975491199e+01, 3.612372897321e+01, 3.593170528328e+01, + 3.574356618553e+01, 3.555919854373e+01, 3.537849352840e+01, + 3.520134641506e+01, 3.502765639371e+01, 3.485732638868e+01, + 3.469026288835e+01, 3.452637578404e+01, 3.436557821752e+01, + 3.420778643657e+01, 3.405291965818e+01, 3.390089993889e+01, + 3.375165205176e+01, 3.360510336976e+01, 3.346118375498e+01, + 3.331982545353e+01, 3.318096299559e+01, 3.304453310056e+01, + 3.291047458672e+01, 3.277872828546e+01, 3.264923695954e+01, + 3.252194522538e+01, 3.239679947899e+01, 3.227374782543e+01, + 3.215274001160e+01, 3.203372736217e+01, 3.191666271841e+01, + 3.180150037995e+01, 3.168819604906e+01, 3.157670677757e+01, + 3.146699091609e+01, 3.135900806558e+01, 3.125271903094e+01, + 3.114808577681e+01, 3.104507138512e+01, 3.094364001463e+01, + 3.084375686214e+01, 3.074538812535e+01, 3.064850096732e+01, + 3.055306348245e+01, 3.045904466382e+01, 3.036641437198e+01, + 3.027514330493e+01, 3.018520296939e+01, 3.009656565327e+01, + 3.000920439917e+01, 2.992309297901e+01, 2.983820586965e+01, + 2.975451822951e+01, 2.967200587605e+01, 2.959064526421e+01, + 2.951041346560e+01, 2.943128814859e+01, 2.935324755910e+01, + 2.927627050216e+01, 2.920033632412e+01, 2.912542489563e+01, + 2.905151659513e+01, 2.897859229304e+01, 2.890663333657e+01, + 2.883562153495e+01, 2.876553914536e+01, 2.869636885925e+01, + 2.862809378926e+01, 2.856069745647e+01, 2.849416377831e+01, + 2.842847705665e+01, 2.836362196655e+01, 2.829958354524e+01, + 2.823634718156e+01, 2.817389860574e+01, 2.811222387955e+01, + 2.805130938680e+01, 2.799114182409e+01, 2.793170819200e+01, + 2.787299578644e+01, 2.781499219041e+01, 2.775768526597e+01, + 2.770106314645e+01, 2.764511422901e+01, 2.758982716738e+01, + 2.753519086483e+01, 2.748119446739e+01, 2.742782735730e+01, + 2.737507914666e+01, 2.732293967126e+01, 2.727139898466e+01, + 2.722044735238e+01, 2.717007524637e+01, 2.712027333955e+01, + 2.707103250062e+01, 2.702234378893e+01, 2.697419844961e+01, + 2.692658790878e+01, 2.687950376892e+01, 2.683293780439e+01, + 2.678688195709e+01, 2.674132833226e+01, 2.669626919434e+01, + 2.665169696304e+01, 2.660760420951e+01]) -sine_sweep_fds_true = np.array([1.48829368e-15, 1.93501515e-15, 4.77631432e-15, 4.08234019e-14, - 4.05729827e-11, 1.20790969e-11, 2.34361197e-12, 5.85376481e-13, - 1.76008210e-13, 6.09779979e-14, 2.36245938e-14, 1.00193219e-14, - 4.57882664e-15, 2.22805855e-15, 1.14382333e-15, 6.15196968e-16, - 3.45171664e-16, 2.02886013e-16, 1.32974225e-16, 1.63796165e-16, - 6.88062359e-16, 8.75296113e-16, 6.16454585e-16, 4.17555013e-16, - 2.85481057e-16, 1.97912487e-16, 1.39118445e-16, 9.90797586e-17, - 7.14339568e-17, 5.20941657e-17, 3.83981265e-17, 2.85869523e-17, - 2.14827352e-17, 1.62864516e-17, 1.24494916e-17, 9.59085909e-18, - 7.44310307e-18, 5.81656496e-18, 4.57545680e-18, 3.62167474e-18, - 2.88372967e-18, 2.30910085e-18, 1.85890334e-18, 1.50413516e-18, - 1.22301336e-18, 9.99067489e-19, 8.19764298e-19, 6.75508336e-19, - 5.58910412e-19, 4.64248502e-19, 3.87067869e-19, 3.23882578e-19, - 2.71951354e-19, 2.29108307e-19, 1.93634368e-19, 1.64159136e-19, - 1.39585555e-19, 1.19031824e-19, 1.01786388e-19, 8.72728974e-20, - 7.50228167e-20, 6.46539150e-20, 5.58533074e-20, 4.83640310e-20, - 4.19743787e-20, 3.65093919e-20, 3.18240508e-20, 2.77978048e-20, - 2.43301645e-20, 2.13371376e-20, 1.87483380e-20, 1.65046339e-20, - 1.45562297e-20, 1.28610960e-20, 1.13836832e-20, 1.00938634e-20, - 8.96606080e-21, 7.97853441e-21, 7.11278872e-21, 6.35309016e-21, - 5.68607418e-21, 5.10043171e-21, 4.58666871e-21, 4.13693790e-21, - 3.74494904e-21, 3.40597491e-21, 3.11698698e-21, 2.87698373e-21, - 2.68762450e-21, 2.55437038e-21, 2.48849258e-21, 2.51058869e-21, - 2.65672077e-21, 2.98899175e-21, 3.61303383e-21, 4.70389635e-21, - 6.53353072e-21, 9.46419021e-21, 1.38148757e-20, 1.95036737e-20, - 2.56615777e-20, 3.08596190e-20, 3.40492013e-20, 3.51368548e-20, - 3.46628013e-20, 3.32592746e-20, 3.13956492e-20, 2.93589071e-20, - 2.73076031e-20, 2.53235352e-20, 2.34457164e-20, 2.16900427e-20, - 2.00601398e-20, 1.85532568e-20, 1.71634644e-20, 1.58833975e-20, - 1.47052048e-20, 1.36210627e-20, 1.26234457e-20, 1.17052617e-20, - 1.08599081e-20, 1.00812862e-20, 9.36379007e-21, 8.70228350e-21, - 8.09207002e-21, 7.52886065e-21, 7.00874136e-21, 6.52814155e-21, - 6.08380417e-21, 5.67275795e-21, 5.29229162e-21, 4.93993037e-21, - 4.61341431e-21, 4.31067884e-21, 4.02983686e-21, 3.76916262e-21, - 3.52707702e-21, 3.30213441e-21, 3.09301049e-21, 2.89849151e-21, - 2.71746434e-21, 2.54890758e-21, 2.39188344e-21, 2.24553042e-21, - 2.10905666e-21, 1.98173386e-21, 1.86289187e-21, 1.75191363e-21, - 1.64823071e-21, 1.55131916e-21, 1.46069579e-21, 1.37591472e-21, - 1.29656433e-21, 1.22226441e-21, 1.15266356e-21, 1.08743688e-21, - 1.02628377e-21, 9.68926019e-22, 9.15105969e-22, 8.64584898e-22, - 8.17141514e-22, 7.72570574e-22, 7.30681628e-22, 6.91297863e-22, - 6.54255041e-22, 6.19400520e-22, 5.86592364e-22, 5.55698509e-22, - 5.26596005e-22, 4.99170309e-22, 4.73314630e-22, 4.48929320e-22, - 4.25921306e-22, 4.04203552e-22, 3.83694551e-22, 3.64317833e-22, - 3.46001490e-22, 3.28677703e-22, 3.12282257e-22, 2.96754034e-22, - 2.82034472e-22, 2.68066958e-22, 2.54796125e-22, 2.42167033e-22, - 2.30124179e-22, 2.18610289e-22, 2.07564852e-22, 1.96922368e-22, - 1.86610316e-22, 1.76546997e-22, 1.66639577e-22, 1.56783061e-22, - 1.46861497e-22, 1.36753401e-22, 1.26343953e-22, 1.15546202e-22, - 1.04331096e-22, 9.27608424e-23, 8.10129310e-23, 6.93779047e-23, - 5.82196826e-23, 4.79046494e-23, 3.87249670e-23, 3.08467486e-23, - 2.42994872e-23, 1.90012910e-23, 1.48011967e-23, 1.15203046e-23, - 8.98174614e-24, 7.02768593e-24, 5.52607924e-24, 4.37102448e-24, - 3.47990310e-24, 2.78938764e-24, 2.25144846e-24, 1.82986003e-24, - 1.49735308e-24, 1.23338728e-24, 1.02245265e-24, 8.52793572e-25, - 7.15458559e-25, 6.03595636e-25, 5.11930424e-25, 4.36379218e-25, - 3.73761442e-25, 3.21585191e-25, 2.77886613e-25, 2.41109037e-25, - 2.10011557e-25, 1.83599512e-25, 1.61071351e-25, 1.41777786e-25, - 1.25190233e-25, 1.10876282e-25, 9.84805542e-26, 8.77096601e-26, - 7.83203390e-26, 7.01100521e-26, 6.29094887e-26, 5.65765674e-26, - 5.09916134e-26, 4.60534642e-26, 4.16763105e-26, 3.77871245e-26, - 3.43235571e-26, 3.12322123e-26, 2.84672256e-26, 2.59890883e-26, - 2.37636733e-26, 2.17614228e-26, 1.99566707e-26, 1.83270748e-26, - 1.68531395e-26, 1.55178135e-26, 1.43061499e-26, 1.32050180e-26, - 1.22028584e-26, 1.12894741e-26, 1.04558521e-26, 9.69401095e-27, - 8.99686956e-27, 8.35813413e-27, 7.77220104e-27, 7.23407273e-27, - 6.73928475e-27, 6.28384265e-27, 5.86416687e-27, 5.47704490e-27, - 5.11958937e-27, 4.78920150e-27, 4.48353901e-27, 4.20048796e-27, - 3.93813800e-27, 3.69476055e-27, 3.46878960e-27, 3.25880466e-27, - 3.06351577e-27, 2.88175012e-27, 2.71244024e-27, 2.55461350e-27, - 2.40738268e-27, 2.26993768e-27, 2.14153808e-27, 2.02150642e-27, - 1.90922230e-27, 1.80411701e-27, 1.70566875e-27, 1.61339835e-27, - 1.52686537e-27, 1.44566462e-27, 1.36942307e-27, 1.29779697e-27, - 1.23046930e-27, 1.16714750e-27, 1.10756131e-27, 1.05146096e-27, - 9.98615381e-28, 9.48810683e-28, 9.01848729e-28, 8.57545848e-28, - 8.15731665e-28, 7.76248029e-28, 7.38948044e-28, 7.03695182e-28, - 6.70362465e-28, 6.38831730e-28, 6.08992951e-28, 5.80743611e-28, - 5.53988144e-28, 5.28637405e-28, 5.04608195e-28, 4.81822822e-28, - 4.60208695e-28, 4.39697958e-28, 4.20227142e-28, 4.01736855e-28, - 3.84171491e-28, 3.67478962e-28, 3.51610455e-28, 3.36520200e-28, - 3.22165262e-28, 3.08505348e-28, 2.95502626e-28, 2.83121557e-28, - 2.71328746e-28, 2.60092795e-28, 2.49384172e-28, 2.39175090e-28, - 2.29439391e-28, 2.20152443e-28, 2.11291038e-28, 2.02833305e-28, - 1.94758622e-28, 1.87047542e-28, 1.79681710e-28, 1.72643806e-28, - 1.65917473e-28, 1.59487263e-28, 1.53338575e-28, 1.47457611e-28, - 1.41831324e-28, 1.36447371e-28, 1.31294074e-28, 1.26360379e-28, - 1.21635822e-28, 1.17110490e-28, 1.12774992e-28, 1.08620428e-28, - 1.04638360e-28, 1.00820787e-28, 9.71601199e-29, 9.36491559e-29, - 9.02810600e-29, 8.70493425e-29, 8.39478403e-29, 8.09706986e-29, - 7.81123544e-29, 7.53675198e-29, 7.27311678e-29, 7.01985176e-29, - 6.77650217e-29, 6.54263529e-29, 6.31783933e-29, 6.10172226e-29, - 5.89391078e-29, 5.69404936e-29, 5.50179929e-29, 5.31683779e-29, - 5.13885723e-29, 4.96756433e-29, 4.80267942e-29, 4.64393573e-29, - 4.49107878e-29, 4.34386573e-29, 4.20206479e-29, 4.06545470e-29, - 3.93382417e-29, 3.80697141e-29, 3.68470364e-29, 3.56683669e-29, - 3.45319453e-29, 3.34360890e-29, 3.23791894e-29, 3.13597082e-29, - 3.03761740e-29, 2.94271794e-29, 2.85113775e-29, 2.76274794e-29, - 2.67742515e-29, 2.59505126e-29, 2.51551316e-29, 2.43870253e-29, - 2.36451560e-29, 2.29285296e-29, 2.22361933e-29, 2.15672341e-29, - 2.09207767e-29, 2.02959819e-29, 1.96920448e-29, 1.91081937e-29, - 1.85436881e-29]) +sine_sweep_fds_true = np.array([1.488293678777e-15, 1.935015154049e-15, 4.776314316974e-15, + 4.082340193263e-14, 4.057298269391e-11, 1.207909693581e-11, + 2.343611968136e-12, 5.853764806884e-13, 1.760082099267e-13, + 6.097799793350e-14, 2.362459378636e-14, 1.001932194401e-14, + 4.578826640875e-15, 2.228058546420e-15, 1.143823332458e-15, + 6.151969683524e-16, 3.451716642323e-16, 2.028860132967e-16, + 1.329742248395e-16, 1.637961652850e-16, 6.880623592933e-16, + 8.752961130483e-16, 6.164545846291e-16, 4.175550134142e-16, + 2.854810570336e-16, 1.979124869386e-16, 1.391184447023e-16, + 9.907975856482e-17, 7.143395681316e-17, 5.209416571730e-17, + 3.839812646313e-17, 2.858695234257e-17, 2.148273516164e-17, + 1.628645162472e-17, 1.244949157328e-17, 9.590859087301e-18, + 7.443103071079e-18, 5.816564958630e-18, 4.575456803312e-18, + 3.621674740420e-18, 2.883729667889e-18, 2.309100852646e-18, + 1.858903344438e-18, 1.504135160717e-18, 1.223013363058e-18, + 9.990674885680e-19, 8.197642977375e-19, 6.755083362590e-19, + 5.589104118303e-19, 4.642485018177e-19, 3.870678691548e-19, + 3.238825776578e-19, 2.719513541592e-19, 2.291083072957e-19, + 1.936343680810e-19, 1.641591359634e-19, 1.395855549683e-19, + 1.190318244798e-19, 1.017863882616e-19, 8.727289742815e-20, + 7.502281667587e-20, 6.465391502190e-20, 5.585330739548e-20, + 4.836403099279e-20, 4.197437872268e-20, 3.650939191718e-20, + 3.182405077527e-20, 2.779780476118e-20, 2.433016450184e-20, + 2.133713763253e-20, 1.874833799393e-20, 1.650463393195e-20, + 1.455622970243e-20, 1.286109603269e-20, 1.138368317693e-20, + 1.009386342220e-20, 8.966060800808e-21, 7.978534405747e-21, + 7.112788715859e-21, 6.353090159815e-21, 5.686074180917e-21, + 5.100431712411e-21, 4.586668712709e-21, 4.136937896032e-21, + 3.744949036430e-21, 3.405974906164e-21, 3.116986975618e-21, + 2.876983734487e-21, 2.687624504759e-21, 2.554370384152e-21, + 2.488492582439e-21, 2.510588694373e-21, 2.656720765217e-21, + 2.988991748348e-21, 3.613033825457e-21, 4.703896352800e-21, + 6.533530718531e-21, 9.464190212216e-21, 1.381487571576e-20, + 1.950367368725e-20, 2.566157767467e-20, 3.085961904472e-20, + 3.404920129961e-20, 3.513685483046e-20, 3.466280126925e-20, + 3.325927455903e-20, 3.139564919659e-20, 2.935890706269e-20, + 2.730760314666e-20, 2.532353519602e-20, 2.344571641310e-20, + 2.169004266513e-20, 2.006013982470e-20, 1.855325681604e-20, + 1.716346442678e-20, 1.588339752951e-20, 1.470520484108e-20, + 1.362106265252e-20, 1.262344574066e-20, 1.170526171301e-20, + 1.085990814744e-20, 1.008128620332e-20, 9.363790069218e-21, + 8.702283499854e-21, 8.092070021326e-21, 7.528860651061e-21, + 7.008741361119e-21, 6.528141546090e-21, 6.083804174832e-21, + 5.672757954437e-21, 5.292291624397e-21, 4.939930374470e-21, + 4.613414308269e-21, 4.310678835872e-21, 4.029836860257e-21, + 3.769162616186e-21, 3.527077021481e-21, 3.302134406217e-21, + 3.093010493327e-21, 2.898491513217e-21, 2.717464344400e-21, + 2.548907581522e-21, 2.391883441058e-21, 2.245530423396e-21, + 2.109056657778e-21, 1.981733863753e-21, 1.862891869309e-21, + 1.751913631772e-21, 1.648230712950e-21, 1.551319164795e-21, + 1.460695786267e-21, 1.375914715950e-21, 1.296564328554e-21, + 1.222264406528e-21, 1.152663560933e-21, 1.087436878194e-21, + 1.026283771689e-21, 9.689260191687e-22, 9.151059688238e-22, + 8.645848984932e-22, 8.171415139594e-22, 7.725705736125e-22, + 7.306816279389e-22, 6.912978633472e-22, 6.542550407751e-22, + 6.194005203483e-22, 5.865923640833e-22, 5.556985092457e-22, + 5.265960054981e-22, 4.991703093916e-22, 4.733146300635e-22, + 4.489293201940e-22, 4.259213063215e-22, 4.042035524943e-22, + 3.836945509057e-22, 3.643178325581e-22, 3.460014900597e-22, + 3.286777032678e-22, 3.122822565272e-22, 2.967540335468e-22, + 2.820344723348e-22, 2.680669579045e-22, 2.547961245805e-22, + 2.421670328738e-22, 2.301241788358e-22, 2.186102886273e-22, + 2.075648523379e-22, 1.969223680163e-22, 1.866103163748e-22, + 1.765469974841e-22, 1.666395765645e-22, 1.567830605551e-22, + 1.468614974993e-22, 1.367534009440e-22, 1.263439528541e-22, + 1.155462023921e-22, 1.043310959138e-22, 9.276084235796e-23, + 8.101293104165e-23, 6.937790472167e-23, 5.821968259775e-23, + 4.790464940143e-23, 3.872496696370e-23, 3.084674863439e-23, + 2.429948718676e-23, 1.900129104433e-23, 1.480119667927e-23, + 1.152030460297e-23, 8.981746140584e-24, 7.027685927556e-24, + 5.526079241822e-24, 4.371024481646e-24, 3.479903104223e-24, + 2.789387641784e-24, 2.251448455703e-24, 1.829860030648e-24, + 1.497353080536e-24, 1.233387283588e-24, 1.022452654149e-24, + 8.527935721661e-25, 7.154585589080e-25, 6.035956362345e-25, + 5.119304235397e-25, 4.363792178389e-25, 3.737614420906e-25, + 3.215851910946e-25, 2.778866126862e-25, 2.411090373722e-25, + 2.100115570432e-25, 1.835995119775e-25, 1.610713508212e-25, + 1.417777864505e-25, 1.251902326518e-25, 1.108762820856e-25, + 9.848055424575e-26, 8.770966011347e-26, 7.832033899122e-26, + 7.011005214431e-26, 6.290948871728e-26, 5.657656737340e-26, + 5.099161344203e-26, 4.605346422451e-26, 4.167631048733e-26, + 3.778712445894e-26, 3.432355708838e-26, 3.123221232768e-26, + 2.846722555741e-26, 2.598908832774e-26, 2.376367334288e-26, + 2.176142283685e-26, 1.995667074884e-26, 1.832707484707e-26, + 1.685313950686e-26, 1.551781347891e-26, 1.430614988776e-26, + 1.320501803030e-26, 1.220285842163e-26, 1.128947405239e-26, + 1.045585205163e-26, 9.694010950367e-27, 8.996869557154e-27, + 8.358134125886e-27, 7.772201044587e-27, 7.234072726052e-27, + 6.739284754268e-27, 6.283842649556e-27, 5.864166871929e-27, + 5.477044895638e-27, 5.119589366154e-27, 4.789201499847e-27, + 4.483539011696e-27, 4.200487961432e-27, 3.938137997067e-27, + 3.694760549539e-27, 3.468789595465e-27, 3.258804658665e-27, + 3.063515766713e-27, 2.881750117628e-27, 2.712440244918e-27, + 2.554613497548e-27, 2.407382675662e-27, 2.269937683692e-27, + 2.141538080404e-27, 2.021506420846e-27, 1.909222298446e-27, + 1.804117007004e-27, 1.705668752287e-27, 1.613398351522e-27, + 1.526865366602e-27, 1.445664623316e-27, 1.369423074581e-27, + 1.297796970616e-27, 1.230469303306e-27, 1.167147495780e-27, + 1.107561311563e-27, 1.051460960535e-27, 9.986153814990e-28, + 9.488106834048e-28, 9.018487292442e-28, 8.575458483760e-28, + 8.157316645823e-28, 7.762480285128e-28, 7.389480443789e-28, + 7.036951818234e-28, 6.703624648392e-28, 6.388317304481e-28, + 6.089929505980e-28, 5.807436114002e-28, 5.539881444204e-28, + 5.286374052654e-28, 5.046081951765e-28, 4.818228217627e-28, + 4.602086953838e-28, 4.396979580291e-28, 4.202271418393e-28, + 4.017368546923e-28, 3.841714905138e-28, 3.674789621946e-28, + 3.516104551917e-28, 3.365202000677e-28, 3.221652623823e-28, + 3.085053484940e-28, 2.955026259588e-28, 2.831215573312e-28, + 2.713287462775e-28, 2.600927950082e-28, 2.493841721221e-28, + 2.391750900354e-28, 2.294393912361e-28, 2.201524426749e-28, + 2.112910376562e-28, 2.028333046504e-28, 1.947586224966e-28, + 1.870475415064e-28, 1.796817100230e-28, 1.726438060256e-28, + 1.659174733994e-28, 1.594872625283e-28, 1.533385748881e-28, + 1.474576113488e-28, 1.418313239158e-28, 1.364473706602e-28, + 1.312940736096e-28, 1.263603793884e-28, 1.216358224110e-28, + 1.171104904489e-28, 1.127749924050e-28, 1.086204281406e-28, + 1.046383602140e-28, 1.008207873984e-28, 9.716011985716e-29, + 9.364915586418e-29, 9.028105996453e-29, 8.704934247872e-29, + 8.394784026054e-29, 8.097069862536e-29, 7.811235437147e-29, + 7.536751982259e-29, 7.273116782498e-29, 7.019851763690e-29, + 6.776502165301e-29, 6.542635290992e-29, 6.317839332300e-29, + 6.101722260803e-29, 5.893910784433e-29, 5.694049363915e-29, + 5.501799285558e-29, 5.316837786910e-29, 5.138857231993e-29, + 4.967564333075e-29, 4.802679416124e-29, 4.643935727292e-29, + 4.491078777930e-29, 4.343865725829e-29, 4.202064790495e-29, + 4.065454700442e-29, 3.933824170597e-29, 3.806971408036e-29, + 3.684703644385e-29, 3.566836693337e-29, 3.453194531804e-29, + 3.343608903352e-29, 3.237918942630e-29, 3.135970819577e-29, + 3.037617402302e-29, 2.942717937545e-29, 2.851137747757e-29, + 2.762747943832e-29, 2.677425152642e-29, 2.595051258531e-29, + 2.515513157999e-29, 2.438702526851e-29, 2.364515599112e-29, + 2.292852957088e-29, 2.223619331936e-29, 2.156723414197e-29, + 2.092077673736e-29, 2.029598188601e-29, 1.969204482304e-29, + 1.910819369088e-29, 1.854368806751e-29]) -random_psd_ers_true = np.array([ 0.67091768, 0.98388194, 1.63247542, 3.29788837, - 4.75383438, 4.99785655, 6.0270407 , 7.67571032, - 9.35047492, 12.0497534 , 15.75766271, 17.61621176, - 18.93799533, 16.95103332, 16.97641796, 19.05362423, - 22.40096774, 27.10816543, 33.66999142, 41.89796133, - 50.12713593, 58.22040026, 68.31443109, 82.49658532, - 103.51585301, 135.71439027, 184.26416655, 242.8514731 , - 273.92720623, 252.32139196, 208.69281484, 168.63234503, - 138.37984191, 117.15507006, 102.17017646, 91.25217518, - 83.01077056]) +random_psd_ers_true = np.array([ 0.648090424988, 0.950662701293, 1.576695180869, 3.18135848496 , + 4.58500815002 , 4.823609898684, 5.818083049655, 7.409584972776, + 9.027029380723, 11.632304979946, 15.210364978889, 17.007492097751, + 18.287702558843, 16.377949833245, 16.408659703298, 18.41880183438 , + 21.655280368578, 26.205315034631, 32.54706760129 , 40.499247659264, + 48.454954673049, 56.282067298352, 66.044592935802, 79.759871603961, + 100.085713263054, 131.220684907453, 178.166133896886, 234.818884160492, + 264.872874687469, 243.986820927801, 201.803000178221, 163.066277658454, + 133.812182369895, 113.287616809697, 98.797113836241, 88.239452679016, + 80.270179197913]) -random_psd_fds_true = np.array([3.82709923e-15, 2.95840805e-15, 5.47767260e-15, 3.06611256e-14, - 4.83763821e-14, 2.19304752e-14, 2.03374664e-14, 2.62627689e-14, - 3.00317155e-14, 4.73934452e-14, 8.47422726e-14, 7.71568736e-14, - 6.09463324e-14, 2.15303382e-14, 1.33345238e-14, 1.42507575e-14, - 1.93008425e-14, 3.06236179e-14, 5.62393884e-14, 1.06743408e-13, - 1.71983299e-13, 2.45479841e-13, 3.74800030e-13, 6.68359831e-13, - 1.45822973e-12, 4.00066484e-12, 1.32073361e-11, 3.80002040e-11, - 5.07843483e-11, 2.48902485e-11, 7.17773588e-12, 1.85355859e-12, - 5.20252849e-13, 1.71916345e-13, 6.63776932e-14, 2.90858483e-14, - 1.40680124e-14]) +random_psd_fds_true = np.array([1.913549616983e-15, 1.479204025928e-15, 2.738836299824e-15, + 1.533056278836e-14, 2.418819106024e-14, 1.096523758199e-14, + 1.016873317891e-14, 1.313138442793e-14, 1.501585776452e-14, + 2.369672259044e-14, 4.237113628645e-14, 3.857843681479e-14, + 3.047316621633e-14, 1.076516909464e-14, 6.667261875130e-15, + 7.125378749098e-15, 9.650421232457e-15, 1.531180894821e-14, + 2.811969422259e-14, 5.337170416851e-14, 8.599164926747e-14, + 1.227399206751e-13, 1.874000147893e-13, 3.341799156894e-13, + 7.291148627469e-13, 2.000332421405e-12, 6.603668050857e-12, + 1.900010198647e-11, 2.539217417048e-11, 1.244512424006e-11, + 3.588867940773e-12, 9.267792966951e-13, 2.601264245105e-13, + 8.595817234579e-14, 3.318884660841e-14, 1.454292412754e-14, + 7.034006193421e-15]) -random_time_convolution_ers_true = np.array([ 0.6099179 , 0.90024939, 1.58842974, 3.27566123, - 3.52033832, 3.52442658, 5.06568159, 6.91651683, - 6.58642658, 9.08957127, 15.44237487, 18.6571416 , - 22.95008567, 14.64092216, 16.12775012, 18.23665893, - 21.43841285, 27.03874696, 31.89604905, 38.48662753, - 44.07566044, 51.43851906, 60.06826414, 77.19192935, - 97.55560784, 128.18880101, 177.46755538, 235.12800744, - 255.86616316, 223.11173246, 175.9850834 , 140.50045444, - 116.25702449, 101.63699583, 89.61811721, 80.55439421, - 73.42014547]) +random_time_convolution_ers_true = np.array([ 0.609917902834, 0.900249389815, 1.588429740467, 3.275661225469, + 3.520338319522, 3.524426583473, 5.065681589184, 6.916516833636, + 6.586426583431, 9.089571269482, 15.442374870328, 18.657141595561, + 22.950085666686, 14.640922156082, 16.127750116007, 18.236658925636, + 21.438412853576, 27.038746959674, 31.896049054443, 38.486627531051, + 44.075660444232, 51.438519061149, 60.068264144119, 77.191929345094, + 97.555607837718, 128.188801009866, 177.467555375057, 235.128007441727, + 255.86616316305 , 223.111732460848, 175.985083402906, 140.50045443875 , + 116.257024494942, 101.636995827753, 89.618117207621, 80.554394207243, + 73.420145467834]) -random_time_convolution_fds_true = np.array([4.44750346e-15, 3.64972875e-15, 4.81530707e-15, 3.93224792e-14, - 4.97618080e-14, 1.84276306e-14, 2.05773726e-14, 5.90468334e-14, - 2.81286302e-14, 5.18810683e-14, 1.77647730e-13, 2.25013716e-13, - 4.17914600e-13, 8.08228777e-14, 3.74689816e-14, 3.17274940e-14, - 3.87678188e-14, 5.31947296e-14, 8.18807569e-14, 1.42588064e-13, - 2.18840066e-13, 3.03394132e-13, 5.14781240e-13, 1.10101535e-12, - 2.72993636e-12, 7.99340960e-12, 2.96421138e-11, 1.00091619e-10, - 1.40830580e-10, 6.32629767e-11, 1.51780343e-11, 3.61950545e-12, - 1.00532493e-12, 3.36335237e-13, 1.32052620e-13, 5.87197129e-14, - 2.87066429e-14]) +random_time_convolution_fds_true = np.array([2.223751729714e-15, 1.824864375801e-15, 2.407653533898e-15, + 1.966123962121e-14, 2.488090402189e-14, 9.213815291773e-15, + 1.028868630564e-14, 2.952341668012e-14, 1.406431511512e-14, + 2.594053413940e-14, 8.882386511550e-14, 1.125068581595e-13, + 2.089573000984e-13, 4.041143885167e-14, 1.873449080281e-14, + 1.586374702163e-14, 1.938390941911e-14, 2.659736477947e-14, + 4.094037843490e-14, 7.129403180252e-14, 1.094200330692e-13, + 1.516970660210e-13, 2.573906200294e-13, 5.505076765620e-13, + 1.364968179386e-12, 3.996704802336e-12, 1.482105691075e-11, + 5.004580950374e-11, 7.041528999769e-11, 3.163148836192e-11, + 7.589017164135e-12, 1.809752726388e-12, 5.026624655536e-13, + 1.681676184770e-13, 6.602631020244e-14, 2.935985645443e-14, + 1.435332147165e-14]) +random_time_averaging_ers_true = np.array([ 0.688798678829, 0.972813471527, 1.548654343504, 2.940156834089, + 4.596034070523, 4.857705303958, 5.842274087815, 7.438486748778, + 9.065322540381, 11.68387655829 , 15.324564539318, 16.79554214044 , + 17.163821574784, 15.470942844752, 15.892242871032, 17.998417106553, + 21.245457501816, 25.8123281857 , 32.219659350718, 40.288489291266, + 48.224325727331, 55.841729846577, 65.307739019269, 78.590121814914, + 98.37160204807 , 128.914586890175, 174.931188343257, 229.450575991764, + 255.54387335346 , 234.053207465682, 194.488500274938, 157.708798942311, + 129.566084718982, 109.726670678954, 95.703129215536, 85.485342502239, + 77.77237799016 ]) -random_time_averaging_ers_true = np.array([ 0.7132824 , 1.00698015, 1.6034918 , 3.04733707, - 4.76565368, 5.03366731, 6.05260711, 7.70623989, - 9.39082283, 12.10395372, 15.87696591, 17.39723053, - 17.773186 , 16.01129239, 16.44190528, 18.61883622, - 21.97728329, 26.7020753 , 33.33198404, 41.68093115, - 49.88969719, 57.76600833, 67.55327577, 81.28758475, - 101.74375727, 133.33007801, 180.91936669, 237.30055765, - 264.2802926 , 242.04891168, 201.12861375, 163.09189855, - 133.98871832, 113.47250634, 98.97053004, 88.40401509, - 80.42767645]) - -random_time_averaging_fds_true = np.array([4.85734344e-15, 3.19769291e-15, 4.97511369e-15, 2.13702173e-14, - 4.81996227e-14, 2.22810029e-14, 2.04118103e-14, 2.63634910e-14, - 3.02192968e-14, 4.78197297e-14, 8.68570356e-14, 7.19924092e-14, - 4.48922136e-14, 1.64147366e-14, 1.13993314e-14, 1.26838790e-14, - 1.74972647e-14, 2.82908138e-14, 5.32163817e-14, 1.03432956e-13, - 1.67062699e-13, 2.35004268e-13, 3.53138486e-13, 6.19228167e-13, - 1.33527914e-12, 3.65649900e-12, 1.20378509e-11, 3.38169505e-11, - 4.24128165e-11, 2.02105694e-11, 5.96769262e-12, 1.56864466e-12, - 4.42850493e-13, 1.46558997e-13, 5.66188439e-14, 2.48225150e-14, - 1.20116961e-14]) - +random_time_averaging_fds_true = np.array([2.428671722244e-15, 1.598846453750e-15, 2.487556844155e-15, + 1.068510867358e-14, 2.409981134308e-14, 1.114050143555e-14, + 1.020590513724e-14, 1.318174551576e-14, 1.510964841022e-14, + 2.390986487275e-14, 4.342851779439e-14, 3.599620458225e-14, + 2.244610682047e-14, 8.207368288748e-15, 5.699665698140e-15, + 6.341939487772e-15, 8.748632333978e-15, 1.414540692292e-14, + 2.660819086063e-14, 5.171647794890e-14, 8.353134956490e-14, + 1.175021337606e-13, 1.765692428609e-13, 3.096140834934e-13, + 6.676395685341e-13, 1.828249501354e-12, 6.018925454984e-12, + 1.690847523660e-11, 2.120640824931e-11, 1.010528469127e-11, + 2.983846307715e-12, 7.843223288389e-13, 2.214252465719e-13, + 7.327949872890e-14, 2.830942194915e-14, 1.241125749202e-14, + 6.005848066016e-15]) diff --git a/validation/cmp_fig4_3.png b/validation/cmp_fig4_3.png new file mode 100644 index 0000000..169457c Binary files /dev/null and b/validation/cmp_fig4_3.png differ diff --git a/validation/cmp_fig4_4.png b/validation/cmp_fig4_4.png new file mode 100644 index 0000000..10a224e Binary files /dev/null and b/validation/cmp_fig4_4.png differ diff --git a/validation/validation.md b/validation/validation.md new file mode 100644 index 0000000..a1cee50 --- /dev/null +++ b/validation/validation.md @@ -0,0 +1,115 @@ +# Validation of the random-vibration FDS fix + +This documents the correction of a factor-of-2 error in the random Fatigue Damage +Spectrum and its validation against Christian Lalanne, *Mechanical Vibration and +Shock Analysis*, 2nd ed., Wiley-ISTE (2009). + +**Affected releases:** the error is present in the published releases **0.2.0 and +0.3.0** (the 0.3.0 release did not include this fix). The correction is intended for +the next release (0.3.1 / 0.4.0). + +## The correction + +Two independent factors of 2 made the **random FDS 2× too high** (they sit in +separate code paths, so the net error was 2×, not 4×). Sine and sine-sweep FDS, and +all ERS, were essentially correct. + +1. **Cycle rate** (`_get_random_psd_ers_fds`). The mean upward zero-crossing rate is + `n0+ = (1/2π)·√(M2/M0) = (1/2π)·(ż_rms/z_rms)` (Lalanne Vol.3 eq [5.76]); for a + Q=10 narrow-band SDOF response `n0+ = f0` (Vol.5 p.46; Vol.5 Example 4.4 shows + 50 up-crossings in 5 s for a 10 Hz oscillator). The code used `1/π` (≈ 2·f0). + Fixed to `1/(2π)`. FDS scales linearly with `n0` → was 2× high; ERS uses `n0` + inside `√(2·ln(n0·T))`, so the ERS effect is only ~3–4%. +2. **Rainflow cycle count** (`_get_random_time_ers_fds`). `rainflow.count_cycles` + returns full cycles, so full-cycle Miner–Basquin damage is + `(p**k/C)·Σ count·(range/2)**k`. The code carried an extra `×2` (full→half + cycles) with no matching `1/2` from Lalanne Vol.4 eq [4.6] (`K**b/(2C)`), + doubling the result. The `×2` was removed. + +## Verification + +### 1. Numeric match to Lalanne's closed form, eq [4.9] + +For white-noise base excitation the book gives (Vol.5 p.121, eq [4.9]): + + D ≈ (K**b/C)·n0+·T·(Q·G/(2·ω0**3))**(b/2)·Γ(1+b/2), n0+ ≈ f0 + +In the narrow-band limit where [4.9] is exact (wide band, high Q, mid-band f0), the +fixed package converges to it: + +| Q | package ÷ book eq [4.9] | +|-----|-------------------------| +| 25 | 0.9958 | +| 50 | 0.9979 | +| 100 | 0.9989 | +| 200 | 0.9995 | + +→ **1.000** as Q→∞. The pre-fix code converges to **2.000**. (Reproduce with +`literature_notes/_book_examples.py`.) + +### 2. Reproduction of published figures + +Example 4.2 (Vol.5 pp.114–115), package vs book, side by side: + +![Fig 4.3 — FDS from a 3-segment PSD](cmp_fig4_3.png) + +![Fig 4.4 — damping influence](cmp_fig4_4.png) + +**Note on Example 4.2 (book inconsistency).** The table prints 100 (m/s²)²/Hz for the +300–600 Hz band, but the book's printed input rms (`ẍ_rms = 69.28 m/s²`) and Fig 4.3 +were computed with **10**, not 100: `√(5·200 + 10·300 + 2·400) = 69.30` vs +`√(…100…) = 178.3`. Fig 4.3 above is reproduced with 10 (matching the book). The +package, fed 100, correctly produces a larger second peak — the physically correct +response for that PSD. + +### 3. Example 4.3 damage ratio (Vol.5 p.116) + +White noise 10–1000 Hz vs 475–525 Hz (both PSD = 1), f0 = 500, Q = 10, b = 8. +Package: damage ratio **15.34** (book: 16 = 2^(b/2)); narrow-band contribution +**6.52%** (book: ~6.25%). The small gap is the genuine finite-band correction (the +package computes the exact integral; 16 is the idealized asymptote). + +### 4. Independent verification (convention-free ground truth + adversarial review) + +The fix was cross-checked by four mutually independent methods, none sharing the +others' reasoning, plus the book. All converge on the corrected formulas. + +**Direct rainflow ground truth.** A Gaussian white-noise signal is passed through an +SDOF oscillator (computed independently of the package), and fatigue damage is taken +directly as `Σ count·(amplitude)^k` over rainflow-counted full cycles — the +definition of Miner–Basquin damage, with no spectral formula involved. Two separate +implementations (one using `scipy.signal.lsim`, one using an impulse-invariant IIR +filter, 5 seeds, T = 2000 s) give, to machine precision: + +| quantity | corrected (`Σ count·(range/2)^k`) | pre-fix (`Σ count·2·(range/2)^k`) | +|----------|-----------------------------------|-----------------------------------| +| rainflow damage ÷ direct ground truth | **1.0000** | **2.0000** | + +**Cycle rate, measured.** The mean upward zero-crossing rate of the SDOF response +was measured directly: **1.000·f0** (e.g. 100.0 / 200.0 / 400.0 Hz for f0 = 100 / +200 / 400). `n0 = (1/2π)·(ż_rms/z_rms)` reproduces it (≈ 0.998·f0); the pre-fix +`n0 = (1/π)·(ż_rms/z_rms)` gives ≈ 1.996·f0 — twice the true cycle rate. + +**Closed-form FDS.** Against the same ground truth, the corrected closed form lands +at 1.03–1.07× (the residual is the known narrow-band Rayleigh approximation, larger +at high `k`); the pre-fix form lands at ~2.1×. + +**Adversarial review.** An independent reviewer was instructed to build the strongest +possible case that the *pre-fix* formulas were correct. The defense (Lalanne's +half-cycle accounting, Coffin–Manson 2N reversals, the explicit `×2` in eq [4.6]) +was found citable but internally inconsistent, and collapsed against the +convention-free measurements above. + +**Root cause.** Both factors of 2 are genuine Lalanne *half-cycle* artifacts — the +`×2` in eq [4.6] and the `1/π` (= 2·f0 reversals) rate — that were applied to +**full-cycle** rainflow counts and to the **upward-crossing** rate, without the +compensating `1/2`. A half-cycle-vs-full-cycle bookkeeping slip; the factor is real +in the book, but double-counts once paired with full-cycle quantities. + +## Regression tests + +`tests/test_data.py` golden arrays were regenerated. The change was verified to be +exactly as intended: the three random FDS arrays are exactly ×0.5 of the previous +values; sine/sweep and the convolution-ERS arrays are unchanged; the two random-ERS +arrays drop ~3.5%. `tests/test_basic.py::test_narrowband_crossing_rate_equals_f0` +adds an absolute, book-anchored check (Vol.5 Example 4.4: response cycle rate = f0).