Loads Module
The loads module contains a set of functions to calculate quantities of interest for mechanical loads assessments.
General
The loads general submodule contains general loads calculations that can be applied to most MRE devices.
Bins calculated statistics against data signal (or channel) according to IEC TS 62600-3:2020 ED1. |
|
Transfer function for deriving blade flap and edge moments using blade matrix. |
|
Calculates the damage equivalent load of a single data signal (or channel) based on IEC TS 62600-3:2020 ED1. |
- mhkit.loads.general.bin_statistics(data, bin_against, bin_edges, data_signal=[])[source]
Bins calculated statistics against data signal (or channel) according to IEC TS 62600-3:2020 ED1.
- Parameters
data (pandas DataFrame) – Time-series statistics of data signal(s)
bin_against (array) – Data signal to bin data against (e.g. wind speed)
bin_edges (array) – Bin edges with consistent step size
data_signal (list, optional) – List of data signal(s) to bin, default = all data signals
- Returns
bin_mean (pandas DataFrame) – Mean of each bin
bin_std (pandas DataFrame) – Standard deviation of each bim
- mhkit.loads.general.blade_moments(blade_coefficients, flap_offset, flap_raw, edge_offset, edge_raw)[source]
Transfer function for deriving blade flap and edge moments using blade matrix.
- Parameters
blade_coefficients (numpy array) – Derived blade calibration coefficients listed in order of D1, D2, D3, D4
flap_offset (float) – Derived offset of raw flap signal obtained during calibration process
flap_raw (numpy array) – Raw strain signal of blade in the flapwise direction
edge_offset (float) – Derived offset of raw edge signal obtained during calibration process
edge_raw (numpy array) – Raw strain signal of blade in the edgewise direction
- Returns
M_flap (numpy array) – Blade flapwise moment in SI units
M_edge (numpy array) – Blade edgewise moment in SI units
- mhkit.loads.general.damage_equivalent_load(data_signal, m, bin_num=100, data_length=600)[source]
Calculates the damage equivalent load of a single data signal (or channel) based on IEC TS 62600-3:2020 ED1. 4-point rainflow counting algorithm from fatpack module is based on the following resources:
C. Amzallag et. al. Standardization of the rainflow counting method for fatigue analysis. International Journal of Fatigue, 16 (1994) 287-293
ISO 12110-2, Metallic materials - Fatigue testing - Variable amplitude fatigue testing.
G. Marsh et. al. Review and application of Rainflow residue processing techniques for accurate fatigue damage estimation. International Journal of Fatigue, 82 (2016) 757-765
Parameters:
- data_signalarray
Data signal being analyzed
- mfloat/int
Fatigue slope factor of material
- bin_numint
Number of bins for rainflow counting method (minimum=100)
- data_lengthfloat/int
Length of measured data (seconds)
- returns
DEL (float) – Damage equivalent load (DEL) of single data signal
Graphics
The graphics submodule contains functions to plot loads metrics.
Plot showing standard raw statistics of variable |
|
Plot showing standard binned statistics of single variable |
- mhkit.loads.graphics.plot_statistics(x, y_mean, y_max, y_min, y_stdev=[], **kwargs)[source]
Plot showing standard raw statistics of variable
- Parameters
x (numpy array) – Array of x-axis values
y_mean (numpy array) – Array of mean statistical values of variable
y_max (numpy array) – Array of max statistical values of variable
y_min (numpy array) – Array of min statistical values of variable
y_stdev (numpy array, optional) – Array of standard deviation statistical values of variable
**kwargs (optional) –
- x_labelstring
x axis label for plot
- y_labelstring
y axis label for plot
- titlestring, optional
Title for plot
- save_pathstring
Path and filename to save figure.
- Returns
ax (matplotlib pyplot axes)
- mhkit.loads.graphics.plot_bin_statistics(bin_centers, bin_mean, bin_max, bin_min, bin_mean_std, bin_max_std, bin_min_std, **kwargs)[source]
Plot showing standard binned statistics of single variable
- Parameters
bin_centers (numpy array) – x-axis bin center values
bin_mean (numpy array) – Binned mean statistical values of variable
bin_max (numpy array) – Binned max statistical values of variable
bin_min (numpy array) – Binned min statistical values of variable
bin_mean_std (numpy array) – Standard deviations of mean binned statistics
bin_max_std (numpy array) – Standard deviations of max binned statistics
bin_min_std (numpy array) – Standard deviations of min binned statistics
**kwargs (optional) –
- x_labelstring
x axis label for plot
- y_labelstring
y axis label for plot
- titlestring, optional
Title for plot
- save_pathstring
Path and filename to save figure.
- Returns
ax (matplotlib pyplot axes)
Extreme
The extreme submodule contains functions to calculate peak distribution.
Find the global peaks of a zero-centered response time-series. |
|
Estimate the number of peaks in a specified period. |
|
Estimate the peaks distribution by fitting a Weibull distribution to the peaks of the response. |
|
Estimate the peaks distribution using the Weibull tail fit method. |
|
Estimate the peaks distribution using the peaks over threshold method. |
|
Estimate the short-term extreme distribution from the peaks distribution. |
|
Find the block maxima of a time-series. |
|
Approximate the short-term extreme distribution using the block maxima method and the Generalized Extreme Value distribution. |
|
Approximate the short-term extreme distribution using the block maxima method and the Gumbel (right) distribution. |
|
Approximate the short-term extreme distribution from a timeseries of the response using chosen method. |
|
Return the long-term extreme distribution of a response of interest using the full sea state approach. |
|
Calculate MLER (most likely extreme response) coefficients from a sea state spectrum and a response RAO. |
|
Define the simulation parameters that are used in various MLER functionalities. |
|
Function that renormalizes the incoming amplitude of the MLER wave to the desired peak height (peak to MSL). |
|
Generate the wave amplitude time series at X0 from the calculated MLER coefficients |
- mhkit.loads.extreme.global_peaks(t, data)[source]
Find the global peaks of a zero-centered response time-series.
The global peaks are the maxima between consecutive zero up-crossings.
- Parameters
t (np.array) – Time array.
data (np.array) – Response time-series.
- Returns
t_peaks (np.array) – Time array for peaks
peaks (np.array) – Peak values of the response time-series
- mhkit.loads.extreme.number_of_short_term_peaks(n, t, t_st)[source]
Estimate the number of peaks in a specified period.
- Parameters
n (int) – Number of peaks in analyzed timeseries.
t (float) – Length of time of analyzed timeseries.
t_st (float) – Short-term period for which to estimate the number of peaks.
- Returns
n_st (float) – Number of peaks in short term period.
- mhkit.loads.extreme.peaks_distribution_weibull(x)[source]
Estimate the peaks distribution by fitting a Weibull distribution to the peaks of the response.
The fitted parameters can be accessed through the params field of the returned distribution.
- Parameters
x (np.array) – Global peaks.
- Returns
peaks (scipy.stats.rv_frozen) – Probability distribution of the peaks.
- mhkit.loads.extreme.peaks_distribution_weibull_tail_fit(x)[source]
Estimate the peaks distribution using the Weibull tail fit method.
The fitted parameters can be accessed through the params field of the returned distribution.
- Parameters
x (np.array) – Global peaks.
- Returns
peaks (scipy.stats.rv_frozen) – Probability distribution of the peaks.
- mhkit.loads.extreme.peaks_distribution_peaks_over_threshold(x, threshold=None)[source]
Estimate the peaks distribution using the peaks over threshold method.
This fits a generalized Pareto distribution to all the peaks above the specified threshold. The distribution is only defined for values above the threshold and therefore cannot be used to obtain integral metrics such as the expected value. A typical choice of threshold is 1.4 standard deviations above the mean. The peaks over threshold distribution can be accessed through the pot field of the returned peaks distribution.
- Parameters
x (np.array) – Global peaks.
threshold (float) – Threshold value. Only peaks above this value will be used. Default value calculated as: np.mean(x) + 1.4 * np.std(x)
- Returns
peaks (scipy.stats.rv_frozen) – Probability distribution of the peaks.
- mhkit.loads.extreme.ste_peaks(peaks_distribution, npeaks)[source]
Estimate the short-term extreme distribution from the peaks distribution.
- Parameters
peaks_distribution (scipy.stats.rv_frozen) – Probability distribution of the peaks.
npeaks (float) – Number of peaks in short term period.
- Returns
ste (scipy.stats.rv_frozen) – Short-term extreme distribution.
- mhkit.loads.extreme.block_maxima(t, x, t_st)[source]
Find the block maxima of a time-series.
The timeseries (t,x) is divided into blocks of length t_st, and the maxima of each bloock is returned.
- Parameters
t (np.array) – Time array.
x (np.array) – global peaks timeseries.
t_st (float) – Short-term period.
- Returns
block_maxima (np.array) – Block maxima (i.e. largest peak in each block).
- mhkit.loads.extreme.ste_block_maxima_gev(block_maxima)[source]
Approximate the short-term extreme distribution using the block maxima method and the Generalized Extreme Value distribution.
- Parameters
block_maxima (np.array) – Block maxima (i.e. largest peak in each block).
- Returns
ste (scipy.stats.rv_frozen) – Short-term extreme distribution.
- mhkit.loads.extreme.ste_block_maxima_gumbel(block_maxima)[source]
Approximate the short-term extreme distribution using the block maxima method and the Gumbel (right) distribution.
- Parameters
block_maxima (np.array) – Block maxima (i.e. largest peak in each block).
- Returns
ste (scipy.stats.rv_frozen) – Short-term extreme distribution.
- mhkit.loads.extreme.short_term_extreme(t, data, t_st, method)[source]
Approximate the short-term extreme distribution from a timeseries of the response using chosen method.
The availabe methods are: ‘peaks_weibull’, ‘peaks_weibull_tail_fit’, ‘peaks_over_threshold’, ‘block_maxima_gev’, and ‘block_maxima_gumbel’. For the block maxima methods the timeseries needs to be many times longer than the short-term period. For the peak-fitting methods the timeseries can be of arbitrary length.
- Parameters
t (np.array) – Time array.
data (np.array) – Response timeseries.
t_st (float) – Short-term period.
method (string) – Method for estimating the short-term extreme distribution.
- Returns
ste (scipy.stats.rv_frozen) – Short-term extreme distribution.
- mhkit.loads.extreme.full_seastate_long_term_extreme(ste, weights)[source]
Return the long-term extreme distribution of a response of interest using the full sea state approach.
- Parameters
ste (list[scipy.stats.rv_frozen]) – Short-term extreme distribution of the quantity of interest for each sample sea state.
weights (list[floats]) – The weights from the full sea state sampling
- Returns
ste (scipy.stats.rv_frozen) – Short-term extreme distribution.
- mhkit.loads.extreme.mler_coefficients(rao, wave_spectrum, response_desired)[source]
Calculate MLER (most likely extreme response) coefficients from a sea state spectrum and a response RAO.
- Parameters
rao (numpy ndarray) – Response amplitude operator.
wave_spectrum (pd.DataFrame) – Wave spectral density [m^2/Hz] indexed by frequency [Hz].
response_desired (int or float) – Desired response, units should correspond to a motion RAO or units of force for a force RAO.
- Returns
mler (pd.DataFrame) – DataFrame containing conditioned wave spectral amplitude coefficient [m^2-s], and Phase [rad] indexed by freq [Hz].
- mhkit.loads.extreme.mler_simulation(parameters=None)[source]
Define the simulation parameters that are used in various MLER functionalities.
See extreme_response_contour_example.ipynb example for how this is useful. If no input is given, then default values are returned.
- Parameters
parameters (dict (optional)) – Simulation parameters. Keys: —– ‘startTime’: starting time [s] ‘endTime’: ending time [s] ‘dT’: time-step size [s] ‘T0’: time of maximum event [s] ‘startx’: start of simulation space [m] ‘endX’: end of simulation space [m] ‘dX’: horizontal spacing [m] ‘X’: position of maximum event [m]
- Returns
sim (dict) – Simulation parameters including spatial and time calculated arrays.
- mhkit.loads.extreme.mler_wave_amp_normalize(wave_amp, mler, sim, k)[source]
Function that renormalizes the incoming amplitude of the MLER wave to the desired peak height (peak to MSL).
- Parameters
wave_amp (float) – Desired wave amplitude (peak to MSL).
mler (pd.DataFrame) – MLER coefficients generated by ‘mler_coefficients’ function.
sim (dict) – Simulation parameters formatted by output from ‘mler_simulation’.
k (numpy ndarray) – Wave number.
- Returns
mler_norm (pd.DataFrame) – MLER coefficients
- mhkit.loads.extreme.mler_export_time_series(rao, mler, sim, k)[source]
Generate the wave amplitude time series at X0 from the calculated MLER coefficients
- Parameters
rao (numpy ndarray) – Response amplitude operator.
mler (pd.DataFrame) – MLER coefficients dataframe generated from an MLER function.
sim (dict) – Simulation parameters formatted by output from ‘mler_simulation’.
k (numpy ndarray) – Wave number.
- Returns
mler_ts (pd.DataFrame) – Time series of wave height [m] and linear response [*] indexed by time [s].
- mhkit.loads.extreme.return_year_value(ppf, return_year, short_term_period_hr)[source]
Calculate the value from a given distribution corresponding to a particular return year.
- Parameters
ppf (callable function of 1 argument) – Percentage Point Function (inverse CDF) of short term distribution.
return_year (int, float) – Return period in years.
short_term_period_hr (int, float) – Short term period the distribution is created from in hours.
- Returns
value (float) – The value corresponding to the return period from the distribution.