Skip to content

Commit

Permalink
Style: Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
simmsa committed Dec 31, 2024
1 parent 0352446 commit 16518ae
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions mhkit/wave/resource/environmental_contours.m
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
function environmental_contour=environmental_contours(x1, x2, dt, period, method, options)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculates environmental contours of extreme sea
% states using the improved joint probability distributions
% with the inverse first-order reliability method (IFORM)
% probability for the desired return period (period). Given the
% Calculates environmental contours of extreme sea
% states using the improved joint probability distributions
% with the inverse first-order reliability method (IFORM)
% probability for the desired return period (period). Given the
% period of interest a circle of iso-probability is created in the
% in the PCA joint probability (x1, x2) reference frame.
% Using the joint probability value the CDF of the marginal
% distribution is used to find the quantile of each component.
% in the PCA joint probability (x1, x2) reference frame.
% Using the joint probability value the CDF of the marginal
% distribution is used to find the quantile of each component.
% Finally, using the improved PCA methodology
% the component 2 contour lines are calculated from component 1 using
% the relationships defined in Exkert-Gallup et. al. 2016.
%
% Eckert-Gallup, A. C., Sallaberry, C. J., Dallman, A. R., &
% Neary, V. S. (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, 307-319.
%
% the component 2 contour lines are calculated from component 1 using
% the relationships defined in Exkert-Gallup et. al. 2016.
%
% Eckert-Gallup, A. C., Sallaberry, C. J., Dallman, A. R., &
% Neary, V. S. (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, 307-319.
%
% Parameters
% ------------
% x1 : vector
% component 1 data
%
% x2 : vector
% component 2 data
% component 2 data
%
% dt : double
% x1 and x2 sample rate (seconds)
%
%
% period : scalar or vector
% Desired return period (years) for calculation of environmental
% contour, can be a scalar or a vector.
%
%
% PCA: Structure (optional)
% principal component analysis dictionary from previous function
% call. When supplied the function will skip the PCA calculation
% for the passe x1, and x2.
% principal component analysis dictionary from previous function
% call. When supplied the function will skip the PCA calculation
% for the passe x1, and x2.
% to call: environmental_contour(x1,x2,dt,period,"PCA",PCA)
%
%
% bin_size : double (optional)
% Data points in each bin
% Data points in each bin
% to call: environmental_contour(x1,x2,dt,period,"bin_size",bin_size)
%
%
% nb_steps : int (optional)
% Discretization of the circle in the normal space used for
% IFORM calculation.
Expand All @@ -52,17 +52,17 @@
% return_PCA: boolean
% Default False, if True will retun the PCA dictionary
% to call: environmental_contour(x1,x2,dt,period,"return_PCA",return_PCA)
%
%
%
%
% Returns
% ---------
% environmental_contour: Structure
% environmental_contour: Structure
% Structure with fields contour1, contour2, and optionally PCA
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

arguments
arguments
x1
x2
dt
Expand All @@ -83,7 +83,7 @@
if isscalar(period)
period_py = period;
elseif isvector(period)
period_py = py.numpy.array(period);
period_py = py.numpy.array(period);
else
ME = MException('MATLAB:environmental_contour','period must be a vector or scalar');
throw(ME);
Expand All @@ -106,4 +106,3 @@
environmental_contour.fit = struct(data_struct.(varfit));
end


0 comments on commit 16518ae

Please sign in to comment.