Extreme Conditions Modeling - Full Sea State Approach

Extreme conditions modeling consists of identifying the expected extreme (e.g. 100-year) response of some quantity of interest, such as WEC motions or mooring loads. Three different methods of estimating extreme conditions were adapted from WDRT: full sea state approach, contour approach, and MLER design wave. This noteboook presents the full sea state approach.
The full sea state approach consists of the following steps:
  1. Take N samples to represent the sea state. Each sample represents a small area of the sea state and consists of a representative (H, T) pair and a weight W associated with the probability of that sea state area.
  2. For each sample (H, T) calculate the short-term (e.g. 3-hours) extreme for the quantity of interest (e.g. WEC motions or mooring tension).
  3. Integrate over the entire sea state to obtain the long-term extreme. This is a sum of the products of the weight of each sea state times the short-term extreme.
See more details and equations in
[1] Coe, Ryan G., Carlos A. Michelén Ströfer, Aubrey Eckert-Gallup, and Cédric Sallaberry. 2018. “Full Long-Term Design Response Analysis of a Wave Energy Converter.” Renewable Energy 116: 356–66.
NOTE: Prior to running this example it is recommended to become familiar with environmental_contours_example.ipynb and short_term_extremes_example.ipynb since some code blocks are adapted from those examples and used here without the additional description.

Obtain and Process NDBC Buouy Data

The first step will be obtaining the environmental data and creating the contours. See environmental_contours_example.ipynb for more details and explanations of how this is being done in the following code block.
% Specify the parameter as spectral wave density and the buoy number to be 46022
parameter = 'swden';
buoy_number = '46022';
available_data= NDBC_available_data(parameter,"buoy_number", buoy_number);
Data request URL: https://www.ndbc.noaa.gov/data/historical/swden
 
% Slice the available data to only include through year 2012
rows = (available_data.year < 2013) ;
filenames_of_interest = available_data.file(rows);
 
ndbc_requested_data = NDBC_request_data(parameter, filenames_of_interest);
 
Hm0 = [];
Te = [];
for field = fieldnames(ndbc_requested_data)'
Hm0 = [Hm0 ; significant_wave_height(ndbc_requested_data.(field{1}))];
Te = [Te ; energy_period(ndbc_requested_data.(field{1}))];
end
 
% Remove Hm0 Outliers and NaNs
filter = Hm0 < 20;
Hm0 = Hm0(filter);
Te = Te(filter);
[row, ~] = find(~isnan(Te));
Hm0 = Hm0(row);
Te = Te(row);
[row, col] = find(~isnan(Hm0));
Hm0 = Hm0(row);
Te = Te(row);
 
% Delta time of sea-states in seconds
dt = ndbc_requested_data.year_1996.time(2)- ndbc_requested_data.year_1996.time(1);
dt = seconds(dt);

1. Sampling

The first step is sampling the sea state to get samples (H, T) and associtated weights. For this we will use the waves.contours.samples_full_seastate function. We will sample 20 points between each return level, for 10 levels ranging from 0.001—100 years return periods. For more details on the sampling approach see
[1] Coe, Ryan G., Carlos A. Michelén Ströfer, Aubrey Eckert-Gallup, and Cédric Sallaberry. 2018. “Full Long-Term Design Response Analysis of a Wave Energy Converter.” Renewable Energy 116: 356–66.
[2] Eckert-Gallup, Aubrey C., Cédric J. Sallaberry, Ann R. Dallman, and Vincent S. Neary. 2016. “Application of Principal Component Analysis (PCA) and Improved Joint Probability Distributions to the Inverse First-Order Reliability Method (I-FORM) for Predicting Extreme Sea States.” Ocean Engineering 112 (January): 307–19.
% return levels
levels = [0.001; 0.01; 0.05; 0.1; 0.5; 1; 5; 10; 50; 100];
 
% points per return level interval
npoints = 20;
 
% create samples
[sample_hs, sample_te, sample_weights] = samples_full_seastate( ...
Hm0, Te, npoints, levels, dt, "PCA", 250);
We will now plot the samples alongside the contours. First we will create the different contours using contours.environmental_contours. See environmental_contours_example.ipynb for more details on using this function. There are 20 samples, randomly distributed, between each set of return levels.
Hm0_contours = zeros(length(levels),1000);
Te_contours = zeros(length(levels),1000);
for p = 1:length(levels)
contour = environmental_contours(Hm0, Te, dt, levels(p), "PCA", "return_fit",true);
Hm0_contours(p,:) = contour.contour1;
Te_contours(p,:) = contour.contour2;
end
 
plot_environmental_contours(sample_te,sample_hs,Te_contours,Hm0_contours,"x_label",...
'Energy Period (s)', "y_label",'Significant Wave Height (m)',"data_label",'NDBC 46022',...
"contour_label",string(levels'));

2. Short-Term Extreme Distributions

Many different methods for short-term extremes were adapted from WDRT, and a summary and examples can be found in short_term_extremes_example.ipynb. The response quantity of interest is typically related to the WEC itself, e.g. maximum heave displacement, PTO extension, or load on the mooring lines. This requires running a simulation (e.g. WEC-Sim) for each of the 200 (H, T) sampled sea states.
For the sake of example we will consider the wave elevation as the quantity of interest (can be thought as a proxy for heave motion in this example). Wave elevation time-series for a specific sea state can be created quickly without running any external software.
NOTE: The majority of the for loop below is simply creating the synthetic data (wave elevation time series). In a realistic case the variables time and data describing each time series would be obtained externally, e.g. through simulation software such as WEC-Sim or CFD. For this reason, the details of creating the synthetic data are not presented here, instead assume for each sea state there is time-series data available.
The last lines of the for-loop create the short-term extreme distribution from the time-series using the loads.extreme.short_term_extreme function. The short-term period will be 3-hours and we will use 1-hour "simulations" and the Weibull-tail-fitting method to estimate the 3-hour short-term extreme distributions for each of the 200 samples.
For more details on short-term extreme distributions see short_term_extremes_example.ipynb and
[3] Michelén Ströfer, Carlos A., and Ryan Coe. 2015. “Comparison of Methods for Estimating Short-Term Extreme Response of Wave Energy Converters.” In OCEANS 2015 - MTS/IEEE Washington, 1–6. IEEE.
NOTE: For calculating the short_term_extreme of each state, we set the optional argument output_py to true in order to return the native python output that we can then feed into our long term extreme function. Consequently, we can put arbitrary inputs to the x and method inputs of the short_term_extreme function.
% create the short-term extreme distribution for each sample sea state
t_st = 3.0 * 60.0 * 60.0;
gamma = 3.3;
t_sim = 1.0 * 60.0 * 60.0;
 
for i=1:length(sample_hs)
tp = sample_te(i) / (0.8255 + 0.03852 * gamma - 0.005537 * gamma^2 + 0.0003154 * gamma^3);
% time & frequency arrays
df = 1.0 / t_sim;
T_min = tp / 10.0; % s
f_max = 1.0 / T_min;
Nf = int32(f_max / df) + 1;
time = linspace(0, t_sim, 2 * Nf + 1);
f = linspace(0.0, f_max, Nf);
fprintf("Sea state %g/%g. (Hs, Te) = (%.2f m, %.2f s). Tp = %.2f s\n",i,200,sample_hs(i),sample_te(i),tp);
% spectrum
S = jonswap_spectrum(f, tp, sample_hs(i), gamma);
% 1-hour elevation time-series
data = surface_elevation(S, time);
% 3-hour extreme distribution
ste_all{i} = short_term_extreme(time, data.elevation, t_st, "peaks_weibull_tail_fit", 100, "cdf", "output_py",true);
end
Sea state 1/200. (Hs, Te) = (2.87 m, 10.18 s). Tp = 11.26 s Sea state 2/200. (Hs, Te) = (3.23 m, 10.46 s). Tp = 11.57 s Sea state 3/200. (Hs, Te) = (3.78 m, 10.59 s). Tp = 11.72 s Sea state 4/200. (Hs, Te) = (3.49 m, 9.51 s). Tp = 10.53 s Sea state 5/200. (Hs, Te) = (3.12 m, 9.07 s). Tp = 10.04 s Sea state 6/200. (Hs, Te) = (2.53 m, 9.01 s). Tp = 9.97 s Sea state 7/200. (Hs, Te) = (2.78 m, 8.23 s). Tp = 9.11 s Sea state 8/200. (Hs, Te) = (2.41 m, 8.94 s). Tp = 9.89 s Sea state 9/200. (Hs, Te) = (2.32 m, 7.81 s). Tp = 8.64 s Sea state 10/200. (Hs, Te) = (2.04 m, 8.03 s). Tp = 8.89 s Sea state 11/200. (Hs, Te) = (1.66 m, 7.45 s). Tp = 8.25 s Sea state 12/200. (Hs, Te) = (1.48 m, 7.66 s). Tp = 8.48 s Sea state 13/200. (Hs, Te) = (2.35 m, 9.11 s). Tp = 10.08 s Sea state 14/200. (Hs, Te) = (2.35 m, 9.12 s). Tp = 10.09 s Sea state 15/200. (Hs, Te) = (2.11 m, 9.11 s). Tp = 10.08 s Sea state 16/200. (Hs, Te) = (2.21 m, 9.32 s). Tp = 10.32 s Sea state 17/200. (Hs, Te) = (2.25 m, 9.37 s). Tp = 10.37 s Sea state 18/200. (Hs, Te) = (2.37 m, 9.16 s). Tp = 10.14 s Sea state 19/200. (Hs, Te) = (2.38 m, 9.19 s). Tp = 10.17 s Sea state 20/200. (Hs, Te) = (2.39 m, 9.20 s). Tp = 10.18 s Sea state 21/200. (Hs, Te) = (4.44 m, 13.23 s). Tp = 14.64 s Sea state 22/200. (Hs, Te) = (4.62 m, 12.60 s). Tp = 13.95 s Sea state 23/200. (Hs, Te) = (3.92 m, 10.88 s). Tp = 12.04 s Sea state 24/200. (Hs, Te) = (4.38 m, 10.45 s). Tp = 11.56 s Sea state 25/200. (Hs, Te) = (4.60 m, 9.34 s). Tp = 10.34 s Sea state 26/200. (Hs, Te) = (3.24 m, 8.11 s). Tp = 8.98 s Sea state 27/200. (Hs, Te) = (3.20 m, 7.16 s). Tp = 7.92 s Sea state 28/200. (Hs, Te) = (2.37 m, 6.24 s). Tp = 6.91 s Sea state 29/200. (Hs, Te) = (2.15 m, 6.98 s). Tp = 7.72 s Sea state 30/200. (Hs, Te) = (1.55 m, 5.77 s). Tp = 6.39 s Sea state 31/200. (Hs, Te) = (1.14 m, 5.86 s). Tp = 6.48 s Sea state 32/200. (Hs, Te) = (1.04 m, 6.56 s). Tp = 7.26 s Sea state 33/200. (Hs, Te) = (0.80 m, 7.16 s). Tp = 7.92 s Sea state 34/200. (Hs, Te) = (0.52 m, 8.36 s). Tp = 9.26 s Sea state 35/200. (Hs, Te) = (1.00 m, 8.74 s). Tp = 9.67 s Sea state 36/200. (Hs, Te) = (1.22 m, 10.30 s). Tp = 11.40 s Sea state 37/200. (Hs, Te) = (1.50 m, 10.77 s). Tp = 11.92 s Sea state 38/200. (Hs, Te) = (1.84 m, 13.76 s). Tp = 15.23 s Sea state 39/200. (Hs, Te) = (2.14 m, 14.16 s). Tp = 15.67 s Sea state 40/200. (Hs, Te) = (3.64 m, 13.32 s). Tp = 14.74 s Sea state 41/200. (Hs, Te) = (0.40 m, 11.12 s). Tp = 12.31 s Sea state 42/200. (Hs, Te) = (0.73 m, 11.89 s). Tp = 13.16 s Sea state 43/200. (Hs, Te) = (1.23 m, 13.83 s). Tp = 15.31 s Sea state 44/200. (Hs, Te) = (2.74 m, 15.95 s). Tp = 17.65 s Sea state 45/200. (Hs, Te) = (3.90 m, 15.72 s). Tp = 17.40 s Sea state 46/200. (Hs, Te) = (4.60 m, 15.40 s). Tp = 17.05 s Sea state 47/200. (Hs, Te) = (5.08 m, 14.47 s). Tp = 16.01 s Sea state 48/200. (Hs, Te) = (5.74 m, 12.87 s). Tp = 14.24 s Sea state 49/200. (Hs, Te) = (6.28 m, 12.58 s). Tp = 13.92 s Sea state 50/200. (Hs, Te) = (5.22 m, 9.61 s). Tp = 10.64 s Sea state 51/200. (Hs, Te) = (4.59 m, 8.55 s). Tp = 9.46 s Sea state 52/200. (Hs, Te) = (3.85 m, 7.33 s). Tp = 8.11 s Sea state 53/200. (Hs, Te) = (2.66 m, 5.95 s). Tp = 6.59 s Sea state 54/200. (Hs, Te) = (2.13 m, 5.38 s). Tp = 5.95 s Sea state 55/200. (Hs, Te) = (1.81 m, 5.17 s). Tp = 5.72 s Sea state 56/200. (Hs, Te) = (1.33 m, 5.11 s). Tp = 5.65 s Sea state 57/200. (Hs, Te) = (0.91 m, 5.41 s). Tp = 5.99 s Sea state 58/200. (Hs, Te) = (0.71 m, 6.13 s). Tp = 6.78 s Sea state 59/200. (Hs, Te) = (0.37 m, 6.53 s). Tp = 7.23 s Sea state 60/200. (Hs, Te) = (0.42 m, 7.52 s). Tp = 8.32 s Sea state 61/200. (Hs, Te) = (0.41 m, 13.51 s). Tp = 14.95 s Sea state 62/200. (Hs, Te) = (0.75 m, 14.83 s). Tp = 16.41 s Sea state 63/200. (Hs, Te) = (2.15 m, 16.55 s). Tp = 18.32 s Sea state 64/200. (Hs, Te) = (3.37 m, 17.22 s). Tp = 19.05 s Sea state 65/200. (Hs, Te) = (4.01 m, 17.20 s). Tp = 19.03 s Sea state 66/200. (Hs, Te) = (6.27 m, 16.59 s). Tp = 18.35 s Sea state 67/200. (Hs, Te) = (6.33 m, 15.75 s). Tp = 17.43 s Sea state 68/200. (Hs, Te) = (6.78 m, 14.08 s). Tp = 15.58 s Sea state 69/200. (Hs, Te) = (6.28 m, 11.10 s). Tp = 12.29 s Sea state 70/200. (Hs, Te) = (5.70 m, 9.76 s). Tp = 10.80 s Sea state 71/200. (Hs, Te) = (5.07 m, 8.50 s). Tp = 9.41 s Sea state 72/200. (Hs, Te) = (4.14 m, 7.24 s). Tp = 8.02 s Sea state 73/200. (Hs, Te) = (3.38 m, 6.33 s). Tp = 7.00 s Sea state 74/200. (Hs, Te) = (2.79 m, 5.68 s). Tp = 6.28 s Sea state 75/200. (Hs, Te) = (1.65 m, 4.95 s). Tp = 5.47 s Sea state 76/200. (Hs, Te) = (1.61 m, 4.99 s). Tp = 5.53 s Sea state 77/200. (Hs, Te) = (1.15 m, 4.90 s). Tp = 5.42 s Sea state 78/200. (Hs, Te) = (0.60 m, 5.13 s). Tp = 5.68 s Sea state 79/200. (Hs, Te) = (0.25 m, 5.88 s). Tp = 6.50 s Sea state 80/200. (Hs, Te) = (0.17 m, 6.27 s). Tp = 6.94 s Sea state 81/200. (Hs, Te) = (0.78 m, 16.17 s). Tp = 17.89 s Sea state 82/200. (Hs, Te) = (1.97 m, 17.29 s). Tp = 19.14 s Sea state 83/200. (Hs, Te) = (3.66 m, 18.06 s). Tp = 19.98 s Sea state 84/200. (Hs, Te) = (4.52 m, 19.50 s). Tp = 21.57 s Sea state 85/200. (Hs, Te) = (6.21 m, 18.91 s). Tp = 20.92 s Sea state 86/200. (Hs, Te) = (7.49 m, 16.74 s). Tp = 18.52 s Sea state 87/200. (Hs, Te) = (8.16 m, 15.00 s). Tp = 16.60 s Sea state 88/200. (Hs, Te) = (7.65 m, 13.41 s). Tp = 14.84 s Sea state 89/200. (Hs, Te) = (7.20 m, 11.74 s). Tp = 12.99 s Sea state 90/200. (Hs, Te) = (6.61 m, 10.39 s). Tp = 11.50 s Sea state 91/200. (Hs, Te) = (5.05 m, 8.41 s). Tp = 9.31 s Sea state 92/200. (Hs, Te) = (4.24 m, 7.09 s). Tp = 7.85 s Sea state 93/200. (Hs, Te) = (3.56 m, 6.19 s). Tp = 6.85 s Sea state 94/200. (Hs, Te) = (2.61 m, 5.36 s). Tp = 5.93 s Sea state 95/200. (Hs, Te) = (1.94 m, 4.82 s). Tp = 5.34 s Sea state 96/200. (Hs, Te) = (1.40 m, 4.45 s). Tp = 4.93 s Sea state 97/200. (Hs, Te) = (1.36 m, 4.71 s). Tp = 5.22 s Sea state 98/200. (Hs, Te) = (0.72 m, 4.61 s). Tp = 5.10 s Sea state 99/200. (Hs, Te) = (0.67 m, 4.84 s). Tp = 5.36 s Sea state 100/200. (Hs, Te) = (0.07 m, 5.34 s). Tp = 5.91 s Sea state 101/200. (Hs, Te) = (0.23 m, 17.16 s). Tp = 18.99 s Sea state 102/200. (Hs, Te) = (2.04 m, 19.19 s). Tp = 21.24 s Sea state 103/200. (Hs, Te) = (2.49 m, 19.57 s). Tp = 21.65 s Sea state 104/200. (Hs, Te) = (6.08 m, 19.65 s). Tp = 21.74 s Sea state 105/200. (Hs, Te) = (6.77 m, 19.04 s). Tp = 21.07 s Sea state 106/200. (Hs, Te) = (8.08 m, 18.35 s). Tp = 20.30 s Sea state 107/200. (Hs, Te) = (8.66 m, 15.55 s). Tp = 17.21 s Sea state 108/200. (Hs, Te) = (8.18 m, 12.97 s). Tp = 14.36 s Sea state 109/200. (Hs, Te) = (8.06 m, 12.36 s). Tp = 13.68 s Sea state 110/200. (Hs, Te) = (6.49 m, 9.89 s). Tp = 10.95 s Sea state 111/200. (Hs, Te) = (5.13 m, 7.71 s). Tp = 8.53 s Sea state 112/200. (Hs, Te) = (4.07 m, 6.58 s). Tp = 7.28 s Sea state 113/200. (Hs, Te) = (3.18 m, 5.54 s). Tp = 6.13 s Sea state 114/200. (Hs, Te) = (3.04 m, 5.36 s). Tp = 5.93 s Sea state 115/200. (Hs, Te) = (1.95 m, 4.52 s). Tp = 5.01 s Sea state 116/200. (Hs, Te) = (1.40 m, 4.24 s). Tp = 4.69 s Sea state 117/200. (Hs, Te) = (0.97 m, 4.20 s). Tp = 4.65 s Sea state 118/200. (Hs, Te) = (0.75 m, 4.31 s). Tp = 4.77 s Sea state 119/200. (Hs, Te) = (0.51 m, 4.55 s). Tp = 5.03 s Sea state 120/200. (Hs, Te) = (0.06 m, 5.15 s). Tp = 5.70 s Sea state 121/200. (Hs, Te) = (1.41 m, 19.66 s). Tp = 21.76 s Sea state 122/200. (Hs, Te) = (2.54 m, 20.29 s). Tp = 22.46 s Sea state 123/200. (Hs, Te) = (3.47 m, 21.14 s). Tp = 23.39 s Sea state 124/200. (Hs, Te) = (7.10 m, 20.16 s). Tp = 22.31 s Sea state 125/200. (Hs, Te) = (8.64 m, 19.45 s). Tp = 21.53 s Sea state 126/200. (Hs, Te) = (9.72 m, 17.61 s). Tp = 19.48 s Sea state 127/200. (Hs, Te) = (9.35 m, 16.58 s). Tp = 18.34 s Sea state 128/200. (Hs, Te) = (8.45 m, 13.05 s). Tp = 14.44 s Sea state 129/200. (Hs, Te) = (7.97 m, 11.42 s). Tp = 12.64 s Sea state 130/200. (Hs, Te) = (6.37 m, 9.31 s). Tp = 10.30 s Sea state 131/200. (Hs, Te) = (6.28 m, 8.86 s). Tp = 9.80 s Sea state 132/200. (Hs, Te) = (4.57 m, 6.78 s). Tp = 7.50 s Sea state 133/200. (Hs, Te) = (3.53 m, 5.70 s). Tp = 6.30 s Sea state 134/200. (Hs, Te) = (2.70 m, 4.83 s). Tp = 5.34 s Sea state 135/200. (Hs, Te) = (2.55 m, 4.62 s). Tp = 5.11 s Sea state 136/200. (Hs, Te) = (1.61 m, 4.09 s). Tp = 4.53 s Sea state 137/200. (Hs, Te) = (1.14 m, 4.12 s). Tp = 4.56 s Sea state 138/200. (Hs, Te) = (0.97 m, 3.90 s). Tp = 4.32 s Sea state 139/200. (Hs, Te) = (0.42 m, 4.09 s). Tp = 4.52 s Sea state 140/200. (Hs, Te) = (0.08 m, 4.49 s). Tp = 4.97 s Sea state 141/200. (Hs, Te) = (0.25 m, 19.72 s). Tp = 21.82 s Sea state 142/200. (Hs, Te) = (2.18 m, 21.97 s). Tp = 24.31 s Sea state 143/200. (Hs, Te) = (3.88 m, 22.22 s). Tp = 24.59 s Sea state 144/200. (Hs, Te) = (7.30 m, 22.13 s). Tp = 24.49 s Sea state 145/200. (Hs, Te) = (9.22 m, 20.77 s). Tp = 22.98 s Sea state 146/200. (Hs, Te) = (9.69 m, 19.12 s). Tp = 21.16 s Sea state 147/200. (Hs, Te) = (10.60 m, 17.39 s). Tp = 19.24 s Sea state 148/200. (Hs, Te) = (10.20 m, 14.75 s). Tp = 16.32 s Sea state 149/200. (Hs, Te) = (8.50 m, 11.62 s). Tp = 12.86 s Sea state 150/200. (Hs, Te) = (7.08 m, 9.44 s). Tp = 10.45 s Sea state 151/200. (Hs, Te) = (6.06 m, 8.16 s). Tp = 9.03 s Sea state 152/200. (Hs, Te) = (5.13 m, 7.16 s). Tp = 7.92 s Sea state 153/200. (Hs, Te) = (3.76 m, 5.57 s). Tp = 6.16 s Sea state 154/200. (Hs, Te) = (3.00 m, 4.84 s). Tp = 5.35 s Sea state 155/200. (Hs, Te) = (2.24 m, 4.31 s). Tp = 4.77 s Sea state 156/200. (Hs, Te) = (1.55 m, 3.85 s). Tp = 4.27 s Sea state 157/200. (Hs, Te) = (1.48 m, 3.89 s). Tp = 4.31 s Sea state 158/200. (Hs, Te) = (0.76 m, 3.83 s). Tp = 4.24 s Sea state 159/200. (Hs, Te) = (0.40 m, 4.06 s). Tp = 4.49 s Sea state 160/200. (Hs, Te) = (0.22 m, 4.18 s). Tp = 4.62 s Sea state 161/200. (Hs, Te) = (0.65 m, 22.88 s). Tp = 25.32 s Sea state 162/200. (Hs, Te) = (3.04 m, 23.41 s). Tp = 25.90 s Sea state 163/200. (Hs, Te) = (4.59 m, 23.43 s). Tp = 25.92 s Sea state 164/200. (Hs, Te) = (8.08 m, 22.66 s). Tp = 25.08 s Sea state 165/200. (Hs, Te) = (10.23 m, 20.21 s). Tp = 22.37 s Sea state 166/200. (Hs, Te) = (10.97 m, 19.67 s). Tp = 21.76 s Sea state 167/200. (Hs, Te) = (10.73 m, 16.24 s). Tp = 17.97 s Sea state 168/200. (Hs, Te) = (10.20 m, 13.75 s). Tp = 15.22 s Sea state 169/200. (Hs, Te) = (10.02 m, 12.77 s). Tp = 14.13 s Sea state 170/200. (Hs, Te) = (7.91 m, 10.02 s). Tp = 11.09 s Sea state 171/200. (Hs, Te) = (6.50 m, 8.46 s). Tp = 9.36 s Sea state 172/200. (Hs, Te) = (5.40 m, 7.21 s). Tp = 7.98 s Sea state 173/200. (Hs, Te) = (3.84 m, 5.51 s). Tp = 6.10 s Sea state 174/200. (Hs, Te) = (3.11 m, 4.86 s). Tp = 5.38 s Sea state 175/200. (Hs, Te) = (2.28 m, 4.15 s). Tp = 4.59 s Sea state 176/200. (Hs, Te) = (1.58 m, 3.72 s). Tp = 4.12 s Sea state 177/200. (Hs, Te) = (1.27 m, 3.64 s). Tp = 4.03 s Sea state 178/200. (Hs, Te) = (0.96 m, 3.60 s). Tp = 3.99 s Sea state 179/200. (Hs, Te) = (0.73 m, 3.72 s). Tp = 4.12 s Sea state 180/200. (Hs, Te) = (0.20 m, 4.00 s). Tp = 4.43 s Sea state 181/200. (Hs, Te) = (0.76 m, 23.17 s). Tp = 25.64 s Sea state 182/200. (Hs, Te) = (3.91 m, 24.51 s). Tp = 27.12 s Sea state 183/200. (Hs, Te) = (7.32 m, 24.46 s). Tp = 27.07 s Sea state 184/200. (Hs, Te) = (9.48 m, 23.50 s). Tp = 26.01 s Sea state 185/200. (Hs, Te) = (11.81 m, 21.25 s). Tp = 23.52 s Sea state 186/200. (Hs, Te) = (12.09 m, 19.36 s). Tp = 21.43 s Sea state 187/200. (Hs, Te) = (12.01 m, 16.87 s). Tp = 18.67 s Sea state 188/200. (Hs, Te) = (10.65 m, 13.32 s). Tp = 14.74 s Sea state 189/200. (Hs, Te) = (10.36 m, 13.08 s). Tp = 14.47 s Sea state 190/200. (Hs, Te) = (8.78 m, 10.69 s). Tp = 11.83 s Sea state 191/200. (Hs, Te) = (6.12 m, 7.75 s). Tp = 8.57 s Sea state 192/200. (Hs, Te) = (4.99 m, 6.40 s). Tp = 7.09 s Sea state 193/200. (Hs, Te) = (4.18 m, 5.61 s). Tp = 6.21 s Sea state 194/200. (Hs, Te) = (2.87 m, 4.41 s). Tp = 4.87 s Sea state 195/200. (Hs, Te) = (2.43 m, 4.09 s). Tp = 4.53 s Sea state 196/200. (Hs, Te) = (1.67 m, 3.61 s). Tp = 3.99 s Sea state 197/200. (Hs, Te) = (1.48 m, 3.53 s). Tp = 3.91 s Sea state 198/200. (Hs, Te) = (0.92 m, 3.44 s). Tp = 3.81 s Sea state 199/200. (Hs, Te) = (0.45 m, 3.53 s). Tp = 3.90 s Sea state 200/200. (Hs, Te) = (0.30 m, 3.67 s). Tp = 4.06 s

3. Long-Term Extreme Distribution

Finally we integrate the weighted short-term extreme distributions over the entire sea state space to obtain the extreme distribution, assuming a 3-hour sea state coherence. For this we use the full_seastate_long_term_extreme function. The integral reduces to a sum over the 200 bins of the weighted short-term extreme distributions.
Similar to the short-term extreme functions, the output of long-term extreme function is a probability distribution. Here, we will look at the survival function and the 100-year return level.The value of the survival function at a given return level (e.g. 100-years) may be calculated using the return_year_value function.
t_st_hr = t_st / (60.0 * 60.0);
t_return_yr = 100.0;
probability_of_exceedance = 1 / (t_return_yr * 365.25 * 24 / t_st_hr);
x_t = full_seastate_long_term_extreme(ste_all, sample_weights, 1-probability_of_exceedance, "ppf");
fprintf("100-year elevation: %.3f meters", x_t)
100-year elevation: 10.299 meters
% plot survival function
x = linspace(0, 20, 1000);
lte_sf = full_seastate_long_term_extreme(ste_all, sample_weights, x, "sf");
figure;
semilogy(x, lte_sf);
xlabel('elevation [m]'); ylabel('survival function (1-cdf)'); ylim([1e-10, 1]); xlim([0, x(end)]);
% add 100-year return level to plot
hold on
st_sf = full_seastate_long_term_extreme(ste_all, sample_weights, x_t, "sf");
xline(x_t, '--')
yline(st_sf, '--')