Wafo Tutorial 2017
Wafo Tutorial 2017
Wafo Tutorial 2017
Faculty of Engineering
Centre for Mathematical Sciences
Mathematical Statistics
Mathematical Statistics
Lund University
Box 118
SE-221 00 Lund
Sweden
http://www.maths.lth.se/
i
iii
iv FOREWORD
Matlab m-files together with executable routines from Fortran or C++ source,
and it requires only a standard Matlab setup, with no additional toolboxes.
A main and unique feature of Wafo is the module of routines for computation
of the exact statistical distributions of wave and cycle characteristics in a Gaussian
wave or load process. The routines are described in a series of examples on wave
data from sea surface measurements and other load sequences. There are also sec-
tions for fatigue analysis and for general extreme value analysis. Although the main
applications at hand are from marine and reliability engineering, the routines are
useful for many other applications of Gaussian and related stochastic processes.
The routines are based on algorithms for extreme value and crossing analysis,
developed over many years by the authors as well as many results available in the
literature. References are given to the source of the algorithms whenever it is pos-
sible. These references are given in the Matlab-code for all the routines and they
are also listed in the Bibliography section of this tutorial. If the references are not
used explicitly in the tutorial; it means that it is referred to in one of the Matlab
m-files.
Besides the dedicated wave and fatigue analysis routines the toolbox contains
many statistical simulation and estimation routines for general use, and it can there-
fore be used as a toolbox for statistical work. These routines are listed, but not
explicitly explained in this tutorial.
The present toolbox represents a considerable development of two earlier tool-
boxes, the Fat and Wat toolboxes, for fatigue and wave analysis, respectively. These
toolboxes were both Version 1; therefore Wafo has been named Version 2. The rou-
tines in the tutorial are tested on Wafo-version 2.5, which was made available in
beta-version in January 2009 and in a stable version in February 2011.
The persons that take actively part in creating this tutorial are (in alphabetical
order): Per Andreas Brodtkorb1 , Pär Johannesson2 , Georg Lindgren3 , Igor Rychlik4 .
Many other people have contributed to our understanding of the problems dealt
with in this text, first of all Professor Ross Leadbetter at the University of North
Carolina at Chapel Hill and Professor Krzysztof Podgórski, Mathematical Statistics,
Lund University. We would also like to particularly thank Michel Olagnon and Marc
Provosto, at Institut Français de Recherches pour l’Exploitation de la Mer (IFRE-
MER), Brest, who have contributed with many enlightening and fruitful discussions.
Other persons who have put a great deal of effort into Wafo and its predeces-
sors FAT and WAT are Mats Frendahl, Sylvie van Iseghem, Finn Lindgren, Ulla
Machado, Jesper Ryén, Eva Sjö, Martin Sköld, Sofia Åberg.
This tutorial was first made available for the beta version of Wafo Version 2.5
in November 2009. In the present version some misprints have been corrected and
some more examples added. All examples in the tutorial have been run with success
on MATLAB up to 2010b.
1
Norwegian Defense Research Establishment, Horten, Norway.
2
SP Technical Research Institute, Borås, Sweden.
3
Centre for Mathematical Sciences, Lund University, Sweden.
4
Mathematical Sciences, Chalmers, Göteborg, Sweden.
Technical information
• Wafo was released in a stable version in February 2011. The most recent
stable updated and expanded version of Wafo can be downloaded from
https://github.com/wafo-project/
Older versions can also be downloaded from the Wafo homepage [91]
http://www.maths.lth.se/matstat/wafo/
• To get access to the Wafo toolbox, unzip the downloaded file, identify the
wafo package and save it in a folder of your choise. Take a look at the routines
install.m, startup.m, initwafo.m in the WAFO and WAFO/docs folders to
learn how Matlab can find Wafo.
• To let Matlab start Wafo automatically, edit startup.m and save it in the
starting folder for Matlab.
• To start Wafo manually in Matlab, add the WAFO folder manually to the
Matlab-path and run initwafo.
• In this tutorial, the word WAFO, when used in path specifications, means the
full name of the Wafo main catalogue, for instance C:/wafo/
• The Matlab code used for the examples in this tutorial can be found in the
Wafo catalogue WAFO/papers/tutorcom/
The total time to run the examples in fast mode is less than fifteen minutes
on a PC from 2017, running Windows 10 pro with Intel(R) Core(TM) i7-7700
CPU, 3.6 GHz, 32 GB RAM. All details on execution times given in this
tutorial relates to that configuration.
• Wafo is built of modules of platform independent Matlab m-files and a
set of executable files from C++ and Fortran source files. These executables
are platform and Matlab-version dependent, and they have been tested with
recent Matlab and Windows installations.
• If you have many Matlab-toolboxes installed, name-conflicts may occur. So-
lution: arrange the Matlab-path with WAFO first.
• For help on the toolbox, write help wafo.
• Comments and suggestions are solicited — send to wafo@maths.lth.se
v
vi FOREWORD
Contents
Foreword iii
Foreword to 2017 edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Foreword to 2011 edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Technical information v
Contents x
List of Tables xv
Nomenclature xvii
1 Introduction to Wafo 1
1.1 What is WAFO? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Philosophy – some features of Wafo . . . . . . . . . . . . . . . . . . 3
1.3 Organization of Wafo . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Some applications of Wafo . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.1 Simulation from spectrum, estimation of spectrum . . . . . . . 8
1.4.2 Probability distributions of wave characteristics . . . . . . . . 9
1.4.3 Directional spectra . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4.4 Fatigue, load cycles, and Markov models . . . . . . . . . . . . 12
1.4.5 Statistical extreme value analysis . . . . . . . . . . . . . . . . 13
1.5 Spectra used in the tutorial . . . . . . . . . . . . . . . . . . . . . . . 15
1.5.1 SG, Empirical spectrum from waves in gfaksr89.dat . . . . . 15
1.5.2 SJ, Theoretical Jonswap spectrum . . . . . . . . . . . . . . . 15
1.5.3 SS, Empirical spectrum from waves in sea.dat . . . . . . . . 15
1.5.4 ST, Theoretical Torsethaugen spectrum . . . . . . . . . . . 16
1.6 Datastructures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
vii
viii CONTENTS
Bibliography 161
Index 171
List of Figures
xi
xii LIST OF FIGURES
3.5 Kernel estimate of the joint density of crest period and crest height . 54
3.6 Longuet-Higgins model for joint pdf of crest period and height . . . . 56
3.7 Joint density of crest period and crest height by Cavanié et al . . . . 57
6.5 Empirical and estimated distribution functions for GEV variables . . 127
6.6 Return level extrapolation . . . . . . . . . . . . . . . . . . . . . . . . 127
6.7 Estimated expected exceedance over level u . . . . . . . . . . . . . . 129
6.8 Distribution functions of monthly maxima . . . . . . . . . . . . . . . 130
6.9 Threshold selection in POT analysis . . . . . . . . . . . . . . . . . . . 131
6.10 Diagnostic POT plot for sea data . . . . . . . . . . . . . . . . . . . . 133
C.1 Target spectrum, ST (ω), (solid) and its linear component, SL (ω) (dash-
dot) compared with STN LS (dash) and SLN LS (dot), i.e., spectra of non-
linearly simulated data using input spectrum ST (ω) (method 1) and
SL (ω) (method 2), respectively. . . . . . . . . . . . . . . . . . . . . . 159
xiv LIST OF FIGURES
List of Tables
B.1 Empirical parameter values for the Ochi-Hubble spectral model . . . 155
B.2 Target spectra parameters for mixed sea states . . . . . . . . . . . 155
xv
xvi LIST OF TABLES
Nomenclature
Roman letters
Ac , At Zero-crossing wave crest height and trough excursion.
ai Lower integration limit.
bi Upper integration limit.
c0 Truncation parameter of truncated Weibull distribution.
C[X, Y ] Covariance between random variables X and Y .
D(ω, θ), Directional spreading function.
D(θ)
ddcrit dcrit zcrit Critical distances used for removing outliers and spurious points.
E[X] Expectation of random variable X.
E(ωi , ωj ) Quadratic transfer function.
f Wave frequency [Hz].
fp Spectral peak frequency.
FX (·), fX (·) Cumulative distribution function and
probability density function of variable X.
G(·), g(·) The transformation and its inverse.
g Acceleration of gravity.
H, h Dimensional and dimensionless wave height.
√
Hm0 , Hs Significant wave height, 4 m0 .
Hc Critical wave height.
Hd , Hu Zero-downcrossing and -upcrossing wave height.
h Water depth.
hmax Maximum interval width for Simpson method.
√
Hrms Root mean square value for wave height defined as Hm0 / 2.
Kd (·) Kernel function.
k Wave number [rad/m] or index.
Lp Average wave length.
Lmax Maximum lag beyond which the autocovariance is set to zero.
M, Mk Local maximum.
Mktc Crest maximum for wave no. k.
xvii
xviii NOMENCLATURE
m, mk Local minimum.
mrfc
k Rainflow minimum no. k.
mtck Trough minimum for wave no. k.
R∞ +
mn n’th spectral moment, 0 ω n Sηη (ω) dω.
N Number of variables or waves.
Nc1c2 Number of times to apply regression equation.
NIT Order in the integration of wave characteristic distributions.
ni , n Sample size.
P(A) Probability of event A.
O(·) Order of magnitude.
Qp Peakedness factor.
Rη (τ ) Auto covariance function of η(t).
Sp Average wave steepness.
Ss Significant wave steepness.
+ +
Sηη (f ), Sηη (ω) One sided spectral density of the surface elevation η.
S(ω, θ) Directional wave spectrum.
s Normalized crest front steepness.
sc Critical crest front steepness.
scf Crest front steepness.
sN Return level for return period N .
srms Root mean square value for crest front steepness,
2
i.e., 5/4 Hm0 /Tm02 .
Tc , Tcf , Tcr Crest, crest front, and crest rear period.
Tm(−1)0 Energy period.
Tm01 Mean wave period. p
Tm02 Mean zero-crossing wave period calculated as 2π mp 0 /m2 .
Tm24 Mean wave period between maxima calculated as 2π m2 /m4 .
TM d Wave period between maximum and downcrossing.
TM m Wave period between maximum and minimum.
Tp Spectral peak period.
Tz Mean zero-crossing wave period estimated directly from time series.
T Wave period.
U10 10 min average of windspeed 10[m] above the watersurface.
Ui Uniformly distributed number between zero and one.
V, v Dimensional and dimensionless velocity.
V[X] Variance of random variable X.
Vcf , Vcr Crest front and crest rear velocity.
Vrms Root mean square value for velocity defined as 2Hm0 /Tm02 .
Wage Wave age.
W (x, t) Random Gassian field.
X(t) Time series.
Xi , Yi , Zi Random variables.
xc , yc , zc Truncation parameters.
xix
Greek letters
Abbreviations
Introduction to Wafo
1
2 CHAPTER 1. INTRODUCTION TO WAFO
In the following section, we discuss in more detail the idea of the modular struc-
ture. That section is followed by an overview of the organization of Wafo, presenting
some of the capabilities of the toolbox. Finally, we give a number of examples to
demonstrate the use of some of the tools in Wafo for analysis and modelling.
WAFO is the main directory containing different directories for the Wafo software,
datasets and documentation.
WAFO/docs contains the documentation for the toolbox.
WAFO/papers is a subdirectory including scripts for reproducing figures in various
articles and technical reports. The scripts tutorcom for the examples in this
tutorial are found here.
WAFO/wdemos contains different demonstrations that illustrate and highlight certain
aspects of Wafo.
WAFO/data contains datasets used in the demo and paper scripts.
WAFO/source contains mex and Fortran source files.
WAFO/exec/... contains Fortran compiled executables for different platforms
and Matlab versions.
Data analysis
Routines in the category onedim treat data in the form of time series. As examples
of routines, we find procedures for extraction of so-called turning points, from which
troughs and crests may be obtained, as well as procedures for estimation of auto-
covariance function and one-sided spectral density. One routine extracts wave heights
and steepnesses. Numerous plotting routines are included.
Routines in the category multidim treat multidimensional problems in space
and time. One routine estimates a directional spectrum from a series of wave field
measurements, and other routines handle problems with directional spreading and
wave measurements.
Spectrum
Computation of spectral moments and covariance functions, given a spectrum, is a
necessary step for calculation of exact probability distributions of wave characteris-
tics. The spectrum structure mentioned in the previous section allows this calculation
to be performed for directional spectra as well as encountered spectra. We present
routines for calculations of commonly used frequency spectra S(ω), e.g. Jonswap
and Torsethaugen. The spectra can be expressed in frequency as well as wave num-
ber. Libraries of spreading functions D(θ), in some cases allowed to be also frequency
dependent, cf. [34], are included.
Routines for transformed Gaussian processes, cf. [73], are included. Contrary to
what is often stated in the technical literature, these routines are very efficient and
accurate and they can be used for engineering purposes; cf. [53, Sec. 4.4.1].
These are parametric models, where the calculations need as input the spectral
moments, as opposed to the algorithms in the exact Gaussian module, where the
whole spectrum is required.
Markov models
If the sequence of turning points forms a Markov chain it is called an MC of turning
points (MCTP). The Markov matrix is the expected histogram matrix of min-to-
max and max-to-min cycles. Given a rainflow matrix of an MCTP, one can find its
Markov matrix, and vice versa. In Wafo, algorithms are implemented to calculate
the rainflow matrix for an MC and an MCTP; cf. [22].
In some applications, one wants to model data, whose properties change accord-
ing to an underlying, often unobserved process, called the regime process. The state
of the regime process controls which parameters to use and when to switch the
parameter values. If the regime process is modelled by a Markov chain we have a
Hidden Markov Model (HMM), and this is the fundamental basis for the set of rou-
tines presented. For an application with such switching Markov models for fatigue
problems, see [32, 33].
damage from a cycle count as well as from a cycle matrix. The relation between
load energy spectrum and fatigue can be analysed by using the spectrum for a
transformed Gaussian load process to first calculate a cycle matrix and then the
total damage. See help fatigue for a list of fatigue routines available in the different
Wafo directories.
Kernel-density-estimation tools
The routines in this category complement the ones found in ’Data analysis’ and,
obviously, the routines in ’Statistical tools and extreme value distributions’. They
are, however, also applicable to multi-dimensional data, and hence very useful for
smoothing purposes when comparing (theoretical) joint distributions of wave char-
acteristics to data; cf. [80] and [92].
Miscellaneous routines
We find here various plot routines, algorithms for numerical integration, and func-
tions for documentation of Wafo with modules. Note, that the figures in this tutorial
have been edited with respect to font size, and some other properties.
Standard Deviation
− +2
2
0
−2
− −2
−4
0 20 40 60 80
4
− +2
2
0
−2
− −2
−4
100 120 140 160 180
Time (sec)
Figure 1.1: A simulation from S(ω), a Torsethaugen spectrum with Hm0 = 6 [m],
Tp = 8 [s]. Total number of points = 2000, ∆t = 0.1 [s].
plotflag = 1; Fs = 4; clf
dt = 1/Fs; N = fix(20*60*Fs);
xs = spec2sdat(ST,N,dt);
STest = dat2spec(xs,400)
plotspec(ST,plotflag), hold on
plotspec(STest,plotflag,’--’)
axis([0 3 0 5]), hold off
Spectral density
5
fp = 0.79 [rad/s]
4.5
3.5
S(w) [m2 s / rad]
2.5
1.5
0.5
0
0 0.5 1 1.5 2 2.5 3
Frequency [rad/s]
Figure 1.2: Solid: Thorsethaugen spectrum ST. Dashed: spectrum STest estimated
from data (20 minutes). Maximum lag size of Parzen window = 400.
calculate the theoretical distribution. The parameter NIT determines the accuracy
of the calculation.
NIT = 3; paramt = [0 10 51]; clf
dtyex = spec2tpdf(ST,[],’Tt’,paramt,0,NIT);
dtyest = spec2tpdf(STest,[],’Tt’,paramt,0,NIT);
[T, index] = dat2wa(xs,0,’d2u’);
histgrm(T,25,1,1), hold on
pdfplot(dtyex), pdfplot(dtyest,’-.’)
axis([0 10 0 0.35]), hold off
0.3
0.25
0.2
0.15
0.1
0.05
0
0 2 4 6 8 10
T [s]
Figure 1.3: Pdf for wave trough period for Torsethaugen spectrum ST (solid line)
and estimated spectrum STest (dash-dotted line). The histogram shows the wave
periods extracted from the simulated data in Figure 1.1.
Remark 1.1. “Wave direction” is the direction from which waves are coming.
In Wafo we adhere to the mathematical convention to count direction counter-
clockwise from the positive x-axis. Thus, waves with direction 0o are coming from
the East and waves with direction 90o are coming from the North, just the opposite
to ocean standard. 2
Here are a few lines of code, which produce the graph of these directional spectra
with frequency independent and frequency dependent spreading. The main direc-
tions are 90o and 0o , respectively.
plotflag = 1; clf
Nt = 101; % number of angles
th0 = pi/2; % primary direction of waves
Sp = 15; % spreading parameter
D1 = spreading(Nt,’cos’,th0,Sp,[],0); %frequency independent
D12 = spreading(Nt,’cos’,0,Sp,ST.w,1); %frequency dependent
STD1 = mkdspec(ST,D1); STD12 = mkdspec(ST,D12);
plotspec(STD1,plotflag), hold on
plotspec(STD12,plotflag,’-.’), hold off
Directional Spectrum
90
1.5
Level curves at:
120 60
0.5
1
1.5
1
2
2.5
1503 30
0.5
180 0
210 330
240 300
270
Figure 1.5: Gaussian sea surface, 512 [m] by 1024 [m], with directional spectrum
SD1, spreading independent of frequency, waves from North.
rng(’default’); clf
opt = simoptset(’Nt’,20,’dt’,1,’Nu’,1024’,’du’,1,’Nv’,512,’dv’,1)
W1 = spec2field(STD1,opt);
W12 = spec2field(STD12,opt)
The generated space-time fields can be presented and optionally saved as a movie
by the routine seamovie. Specifying a file name saves the movie in avi-format, as
for Movie12.
figure(1); clf
Movie1 = seamovie(W1,1);
figure(2); clf
Movie12 = seamovie(W12,1,’GaussianSea12.avi’)
The last frame of the movies are shown in Figures 1.5-1.6 and one can see that waves
are coming from different directions. However, frequency dependent spreading leads to a
more irregular surface, so the orientation of waves is less transparent. From the figures it
is not easy to deduce that both sea surfaces have the same period distribution, but it is
more obvious that the wavelength distributions are different.
Figure 1.6: Gaussian sea surface, 512 [m] by 1024 [m], with directional spectrum
SD12, frequency dependent spreading, waves from East.
The Wafo toolbox also contains routines for computing the intensity of rainflow cycles in
more complex load processes, for example for a switching Markov chain of turning points,
TP. Details on fatigue load analysis are given in Chapter 5.
−2
−4
−6
−6 −4 −2 0 2 4 6
max [m]
Figure 1.7: Intensity of rainflow cycles computed from the power spectrum through
Markov approximation, compared with cycles found in the simulation.
from about 23 hours of registration are stored in the data set yura87, taken with a 1 Hz
sampling rate. We first load and plot, in Figure 1.8, part of the data and calculate the
maximum over 5 minute periods.
xn = load(’yura87.dat’); subplot(211);
plot(xn(1:30:end,1)/3600,xn(1:30:end,2),’.’)
title(’Water level’), ylabel(’m’)
yura = xn(1:85500,2);
yura = reshape(yura,300,285);
maxyura = max(yura); subplot(212)
plot(xn(300:300:85500,1)/3600,maxyura,’.’)
xlabel(’Time (h)’), ylabel(’m’)
title(’Maximum 5 min water level’)
It is clear from the figures that there is a trend in the data, with decreasing spreading
with time. In Chapter 5 we will deal with that problem; here we make a crude extreme
value analysis, by fitting a GEV distribution to the sequence of 5 minute maxima, simply
by issuing the commands
phat = fitgev(maxyura,’plotflag’,1);
Figure 1.9 shows cumulative distribution and density of the fitted GEV distribution
together with diagnostic plots of empirical and model quantiles. The non-stationarity gives
a very bad fit in the upper tail of the distribution. The fitted GEV has shape parameter
0.1, with a 95% confidence interval (0.01, 0.18).
1.5. SPECTRA USED IN THE TUTORIAL 15
Water level
20
15
(m)
10
5
0 5 10 15 20 25
15
10
0 5 10 15 20 25
Time (h)
Figure 1.8: Water level variation in the Japan Sea from the data set yura87 and
maxima over 5 minute periods.
0.5
0.8
0.4
0.6
F(x)
0.3
0.4
0.2
0.2 0.1
0 0
10 12 14 16 18 20 12 14 16 18 20
x x
18 0.8
Model (gev)
Model (gev)
0.6
16
0.4
14
0.2
12
0
12 14 16 18 0 0.5 1
Empirical Empirical
Fit method: PWM, Fit p−value: 1.00
1.6 Datastructures
help datastructures
Spectrum structure
~~~~~~~~~~~~~~~~~~
Requisite fields:
.type String: ’freq’, ’dir’, ’k2d’, k1d’, ’encdir’, ’enc’.
.S Spectrum values (size=[nf 1] or [np nf]).
.w OR .f OR .k Frequency/wave number lag, length nf.
.tr Transformation function (default [] (none)).
.h Water depth (default inf).
.norm Normalization flag, Logical 1 if S is normalized,
0 if not.
.note Memorandum string.
.date Date and time of creation or change.
Type-specific fields:
.k2 Second dim. wave number lag,
if .type=’k2d’, ’rotk2d’, length np.
.theta Angular lags, if .type=’dir’, ’rotdir’ or ’encdir’,
length np.
.v Ship speed, if .type = ’enc’ or ’encdir’.
.phi angle of rotation of the coordinate system
(counter-clockwise) e.g. azimuth of a ship.
In this chapter we present some tools for analysis of random functions with respect to
their correlation, spectral, and distributional properties. We first give a brief introduction
to the theory of Gaussian processes and then we present programs in Wafo, which can
be used to analyse random functions. For deeper insight in the theory we refer to [40, 45].
The presentation will be organized in three examples: Example 1 is devoted to es-
timation of different parameters in the model, Example 2 deals with spectral densities
and Example 3 presents the use of Wafo to simulate samples of a Gaussian process. The
commands, collected in Chapter2.m, run in less than 5 seconds on a 3.60 GHz 64 bit PC
with Windows 10; add another two minutes for the display of simulated wave fields.
19
20 CHAPTER 2. RANDOM WAVES AND LOADS
N
X
x(t) ≈ m + ai cos(ωi t) + bi sin(ωi t), (2.3)
i=1
where ωi = i · 2π/T are angular frequencies, m is the mean of the signal and ai , bi
are Fourier coefficients.
Example 1. (Sea data) In this example we use a series with wave data sea.dat with
time argument in the first column and function values in the second column. The data
used in the examples are wave measurements at shallow water location, sampled with
a sampling frequency of 4 Hz, and the units of measurement are seconds and meters,
respectively. The file sea.dat is loaded into Matlab and after the mean value has been
subtracted the data are saved in the two column matrix xx.
xx = load(’sea.dat’);
me = mean(xx(:,2))
sa = std(xx(:,2))
xx(:,2) = xx(:,2) - me;
lc = dat2lc(xx);
plotflag = 2;
lcplot(lc,plotflag,0,sa)
Here me and sa are the mean and standard deviation of the signal, respectively. The
variable lc is a two column matrix with levels in the first column and the number of
upcrossing of the level in the second. In Figure 2.1 the number of upcrossings of xx is
plotted and compared with an estimation based on the assumption that xx is a realization
of a Gaussian sea.
Next, we compute the mean frequency as the average number of upcrossings per time
unit of the mean level (= 0); this may require interpolation in the crossing intensity curve,
as follows.
1
Still another definition, to be used in Chapter 5, is that f0 is the average number of completed
load cycles per time unit.
2.1. INTRODUCTION AND PRELIMINARY ANALYSIS 21
T = max(xx(:,1))-min(xx(:,1))
f0 = interp1(lc(:,1),lc(:,2),0)/T
% zero up-crossing frequency
Crossing spectrum
500
Number of upcrossings
400
300
200
100
0
−1.5 −1 −0.5 0 0.5 1 1.5
level u
Figure 2.1: The observed crossings intensity compared with the theoretically ex-
pected for Gaussian signals, see (2.8).
The process of fatigue damage accumulation depends only on the values and the order
of the local extremes in the load. The sequence of local extremes is called the sequence of
turning points. It is a two column matrix with time for the extremes in the first column
and the values of the extremes in the second.
tp = dat2tp(xx);
fm = length(tp)/(2*T) % frequency of maxima
alfa = f0/fm
Here alfa is the irregularity factor. Note that length(tp) is equal to the number of
local maxima and minima and hence we have a factor 2 in the expression for fm. 2
We finish this section with some remarks about the quality of the measured data.
Especially sea surface measurements can be of poor quality. It is always good practice to
visually examine the data before the analysis to get an impression of the quality, non-
linearities and narrow-bandedness of the data.
Example 1. (contd.) First we shall plot the data xx and zoom in on a specific region.
A part of the sea data is presented in Figure 2.2 obtained by the following commands.
waveplot(xx,tp,’k-’,’*’,1,1)
axis([0 2 -inf inf])
However, if the amount of data is too large for visual examination, or if one wants a
more objective measure of the quality of the data, one could use the following empirical
criteria:
• x0 (t) < 5 [m/s], since the raising speed of Gaussian waves rarely exceeds 5 [m/s],
• x00 (t) < 9.81/2, [m/s2 ] which is the limiting maximum acceleration of Stokes waves,
22 CHAPTER 2. RANDOM WAVES AND LOADS
1.5
−0.5
−1
−1.5
0 0.5 1 1.5 2
Time (minutes)
Figure 2.2: A part of the sea data with turning points marked as stars.
• if the signal is constant in some intervals, then this will add high frequencies to
the estimated spectral density; constant data may occur if the measuring device is
blocked during some period of time.
To find possible spurious points of the dataset use the following commands.
dt = diff(xx(1:2,1));
dcrit = 5*dt;
ddcrit = 9.81/2*dt*dt;
zcrit = 0;
[inds indg] = findoutliers(xx,zcrit,dcrit,ddcrit);
The program will give the following list when used on the sea data.
The values for zcrit, dcrit and ddcrit can be chosen more carefully. One must be
careful using the criteria for extreme value analysis, because it might remove extreme waves
that belong to the data and are not spurious. However, small changes of the constants are
usually not so crucial. As seen from the transcripts from the program a total of 1152 points
are found to be spurious which is approximately 12 % of the data. Based on this one may
classify the datasets into good, reasonable, poor, and useless. Obviously, uncritical use
of data may lead to unsatisfactory results. We return to this problem when discussing
methods to reconstruct the data. 2
2.2. FREQUENCY MODELLING OF LOAD HISTORIES 23
Spectral density
fp1 = 0.52 [rad/s]
fp2 = 1.4 [rad/s]
0.6 fp3 = 1.2 [rad/s]
fp4 = 1.1 [rad/s]
0.5
S(w) [m s / rad]
0.4
2
0.3
0.2
0.1
0
0 1 2 3 4 5
Frequency [rad/s]
Figure 2.3: The observed, unsmoothed, spectrum in the data set sea.dat.
where ∆ω is the sampling interval in frequency domain, i.e. ωi = i · ∆ω. The two-column
matrix ŝ(ωi ) = (ωi , ŝi ) will be called the power spectrum of x(t). The alternative term
periodogram was introduced as early as 1898 by A. Schuster, [78].
√ √
The sequence θi such that cos θi = ai / 2 ŝi ∆ω and sin θi = −bi / 2 ŝi ∆ω, is called a
sequence of phases and the Fourier series can be written as follows:
N p
X
x(t) ≈ m + 2 ŝi ∆ω cos(ωi t + θi ).
i=1
If the sampled signal contains exactly 2N + 1 points, then x(t) is equal to its Fourier series
at the sampled points. In the special case when N = 2k , the so-called FFT (Fast Fourier
Transform) can be used to compute the Fourier coefficients (and the spectrum) from the
measured signal and in reverse the signal from the Fourier coefficients.
The Fourier coefficient to the zero frequency is just the mean of the signal, while
R∞
the variance is given by σ 2 = ∆ω ŝ(ωi ) ≈ 0 ŝ(ω) dω. The last integral is called the
P
Example 1. (contd.) We now calculate the spectrum sb(ω) for the sea data signal xx.
Lmax = 9500;
SS = dat2spec(xx,Lmax);
plotspec(SS); axis([0 5 0 0.7])
24 CHAPTER 2. RANDOM WAVES AND LOADS
The produced plot, not reproduced in this tutorial, shows the spectrum sb(ω) in blue
surrounded by 95% confidence limits, in red. These limits can be removed by the command
SS = rmfield(SS,’CI’)
plotspec(SS); axis([0 5 0 0.7])
giving Figure 2.3 where we can see that the spectrum is extremely irregular with sharp
peaks at many distinct frequencies. In fact, if we had analysed another section of the sea
data we had found a similar general pattern, but the sharp peaks had been found at some
other frequencies. It must be understood, that the observed irregularities are random and
vary between measurements of the sea even under almost identical conditions. This will
be further discussed in the following section, where we introduce smoothing techniques to
get a stable spectrum that represents the “average randomness” of the sea state.
Next, the spectral moments will be computed.
The vector mom now contains spectral moments m0 , m2 , m4 , which are the variances of
the signal and its first and second derivative. We can speculate that the variance of the
derivatives is too high because of spurious points. For example, if there are several points
with the same value, the Gibb’s phenomenon leads to high frequencies in the spectrum. 2
where the phases Θi are random variables, independent and uniformly distributed between
0 and 2π. However, this is not a very realistic model either, since in practice one often
observes a variability in the spectrum amplitudes ŝ(ω) between measured functions. Hence,
ŝi should also be modelled to include a certain randomness.
The best way to accomplish this realistic variability is to assume that there exists a
deterministic function S(ω) such that the average value of sb(ωi )∆ω over many observed se-
ries can be approximated by S(ωi )∆ω. In fact, in many cases one can model the variability
of ŝi as
ŝi = Ri2 · S(ωi )/2,
where Ri are independent random factors, all with a Rayleigh distribution, with probability
density function fR (r) = r exp(−r2 /2), r > 0. (Observe that the average value of Ri2 is 2.)
2.2. FREQUENCY MODELLING OF LOAD HISTORIES 25
This gives the following random function as a model for the series,
N p
X
X(t) = m + S(ωi ) ∆ω Ri cos(ωi t + Θi ). (2.5)
i=1
The process X(t) has many useful properties that can be used for analysis. In particular,
for any fixed t, X(t) is normally (Gaussian) distributed. Then, the probability of any event
defined for X(t) can, in principle, be computed when the mean m and the spectral density
S are known.
In sea modelling, the components in the sum defining X(t) can be interpreted as
individual waves. The assumption that Ri and Θi are independent random variables implies
that the individual waves are independent stationary Gaussian processes2 with mean zero
and covariance function given by
ri (τ ) = ∆ω S(ωi ) cos(ωi τ ).
A process like (2.5), which is the sum of discrete terms, is said to have discrete spectrum.
Its total energy is concentrated to a set of distinct frequencies.
More generally, for a stationary stochastic process with spectral density S(ω), the
covariance function r(τ ) of the process is defined by its spectral density function S(ω),
also called power spectrum,
Z ∞
r(τ ) = C[X(t), X(t + τ )] = cos(ωτ ) S(ω) dω. (2.6)
0
R∞
Since V[X(t)] = rX (0) = 0 S(ω) dω, the spectral density represents a continuous distri-
bution of the wave energy over a continuum of frequencies. The spectrum is continuous.
The covariance function and the spectral density form a Fourier transform pair. The
spectral density can be computed from the covariance function by the Fourier inversion
formula, which for continuous-time signals reads,
2 ∞
Z
S(ω) = cos(ωτ )r(τ ) dτ. (2.7)
π 0
The Gaussian process model is particularly useful in connection with linear filters. If
Y (t) is the output of a linear filter with the Gaussian process X(t) as input, then Y (t)
is also normally distributed. Further, the spectrum of Y (t) is related to that of X(t) in a
simple way. If the filter has transfer function H(ω), also called frequency function, then
the spectrum of Y (t), denoted by SY , is given by
For example, the derivative X 0 (t) is a Gaussian process with mean zero and spectrum
SX 0 (ω) = ω 2 SX (ω). The variance of the derivative is equal to the second spectral moment,
Z Z
σX 0 = SX 0 (ω) dω = ω 2 SX (ω) dω = m2 .
2
26 CHAPTER 2. RANDOM WAVES AND LOADS
Spectral density
fp = 1.1 [rad/s]
0.25
0.15
0.1
0.05
0
0 1 2 3 4 5
Frequency [rad/s]
Figure 2.4: Estimated spectra SS1, SS2 for the data set sea.dat with varying degree
of smoothing; dash-dotted: Lmax1 = 200, solid: Lmax2 = 50.
0.15 0.15
0.1 0.1
0.05 0.05
ACF
ACF
0 0
−0.05 −0.05
−0.1 −0.1
−0.15 −0.15
−0.2 −0.2
0 5 10 15 20 0 5 10 15 20
Lag (sec) Lag (sec)
(a) (b)
Figure 2.5: The covariance function estimated in the data set sea.dat, solid line,
compared to the theoretically computed covariance functions for the spectral densi-
ties SS2 in (a) and SS1 in (b).
With the unimodal spectrum SS2 instead of SS1 we also compute the covariance function
R2 = spec2cov(SS2,1) and plot it together with Rest.
We can see in Figure 2.5(a) that the covariance function corresponding to the spectral
density SS2 differs significantly from the one estimated directly from data. The covariance
corresponding to SS1 agrees much better with the estimated covariance function, as seen
in Figure 2.5(b). Our conclusion is that the bimodal spectrum in Figure 2.4 is a better
model for the data sea.dat than the unimodal one. 2
Observe that the Wafo function spec2cov can be used to compute a covariance struc-
ture which can contain covariances both in time and in space as well as that of the deriva-
tives. The input can be any spectrum structure, e.g. wavenumber spectrum, directional
spectrum or encountered directional spectrum; type help spec2cov for detailed informa-
tion.
(u − m)2
µ(u) = f0 exp − . (2.8)
2σ 2
3
The general expression for the upcrossing intensity for a stationary process is µ(u) =
R∞
z=0
z fX(0),X 0 (0) (u, z) dz, where fX(0),X 0 (0) (u, z) is a joint probability density function.
28 CHAPTER 2. RANDOM WAVES AND LOADS
q
1 m2
Using spectral moments we have that σ 2 = m0 while f0 = 2π m0 is the mean frequency.
X(t) = G(X(t)),
e (2.9)
transformations use higher moments of X(t) to compute g. Information about the mo-
ments of the process can be obtained by site specific data, laboratory measurements or
from physical considerations. Rychlik’s non-parametric method is based on the crossing
intensity µ(u); see [73]. Martinsen and Winterstein, [52], derived an expression for the
skewness and kurtosis for narrow banded Stokes waves to the leading order and used these
to define the transformation. The skewness and kurtosis (excess) of this model can also
be estimated from data by the Wafo functions skew and kurt.
Example 1. (contd.) We begin with computations of skewness and kurtosis for the
data set xx. The commands
rho3 = skew(xx(:,2))
rho4 = kurt(xx(:,2))
give the values rho3 = 0.25 and rho4 = 3.17, respectively, compared to rho3 = 0 and
rho4 = 3 for Gaussian waves. We can compute the same model for the spectrum S̃ using
the second order wave approximation proposed by Winterstein. His approximation gives
suitable values for skewness and kurtosis
Here we shall use Winterstein’s Hermite transformation and denote it by gh, and com-
pare it with the linear transformation, denoted by g, that only has the effect to standardize
the signal, assuming it is already Gaussian,
gh = hermitetr([],[sa sk ku me]);
g = gh; g(:,2)=g(:,1)/sa;
trplot(g)
These commands will result in two two-column matrices, g, gh, with equally spaced y-
values in the first column and the values of g(y) in the second column.
Since we have data we may estimate the transformation directly by the method pro-
posed by Rychlik et al., in [73]:
The same transformation can be obtained from data and the crossing intensity by use of
the Wafo functions dat2lc followed by lc2tr.
In Figure 2.6 we compare the three transformations, the straight line is the Gaussian
linear model, the dash dotted line is the Hermite transformation based on higher moments
of the response computed from the spectrum and the solid line is the direct transformation
estimated from crossing intensity. (The unsmoothed line shows the estimation of the direct
transformation from unsmoothed crossing intensity). We can see that the transformation
derived from crossings will give the highest crest heights. It can be proved that asymp-
totically the transformation based on crossings intensity gives the correct density of crest
heights.
30 CHAPTER 2. RANDOM WAVES AND LOADS
Estimated transform
6
2
g(u)
−2
−4
−6
−3 −2 −1 0 1 2 3
u
Figure 2.6: Comparisons of the three transformations g, straight line is the Gaussian
model, dash dotted line the Hermite transformation gh and solid line the Rychlik
method glc.
1.4
1.2
1
e(g(u)−u)
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50
Simulation number
Figure 2.7: The simulated 50 values of the test variable for the Gaussian process
with spectrum S1 compared with the observed value (dashed line).
The transformations indicate that data xx has a light lower tail and heavy upper tail
compared to a Gaussian model. This is also consistent with second order wave theory,
where the crests are higher and the troughs shallower compared to Gaussian waves. Now
the question is whether this difference is significant compared to the natural statistical
variability due to finite length of the time series.
To determine the degree of departure from Gaussianity, we can compare an indicator
of non-Gaussianity test0 obtained from Monte Carlo simulation. The value of test0 is a
measure of how munch the transformation g deviates from a straight line.
The significance test is done by simulating 50 independent samples of test0 from a
true Gaussian process with the same spectral density and length as the original data. This
is accomplished by the Wafo program testgaussian. The output from the program is
a plot of the ratio test1 between the simulated (Gaussian) test0-values and the sample
test0, that was calculated in the previous call to dat2tr:
2.2. FREQUENCY MODELLING OF LOAD HISTORIES 31
99.9%
3
99.5%
0 50%
30%
−1
10%
5%
−2 2%
1%
0.5%
−3 0.1%
0.01%
−4
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2
N = length(xx);
test1 = testgaussian(S1,[N,50],test0);
The program gives a plot of simulated test values, see Figure 2.7. As we see from the
figure none of the simulated values of test1 is above 1.00. Thus the data significantly
departs from a Gaussian distribution; see [73] for more detailed discussion of the testing
procedure and the estimation of the transformation g from the crossing intensity.
We finish the tests for Gaussianity of the data by a more classical approach and simply
plot the data on normal probability paper. Then N independent observations of identically
distributed Gaussian variables form a straight line in a normalplot. Now, for a time series
the data is clearly not independent. However, if the process is ergodic then the data forms
a straight line as N tends to infinity.
The command
plotnorm(xx(:,2))
produces Figure 2.8. As we can see the normal probability plot is slightly curved indicating
that the underlying distribution has a heavy upper tail and a light lower tail. 2
spectral density
mccormick - McCormick spectral density
tmaspec - JONSWAP spectral density
for finite water depth
Wafo also contains some different spreading functions; use the help function on spec
and spreading for more detailed information.
The spectrum of the sea can be given in many different formats, that are intercon-
nected by the dispersion relation4 . The spectrum can be given using frequencies, angular
frequencies or wavenumbers, and it can also be directional.
A related spectrum is the encountered spectrum for a moving vessel. The transforma-
tions between the different types of spectra are defined by means of integrals and variable
change defined by the dispersion relation and the Doppler shift of individual waves. The
function spec2spec makes all these transformations easily accessible for the user. (Ac-
tually many programs perform the appropriate transformations internally whenever it is
necessary and for example one can compute the density of wave-length, which is a quan-
tity in space domain, from an input that is the directional frequency spectrum, which is
related to the time domain.)
Directional Spectrum
90
1.5
Level curves at:
120 60
2
4
6
1
8
10
15012 30
0.5
180 0
210 330
240 300
270
Figure 2.9: Directional spectrum SJd of Jonswap sea (dashed line) compared with
the encountered directional spectrum SJe for heading sea, speed 10 [m/s] (solid line).
In order to include the space dimension, i.e. the direction in which the waves propagate,
we compute a directional spectrum by adding spreading; see dashed curves in Figure 2.9.
D = spreading(101,’cos2s’,0,[],SJ.w,1)
SJd = mkdspec(SJ,D) % Directional spectrum
Next, we consider a vessel moving with speed 10[m/s] against the waves. The sea
measured from the vessel will have a different directional spectrum, called the encoun-
tered directional spectrum. The following code will compute the encountered directional
spectrum and plot it on top of the original spectrum. The result is shown as the solid
curves in Figure 2.9.
SJe = spec2spec(SJd,’encdir’,0,10); % Encountered dir spectrum
plotspec(SJe), hold on
plotspec(SJd,1,’--’), hold off
Obviously, the periods of waves in the directional sea are defined by the Jonswap spec-
trum (in a linear wave model spreading does not affect the sea level at a fixed point), but
the encountered periods will be shorter with heading seas. This can be seen by comparing
the original Jonswap spectrum SJ with the following two point spectra.
SJd1 = spec2spec(SJd,’freq’); % Point spectrum from dir spectrum
SJd2 = spec2spec(SJe,’enc’); % Point encountered spectrum at ship
plotspec(SJ), hold on
plotspec(SJd1,1,’.’),
plotspec(SJd2), hold off
We can see in Figure 2.10(a) that the spectra SJ and SJd1 are identical (in numerical
sense), while spectrum SJd2 contains more energy at higher frequencies.
A similar question is how much the wave length differs between a longcrested Jonswap
sea and a Jonswap sea with spreading. The answer lies in the wavenumber spectrum that
measures how the wave enegy is distributed over different wavenumbers, i.e. radians (or
cycles) per unit length along a specified direction, usually the main wave direction.
The wavenumber spectra along the main wave direction can be computed by the
following code, the result of which is shown in Figure 2.10(b).
SJk = spec2spec(SJ,’k1d’) % Unidirectional waves
SJkd = spec2spec(SJd,’k1d’) % Waves with directional spreading
plotspec(SJk), hold on
plotspec(SJkd,1,’--’), hold off
We see how the spreading of energy away from the main direction makes observed waves
longer. The total energy is of course the same but shifted to lower wavenumbers.
Finally, we shall show how the Jonswap spectrum can be corrected for a finite depth,
see [17] for a theoretical and empirical study. The Wafo function phi1 computes the
frequency dependent reduction of the spectrum for waters of finite depth, here 20 meters.
plotspec(SJ,1,’--’), hold on
SJ20 = SJ;
SJ20.S = SJ20.S.*phi1(SJ20.w,20); % Finite depth correction
SJ20.h = 20;
plotspec(SJ20), hold off
34 CHAPTER 2. RANDOM WAVES AND LOADS
10
S(w) [m s / rad]
80
60
6
40
4
20
2
0 0
0 1 2 3 4 5 6 0 0.05 0.1 0.15 0.2 0.25 0.3
Frequency [rad/s] Wave number [rad/m]
(a) (b)
Figure 2.10: (a) Frequency Jonswap spectrum SJ and point spectrum SJd1 com-
pared with encountered point spectrum SJd2 for heading sea speed 10 [m/s] (solid
line). (b) Wavenumber spectrum SJk for longcrested Jonswap sea (solid line) com-
pared with wavenumber spectrum SJkd for Jonswap with spreading (dashed).
Spectral density
fp = 0.57 [rad/s]
12
10
S(w) [m2 s / rad]
0
0 0.5 1 1.5 2 2.5 3
Frequency [rad/s]
Figure 2.11: Standard Jonswap spectrum SJ (dashed line) compared with the spec-
trum SJ20 on finite depth of 20 [m] (solid line)
function dat2gaus one can compute x̃(t) = g(x(t)), which we assume is a realization of
a Gaussian process. From x̃ we can then estimate the spectrum S̃(ω) by means of the
function dat2spec. The spectrum S̃(ω) and the transformation g will uniquely define the
transformed Gaussian model. A random function that models the measured signal can
then be obtained using the simulation program spec2sdat, which includes the desired
transformation. In the following example we shall illustrate this approach on the data set
sea.dat.
Before we can start to simulate we need to put the transformation into the spectrum
data structure, which is a Matlab structure variable; see Section 1.6, page 17. Since
Wafo is based on transformed Gaussian processes the entire process structure is defined
by the spectrum and the transformation together. Therefore the transformation has been
incorporated, as part of a model, into the spectrum structure, and is passed to other Wafo
programs via the spectrum. If no transformation is given then the process is Gaussian.
Observe that the possibly nonzero mean m for the model is included in the transfor-
mation. The change of mean by for example 0.5 [m] is simply accomplished by modifying
the transformation by the command g(:,2) = g(:,2)+0.5; Consequently the spectrum
structure completely defines the model.
Important note 1: When the simulation routine spec2sdat is called with a spectrum
argument that contains a scale changing transformation spectrum.tr, then it is assumed
that the input spectrum is standardized with spectral moment m0 = 1, i.e. unit variance.
The correct standard deviation for the output should normally be obtained via the trans-
formation spectrum.tr. If you happen to use a transformation together with an input
spectrum that does not have unit variance, then you get the double scale effect, both
from the transformation and via the standard deviation from the spectrum. It is only the
routine spec2sdat that works in this way. All other routines, in particular those which
calculate cycle distributions, perform an internal normalization of the spectrum before the
calculation, and then transforms back to the original scale at the end.
Important note 2: When you run the simulation examples with different time horizon
and time step you may experience a warning
’Spectrum matrix is very large’.
This is a warning from the Wafo routine specinterp, which is used internally to adapt
the spectrum to the correct Nyquist frequency and frequency resolution. You can turn off
the warning by commenting out three lines in specinterp in the spec module.
[y grec] = reconstruct(xx,inds);
where y is the reconstructed data and grec is the transformation estimated from the signal
y. In Figure 2.12 we can see the transformation (solid line) compared with the empirical
36 CHAPTER 2. RANDOM WAVES AND LOADS
Estimated transform
6
2
g(u)
−2
−4
−6
−3 −2 −1 0 1 2 3
u
Figure 2.12: The transformation computed from the reconstructed signal y (solid
line) compared with the transformation computed from the original signal xx
(dashed dotted line).
smoothed transformation, glc, which is obtained from the original sequence xx without
removing the spurious data (dash-dotted line). We can see that the new transformation
has slightly smaller crests. Actually, it is almost identical with the transformation gh
computed from the spectrum of the signal, however, it may be only a coincident (due to
random fluctuations) and hence we do not draw any conclusions from this fact.
The value of the test variable for the transformation grec is 0.84 and, as expected, it
is smaller than the value of test0 = 1.00 computed for the transformation glc. However,
it is still significantly larger then the values shown in Figure 2.7, i.e. the signal y is not a
Gaussian signal.
We turn now to estimation of the spectrum in the model from the simulated data but
first we transform data to obtain a sample x̃(t):
L = 200
x = dat2gaus(y,grec); %Gaussian process from reconstructed data
SSx = dat2spec(x,L); %Spectrum from Gaussian reconstructed process
The important remark here is that the smoothing of the spectrum defined by the parameter
L, see help dat2spec, removes almost all differences between the spectra in the three
signals xx, y, and x. (The spectrum SSx is normalized to have first spectral moment one
and has to be scaled down to have the same energy as the spectrum SS1 on page 26.)
Next, we shall simulate a random function equivalent to the reconstructed measure-
ments y. The Nyquist frequency gives us the time sampling of the simulated signal,
dt = spec2dt(Sx)
and is equal to 0.25 seconds, since the data has been sampled with a sampling frequency
of 4 Hz. We then simulate 2 minutes (2 × 60 × 4 points) of the signal, to obtain a synthetic
wave equivalent to the reconstructed non-Gaussian sea data.
Standard Deviation
1
− +2
0.5
−0.5
− −2
−1
0 10 20 30 40 50
1
− +2
0.5
−0.5
− −2
−1
60 70 80 90 100 110
Time (sec)
Figure 2.13: Two minutes of simulated sea data, equivalent to the reconstructed
data.
ysim = spec2sdat(SSx,Ny);
waveplot(ysim,’-’)
In the next example we consider a signal with a given theoretical spectrum. Here we
have a problem whether the theoretical spectrum is valid for the transformed Gaussian
model, i.e. it is a spectrum S(ω) or is it the spectrum of the linear sea S.
e In the previous
example the spectrum of the transformed process was almost identical with the normalized
spectrum of the original signal. In [73] it was observed that for sea data the spectrum esti-
mated from the original signal and that for the transformed one do not differ significantly.
Although more experiments should be done in order to recommend using the same spec-
trum in the two cases, here, if we wish to work with non-Gaussian models with a specified
transformation, we shall derive the Se spectrum by dividing the theoretical spectrum by
the square root of the first spectral moment of S.
Example 3. (contd.) Since the spectrum SS1 in Figure 2.4 is clearly two-peaked with
peak frequency Tp = 1.1 [Hz] we choose to use the Torsethaugen spectrum. (This spectrum
is derived for a specific location and we should not expect that it will work well for our
case.) The inputs to the programs are Tp and Hs , which we now compute.
Tp = 1.1;
H0 = 4*sqrt(spec2mom(S1,1))
ST = torsethaugen([0:0.01:5],[H0 2*pi/Tp]);
plotspec(SS1), hold on
plotspec(ST,[],’-.’)
In Figure 2.14, we can see that the Torsethaugen spectrum has too little energy on the
swell peak. Despite this fact we shall use this spectrum in the rest of the example.
We shall now create the spectrum S̃(ω) (= STnorm), i.e. the spectrum for the stan-
dardized Gaussian process X(t)
e with standard deviation equal to one.
STnorm = ST;
38 CHAPTER 2. RANDOM WAVES AND LOADS
Spectral density
0.4
fp = 0.62 [rad/s]
0.35
0.3
0.2
0.15
0.1
0.05
0
0 1 2 3 4 5 6
Frequency [rad/s]
Figure 2.14: Comparison between the estimated spectrum SS1 in the signal sea.dat
(solid line) and the theoretical spectrum ST of the Torsethaugen type (dash-dotted
line).
STnorm.S = STnorm.S/sa^2;
dt = spec2dt(STnorm)
The sampling interval dt = 0.63 [s] (= π/5), is a consequence of our choice of cut off
frequency in the definition of the ST spectrum. This will however not affect our simulation,
where any sampling interval dt can be used.
Next, we recompute the theoretical transformation gh.
The transformation is actually almost identical to gh for the spectrum SS1, which can
be seen in Figure 2.6, where it is compared to the Gaussian model g, given by a straight
line. We can see from the diagram that the waves in a transformed Gaussian process
X(t) = G(X(t)),
e will have an excess of high crests and shallow troughs compared to
waves in the Gaussian process X(t). e The difference is largest for extreme waves with
crests above 1.5 meters, where the excess is 10 cm, ca 7 %. Such waves, which have crests
above three standard deviations, are quite rare and for moderate waves the difference is
negligible.
In order to illustrate the difference in distribution for extreme waves we will simulate a
sample of 4 minutes of X(t) with sampling frequency 2 Hz. The result is put into ysim_t. In
order to obtain the corresponding sample path of the process X e we use the transformation
gh, stored in STnorm.tr, and put the result in xsim_t.
dt = 0.5;
ysim_t = spec2sdat(STnorm,240,dt);
xsim_t = dat2gaus(ysim_t,STnorm.tr);
2.4. MORE ON SIMULATION WITH WAFO 39
Standard Deviation
− −2
−2
25 30 35 40 45
2
− +2
0
− −2
−2
50 55 60 65 70
2
− +2
0
− −2
−2
75 80 85 90 95
2
− +2
0
− −2
−2
100 105 110 115
Time (sec)
Figure 2.15: Simulated X(t) = G(X(t))e (solid line) compared with X(t)
e (dots)
scaled to have the same Hs as X(t) for a theoretical spectrum given by Torsethaugen
spectrum St.
Since the process X̃(t) always has variance one, in order to compare the Gaussian
and non-Gaussian models we scale xsim_t to have the same second spectral moment as
ysim_t, which will be done by the following commands:
xsim_t(:,2) = sa*xsim_t(:,2);
waveplot(xsim_t,ysim_t,5,1,sa,4.5,’r.’,’b’)
In Figure 2.15 we have waves that are not extremely high and hence the difference
between the two models is hardly noticeable in this scale. Only in the second subplot
we can see that Gaussian waves (dots) have troughs deeper and crests lower than the
transformed Gaussian model (solid line). This also indicates that the amplitude estimated
from the transformed Gaussian and Gaussian models are practically identical. Using the
empirical transformation glc instead of the Hermite transformation gh would give errors
of ca 11%, which for waves with higher significant wave height would give considerable
underestimation of the crest height of more extreme waves. Even if the probability for
observing an extreme wave during the period of 20 minutes is small, it is not negligible
for safety analysis and therefore the choice of transformation is one of the most important
questions in wave modelling.
Since the difference between Gaussian and non-Gaussian model is not so big we may
ask whether 20 minutes of observation of a transformed Gaussian process presented in this
example is long enough to reject the Gaussian model. Using the function testgaussian
we can see that rejection of Gaussian model would occur very seldom. Observe that the
sea.dat is 40 minutes long and that we clearly rejected the Gaussian model. 2
to switch to new values according to a Markov chain. Another group of simulation rou-
tines generate non-linear waves and loads, like second order Stokes waves with interaction
between frequency components in the Gaussian wave model, and Lagrange waves, with a
horizontal deformation of space. This group includes a program to simulate the output
of second order oscillators with nonlinear spring, when external force is white noise. The
nonlinear oscillators can be used to model nonlinear responses of sea structures.
lc2sdat Simulates a load process with specified crossing spectrum and irregularity
mcsim Simulates a finite Markov chain from its probability transition matrix
Figure 2.16 shows the hidden Markov states and the, seemingly non-stationary, ARMA-
process. In fact, the Markov chain is simulated from its stationary distribution and each
ARMA-section starts with the stationary distribution for that particular ARMA-process,
so the process is stationary! 2
2.4. MORE ON SIMULATION WITH WAFO 41
1.5
0.5
-0.5
-1
2
1
200 400 600 800 1000 1200 1400 1600 1800 2000
seamovie Makes a movie in time of 2D or 3D random waves and optionally exports movie
in avi format
seasim Old routine that generates a space-time Gaussian process and movie with 1D or
2D space parameter
spec2ldat and spec2ldat3D Routines in module lagrange that generate front-back and
crest-trough asymmetric modifications of Gaussian wave fields
spec2nlsdat Simulates a random 2nd order non-linear wave from a spectral density
Example 5. (How to export a sea movie) In Section 1.4.3 we gave an example of how
to use spec2field to generate and plot a Gaussian sea surface with directional spreading.
We now show how to use seamovie to generate and save a movie of the time evolution of
the sea.
We define and plot the demospec spectrum, with frequency independent spreading
SD = demospec(’dir’)
plotspec(SD)
SD =
struct with fields:
S: [101 x 257 double]
w: [257 x 1 double]
42 CHAPTER 2. RANDOM WAVES AND LOADS
Directional Spectrum
90 1
Level curves at:
120 60
2 0.8
4
6 0.6
150
8 30
10 0.4
12
0.2
14
180 0
210 330
240 300
270
To generate two minutes of a wave field of size 500[m] by 250[m] we define parameters
by the function simoptset, generate the field with spec2field, and make three different
types of movies with seamovie.
opt = simoptset(’Nt’,600,’dt’,0.2,’Nu’,501’,’du’,1,’Nv’,251,’dv’,1)
rng(’default’)
W = spec2field(SD,opt); % structure with fields .Z, .x, .y, .t
figure(2); Mv2 = seamovie(W,2); pause
figure(3); Mv3 = seamovie(W,3); pause
figure(1); Mv1 = seamovie(W,1,’sea.avi’)
The last movie command saves the movie as sea.avi in the working directory. If sea.avi
already exists, the new movie file is given a random name. 2
Remark 2.2 . The wave fields generated by spec2field differ from animated wave fields
used for example in feature films. They are intended to be used in applications where the
fine structure, so important for the visual impression, can be neglected. Examples involve
extreme value analysis, fatigue loads, and ship dynamics. 2
2.4. MORE ON SIMULATION WITH WAFO 43
250
200
150
[m]
100
50
0
0 100 200 300 400 500
[m]
Figure 2.18: Three aspects of a simulated Gaussian wave field with directional spec-
trum demospec(’dir’); last frames in Mv1, Mv1, and Mv3.
44
2.4.3
1st and 2nd order Gaussian waves in module simtools
Routine spec2sdat spec2wave spec2field spec2nlsdat
Type 1st order Gaussian 1st order Gaussian 1st order Gaussian 2nd order Gauss-Euler
time or space series 2D space-time wave 3D space-time field 2D time wave
↓ ↓ ↓ ↓
Output [x,xder] W.Z, .x, .t W.Z, .x, .y, .t [xs2,xs1]
↓ ↓
Movie M = seamovie(W,type) M = seamovie(W,type)
One of the unique capabilities of Wafo is the treatment of the statistical properties of
wave characteristic. This, and the next chapter, describe how to extract information on
distributions of observables like wave period, wave length, crest height, etc, either directly
from data, or from empirically fitted approximative models, or, in the next chapter, by
means of exact statistical distributions, numerically computed from a spectral model.
We first define the different wave characteristics commonly used in oceanographic
engineering and science, and present the Wafo routines for handling them. Then we
compare the empirical findings with some approximative representations of the statistical
distributions, based on empirical parameters from observed sea states. The code for the
examples are found in the m-file Chapter3.m, and it takes a few seconds to run.
3.1 Introduction
3.1.1 The Gaussian paradigm - linear wave theory
In the previous chapter we discussed modelling of random functions by means of Fourier
methods. The signal was represented as a sum of independent random cosine functions
with random amplitudes and phases. In linear wave theory those cosine functions are
waves travelling in water. Waves with different frequencies have different speeds, defined
by the dispersion relation. This property causes the characteristic irregularity of the sea
surface. Even if it were possible to arrange a very particular combination of phases and
amplitudes, so that the signal looks, for example, like a saw blade, it will, after a while,
change shape totally. The phases will be almost independent and the sea would again
look like a Gaussian random process. On the other hand an observer clearly can identify
moving sea waves. The shape of those waves, which are often called the apparent waves,
since theoretically, those are not mathematical waves, but are constantly changing up to
the moment when they disappear.
The wave action on marine structures is often modelled using linear filters. Then the
sea spectrum, together with the filter frequency function, gives a complete characterization
of the response of the structure. However, often such models are too simplistic and non-
linearities have to be considered to allow more complex responses. Then one may not
45
46 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
wish to perform a complicated numerical analysis to derive the complete response but is
willing to accept the simplification that the response is proportional to the waves. One
may also wish to identify some properties of waves that are dangerous in some way for
the particular ocean operation. Also the apparent waves themselves can be the reason for
non-linear response. For example, for waves with crests higher than some threshold, water
may fill a structure and change its dynamical properties. The combined effect of apparent
waves, often described by their height and wave period, is therefore important in ocean
engineering. These aspects are discussed in more detail in the textbook [60].
The apparent waves will be described by some geometric properties, called wave char-
acteristics, while frequencies of occurrences of waves with specified characteristics will be
treated in the statistical sense and described by a probability distribution. Such distribu-
tions can then be used to estimate the frequency of occurrences of some events important
in the design of floating marine systems, e.g. wave breaking, slamming, ringing, etc.
Direction of wave
propagation in space Time
Wave AC
Hu
elevation Hd
Tcf Tcr
AT d AT u
Tc
Td
Tu
Figure 3.1: Definition of wave parameters. The notation for the parameters used in
our examples are given in Table 3.1 at the end of this chapter.
Having precisely defined the characteristics of interest, one can extract their frequency
(empirical) distributions from a typical sufficiently long record. For example, measure-
ments of the apparent period and height of waves could be taken over a long observation
interval to form an empirical two-dimensional distribution. This distribution will repre-
sent some aspects of a given sea surface. Clearly, because of the irregularity of the sea,
empirical frequencies will vary from record to record. However if the sea is in “steady”
condition, which corresponds mathematically to the assumption that the observed random
field is stationary and ergodic, their variability will be insignificant for sufficiently large
records. Such limiting distributions (limiting with respect to observation time, for records
measured in time, increasing without bound) are termed the long-run distributions. Ob-
viously, in a real sea we seldom have a so long period of ”steady” conditions that the
limiting distribution will be reached. On average, one may observe 400-500 waves per hour
of measurements, while the stationary conditions may last from 20 minutes to only a few
hours.
Despite of this, a fact that makes these long-run distributions particularly attractive is
that they give probabilities of occurrence of waves that may not be observed in the short
records but still are possible. Hence, one can estimate the intensity of occurrence of waves
with special properties and then extrapolate beyond the observed types of waves. What
we shall be concerned with next is how to compute such distributional properties.
In the following we shall consider three different ways to obtain the wave characteristic
probability densities (or distributions):
• To simplify the model for the sea surface to such a degree that explicit computation
48 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
of wave characteristic densities (in the simplified model) is possible. Some examples
of proposed models from the literature will also be given in this chapter.
xx = load(’sea.dat’);
xx(:,2) = detrend(xx(:,2));
rate = 8;
Tcrcr = dat2wa(xx,0,’c2c’,’tw’,rate);
Tc = dat2wa(xx,0,’u2d’,’tw’,rate);
Next we shall use a kernel density estimator (KDE) to estimate the probability density
function (pdf) of the crest period and compare the resulting pdf with a histogram of the
observed periods stored in Tc. In order to define a suitable scale for the density we first
compute the mean and maximum of the observed crest periods.
mean(Tc)
3.2. ESTIMATION OF WAVE CHARACTERISTICS FROM DATA 49
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0 2 4 6 8
Figure 3.2: Kernel estimate of crest period density observed in sea.dat; solid line:
full KDE, dash dotted line: binned KDE, compared with histogram of the data.
max(Tc)
t = linspace(0.01,8,200);
kopt = kdeoptset(’L2’,0);
ftc1 = kde(Tc,kopt,t);
pdfplot(ftc1), hold on
histgrm(Tc,[],[],1)
axis([0 8 0 0.5])
(The parameter L2=0 is used internally in kde, and causes a logarithmic transformation
of the data to ensure that the density is zero for negative values. Run help kdeoptset to
see the definition.)
In Figure 3.2 we can see that many short waves have been recorded (due to relatively
high sampling frequency). The kernel estimate will be compared with the theoretically
computed density in Figure 4.6 in Chapter 4, page 80. 2
Remark 3.3 . Note that the program kde can be quite slow for large data sets. If a faster
estimate of the density for the observations is preferred one can use kdebin, which is an
approximation to the true kernel density estimator. An important input parameter in the
program, that defines the degree of approximation, is inc which should be given a value
between 100 and 500. (A value of inc below 50 gives fast execution times but can lead to
inaccurate results.)
kopt.inc = 128;
ftc2 = kdebin(Tc,kopt); pdfplot(ftc2,’-.’)
title(’Kernel Density Estimates’), hold off
method = 0; rate = 8;
[S, H, Ac, At, Tcf, Tcb, z_ind, yn] = ...
dat2steep(xx,rate,method);
The first preliminary analysis of the data is to find the individual waves which are
extreme by some specified criterion, e.g. the steepest or the highest waves, etc. To do such
an analysis one can use the function spwaveplot(xx,ind), which plots waves in xx that
are selected by the index variable ind. For example, let us look at the highest and the
steepest waves.
The two waves are shown in Figure 3.3(a). The shape of the biggest wave reminds of
the so called ”extreme” waves. In the following we shall examine whether this particular
shape contradicts the assumption of a transformed Gaussian model for the sea.
This is done as follows. First we find the wave with the highest crest. Then we mark
all positive values in that wave as missing. Next we reconstruct the signal, assuming
the Gaussian model is valid, and compare the profile of the reconstructed wave with the
actual measurements. Confidence bands for the reconstruction will also be plotted. In the
previous chapter we have already used the program reconstruct, and here we shall need
some additional output from that function, to be used to compute and plot the confidence
bands.
(Note that we have used the function tranproc instead of gaus2dat, since the last function
requires a two column matrix. Furthermore we have to use the index indA-10 to identify
3.2. ESTIMATION OF WAVE CHARACTERISTICS FROM DATA 51
2
3
Wave 345
1 2.5
0 2
−1 1.5
Wave 335
1482 1484 1486 1488 1490 1492 1494 1496 1498
1
2
0.5
Wave 98
1
0
0
−0.5
−1
422 423 424 425 426 427 428 429 430 431 −1
1482 1484 1486 1488 1490 1492 1494 1496 1498
Time (sec) Time (sec)
(a) (b)
Figure 3.3: (a): Two waves, the highest and the steepest, observed in sea.dat. (b):
Crosses are observations removed from the highest wave. The reconstructed wave,
using transformed Gaussian model, is given by the middle solid line. Upper and
lower curves give the confidence band defined as the conditional mean of the process
plus minus two conditional standard deviations.
the highest wave in y1. This is caused by the fact that the interpolated signal yn has a
few additional small waves that are not in xx.)
In Figure 3.3(b) the crosses are the removed values from the wave. The reconstructed
wave, plotted by a solid line, is close to the measured. (Observe that this is a simulated
wave, using the transformed Gaussian model, and hence each time we execute the com-
mand the shape will change.) The confidence bands gives limits containing 95% of the
simulated values, pointwise. From the figure we can deduce that the highest wave could
have been even higher and that the height is determined by the particularly high values
of the derivatives at the zero crossings which define the wave. The observed wave looks
more asymmetric in time than the reconstructed one. Such asymmetry is unusual for the
transformed Gaussian waves but not impossible. By executing the following commands we
can see that actually the observed wave is close to the expected in a transformed Gaussian
model.
plot(xx(inds1,1),xx(inds1,2),’+’), hold on
mu = tranproc(mu1o,fliplr(grec1));
plot(y1(inds1,1), mu), hold off
Example 1. (contd.) We shall continue with the analysis of the crest height distribu-
tion. By letting L2 = 0.6 we see that the normalplot of the transformed data is approx-
imately linear. (Note: One should try out several different values for L2. It is also always
good practise to try out several different values of the smoothing parameter; see the help
text of kde and kdebin for further explanation.)
L2 = 0.6;
plotnorm(Ac.^L2)
fac = kde(Ac,{’L2’,L2},linspace(0.01,3,200));
pdfplot(fac)
simpson(fac.x{1},fac.f)
The integral of the estimated density fac is 0.9675 but it should be one. Therefore,
when we use the estimated density to compute different probabilities concerning the crest
height the uncertainty of the computed probability is at least 0.03. We suspect that this
is due to the estimated density being non-zero for negative values. In order to check this
we compute the cumulative distribution using the formula,
Z +∞
P(Ac ≤ h) = 1 − fAc (x) dx,
h
where fAc (x) is the estimated probability density of Ac. For the pdf saved in fac the
following code gives an estimate of the cumulative distribution function (cdf) for crest
height and compares it with the empirical distribution computed from data by means of
function edf or plotedf.
Fac = flipud(cumtrapz(fac.x{1},flipud(fac.f)));
Fac = [fac.x{1} 1-Fac];
Femp = plotedf(Ac,Fac);
axis([0 2 0 1]), hold off
Since a kernel density estimator KDE in essence is a smoothed histogram it is not very
well suited for extrapolation of the density to the region where no data are available, e.g. for
high crests. In such a case a parametric model should be used. In Wafo there is a function
trraylpdf that combines the non-parametric approach of KDE with a Rayleigh density.
Simply, if the Rayleigh variable can be used to described the crests of Gaussian waves then
a transformed Rayleigh variable should be used for the crests of the transformed Gaussian
waves. The method has several nice properties and will be described more in Section 3.3.3.
Here we just use it in order to compare with the non-parametric KDE method.
facr = trraylpdf(fac.x{1},’Ac’,grec1);
Facr = cumtrapz(facr.x{1},facr.f); hold on
plot(facr.x{1},Facr,’.’)
axis([1.25 2.25 0.95 1]), hold off
Figure 3.4(a) shows that our hypothesis that the pdf fac is slightly too low for small
crests seems to be correct. Next from Figure 3.4(b) we can see that also the tail is reason-
ably well modelled even if it is lighter than, i.e. gives smaller probabilities of high waves
than, the one derived from the transformed Gaussian model. 2
3.3. EXPLICIT RESULTS - PARAMETRIC WAVE MODELS 53
1 1
0.9 0.995
0.8 0.99
0.7 0.985
0.6 0.98
F(x)
F(x)
0.5 0.975
0.4 0.97
0.3 0.965
0.2 0.96
0.1 0.955
0 0.95
0 0.5 1 1.5 2 1.4 1.6 1.8 2 2.2
x x
(a) (b)
Figure 3.4: (a) Comparison of the empirical distribution of the crest height with
the cumulative distribution computed from the KDE estimator. (b) Zooming in on
the tails of distributions in (a) together with the tail of the transformed Rayleigh
approximation (dots) to the crest height distribution.
Ac [m]
1.5
0.5
2 4 6 8 10
Tc [s]
Figure 3.5: Kernel estimate of joint density of crest period Tc and crest height Ac in
sea.dat compared with the observed data (dots). The contour lines are drawn in
such a way that they contain specified (estimated) proportions of data.
SJ = jonswap([],[5 10]);
[m mt]= spec2mom(SJ,4,[],0);
The most basic information about waves is contained in the spectral moments. The
variable mt now contains information about what kind of moments have been computed,
in this case spectral moments up to order four (m0 , . . . , m4 ). Next, the irregularity factor
α, significant wave height, zero crossing wave period, and peak period can be computed.
spec2bw(SJ)
[ch Sa2] = spec2char(SJ,[1 3])
The interesting feature of the program spec2char is that it also computes an esti-
mate of the variance of the characteristics, given the length of observations (assuming the
Gaussian sea); see [35], [90], and [98] for more detailed discussion. For example, for the
Jonswap Gaussian sea, the standard deviation of significant wave height estimated from
20 minutes of observations is approximately 0.25 meter. 2
3.3. EXPLICIT RESULTS - PARAMETRIC WAVE MODELS 55
Model by Longuet-Higgins
Longuet-Higgins, [48, 49], derived his approximative distribution by considering the joint
distribution of the envelope amplitude and the time derivative of the envelope phase. The
model is valid for narrow-band processes. It seams to give relatively accurate results for
big waves, e.g. for waves with significant amplitudes.
The Longuet-Higgins density depends, besides the significant wave height Hs and peak
period Tp , on the spectral width parameter ν = mm 0 m2
2 − 1, which can be calculated by the
1
command spec2bw(S,’eps2’), (for a narrow-band process, ν ≈ 0). The explicit density
is given by
x 2 2
x
fTLH −2 −1 2
c ,Ac
(t, x) = cLH exp − 1 + ν (1 − t ) ,
t 8
where
1
cLH = (2π)−1/2 ν −1 [1 + (1 + ν 2 )−1/2 ]−1 .
8
The density is calculated by the function lh83pdf.
Example 6. (contd.) For the Longuet-Higgins approximation of the Tc , Ac distribution
for Jonswap waves we use the spectral moments just calculated.
t = linspace(0,15,100);
h = linspace(0,6,100);
flh = lh83pdf(t,h,[m(1),m(2),m(3)]);
In Wafo we have modified the Longuet-Higgins density to be applicable also for trans-
formed Gaussian models. Following the examples from the previous chapter we compute
the transformation proposed by Winterstein and combine it with the Longuet-Higgins
model.
In Figure 3.6 the densities flh and flhg are compared. The contour lines are drawn in
such a way that they contain predefined proportions of the total probability mass inside
the contours. We can see that including some nonlinear effects gives somewhat higher
waves for the Jonswap spectrum. 2
56 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
Joint density of (Tc,Ac) − Longuet−Higgins (1983) Joint density of (Tc,Ac) − Longuet−Higgins (1983)
6 6
Level curves enclosing: Level curves enclosing:
10 10
30 30
5 50 5 50
70 70
90 90
95 95
99 99
4 4
Ac
Ac
3 3
2 2
1 1
0 0
0 5 10 15 0 5 10 15
Tc Tc
(a) (b)
Figure 3.6: Longuet-Higgins model for joint pdf of crest period Tc and crest height
Ac . Spectrum: JONSWAP with Tp = 10 [s], Hm0 = 5 [m]. (a) linear Gaussian sea,
(b) transformed Gaussian sea.
where
1
cCA = (1 − 2 )(2π)−1/2 −1 α2 −1 (1 + ν 2 )−2 ,
4
1
α2 = [1 + (1 − 2 )1/2 ],
2
β = 2 /(1 − 2 ).
t = linspace(0,10,100);
h = linspace(0,7,100);
fcav = cav76pdf(t,h,[m(1) m(2) m(3) m(5)],[]);
and a contour plot of the pdf is obtained by pdfplot(fcav); see Figure 3.7.
2
The value of may be calculated by spec2bw(S,’eps4’)
3.3. EXPLICIT RESULTS - PARAMETRIC WAVE MODELS 57
F(x)
Level curves enclosing:
10 0.95
6 30
50
70
0.9
90
1 1.2 1.4 1.6 1.8 2
5 95 x
99
99.9 At CDF
1
4
F(x)
0.95
Ac
3 0.9
1 1.2 1.4 1.6 1.8 2
x
2 At+Ac CDF
1
F(x)
1 0.95
0.9
0 1.5 2 2.5 3 3.5
0 2 4 6 8 10 x
Tc
(a) (b)
Figure 3.7: (a) Contour lines of the joint density of crest period and crest height
proposed by Cavanié et al, for Gaussian sea with Jonswap spectrum (Tp = 10 [s],
Hm0 = 5 [m]). (b) The tail of the empirical distribution of crest height (top), trough
depth (middle) and amplitude (bottom) compared with Rayleigh approximation
(dots) and transformed Rayleigh model with Hermite transformation.
function trraylpdf computes the pdf of G(R). (Obviously the function works for any
transformation g.)
In previous examples we used the estimated crossing intensity to compute the trans-
formation and then approximated the crest height density using the transformed Rayleigh
variable. The accuracy of the approximation for the high crests in the data set xx =
sea.dat was checked, see Figure 3.4(b). A more extensive study of the applicability of
this approximation is done in [74].
xx = load(’sea.dat’);
x = xx;
x(:,2) = detrend(x(:,2));
SS = dat2spec2(x);
[sk, ku, me, si] = spec2skew(SS);
gh = hermitetr([],[si sk ku me]);
Hs = 4*si;
r = (0:0.05:1.1*Hs)’;
fac_h = trraylpdf(r,’Ac’,gh);
fat_h = trraylpdf(r,’At’,gh);
h = (0:0.05:1.7*Hs)’;
facat_h = trraylpdf(h,’AcAt’,gh);
pdfplot(fac_h), hold on
pdfplot(fat_h), hold off
Next, we shall compare the derived approximation with the observed crest heights in
x. As before, we could use the function dat2steep to find the crests. Here, for illustration
only, we shall use dat2tc to find the crest heights Ac and trough depth At.
TC = dat2tc(xx, me);
tc = tp2mm(TC);
Ac = tc(:,2); At = -tc(:,1);
AcAt = Ac+At;
Finally, the following commands will give the cumulative distributions for the com-
puted densities.
plot(r,1-exp(-8*r.^2/Hs^2),’.’)
axis([1. 2. 0.9 1])
Facat_h = [facat_h.x{1} cumtrapz(facat_h.x{1},facat_h.f)];
subplot(3,1,3)
Facat = plotedf(AcAt,Facat_h); hold on
r2 = (0:05:2.1*Hs)’;
plot(r2,1-exp(-2*r2.^2/Hs^2),’.’)
axis([1.5 3.5 0.9 1]), hold off
In Figure 3.7(b) we can see some differences between the observed crest and trough
distributions and those obtained from the transformation gh. However, it still gives a much
better approximation than the standard Rayleigh approximation (dots). As it was shown
before, using the transformation computed from the crossing intensity, the transformed
Rayleigh approach is giving a perfect fit. Finally, one can see that the Rayleigh and
transformed Rayleigh variables give too conservative approximations to the distribution
of wave amplitude. 2
60 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
3.4.2 spec2bw
help spec2bw
CALL: bw = spec2bw(S,factors)
bw = vector of factors
S = spectrum struct
factors = vector with integers, see below. (default [1])
Example:
S=demospec;
bw=spec2bw(S,[1 2 3 4]);
62 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
3.4.3 wavedef
help wavedef
3.4.4 perioddef
help perioddef
<-------Tu-------->
: :
<---Tc-----> :
: : : <------Tcc---->
M : c : : : :
/ \ : M / \_ : : c_ c
F \ :/ \m/ \: :/ \ / \ level v
------d--------u----------d------u----d--------u---d--------
\ / \ / :\_ _/: :\_ L
\_ / \t_/ : \t_/ : : \m/
\t/ : : : :
:<-------Ttt----->: <---Tt---> :
:<----Td---->:
Tu = Wave up-crossing period
Td = Wave down-crossing period
Tc = Crest period, i.e., period between up-crossing and
the next down-crossing
Tt = Trough period, i.e., period between down-crossing and
the next up-crossing
Ttt = Trough2trough period
Tcc = Crest2crest period
64 CHAPTER 3. EMPIRICAL WAVE CHARACTERISTICS
<--Tcf-> Tuc
: : <-Tcb-> <->
M : c : : : :
/ \ : M / \_ c_ : : c
F \ :/ \m/ \ / \___: :/ \ level v
------d---------u----------d---------u-------d-----u---d-------
:\_ / \ __/: \ / \_ L
: \_ / \_t_/ : \t/ \m/
: \t/ : :
: : : :
<-Ttf-> <-Ttb->
Also note that Tcf and Ttf can also be abbreviated by their
crossing marker, e.g. Tuc (u2c) and Tdt (d2t), respectively.
Similar rules apply to all the other wave periods and wave
lengths. (The nomenclature for wave length is similar, just
substitute T and period with L and length, respectively)
3.4.5 ampdef
help ampdef
...............c_..........
| /| \ |
Hd | _/ | \ | Hu
M | / | \ |
/ \ | M / Ac | \_ | c_
F \ | / \m/ | \ | / \ level v
------d----|---u------------------d---|---u----d------
\ | /| \ | / \L
\_ | / | At \_|_/
\|/..| t
t
Ac = crest amplitude
At = trough amplitude
Hd = wave height as defined for down-crossing waves
Hu = wave height as defined for up-crossing waves
3.4.6 crossdef
help crossdef
M
. . M M
. . . . . .
F d . . L level v
----------------------u-------d-------o---------------------
. . . . u
. m
m
The wave characteristic distributions in Chapter 3 have been empirical, either constructed
directly from data, or from a specific model fitted by means of data, via a few spectral
moments. In this chapter we will use the Gaussian paradigm, described in Section 3.1.1,
to produce exact, up to numeric accuracy, wave characteristic distributions directly from
an assumed spectral density, without any further assumptions than Gaussianity and a
following transformation. This is a unique facility in Wafo, not available in any other
wave analysis software. The routines are collected in the module trgauss and they are
listed in Section 4.4.
The functions are the results of long time research at Lund University, see [63] and
[44], where a review of the historical development and the mathematical tools behind the
algorithms are given.
The Matlab code for the examples in this chapter are found in Chapter4.m and is
takes 10 minutes to run on a 3.6 GHz 64-bit i7 7700, in fast mode and 40 minutes in slow
mode.
69
70 CHAPTER 4. EXACT WAVE CHARACTERISTICS
ST = torsethaugen([],[6 8],1);
D1 = spreading(101,’cos’,pi/2,[15],[],0);
D12 = spreading(101,’cos’,0,[15],ST.w,1);
STD1 = mkdspec(ST,D1);
STD12 = mkdspec(ST,D12);
The energy is divided between two peaks, corresponding to contributions from wind
and swell. We shall also use the two directional spectra from Chapter 1 with frequency
independent, STD1, and frequency dependent, STD12, spreading. 2
Crest period
Example 8. (contd.) (Crest period) We begin with the density of crest period, which
(obviously) is identical for all three spectra S1, SD1, and SD12. The computed density is
a result of a numerical integration of a theoretically derived formula, which is described,
e.g., in [46]. The algorithm gives an upper bound (and, if requested, a lower bound too)
for the density. Consequently, if the integral of the computed density, over all periods, is
close to one it implies that the density is computed with high accuracy.
4.2. MARGINAL DISTRIBUTIONS OF WAVE CHARACTERISTICS 71
0.25
0.08
0.2
0.06
0.15
0.04
0.1
0.02
0.05
0 0
0 2 4 6 8 10 12 0 50 100
T [s] L [m]
(a) (b)
The last argument in the calls above to spec2tpdf is worth special attention, and we
will later study its effect in detail. It controls the numerical algorithm that computes the
density. Here, we only note that a positive choice, here 4, gives an upper bound to the
density, more accurate and more time consuming the higher the value, while a negative
value, here -1, given an almost unbiased value in much shorter time. 2
Crest length
Example 8. (contd.) (Crest length) We then turn to the density of crest length for the
Torsethaugen spectrum. It can be computed using the same function spec2tpdf, we just
change the input def variable ’Tc’ to ’Lc’.
72 CHAPTER 4. EXACT WAVE CHARACTERISTICS
Table 4.1: Second row: proportion of crest heights above a level, computed by
spec2tpdf; Third row: CDF of crest height computed by spec2Acdf.
The crest length density has a sharp peak for very short waves – the wave-number
spectrum is much more broad banded than the frequency spectrum; see [47] for a general
comparison of wave period and wave length. However, the short waves have small crests
and should be considered as ’noise’ rather than as apparent waves. Consequently, we may
wish to compute the proportion of waves that have crest higher than a certain proportion
of the significant wave height, e.g. 25%, i.e. one standard deviation, Hs/4 = 1.5[m], and
give the density of the crest length for these waves. This can be done by specifying an
extra argument h = 1.5 in the call to spec2tpdf.
Figure 4.1(b) presents the results when the crest height is restricted to more than 10%,
20%, 30%, 40%, 50% of the significant wave height. and we can see that all short waves in
fact were small. (The algorithm produces some very small negative density values. These
have been removed before the plotting; see the following section on numerical accuracy,
Section 4.2.2.)
The proportion of waves with crests above 1.5 [m] (one standard deviation) is computed
by the following commands.
simpson(f_Lc.x{1},f_Lc.f)
simpson(f_Lc_1.x{1},f_Lc_1.f)
Taking the ratio, we can see that more than half of the waves are small, about 37% of the
waves have crests above 1.5 [m]. Similar calculations for the curves in Figure 4.1(b), give
the proportions of crests above the levels in Table 4.1. 2
Crest height
From a statistical viewpoint the crest period distribution is uniquely defined as the empiri-
cal distribution of the time between mean level upcrossings and the following downcrossing.
It is linked to a fixed observation point and an “infinite” observation interval. Similarly,
crest length distribution is the empirical distribution of the distance between mean level
up- and downcrossings. It is linked to a fixed time and a fixed, “infinitely long”, obser-
vation transect on the ocean surface. Discussing crest height distribution, the maximum
height between an up- and a downcrossing, we obviously have to decide which observa-
tion scheme is used. Fortunately, the Wafo routine spec2Acdf handles both alternatives,
depending on the type of spectrum we use..
4.2. MARGINAL DISTRIBUTIONS OF WAVE CHARACTERISTICS 73
Example 8. (contd.) (Crest height) The table of the proportion of high crest waves is
related to the cumulative distribution function (cdf) of the crest height Ac in a natural
way. The routine spec2Acdf computes and plots the cdf directly, both for the crest height
over a crest period in time and for the crest height over a crest length in space. It also
plots the Rayleigh approximation.
The following commands creates empirical and theoretical crest height distributions in
time and in space for Gaussian waves with Torsethaugen frequency spectrum. The vector
T contains 100 replicates of 400 seconds of time wave simulation, the vector L contains
100 replicates of 4000 meters of space wave simulation. AcT, AcL are the time and space
observed crest heights, respectively.
clf; Hs = 6;
r = (0:0.12:1.1*Hs)’;
F_Ac_s1_T = spec2Acdf(ST,[],’Tc’,[0 12 61],r,-1); hold on
T = spec2sdat(ST,[40000,100],0.01);
[SteepT,HeightT,AcT] = dat2steep(T);
plotedf(AcT,’-.’)
F_Ac_s1_L = spec2Acdf(ST,[],’Lc’,[0 125 251],r,-1);
L = spec2sdat(spec2spec(ST,’k1d’),[40000 100],0.1);
[SteepL,HeightL,AcL] = dat2steep(L);
plotedf(AcL,’-.’)
plot(r,1-exp(-8*r.^2/Hs^2)), hold off
Figure 4.2 shows the empirical distribution of Ac in a long simulation in time, and
the theoretical distribution functions for crest height in time and in space computed by
spec2Acdf, as well as the Rayleigh approximation from Section 3.3.3. The simulations
contain 9255 space wave crests and 5823 time wave crests. The agreement between the
empirical and theoretical distribution functions is very good. The Rayleigh distribution
gives a good approximation of the time crest height for large crest values but over-estimates
the smallest crests. It does not work for space waves.
The third row in Table 4.1 shows the cdf values for crest height in space computed
by spec2Acdf. The sum of the second and third row should be one; here, all sums in the
table are greater than 0.997. 2
f_Lc_d1 = spec2tpdf(spec2spec(STD1,’rotdir’,pi/2),[],...
’Lc’,[0 200 201],[],-1);
pdfplot(f_Lc_d1,’-.’), hold on
74 CHAPTER 4. EXACT WAVE CHARACTERISTICS
0.8
0.6
F(x)
0.4
0.2
0
0 2 4 6
Ac [m]
Figure 4.2: Cumulative distribution (cdf) for crest height Ac with Torsethaugen
spectrum ST. Curves most to the left = theoretical (solid) and empirical (dash
dotted) cdf for Ac over a crest length. Middle curves show theoretical and empirical
cdf for Ac over a crest period. Curve most to the right is the cdf for the Rayleigh
approximation.
figure(2)
dx = f_Lc.x{1}(2)-f_Lc.x{1}(1);
dx1 = f_Lc_d1.x{1}(2)-f_Lc_d1.x{1}(1);
dx12 = f_Lc_d12.x{1}(2)-f_Lc_d12.x{1}(1);
plot(f_Lc.x{1},cumsum(f_Lc.f)*dx), hold on
plot(f_Lc_d1.x{1},cumsum(f_Lc_d1.f)*dx1,’-.’)
plot(f_Lc_d12.x{1},cumsum(f_Lc_d12.f)*dx12,’--’), hold off
As expected, after examination of the simulated sea surfaces in Figures 1.5 and 1.6, the
crest length for the two directional spectra are different. The sea with frequency dependent
spreading seems to be more irregular. We can see in Figure 4.3 that waves with frequency
independent spreading are only slightly longer than the waves in unidirectional sea, while
the crest length of both seas are much shorter than for frequency dependent spreading. 2
0.08
0.07 0.8
0.06
0.6
0.05
0.04
0.4
0.03
0.02 0.2
0.01
0 0
0 50 100 150 200 0 50 100 150 200
L [m] L [m]
Figure 4.3: Computed pdf (left) and cdf (right) for Lc in Gaussian sea with
Torsethaugen spectrum with different spreading: unidirectional spectrum S1 (solid
line) ; frequency independent spreading SD1 (dash-dotted line); frequency dependent
spreading SD12 (dashed line).
cal, deterministic, integration algorithms, while negative values use a simulation technique
based on importance sampling; see [15, 16] for a review of different methods.
The methods with positive nit are very reliable and have been tested on different
wave problems since the first version was used already in 1987; see [69]. As default, they
give an upper bound to the densities. The integration methods corresponding to negative
nit values are often much faster and also very accurate in cases when the deterministic
method has troubles with too long execution times; see [41] for examples.
Although the method with negative nit is based on simulation, the accuracy is still
controlled. If the number of simulations is too small to achieve the required accuracy the
program gives an error statement with an estimate of the possible error in the computed
density.
One should be aware that both positive and negative nit values can produce negative
density values with spec2tpdf. This is the result of the way the densities are computed,
namely as differences between ”cumulative distribution type” functions. Then, small nu-
merical variations may cause negative density estimates, mostly for very small density
values.
The routine spec2tpdf is the Matlab interface to a Fortran program. All programs
computing exact densities of different wave characteristics can be reformulated in such a
way that the density is written as a certain multidimensional integral of a function of
Gaussian variables; see [46] for more details. This integral is computed using a Fortran
module called RIND. There is also a Matlab interface called rind which can be used to
test programs for new wave characteristics.
An example is a function spec2tpdf2 which uses the program rind. The program is
slower than spec2tpdf, and it does not have an option that allows to choose waves with
crest above some level, but on the other hand it is easier to use for experimentation, and
it can also be used to learn how to create own programs.
Besides the parameter nit, the input parameter speed will also control the accuracy
of the computations in module trgauss; see the help text to the routines for information.
Remark 4.4 . The accuracy of the numerical computations depends on the parameters
76 CHAPTER 4. EXACT WAVE CHARACTERISTICS
nit and speed in a natural and predictable way. Of course, also the choise of grid size
affects the accuracy; some of the algorithms are very sensitive to short time or space steps
and can produce covariance matrices which are not positive definite.
Matlab version, computer CPU, and RAM memory size, all affect speed. More sub-
tle effects of hardware implementation can affect some computed small probabilities, of
interest in applications. In the examples we present many numerical results and execution
times, and the reader is advised to make own experiments to become familiar with these
characteristics. 2
Example 8. (contd.) (Numerical accuracy and the parameter nit) We shall exemplify
the use of the parameter nit by computing the crest length density for the directional
spectrum with frequency independent spreading. We shall also use the slower program
spec2tpdf2 for illustration. We fix the speed and method by setting an option variable.
opt1 = rindoptset(’speed’,5,’method’,3);
STD1r = rotspec(STD1,pi/2);
f_Lc_d1_5 = spec2tpdf(STD1r,[],’Lc’,[0 200 201],[],5);
f_Lc_d1_3 = spec2tpdf(STD1r,[],’Lc’,[0 200 201],[],3);
f_Lc_d1_2 = spec2tpdf(STD1r,[],’Lc’,[0 200 201],[],2);
f_Lc_d1_0 = spec2tpdf(STD1r,[],’Lc’,[0 200 201],[],0);
f_Lc_d1_neg = spec2tpdf(STD1r,[],’Lc’,[0 200 201],[],-1);
f_Lc_d1_n4 = spec2tpdf2(STD1r,[],’Lc’,[0 200 201],opt1);
pdfplot(f_Lc_d1_5), hold on
pdfplot(f_Lc_d1_2), pdfplot(f_Lc_d1_3)
pdfplot(f_Lc_d1_0), pdfplot(f_Lc_d1_neg)
pdfplot(f_Lc_d1_n4,’LineWidth’,2,’-.’)
simpson(f_Lc_d1_n4.x{1},f_Lc_d1_n4.f)
The execution times for the densities were 150 seconds, 5.6 seconds, 1.3 seconds, 0.13
seconds, 2.4 seconds, and 3.7 seconds, respectively. In Figure 4.4(a) the different approxi-
mations are presented and we can see how the density decreases with increasing positive
nit. The negative nit involves some random number integration methods, but we can
hardly see that the computed density is actually a random function. Most problems are
less numerical demanding and nit=2 often suffices, but here clearly the negative nit is
preferable.
In Figure 4.4(b) we compare an empirical density of crest length Lc, conditioned on
crest height Ac > 1.5[m], based on 500 000 observed waves, with the normalized density
f Lc 1 from page 71, computed with nit = -1. The agreement is almost perfect. 2
0.08
0.02
0.07
0.06
0.015
0.05
0.04
0.01
0.03
0.02 0.005
0.01
0 0
0 50 100 150 200 −100 0 100 200 300
wave length [m] L [m]
(a) (b)
Figure 4.4: (a) Approximations by different methods and accuracy of the crest length
for the directional spectrum STD1r with frequency independent spreading. The top
solid curves are computed with positive nit = 0 (top), 2, 3, 5, and negative nit
= -1 (bottom), in routine spec2tpdf, while the dash-dotted curve has negative nit
with routine spec2tpdf2. (b) Solid curve = the empirical density of crest length
Lc with crest height Ac > 1.5[m], dash-dotted curve is the normalized computed
density f Lc 1.
We now turn to the wave period, Tu = Tc+Tt, which is the time between two successive
upcrossings of the still water level u. It is related to, but not equal to, the crest-to-crest
wave period Tcc, which is the time span between two successive crests. The density of
Tu can be computed using the function spec2tccpdf. The wave length Lu or encountered
wave period can also be computed by spec2tccpdf, with just a few inputs to be modified;
see the help text. Hence, these variables shall not be discussed here any more.
The computations using spec2tccpdf are slower than those using spec2tpdf, since
one needs to compute the joint density of Tc and Tt and then integrate the convolution
to get Tu = Tc+Tt. It should be mentioned that, in addition to the methods to reduce
computation time, one of the best methods to speed up computation is to cut off high
frequencies in the spectrum. The syntax of spec2tccpdf is almost identical to that of
spec2tpdf, and hence we limit ourselves to a few examples.
Example 9. (Sea data wave distributions) In order to make comparisons with the wave
characteristic distributions in sea.dat we shall use the estimated spectrum SS, see Ex-
ample 1 on pages 20 and 26. We first re-compute the spectrum estimate and the transfor-
mation to Gaussianness, and extract some characteristics.
xx = load(’sea.dat’);
x = xx;
x(:,2) = detrend(x(:,2));
SS = dat2spec(x);
si = sqrt(spec2mom(SS,1));
SS.tr = dat2tr(x);
Hs = 4*si
78 CHAPTER 4. EXACT WAVE CHARACTERISTICS
The estimated spectrum is plotted in Figure 4.5, together with pointwise 95% confidence
intervals.
Note that the spectrum contains a transformation field SS.tr, and recall the Impor-
tant note 1 on page 35. If you want to simulate new versions of sea.dat by spec2sdat
you must normalise the spectrum to have m0 = 1. 2
Spectral density
fp1 = 1.1 [rad/s]
fp2 = 0.55 [rad/s]
0.25 95% CI
S(w) [m2 s / rad]
0.2
0.15
0.1
0.05
0
0 1 2 3 4 5
Frequency [rad/s]
Figure 4.5: Estimated spectrum SS for data sea.dat with confidence bands.
Example 9. (contd.) (Crest period) We first consider the crest period, as we did in
Example 8 on page 70, and also the proportion of crests with significant crest height,
i.e. Tc when Ac > Hs/2, in the same way as we did for crest length. After that we will
do the same for wave period and consider Tu when Ac > Hs/2. The proportion of crest
periods with significant crest height should be the same as the proportion of wave periods
with significant crest height, i.e. Tu when Ac > Hs/2. The difference between the two
proportions gives an indication of the accuracy in the computation of the convolution Tu
= Tc + Tt.
We can also compare the calculated proportion of significant crests with the proportion
observed in data and with the approximative Rayleigh model. Finally, we estimate the
density using KDE from data and compare to the theoretically computed one, based on
the transformed Gaussian model.
For completeness we again estimate the transformation and find wave characteristics
in the signal. The crest period, Tc, distribution, estimated from data, and the computed
density are almost identical, except for very short waves; see Figure 4.6(a), obtained by
the following commands. Note the last output variable yn in the call to dat2steep, which
is an interpolated series, to be used later, when we need more exact values for the wave
periods.
method = 0; rate = 2;
[S,H,Ac,At,Tcf,Tcb,z_ind,yn] = dat2steep(x,rate,method);
Tc = Tcf+Tcb;
t = linspace(0.01,8,200);
f_tc1emp = kde(Tc,{’L2’,0},t);
pdfplot(f_tc1emp), hold on
4.2. MARGINAL DISTRIBUTIONS OF WAVE CHARACTERISTICS 79
Example 9. (contd.) (Wave period for high-crest waves) We turn now to the more
difficult problem of wave period Tu = Tc+Tt, and compute the density for waves with
significant crest height, Ac > Hs/2 and with At > 0. As mentioned, this differs from crest
period Example 8 on page 70 in that it involves the distribution of the sum Tc + Tt of two
dependent random variables, with the same marginal distribution. Since the computations
need to be done with high accuracy (the computed density is different for the unconditional
wave period and for the period of waves with crest below a given threshold), we need to
use a high positive nit value, so that the total sum of the density is close to 0.1789, or
use a negative nit. We begin with negative nit, which gives faster results very close to
the true density, and then take nit = 3.
80 CHAPTER 4. EXACT WAVE CHARACTERISTICS
0.3 0.1
0.25 0.08
0.2 0.06
0.15 0.04
0.1 0.02
0.05 0
0 −0.02
0 2 4 6 8 0 2 4 6 8
T [s] T [s]
(a) (b)
Figure 4.6: (a) Estimated density (KDE) of crest periods in sea.dat (solid line)
compared with theoretically computed using spec2tpdf (dashed line). (b) The same
for the waves with significant crest, i.e. Ac > Hs/2.
The integral of the density f_tcn is 0.1778, which is close to the previously computed
value 0.1789. However, the execution time was 66 seconds, compared to 21 seconds for
f_t2. The choice nit=3 takes 3 minutes and give the integral 0.15. We have checked the
program with nit=5 (execution times 66 minutes), and the integrals was 0.17. The densities
are shown in Figure 4.7(a). We can see that the density computed using nit=-1 (dash-
dotted line) is quite accurate, even if it slightly wiggly, being a random function with very
small variance, and errors compensate each other giving almost perfect total probability
mass. Note that another call of the program would give slightly different values and the
total mass would also be changed. 2
Example 9. (contd.) (Wave period for high-crest, deep-trough waves) We finish the
example with an even more interesting case, the density of wave period of waves with
both significant crest and significant trough, i.e. really big waves. We first estimate the
probability of such waves in the data; then we use the interpolated series yn from page 78.
0.05 12
10
0.04
8
0.03
6
0.02
4
0.01
2
0 0
−0.01 −2
0 2 4 6 8 10 12 0 2 4 6 8 10 12
T [s] T [s]
(a) (b)
Figure 4.7: (a) Densities of upcrossing period Tu for waves with significant crest
in the transformed Gaussian model for sea.dat computed with different degree of
accuracy; (solid line) nit=-1; the dashed line is computed with nit=5 and the dash
dotted line with nit=3. (b) Densities of period Tu for waves with significant crest
and trough in the same model; solid wiggled line nit=-1; solid smooth line nit=4;
the dash dotted line is estimated from the data with KDE.
Tu = yn(v_ind(1+2*ind),1)-yn(v_ind(1+2*(ind-1)),1);
t = linspace(0.01,14,200);
f_tu2_emp = kde(Tcc,{’L2’,0},t);
f_tu2_emp.f = Pemp*f_tu2_emp.f;
pdfplot(f_tu2_emp,’-.’)
The probability is estimated to be Pemp = 0.0370, which is slightly higher than what
we could expect if high crests and low troughs occur independently of each other (the
probability would then be less than 0.025).
We turn now to computation of the probability using spec2tccpdf with nit=-1. How-
ever, we are here in a situation when the error in computations is of the order 10−3 , which
is comparable to the values of the density itself. Hence the computed function will look
very noisy.
The execution time is less than one minute, and the computed probability with nit = -1
is 0.0358, which is well in agreement with the number estimated from data. The more time-
demanding nit = 4 gives a much smoother pdf curve with almost the same integral, with
an execution time of 15 minutes.
In Figure 4.7(b) we see the computed densities of wave period for these big waves.
Those are well concentrated around the mean value. It is also compared to the KDE
estimator. We have not tried to tune up the estimator that is based on only 20 values and
hardly can be considered as accurate. 2
82 CHAPTER 4. EXACT WAVE CHARACTERISTICS
64
Spectral density
Trondheim
fp1 = 0.61 [rad/s]
62 Statfjord A 10 fp2 = 0.33 [rad/s]
Gullfaks C
Bergen
60 Oslo
8
S(w) [m2 s / rad]
Frigg
Stavanger
58
Sleipner 6
Draupner
56
4
54
2
52
0
0 1 2 3 4 5 6
50
−4 −2 0 2 4 6 8 10 12
Frequency [rad/s]
(a) (b)
Figure 4.8: Location of Gullfaks C platform (a). The estimated spectrum (b).
WARNING: In the following examples we run the programs with maximum accuracy
and hence we have long execution times. Usually one should use simpler and faster ap-
proximations at first experiments with complicated distributions. When one is satisfied
with the results, one should compute the densities with the desired high accuracy. For
testing own problems we recommend to start execution of programs with input parameter
speed = 9,8 (maximal speed is 9, the default is 4) and nit = -1, 1, (default is 2). These
choices will produce fast but still useful approximations.
yy = load(’gfaksr89.dat’);
SG = dat2spec(yy);
si = sqrt(spec2mom(SG,1));
4.3. JOINT DENSITY OF CREST PERIOD AND CREST HEIGHT 83
SG.tr = dat2tr(yy);
Hs = 4*si
v = gaus2dat([0 0],SG.tr); v = v(2)
The spectrum has two peaks, see Figure 4.8(b). We are not checking different options to
estimate the spectrum, but use the default parameters.
We shall now extract some simple wave characteristics, Tc,Tt,Tcf,Ac,At. All these
are column vectors containing crest period, trough period, position of crest, crest height,
and trough height, respectively. All vectors are ordered by number of a wave, i.e. all vectors
contain characteristic of the i’th wave in their position i.
Here we used the routine ecross to interpolate the data to find the exact level cross-
ings. We then compute the crest period density from spectrum and compare it with that
observed in data.
t = linspace(0.01,15,200);
kopt3 = kdeoptset(’hs’,0.25,’L2’,0);
ftc1 = kde(Tc,kopt3,t);
ftt1 = kde(Tt,kopt3,t);
pdfplot(ftt1,’k’), hold on
pdfplot(ftc1,’k-.’)
f_tc4 = spec2tpdf(SG,[],’Tc’,[0 12 81],0,4,5);
f_tcn = spec2tpdf(SG,[],’Tc’,[0 12 81],0,-1);
pdfplot(f_tcn,’b’), hold off
We do not present the graphical result for this computations but simply comment that
the agreement between theory and data is very good for both densities, except for observed
long waves, which have somewhat longer periods (about 0.25 seconds) than theoretically
computed. It is not much for a signal with 2.5 [Hz] sampling frequency. There is also the
possibility that the swell peak in the spectrum is too much smoothed. 2
84 CHAPTER 4. EXACT WAVE CHARACTERISTICS
Next, we compare the observed distribution with the theoretically computed joint
density of Tc, Tcf, Ac for a fixed value of Tc. By this we mean that if we integrate the
result we shall obtain the value of the density of Tc. Note that the distribution can also
be computed using the program spec2tpdf.
opt1 = rindoptset(’speed’,5,’method’,3);
opt2 = rindoptset(’speed’,5,’nit’,2,’method’,0);
f_tcfac1 = ...
spec2thpdf(SG,[],’TcfAc’,[4.5 4.5 46],[0:0.25:8],opt1);
f_tcfac2 = ...
spec2thpdf(SG,[],’TcfAc’,[4.5 4.5 46],[0:0.25:8],opt2);
pdfplot(f_tcfac1,’-.’), hold on
pdfplot(f_tcfac2)
plot(Tcf(ind), Ac(ind),’.’), hold off
simpson(f_tcfac1.x{1},simpson(f_tcfac1.x{2},f_tcfac1.f,1))
simpson(f_tcfac2.x{1},simpson(f_tcfac2.x{2},f_tcfac2.f,1))
We conclude that the densities f_tcfac1 and f_tcfac2 really integrate to the marginal
density of Tc (f_tc4.f(46)), demonstrating the accuracy of the densities f_tcfac1 and
f_tcfac2. Note the difference in computation time.
4.3. JOINT DENSITY OF CREST PERIOD AND CREST HEIGHT 85
amplitude [m]
5 5
4 4
3 3
2
2
1
1
0
0.5 1 1.5 2 2.5 3 3.5 4 0 1 2 3 4
period [s] period [s]
(a) (b)
Figure 4.9: Distribution of crest position and crest height for Gullfaks waves with
crest period Tc = 4.5[s]. (a) The estimated (KDE) density of crest position and
height together with observations (dots). (b) The theoretically computed density
with nit = -1, 2 and the data.
In Figure 4.9(a) the estimated (KDE) joint density is given and it should be compared
with Figure 4.9(b), where the theoretical density is presented. Here we can really see the
advantage of the theoretically computed densities. Even if we have here used a long record
of wave data, there is not enough of waves to make a reliable estimate of the joint density,
and in a standard 20 minutes records there would be far too few observations. 2
As we have mentioned already the integral over the crest position of the computed
densities is equal to the joint density of crest period and height. So in order to get the
whole density of Tc, Ac one needs to execute the previous program to obtain the density
of Tc, Tcf, Ac for different values of Tc and integrate out the variable Tcf, and this will
take some time. However, most time is spent on the computation of the density of long
and small waves, and these are not interesting. Hence we can start to compute the joint
density of Tc,Ac for significant waves.
Example 10. (contd.) (Joint crest period/amplitude for significant waves) We compute
the joint density of Tc,Ac of significant waves in the Gullfaks data in order to compare the
distribution with the Longuet-Higgins approximation; see Section 3.3.2. The following call
takes substantial time (35 minutes), and gives the “exact” distribution. It is not included
in the “fast” version of the command file Chapter4.m.
Next, we find the modified Longuet-Higgins density, i.e. the density with transformed
crest heights. The original LH-density underestimates the high crests with up to one meter.
We can see that for significant waves and the present spectrum the modified Longuet-
Higgins density is quite accurate.
86 CHAPTER 4. EXACT WAVE CHARACTERISTICS
mom = spec2mom(SS,4,[],0);
t = f_tcac_s.x{1}; h = f_tcac_s.x{2};
flh_g = lh83pdf(t’,h’,[mom(1),mom(2),mom(3)],SS.tr);
ind = find(Ac>Hs/2);
plot(Tc(ind), Ac(ind),’.’); hold on
pdfplot(flh_g,’k-.’); pdfplot(f_tcac_s); hold off
In Figure 4.10(a) the theoretical density is plotted with solid lines and the transformed
LH-density with dash dotted lines. We can see that the simple approximation is working
very well, even if it gives slightly too short periods.
6 5
5.5 4
5
3
4.5
2
4
3.5 1
3 0
2 4 6 8 10 12 0 2 4 6 8 10 12
period [s] period [s]
(a) (b)
Figure 4.10: Joint density of Tc and Ac for the transformed Gaussian model of
the sea measurements from Gullfaks C platform (solid line) compared with the
transformed Longuet-Higgins density (dash dotted line) and the data (dots) for
waves with significant crest.
In Figure 4.10(b) the theoretical density is compared with the data, and as we see, the
agreement is again quite good. This routine take about 15 minutes to run, and it is not
executed in the default version of the command file Chapter4.m. 2
Example 11. (min-max problems with Gullfaks data) In this example we continue the
analysis of the Gullfaks C platform data. First we shall retrieve the sequence of turning
points, i.e. the minima and maxima, in yy and calculate the theoretical distribution.
opt2 = rindoptset(’speed’,5,’nit’,2,’method’,0);
tp = dat2tp(yy);
Mm = fliplr(tp2mm(tp));
fmm = kde(Mm);
f_mM = spec2mmtpdf(SG,[],’mm’,[],[-7 7 51],opt2);
pdfplot(f_mM,’-.’), hold on
pdfplot(fmm,’k-’), hold off
88 CHAPTER 4. EXACT WAVE CHARACTERISTICS
-2
-4
-6
-8
-6 -4 -2 0 2 4 6 8
Max [m]
Figure 4.11: Joint density of maximum and the following minimum for the trans-
formed Gaussian model of the sea measurements from Gullfaks C (dash-dotted lines)
compared with the estimated (KDE) density from data (solid lines).
In Figure 4.11 we can see that the theoretically computed density agrees very well with
the estimated one, even with an as low a nit as 2. 2
Then we compute the joint density of crest and trough using the Markov approximation
to the sequence of local extremes (sequence of turning points tp).
Now we are in the position to check our two methods, the Markov method, where the
min-to-max sequence is approximated by a Markov chain, and the replacement of the true
min-to-max transition probabilities by the transition probabilities that are valid for the
stillwater-separated min-to-max values. The results are presented in Figure 4.12. We see
4.3. JOINT DENSITY OF CREST PERIOD AND CREST HEIGHT 89
min [m]
min [m]
3 4
2 3
1
2
0
1
-1
0 2 4 6 8 1 2 3 4 5 6 7 8
Max [m] Max [m]
(a) (b)
help trgauss
Misc
createpdf - PDF struct constructor.
pdfplot - Plot contents of pdf structures.
trplot - Plots transformation, g, eg. estimated with dat2tr.
This chapter contains some elementary facts about random fatigue and how to compute
expected fatigue damage from a stochastic, stationary load process. The commands can
be found in Chapter5.m, taking a few seconds to run.
1. As measurements of the stress or strain function with some given sampling frequency
in Hz. Such loads will be called measured loads and denoted by x(t), 0 ≤ t ≤ T ,
where t is time and T is the duration of the measurements.
[T /2]
X
x(t) ≈ m + ai cos(ωi t) + bi sin(ωi t)
i=1
where ωi = i · 2π/T are angular frequencies, m is the mean of the signal and ai , bi
are Fourier coefficients. The properties are summarized in a spectral density as in
described in Section 2.2.
3. In the rainflow domain, i.e. the measured load is given in the form of a rainflow
matrix.
93
94 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
We shall now review some simple means to characterize and analyze loads which are
given in any of the forms (1)–(3), and show how to derive characteristics, important for
fatigue evaluation and testing.
We assume that the reader has some knowledge about the concept of cycle counting, in
particular rainflow cycles, and damage accumulation using Palmgren-Miners linear damage
accumulation hypotheses. The basic definitions are given in the end of this introduction.
Another important property is the crossing spectrum µ(u), introduced in Section 2.1,
defined as the intensity of upcrossings of a level u by x(t) as a function of u.
The process of damage accumulation depends only on the values and the order of
the local extremes (maxima and minima), in the load. The sequence of local extremes is
called the sequence of turning points. The irregularity factor α measures how dense the
local extremes are relatively to the mean frequency f0 . For a completely regular function
there would be only one local maximum between upcrossings of the mean level, giving
irregularity factor equal to one. In the other extreme case, there are infinitely many local
extremes giving irregularity factor zero. However, if the crossing intensity µ(u) is finite,
most of those local extremes are irrelevant for the fatigue and should be disregarded by
means of some smoothing device.
A particularly useful filter is the so-called rainflow filter that removes all local extremes
that build rainflow cycles with amplitude smaller than a given threshold. We shall always
assume that the signals are rainflow filtered; see Section 5.2.1.
If more accurate predictions of fatigue life are needed, then more detailed models are
required for the sequence of turning points. Here the Markov chain theory has shown to
be particularly useful. There are two reasons for this:
• the Markov models constitute a broad class of processes that can accurately model
many real loads,
• for Markov models, the fatigue damage prediction using rainflow method is partic-
ularly simple, [70] and [33].
In the simplest case, the necessary information is the intensity of pairs of local maxima
and the following minima, summarized in the so-called Markov matrix or min-max matrix.
The dependence between other extremes is modelled using Markov chains, see [77] and
[22].
where the sum contains all cycles that have been completed up to time t. Then, the fatigue
life time T f , say, is shorter than t if the total damage at time t exceeds 1, i.e. if D(t) > 1.
In other words, T f is defined as the time when D(t) crosses level 1 for the first time.
A very simple predictor of T f is obtained by replacing K = E −1 in Eq. (5.2) by a
constant, for example the median value of K, which is equal to , under the lognormal
assumption. For high cycle fatigue, the time to failure is long, more than 105 /f0 , and then
for stationary (and ergodic and some other mild assumptions) loads, the damage Dβ (t)
can be approximated by its mean E(Dβ (t)) = dβ · t. Here dβ is the damage intensity, i.e.
how much damage is accumulated per unit time. This leads to a very simple predictor of
fatigue life time,
1
Tbf = . (5.3)
dβ
Definition 5.1 (Rainflow cycle) From each local maximum Mk one shall try to reach
above the same level, in the backward (left) and forward (right) directions, with an as small
downward excursion as possible. The minima, m− +
k and mk , on each side are identified. The
minimum that represents the smallest deviation from the maximum Mk is defined as the
corresponding rainflow minimum mrfc k . The k:th rainflow cycle is defined as (mrfc
k , Mk ).
If tk is the time of the k:th local maximum and the corresponding rainflow amplitude
is srfc
k = Mk − mrfc k , i.e. the amplitude of the attached hysteresis loop, then the total
damage at time t is
X 1 X
D(t) = = K (srfc
k )β = KDβ (t), (5.4)
N (srfc
k )
tk ≤t tk ≤t
where the sum contains all rainflow cycles that have been completed up to time t.
96 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
Mk
rf c
m−
k = mk
m+k
Figure 5.1: Definition of the rainflow cycle as given by [68].
To use Eq. (5.3) to predict the fatigue life we need the damage intensity dβ , i.e. the
damage per time unit caused by the rainflow cycles. If there are on the average f0 maxima1
per time unit, after rainflow filtering, and equally many rainflow cycles, and each rainflow
cycle causes an expected damage E(1/NS rfc ) it is clear that the damage intensity is
equal to
dβ = f0 E (S rfc )β .
Thus, an important parameter for prediction of fatigue life is the distribution of the rain-
flow amplitudes and in particular the expected value of the rainflow amplitudes raised
to the material dependent power parameter β. Wafo contains a number of routines for
handling the rainflow cycles in observed load data and in theoretical load models.
given a random process, one can find its oscillation intensity, and next one can compute
the oscillation intensity of the rainflow filtered random process, and finally, find a random
process model for the filtered signal.
8 F
7 1 4 8
6 1 2
1
5 1
2 1
4 min 4 1
3 1
2 8
1 max
F F
1 4 8 1 4 8
1 1 1
1 1
j 1 i
4 1 1 1
min 1 max 4 1
i 1 j 2
1 1 1
8 8 1 1
min Max max max min min
Figure 5.2: Part of a discrete load process where turning points are marked with
•. The scale to the left is the discrete levels. The transitions from minimum to
maximum and from maximum to minimum are collected in the min-max matrix,
F and max-min matrix, Fb , respectively. The rainflow cycles are collected in the
rainflow matrix, F rfc . The numbers in the squares are the number of observed
cycles and the grey areas are by definition always zero.
where F is a matrix valued function, defined in [72], where also an algorithm to compute
the inverse (I + F)−1 is given. The Wafo functions for computing Frfc from FmM are
mctp2rfm and mctp2rfc, while the inverse, i.e. FmM as a function of Frfc, is computed by
arfm2mctp. It might be a good idea to check the modules cycles and trgauss in Wafo
for different routines for handling these matrices.
xx_sea = load(’sea.dat’);
tp_sea = dat2tp(xx_sea);
lc_sea = tp2lc(tp_sea);
T_sea = xx_sea(end,1)-xx_sea(1,1);
100 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
0.2
1
0.15
0
0.1
−1
0.05
0 −2 −4 −2 0
−2 −1 0 1 2 10 10 10
Figure 5.3: Level crossing intensity for sea.dat
lc_sea(:,2) = lc_sea(:,2)/T_sea;
subplot(221), plot(lc_sea(:,1),lc_sea(:,2))
title(’Crossing intensity, (u, \mu(u))’)
subplot(222), semilogx(lc_sea(:,2),lc_sea(:,1))
title(’Crossing intensity, (log \mu(u), u)’)
The routines dat2tp and tp2lc take a load sequence and extracts the turning points, and
from this calculates the number of up-crossings as a function of level. The plots produced,
Figure 5.3, show the crossing intensity plotted in two common modes, lin-lin of (u, µ(u))
and log-lin of (log µ(u), u).
We shall also have use for the mean frequency f0 , i.e. the number of mean level up-
crossings per time unit, and the irregularity factor, α, which is the mean frequency divided
by the mean number of local maxima per time unit. Thus 1/α is the average number of
local maxima that occur between the mean level upcrossings.
To compute f0 we use the Matlab function interp1, (make help interp1), to find
the crossing intensity of the mean level.
m_sea = mean(xx_sea(:,2));
f0_sea = interp1(lc_sea(:,1),lc_sea(:,2),m_sea,’linear’)
extr_sea = length(tp_sea)/(2*T_sea);
alfa_sea = f0_sea/extr_sea
proc = xx_sea(1:500,:);
democc
Two windows will appear. In Demonstration Window 1, first mark the turning points
by the button TP. Then choose a local maximum (with the buttons marked +1, −1, +5, −5)
and find the corresponding cycle counts, using the buttons RFC, PT. The cycles are
visualized in the other window.
We shall now examine cycle counts in the load xx sea. From the sequence of turning
points tp we find the rainflow and min-max cycles in the data set,
5.3. CYCLE ANALYSIS WITH WAFO 101
1 1
max
max
0 0
-1 -1
-2 -2
-2 0 2 -2 0 2
min min
Figure 5.4: Rainflow and min-max cycle plots for sea.dat.
400
200
300
200
100
100
0 0
0 0.5 1 1.5 0 0.5 1 1.5 2
Figure 5.5: min-max and rainflow cycle distributions for sea.dat.
RFC_sea = tp2rfc(tp_sea);
mM_sea = tp2mm(tp_sea);
Since each cycle is a pair of a local maximum and a local minimum in the load, a
cycle count can be visualized as a set of pairs in the R2 -plane. This is done by the routine
ccplot. Compare the rainflow and min-max counts in the load in Figure 5.4 obtained by
the following commands.
subplot(121), ccplot(mM_sea)
title(’min-max cycle count’)
subplot(122), ccplot(RFC_sea)
title(’Rainflow cycle count’)
Observe that RFC contains more cycles with high amplitudes, compared to mM. This
becomes more evident in an amplitude histogram as seen in Figure 5.5.
ampmM_sea = cc2amp(mM_sea);
ampRFC_sea = cc2amp(RFC_sea);
subplot(221), hist(ampmM_sea,25);
title(’min-max amplitude distribution’)
subplot(222), hist(ampRFC_sea,25);
title(’Rainflow amplitude distribution’)
102 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
The model is easy to simulate and this is performed by the simulation routine mctpsim.
This routine simulates only the sequence of turning points and not the intermediate load
values.
T_markov = 5000;
xxD_markov = mctpsim({G_markov []},T_markov);
xx_markov = [(1:T_markov)’ u_markov(xxD_markov)’];
Here xxD_markov takes values 1, . . . , n, and by changing the scale, as in the third
command line, we get the load xx_markov, with TP-number in first column load values
between −1 and 1 in second column. The first 50 samples of the simulation is plotted in
Figure 5.6 by
plot(xx_markov(1:50,1),xx_markov(1:50,2))
0.4
0.3
0.2
0.1
−0.1
−0.2
−0.3
−0.4
−0.5
0 10 20 30 40 50
Figure 5.6: Simulated Markov sequence of turning points.
We shall later use the matrix G_markov to calculate the theoretical rainflow matrix,
but first we construct a similar sequence of turning points from a transformed Gaussian
model.
5.3. CYCLE ANALYSIS WITH WAFO 103
me = mean(xx_sea(:,2));
sa = std(xx_sea(:,2));
Hm0_sea = 4*sa;
Tp_sea = 1/max(lc_sea(:,2));
SJ = jonswap([],[Hm0_sea Tp_sea]);
The rainflow filtered data xx_herm_1 contains the turning points of xx_herm with
rainflow cycles less than h=0.2 removed. In Figure 5.7 the dashed curve connects the
remaining turning points after filtration.
Try different degree of filtering on the Ochi transformed sequence and see how it affects
the min-max cycle distribution. You can use the following sequence of commands, with
different h -values; see Figure 5.8 for the results. Note that the rainflow cycles have their
original values in the left figure but that they have been discretized to the discrete level
defined by param_h in the right figure.
tp_herm=dat2tp(xx_herm);
RFC_herm=tp2rfc(tp_herm);
104 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 10 20 30 40 50
Figure 5.7: Hermite transformed wave data together with rainflow filtered turning
points, h = 0.2.
h=0 h=0.2
2 2
1 1
max
max
0 0
−1 −1
−2 −2
−2 −1 0 1 2 −2 −1 0 1 2
min min
Figure 5.8: Rainflow cycles and rainflow filtered rainflow cycles in the transformed
Gaussian process.
mM_herm=tp2mm(tp_herm);
h=0.2;
[dtp,u,tp_herm_1]=dat2dtp(param_h,xx_herm,h);
RFC_herm_1 = tp2rfc(tp_herm_1);
subplot(121), ccplot(RFC_herm)
title(’h=0’)
subplot(122), ccplot(RFC_herm_1)
title(’h=0.2’)
0.5 0.5
Max
Max
0 0
−0.5 −0.5
−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
min min
Figure 5.9: min-max-matrix and theoretical rainflow matrix for test Markov se-
quence.
the max-min transition matrix for the sequence of turning points. This matrix can either
be directly estimated from or assigned to a load sequence, or it can be calculated from
the correlation or spectrum structure of a transformed Gaussian model by the methods
described in Section 4.3.4.
Grfc_markov=mctp2rfm({G_markov []});
A cycle matrix, e.g. a min-max or rainflow matrix, can be plotted by cmatplot. Now
we will compare the min-max and the rainflow matrices.
subplot(121),cmatplot(u_markov,u_markov,G_markov),...
axis(’square’)
subplot(122),cmatplot(u_markov,u_markov,Grfc_markov),...
axis(’square’)
Both 2D- and 3D-plots can be drawn; see the help on cmatplot. It is also possible to
plot many matrices in one call.
cmatplot(u_markov,u_markov,{G_markov Grfc_markov},3)
A plot with method = 4 gives contour lines; see Figure 5.9. Note that for high maxima
and low minima, the rainflow matrix has a pointed shape while the min-max matrix has
a more rounded shape.
cmatplot(u_markov,u_markov,{G_markov Grfc_markov},4)
subplot(121), axis(’square’),...
title(’min2max transition matrix’)
subplot(122), axis(’square’), title(’Rainflow matrix’)
106 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
We now compare the theoretical rainflow matrix with an observed rainflow matrix
obtained in the simulation. In this case we have simulated a discrete Markov chain of
turning points with states 1,...,n and put them in the variable xxD_markov. It is turned
into a rainflow matrix by the routine dtp2rfm. The comparison in Figure 5.10 between
the observed rainflow matrix and the theoretical one is produced as follows.
n = length(u_markov);
Frfc_markov = dtp2rfm(xxD_markov,n);
cmatplot(u_markov,u_markov,...
{Frfc_markov Grfc_markov*T/2},3)
subplot(121), axis(’square’)
title(’Observed rainflow matrix’)
subplot(122), axis(’square’)
title(’Theoretical rainflow matrix’)
Note that in order to compare the observed matrix Frfc_markov with the theoreti-
cal matrix Grfc_markov we have to multiply the latter by the number of cycles in the
simulation which is equal to T/2.
0.5 0.5
Max
Max
0 0
−0.5 −0.5
−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
min min
Figure 5.10: Observed and theoretical rainflow matrix for test Markov sequence.
We end this section by an illustration of the rainflow smoothing operation. The ob-
served rainflow matrix is rather irregular, due to the statistical variation in the finite
sample. To facilitate comparison with the theoretical rainflow matrix we smooth it by the
built in smoothing facility in the routine cc2cmat. To see how it works for different degrees
of smoothing we calculate the rainflow cycles by tp2rfc.
tp_markov = dat2tp(xx_markov);
RFC_markov = tp2rfc(tp_markov);
h = 0.2;
Frfc_markov_smooth = cc2cmat(param_m,RFC_markov,[],1,h);
cmatplot(u_markov,u_markov,...
{Frfc_markov_smooth Grfc_markov*T/2},4)
subplot(121), axis(’square’)
title(’Smoothed observed rainflow matrix’)
5.3. CYCLE ANALYSIS WITH WAFO 107
0.5 0.5
Max
Max
0 0
−0.5 −0.5
−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
min min
Figure 5.11: Smoothed observed and calculated rainflow matrix for test Markov
sequence.
subplot(122), axis(’square’)
title(’Theoretical rainflow matrix’)
GmM3_herm = spec2cmat(SJ,[],’Mm’,[],param_h,2);
Grfc_herm = mctp2drfm({GmM3_herm.f,[]});
In Wafo, the rainflow matrix can be calculated directly from the spectrum by the
cycle distribution routine spec2cmat by specifying the cycle parameter to ’rfc’.
Grfc_direct_herm = spec2cmat(SJ,[],’rfc’,[],[],2);
The output is a structure array which contains the rainflow matrix in the cell .f.
The min-max matrix GmM3_herm and the rainflow matrix Grfc_herm are shown to-
gether in Figure 5.12, obtained using the following commands.
108 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
Max
0 0
−0.5 −0.5
−1 −1
−1.5 −1.5
−1 0 1 2 −1 0 1 2
min min
Figure 5.12: min-max matrix and theoretical rainflow matrix for Hermite trans-
formed Gaussian waves.
u_herm = levels(param_h);
cmatplot(u_herm,u_herm,{GmM3_herm.f Grfc_herm},4)
subplot(121), axis(’square’),...
title(’min-max matrix’)
subplot(122), axis(’square’),...
title(’Theoretical rainflow matrix’)
We can also compare the theoretical min-max matrix with the observed cycle count
and the theoretical rainflow matrix with the observed one. In both comparisons we smooth
the observed matrix to get a more regular structure. We also illustrate the multi-plotting
capacity of the routine cmatplot.
tp_herm = dat2tp(xx_herm);
RFC_herm = tp2rfc(tp_herm);
mM_herm = tp2mm(tp_herm);
h = 0.2;
FmM_herm_smooth = cc2cmat(param_o,mM_herm,[],1,h);
Frfc_herm_smooth = cc2cmat(param_o,RFC_herm,[],1,h);
T_herm=xx_herm(end,1)-xx_herm(1,1);
cmatplot(u_herm,u_herm,{FmM_herm_smooth ...
GmM3_herm.f*T_herm/2;...
Frfc_herm_smooth Grfc_herm*T_herm/2},4)
subplot(221), axis(’square’)
title(’Observed smoothed min-max matrix’)
subplot(222), axis(’square’)
title(’Theoretical min-max matrix’)
subplot(223), axis(’square’)
title(’Observed smoothed rainflow matrix’)
subplot(224), axis(’square’)
title(’Theoretical rainflow matrix’)
5.3. CYCLE ANALYSIS WITH WAFO 109
1 1
Max
Max
0 0
−1 −1
−1 0 1 2 −1 0 1 2
min min
Observed smoothed rainflow matrix Theoretical rainflow matrix
2 2
1 1
Max
Max
0 0
−1 −1
−1 0 1 2 −1 0 1 2
min min
Figure 5.13: Observed smoothed and theoretical min-max matrix, and observed
smoothed and theoretical rainflow matrix for Hermite transformed Gaussian waves.
cross_herm = dat2lc(xx_herm);
alpha1 = 0.25;
alpha2 = 0.75;
xx_herm_sim1 = lc2sdat(cross_herm,500,alpha1);
cross_herm_sim1 = dat2lc(xx_herm_sim1);
subplot(211)
plot(cross_herm(:,1),cross_herm(:,2)/max(cross_herm(:,2)))
hold on
stairs(cross_herm_sim1(:,1),...
cross_herm_sim1(:,2)/max(cross_herm_sim1(:,2)))
hold off
110 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
0.5 0.5
0 0
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 −2 −1 0 1 2 3
1
0
0
−1
−1
−2 −2
0 100 200 300 400 500 0 100 200 300 400 500
Figure 5.14: Upper figures show target crossing spectrum (smooth curve) and ob-
tained spectrum (wiggled curve) for simulated process shown in lower figures. Irreg-
ularity factor: left α = 0.25, right α = 0.75.
xx_herm_sim2 = lc2sdat(500,alpha2,cross_herm);
cross_herm_sim2 = dat2lc(xx_herm_sim2);
subplot(211)
plot(cross_herm(:,1),cross_herm(:,2)/max(cross_herm(:,2)))
hold on
stairs(cross_herm_sim2(:,1),...
cross_herm_sim2(:,2)/max(cross_herm_sim2(:,2)))
hold off
title(’Crossing intensity, \alpha = 0.75’)
subplot(212)
plot(xx_herm_sim2(:,1),xx_herm_sim2(:,2))
title(’Simulated load, \alpha = 0.75’)
Here N (s) is the expected fatigue life from constant amplitude test with amplitude s,
and D(t) is the total damage at time t caused by variable amplitude cycles sk , completed
before time t. The damage intensity dβ = D(t)/t for large t is the amount of damage per
time unit.
Most information is contained in the cycle amplitude distribution, in particular in the
rainflow cycles, in which case (5.7) becomes,
X 1 X β
Skrfc , Skrfc = Mk − mrfc
D(t) = =K k /2.
Nsk
tk ≤t tk ≤t
The rainflow cycle count RFC can be directly used for prediction of expected fatigue
life. The expression Eq. (5.3) gives the expected time to fatigue failure in terms of the
material constant and the expected damage dβ per time unit. The parameters and β
can be estimated from an S-N curve. In the examples here we will use = 5.5 · 10−10 ,
β = 3.2; see Section 5.4.4. For our sea load xx_sea, the computations go directly from the
rainflow cycles as follows.
giving the time to failure 5.9693e+006 when time to failure is counted in hours (= 3600
sec). Obviously, this load causes little damage to the material with the specified properties,
since the failure time is almost 700 years – of course, the sea wave data is not a fatigue
load sequence, so the example is meaningless from a fatigue point of view.
mu_markov = cmat2lc(param_m,Grfc_markov);
muObs_markov = cmat2lc(param_m,Frfc_markov/(T_markov/2));
plot(mu_markov(:,1),mu_markov(:,2),...
muObs_markov(:,1),muObs_markov(:,2),’--’)
title(’Theoretical and observed crossing intensity ’)
The plot in Figure 5.15 compares the theoretical upcrossing intensity mu_markov with
the observed upcrossing intensity muObs_markov, as calculated from the theoretical and
observed rainflow matrices, respectively.
5.4.3 Damage
The Wafo toolbox contains a number of routines to compute and bound the damage, as
defined by (5.7), inflicted by a load sequence. The most important routines are cc2dam
and cmat2dam, which give the total damage from a cycle count and from a cycle matrix,
112 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
−1 −0.5 0 0.5 1
Figure 5.15: Crossing intensity as calculated from the Markov observed rainflow
matrix (solid curve) and from the observed rainflow matrix (dashed curve).
beta = 4;
Dam_markov = cmat2dam(param_m,Grfc_markov,beta)
DamObs1_markov = ...
cc2dam(u_markov(RFC_markov),beta)/(T_markov/2)
DamObs2_markov = ...
cmat2dam(param_m,Frfc_markov,beta)/(T_markov/2)
Here, Dam_markov is the theoretical damage per cycle in the assumed Markov chain of
turning points, while DamObs1 and DamObs2 give the observed damage per cycle, calculated
from the cycle count and from the rainflow matrix, respectively. For this model the result
should be Dam_markov = 0.0073 for the theoretical damage and very close to this value
for the simulated series.
The damage matrix is calculated by cmat2dmat. It shows how the damage is distributed
among the different cycles as illustrated in Figure 5.16. The sum of all the elements in the
damage matrix gives the total damage.
Dmat_markov = cmat2dmat(param_m,Grfc_markov,beta);
DmatObs_markov = cmat2dmat(param_m,...
Frfc_markov,beta)/(T_markov/2);}
subplot(121), cmatplot(u_markov,u_markov,Dmat_markov,4)
title(’Theoretical damage matrix’)
subplot(122), cmatplot(u_markov,u_markov,DmatObs_markov,4)
title(’Observed damage matrix’)
sum(sum(Dmat_markov))
sum(sum(DmatObs_markov))
5.4. FATIGUE DAMAGE AND FATIGUE LIFE DISTRIBUTION 113
0.5 0.5
Max
Max
0 0
−0.5 −0.5
−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
min min
Figure 5.16: Distribution of damage from different RFC cycles, from calculated the-
oretical and from observed rainflow matrix.
It is possible to calculate an upper bound on the damage intensity from the crossing
intensity only, without using the rainflow cycles. This is done by the routine lc2dplus,
which works on any theoretical or observed crossing intensity function.
Damplus_markov = lc2dplus(mu_markov,beta)
K = E−1 ,
ln N (s) = − ln E − ln − β ln s,
SN = load(’sn.dat’);
s = SN(:,1); N = SN(:,2);
loglog(N,s,’o’), axis([0 14e5 10 30])
To further check the assumptions of the S-N-model we plot the results for each s-level
separately on normal probability paper. As seen from Figure 5.17 the assumptions seem
acceptable since the data fall on almost parallel straight lines.
114 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
99.9%
3
99.5%
0 50%
30%
-1
10%
5%
-2 2%
1%
0.5%
-3 0.1%
0.01%
-4
10 11 12 13 14
30
25
s
20
15
1
10
10
0 5 10 5
10
6
10
N 5
x 10 N
plotnorm(reshape(log(N),8,5))
The estimation is performed and fitted lines plotted in Figure 5.18, with linear and
log-log plotting scales:
[e0,beta0,s20] = snplot(s,N,12);
title(’S-N-data with estimated N(s)’)
[e0,beta0,s20] = snplot(s,N,14);
title(’S-N-data with estimated N(s)’)
Here K = E −1 takes care of the uncertainty in the material. In the previous section we
used and estimated a lognormal distribution for the variation of K around , when we
assumed that ln K = ln − ln E is normal with mean ln and standard deviation σE .
The cycle sum Dβ (t) is the sum of a large number of damage terms, only dependent
on the cycles. For loads with short memory one can assume that Dβ (t) is approximately
normal,
Dβ (t) ≈ N (dβ t, σβ2 t),
where
Dβ (t) V (Dβ (t))
dβ = lim and σβ2 = lim .
t→∞ t t→∞ t
Thus the fatigue life distribution can be computed by combining the lognormal dis-
tribution for K with the normal distribution for Dβ (t). Denoting the standard normal
density and distribution functions by φ(x) and Φ(x), respectively, an approximate explicit
expression for the failure probability within time t is
σβ
Z ∞ ln + ln dβ t + ln(1 + d √ z)
β t
P(T f ≤ t) ≈ Φ φ(z) dz. (5.8)
−∞ σE
We have already estimated the material dependent parameters = e0, β = beta0, and
2
σE = s20, in the S-N data, so we need the damage intensity dβ and its variability σβ for
the acting load.
We first investigate the effect of uncertainty in the β-estimate.
beta = 3:0.1:8;
DRFC = cc2dam(RFC_sea,beta);
dRFC = DRFC/T_sea;
plot(beta,dRFC), axis([3 8 0 0.25])
title(’Damage intensity as function of \beta’)
The plot in Figure 5.19 shows the increase in damage with increasing β.
0.2
0.15
0.1
0.05
0
3 4 5 6 7 8
Figure 5.19: Increasing damage intensity from sea-load with increasing β.
Next, we shall see how the load variability affects the fatigue life. We use three different
values for σβ2 , namely 0, 0.5, and 5. With beta0, e0, s20 estimated in Section 5.4.4, we
compute and plot the following three possible fatigue life distributions.
116 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
dam0 = cc2dam(RFC_sea,beta0)/T_sea;
[t0,F0] = ftf(e0,dam0,s20,0.5,1);
[t1,F1] = ftf(e0,dam0,s20,0,1);
[t2,F2] = ftf(e0,dam0,s20,5,1);
plot(t0,F0,t1,F1,t2,F2)
Here, the fourth parameter is the value of σβ2 used in the computation; see help ftf.
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
1 1.5 2 2.5 3 3.5
10
x 10
Figure 5.20: Fatigue life distribution with sea load.
The resulting fatigue life distribution function is shown in Figure 5.20. As seen, the
curves are identical, indicating that the correct value of σβ2 is not important for such small
-values as are at hand here. Hence, one can use σβ2 = 0, and assume that the damage
accumulation process is proportional to time.
observed load is shown in the upper part. The alternating curve in the lower part shows
the switches between the two states.
0.8
0.6
0.4
0.2
X(t)
0
−0.2
−0.4
−0.6
−0.8
−1
2
Z(t)
1
0 200 400 600 800 1000 1200 1400 1600 1800 2000
time
Figure 5.21: Simulated switching load with two states. Upper graph shows the load,
and the states are indicated in the lower graph.
As long as the load is in one of the states, the rainflow cycles are made up of alternations
between turning points belonging only to that part of the load. When the state changes
there is introduced extra rainflow cycles with larger amplitudes. These extra cycles can
be seen in the total rainflow matrix, shown in Figure 5.22. The two large groups of cycles
around (min,max) = (0.5, 0.75) and (min,max) = (0, 0) come from states (1) and (2),
respectively. The contribution from the switching is seen in the small assembly of cycles
around (min,max) = (-0.5, 1).
More details on how to analyse and model switching loads can be found in [31].
1.5
1
50
40 0.5
Max
30
Level curves at:
20 0
0.1
0.25
10 0.5
1
2.5
−0.5 5
0 10
25
1 50
−1 100
−0.5 −1 250
0 0
0.5
−1 1
1.5 −1 −0.5 0 0.5 1 1.5
min Max min
Figure 5.22: 3D-plot (left) and isolines (right) of calculated rainflow matrix for
switching load in Figure 5.21. The dots in the right figure are the observed rainflow
cycles.
118 CHAPTER 5. FATIGUE LOAD ANALYSIS AND RAIN-FLOW CYCLES
Chapter 6
Of particular interest in wave analysis is how to find extreme quantiles and extreme sig-
nificant values for a wave series. Often this implies going outside the range of observed
data, i.e. to predict, from a limited number of observations, how large the extreme values
might be. Such analysis is commonly known as Weibull analysis or Gumbel analysis, from
the names of two familiar extreme value distributions. Both these distributions are part of
a general family of extreme value distributions, known as the Generalized Extreme Value
Distribution, (GEV). The Generalized Pareto Distribution (GPD) is another distribution
family, particularly adapted for Peaks Over Threshold (POT), analysis. Wafo contains
routines for fitting of such distributions, both for the Weibull and Gumbel distributions,
and for the two more general classes of distributions. For a general introduction to statis-
tical extreme value analysis, the reader is referred to [19].
This chapter illustrates how Wafo can be used for elementary extreme value analysis in
the direct GEV method and in the POT method. The example commands in Chapter6.m
take a few seconds to run. We start with a simple application of the classical Weibull and
Gumbel analysis before we turn to the general techniques.
The Weibull distribution is often used as distribution for random quantities which are the
minimum of a large number of independent (or weakly dependent) identically distributed
random variables. In practice it is used as a model for random strength of material, in
which case it was originally motivated by the principle of weakest link. Similarly, the
Gumbel distribution is used as a model for values which are maxima of a large number of
independent variables.
119
120 CHAPTER 6. EXTREME VALUE ANALYSIS
Since one gets the minimum of variables x1 , x2 , . . . , xn by changing the sign of the
maximum of the sequence −x1 , −x2 , . . . , −xn , one realises that distributions suitable for
the analysis of maxima can also be used for analysis of minima. Both the Weibull and the
Gumbel distribution are members of the class of Generalized Extreme Value distributions
(GEV), which we shall describe in Section 6.2.
and
− log{− log[FG (x; a, b)]} = x/a − b/a, (6.4)
to relate parameters to intercepts and slopes of the estimated lines. In the following sec-
tion we shall describe some more statistical techniques for parameter estimation in the
Generalized Extreme Value distribution.
6.1. WEIBULL AND GUMBEL PAPERS 121
7
2
6
5
0
log(−log(1−F))
−log(−log(F))
4
−2 3
2
−4
1
0
−6
−1
−8 −2
0.5 1 1.5 2 2.5 3 0 2 4 6 8 10 12 14
log(X) X
(a) (b)
3
20
Quantiles of standard normal
Return value
1 15
0
10
−1
−2 5
−3
0 0 1 2 3 4 5
10 10 10 10 10 10
−4 Return period
0.5 1 1.5 2 2.5
(c) (d)
Figure 6.1: Significant wave-height data: (a) on Weibull paper, (b) on Gumbel paper,
(c) logarithm of data on Normal probability paper, and (d) return values calculated
in the Gumbel model with observed data.
For example, P (Hs > s100 ) = 1 − F (s100 ) = 1/100, which means that,
• the probability that the level s100 is exceeded during one particular year is 0.01,
• on the average, the yearly maximum significant wave height exceeds s100 one year in
100 years, (note that there may be several exceedances during that particular year),
122 CHAPTER 6. EXTREME VALUE ANALYSIS
• the probability that s100 is exceeded at least one time during a time span of 100
years is 1 − (1 − 0.01)100 ≈ 1 − 1/e = 0.6321, provided years are independent.
To make it simple, we consider the Gumbel distribution, and get, from (6.5), the T -year
return value for the yearly maximum in the Gumbel distribution (6.2):
T = 1:100000;
sT = gum(2) - gum(1)*log(-log(1-1./T));
semilogx(T,sT), hold on
N = 1:length(Hs); Nmax = max(N);
plot(Nmax./N,sort(Hs,’descend’),’.’)
title(’Return values in the Gumbel model’)
xlabel(’Return priod’)
ylabel(’Return value’), hold off
In the next section we shall see a more realistic example of return value analysis. The
Atlantic data did not represent yearly maxima and the example was included only as an
alternative way to present the result of a Gumbel analysis.
1 − (1 − kx/σ)1/k , if k 6= 0,
(
GPD: F (x; k, σ) = (6.7)
1 − exp{−x/σ}, if k = 0,
for 0 < x < ∞, if k ≤ 0, and for 0 < x < σ/k, if k > 0. The Generalized Extreme Value
distribution (GEV) has distribution function
for k(x − µ) < σ, σ > 0, k, µ arbitrary. The case k = 0 is interpreted as the limit when
k → 0 for both distributions.
Note that the Gumbel distribution is a GEV distribution with k = 0 and that the
Weibull distribution is equal to a reversed GEV distribution with k = 1/c, σ = a/c, and
µ = −a, i.e. if W has a Weibull distribution with parameters (a, c) then −W has a GEV
distribution with k = 1/c, σ = a/c, and µ = −a.
The estimation of parameters in the GPD and GEV distributions is not a simple mat-
ter, and no general method exists, which has uniformly good properties for all parameter
combinations. Wafo contains algorithms for plotting of distributions and estimation of
parameters with four different methods, suitable in different regions.
6.2. THE GPD AND GEV FAMILIES 123
0.8 0.2
0.6 0.15
F(x)
0.4 0.1
0.2 0.05
0 0
0 5 10 15 0 5 10 15
x x
Residual Quantile Plot Residual Probability Plot
1
15
0.8
Model (gev)
Model (gev)
0.6
10
0.4
5 0.2
0
2 4 6 8 10 12 0 0.5 1
Empirical Empirical
Figure 6.2: Empirical distribution (solid), cdf and pdf, of significant wave-height in
atlantic data, with estimated (dashed) Generalized Extreme Value distribution,
and two diagnostic plots og goodness of fit.
gev = fitgev(Hs,’plotflag’,2)
will give estimates gev.params = [khat sigmahat muhat] of the parameters (k, σ, µ)
in the GEV distribution (6.8). The output matrix field gev.covariance will contain the
estimated covariance matrix of the estimates. The program also gives a plot of the empirical
distribution together with the best fitted distribution and two diagnostic plots that give
indications of the goodness of fit; see Figure 6.2.
The routine plotkde, which is a simplified version of the kernel density estimation
routines in kdetools, is used to compare the GEV density given estimated parameters
with a non-parametric estimate (note that plotkde can be slow for large data sets like
Hs). The commands
clf
x = linspace(0,14,200);
plotkde(Hs,[x;pdfgev(x,gev)]’)
allows a choice between the PWM-method (when method = ’pwm’) and the alternative
ML-method (when method = ’ml’). The variances of the ML estimates are usually smaller
than those of the PWM estimates. However, it is recommended that one first uses the
PWM method, since it works for a wider range of parameter values.
0.8 1
0.6
F(x)
0.4 0.5
0.2
0 0
2 3 4 5 6 2 3 4 5 6
x x
Residual Quantile Plot Residual Probability Plot
1
5
0.8
Model (gev)
Model (gev)
4.5
4 0.6
3.5 0.4
3
0.2
2.5
0
3 4 5 0 0.5 1
Empirical Empirical
Figure 6.3: GEV analysis of 285 maxima over 5 minute intervals of sea level data
Yura87.
Example 13. (Wave data from the Yura station) The Wafo toolbox contains a data
set yura87 of more than 23 hours of water level registrations at the Poseidon platform in
the Japan Sea; see help yura87. Sampling rate is 1 Hz and to smooth data we interpolate
to 4 Hz, and then group the data into a matrix with 5 minutes of data in each column,
leaving out the last, unfinished period.
xn = load(’yura87.dat’);
XI = 0:0.25:length(xn);
N = length(XI); N = N-mod(N,4*60*5);
YI = interp1(xn(:,1),xn(:,2),XI(1:N),’spline’);
YI = reshape(YI,4*60*5,N/(4*60*5)); % Each column holds
% 5 minutes of interpolated data.
It turns out that the mean value and standard deviation change slowly during the mea-
suring period, and we therefore standardize each column to zero mean and unit variance,
before we take the maximum over each 5 minute interval and perform the GEV analysis;
compare the results with those in the simpler analysis in Section 1.4.5.
Y5 = (YI-ones(1200,1)*mean(YI))./(ones(1200,1)*std(YI));
Y5M = max(Y5);
Y5gev = fitgev(Y5M,’plotflag’,2)
6.2. THE GPD AND GEV FAMILIES 125
F(x)
0.2
0.4 0.4 0.2
0 0 0 0
0 5 10 0 5 10 15 6 8 10 12 14 6 8 10 12 14
x x x x
Residual Quantile Plot Residual Probability Plot Residual Quantile Plot Residual Probability Plot
1 1
15
Model (genpar)
Model (genpar)
Model (genpar)
Model (genpar)
0.8 12 0.8
10 0.6 0.6
10
0.4 0.4
5
0.2 8 0.2
0 0 0
2 4 6 8 0 0.5 1 8 10 12 0 0.5 1
Empirical Empirical Empirical Empirical
(a) (b)
Figure 6.4: (a) Exceedances of significant wave-height data over level 3, (b) Signifi-
cant wave-heigh over level 7, in atlantic data
gpd3 = fitgenpar(Hs(Hs>3)-3,’plotflag’,1);
figure
gpd7 = fitgenpar(Hs(Hs>7),’fixpar’,...
[nan,nan,7],’plotflag’,1);
This will give estimates gpd.params = [khat sigmahat] of the parameters (k, σ) in the
Generalized Pareto distribution (6.7) based on exceedance data Hs(Hs>u)-u. The optional
output matrix gpd.covariance will contain the estimated covariance matrix of the esti-
mates. The program also gives a plot of the empirical distribution together with the best
fitted distribution; see Figure 6.4. The fit is better for exceedances over level 7 than over
3, but there are less data available, and the confidence bounds are wider.
The choice of estimation method is rather dependent on the actual parameter val-
ues. The default estimation algorithm in Wafo for estimation in the Generalized Pareto
126 CHAPTER 6. EXTREME VALUE ANALYSIS
distribution is the Maximum Product of Spacings (MPS) estimator since it works for all
values of the shape parameter and have the same asymptotic properties as the Maximum
Likelihood (ML) method (when it is valid). The Pickands’ (PKD) and Least Squares (LS)
estimator also work for any value of the shape parameter k in Eq. (6.7). The ML method
is only useful when k ≤ 1, the PWM when k > −0.5, the MOM when k > −0.25. The
variances of the ML estimates are usually smaller than those of the other estimators. How-
ever, for small sample sizes it is recommended to use the PWM, MOM or MPS if they are
valid.
It is possible to simulate independent GEV and GPD observations in Wafo. The
command series
Rgev = rndgev(0.3,1,2,1,100);
gp = fitgev(Rgev,’method’,’pwm’);
gm = fitgev(Rgev,’method’,’ml’,’start’,gp.params,...
’plotflag’,0);
x=sort(Rgev);
plotedf(Rgev,gp,{’-’,’r-’}); hold on
plot(x,cdfgev(x,gm),’--’); hold off
simulates 100 values from the GEV distribution with parameters (0.3, 1, 2), then estimates
the parameters using two different methods and plots the estimated distribution functions
together with the empirical distribution. Similarly for the GPD distribution.
Rgpd = rndgenpar(0.4,1,0,1,100);
plotedf(Rgpd); hold on
gp = fitgenpar(Rgpd,’method’,’pkd’,’plotflag’,0);
x=sort(Rgpd);
plot(x,cdfgenpar(x,gp))
gw = fitgenpar(Rgpd,’method’,’pwm’,’plotflag’,0);
plot(x,cdfgenpar(x,gw),’g:’)
gml = fitgenpar(Rgpd,’method’,’ml’,’plotflag’,0);
plot(x,cdfgenpar(x,gml),’--’)
gmps = fitgenpar(Rgpd,’method’,’mps’,’plotflag’,0);
plot(x,cdfgenpar(x,gmps),’r-.’); hold off
with four different methods of parameter estimation. The results are shown in Figure 6.5(a)
and (b).
Empirical and estimated CDF for GEV distribution Empirical and estimated CDF for GPD distribution
1 1
0.9 0.9
0.8 0.8
0.7 0.7
0.6 0.6
F(x)
F(x)
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0 0
−1 0 1 2 3 4 5 0 0.5 1 1.5 2
x x
(a) (b)
Figure 6.5: Empirical (solid) distributions and estimated (dashed) distribution func-
tions for 100 observations of GEV (a) and GPD (b) variables.
Example 13. (contd.) Applied to the yura87 data and the estimated GEV-model, we
perform the return level extrapolation by the commands,
T = 1:100000;
k = Y5gev.params(1); mu=Y5gev.params(3);
sigma = Y5gev.params(2);
sT = mu + sigma/k*(1-(log(1-1./T))^k);
semilogx(T,sT), hold
N = 1:length(Y5M); Nmax=max(N);
plot(Nmax./N,sort(Y5M,’descend’),’.’)
title(’Return values in the GEV model’)
xlabel(’Return priod’)
ylabel(’Return value’)
grid on; hold off
The result is shown in Figure 6.6, consistent with the quantile plot in Figure 6.3. 2
10
8
Return value
2 0 1 2 3 4 5
10 10 10 10 10 10
Return priod
Figure 6.6: Return level extrapolation in yura87 data depends on the good fit in the
main part of the distribution. A few deviating large observations are disturbing.
128 CHAPTER 6. EXTREME VALUE ANALYSIS
6.3 POT-analysis
Peaks Over Threshold analysis (POT) is a systematic way to analyse the distribution
of the exceedances over high levels in order to estimate extreme quantiles outside the
range of observed values. The method is based on the observation that the extreme tail
of a distribution often has a rather simple and standardized form, regardless of the shape
of the more central parts of the distribution. One then fits such a simple distribution
only to those observations that exceed some suitable level, with the hope that this fitted
distribution gives an accurate fit to the real distribution also in the more extreme parts.
The level should be chosen high enough for the tail to have approximately the standardized
form, but not so high that there remains too few observations above it. After fitting a tail
distribution one estimates the distribution of the (random) number of exceedances over
the level, and then combines the tail distribution of the individual exceedances with the
distribution for the number of exceedances to find the total tail distribution.
Another important property of the Generalized Pareto Distribution is that if k > −1,
then the mean exceedance over a level u is a linear function of u:
σ − ku
E(X − u | X > u) = .
1+k
Plotting the mean exceedance as a function of u can help on decide on a proper threshold
value. The resulting plot is called Mean residual life plot, also referred to as mean excess
plots in statistical literature. The following command illustrate this for the significant wave
height atlantic data:
plotreslife(Hs,’umin’,2,’umax’,10,’Nu’,200);
The result is plotted in Figure 6.7, and it seems to exhibit an almost linear relationship
for u ≥ 7.
3.5
Mean residual life with 95% CI
2.5
Mean Excess
2
1.5
0.5
2 3 4 5 6 7 8 9 10
Threshold
then one has to combine the distribution of the random size of individual exceedances
with the random number of exceedances N , before one can say anything about the total
maximum. If the level u is high we can, due to the Poisson approximation of the Bino-
mial distribution and neglecting the dependence of nearby values, assume N to have an
approximate Poisson distribution.
Now there is a nice relationship between the Generalized Pareto distribution and the
Generalized Extreme Value distribution in this respect: the maximum of a Poisson dis-
tributed number of independent GPD variables has a GEV distribution. This follows by
simple summation of probabilities: if N is a Poisson distributed random variable with
mean µ, and MN = max(X1 , X2 , . . . , XN ) is the maximum of N independent GPD vari-
ables then,
∞
X
P(MN ≤ x) = P(N = n) · P(X1 ≤ x, X2 ≤ x, . . . , Xn ≤ x)
n=0
∞
X µn x n
= e−µ
· 1 − (1 − k )1/k
n! σ
n=0
n o
= exp −(1 − k(x − a)/b)1/k ,
which is the Generalized Extreme Value distribution with b = σ/µk and a = σ(1 − µ−k )/k.
This means that we can estimate the distribution of the maximum significant wave
height during a winter (December – February) months from our data set Hs by fitting a
GPD to the exceedances over some level u, estimating µ by the number of exceedances N
divided by the number of months (7 × 3 × 2 = 42) and use the above relation to fit a GEV
distribution:
gpd7 = fitgenpar(Hs(Hs>7)-7,’method’,’pwm’,’plotflag’,0);
khat = gpd7.params(1);
sigmahat = gpd7.params(2);
muhat = length(Hs(Hs>7))/(7*3*2);
bhat = sigmahat/muhat^khat;
ahat = 7-(bhat-sigmahat)/khat;
x = linspace(5,15,200);
plot(x,cdfgev(x,khat,bhat,ahat))
130 CHAPTER 6. EXTREME VALUE ANALYSIS
0.9
0.8
0.7
0.6
F(x)
0.5
0.4
0.3
0.2
0.1
0
4 6 8 10 12 14 16
x
Figure 6.8: Estimated distribution functions of monthly maxima with the POT
method (solid), fitting a GEV (dashed) and the empirical distribution.
We have here used the threshold u = 7 since the exceedances over this level seem to fit
well to a GPD distribution in Figures 6.4(b) and 6.7. A larger value will improve the
Poisson approximation to the number of exceedances but give us less data to estimate the
parameters.
Since we have approximately 14 data points for 41 complete months, we can compute
the monthly maxima mm and fit a GEV distribution directly:
mm = zeros(1,41);
for i=1:41 % Last month is not complete
mm(i) = max(Hs(((i-1)*14+1):i*14));
end
gev = fitgev(mm);
plotedf(mm), hold on
plot(x,cdfgev(x,gev),’--’), hold off
The results of the two methods agree very well in this case as can be seen in Figure 6.8,
where the estimated distributions are plotted together with the empirical distribution of
mm.
6.3.3 Declustering
The POT method relies on two properties of peaks over the selected threshold: they should
occur randomly in time according to an approximate Poisson process, and the exceedances
should have an approximate GPD distribution and be approximately independent. In
practice, one does not always find a Poisson distribution for the number of exceedances.
Since extreme values sometimes have a tendency to cluster, some declustering algorithm
could be applied to identify the largest value in each of the clusters, and then use a Poisson
distribution for the number of clusters. The selected peaks should be sufficiently far apart
for the exceedances to be independent. The Wafo toolbox contains the routine decluster
to perform the declustering.
To select the clusters and check the Poisson character one can use the dispersion index,
which is the ratio between the variance and the expectation of the number of peaks. For a
Poisson distribution this ratio is equal to one. An acceptable peak separation should give
a dispersion index near one.
6.3. POT-ANALYSIS 131
Mean Excess
0.9 0.3
0.8
0.7 0.2
0.6
0.5 0.1
0.4
0.3 0
0.6 0.8 1 1.2 1.4 1.6 0.6 0.8 1 1.2 1.4 1.6
Threshold Threshold
(a) (b)
Figure 6.9: Threshold selection in POT analysis. Dashed vertical line indicates
threshold selected by the dispersion index, solid line by the residual life analysis.
Example 14. (Declustering sea data) We will extract peaks over threshold in the
sea.dat, which is a recording of almost 40 minutes of sea level data, sampled at a rate of
4[Hz].
We first define some parameters, Nmin,Tmin,Tb, to control the declustering, and to
identify the peaks that exceed 90% of the median peak size and are separated by at least
Tmin.
Next, we calculate the expected residual life and the dispersion index for thresholds
between umin and umax and select an interval which is compatible with the Poisson dis-
tribution for the number of peaks.
Nu = floor((umax-umin)/0.025)+1;
u = linspace(umin,umax,Nu);
mrl = reslife(Ev, ’u’,u);
umin0 = umin;
132 CHAPTER 6. EXTREME VALUE ANALYSIS
for io = numel(mrl.data):-1:1,
CI = mrl.dataCI(io:end,:);
if ~(max(CI(:,1))<=mrl.data(io) && mrl.data(io)<=min(CI(:,2))),
umin0 = mrl.args(io); break;
end
end
[di, threshold, ok_u] = ...
disprsnidx(tc(Ie0,:), ’Tb’, Tb, ’alpha’,0.05, ’u’,u);
The plots from the following commands are shown in Figure 6.9. It seems as if threshold
= 1.23[m] is a suitable threshold.
figure(1); plot(di)
vline(threshold) % Threshold from dispersion index
vline(umin0,’g’) % Threshold from mean residual life plot
figure(2); plot(mrl)
vline(threshold) % Threshold from dispersion index
vline(umin0,’g’) % Threshold from mean residual life plot
A GPD fit for peaks above 1.23[m] with diagnostic plot is obtained by the commands
The diagnostic plots are found in Figure 6.10. The last step is to calculate the numerical
value and some confidence intervals for a return level, and we do so for a three hour period,
180 min.
The three hour return level is thus estimated to xr = 2.02[m] with a 95% confidence
interval (1.30, 10.08). The 50% confidence bounds are (1.58, 3.05); as expected, a
high confidence leads to a very high upper limit. 2
6.3. POT-ANALYSIS 133
2
F(x)
−2
10
1
0
1.4 1.6 1.8 2 1.2 1.4 1.6 1.8 2
x x
Residual Quantile Plot Residual Probability Plot
1
Model (genpar)
Model (genpar)
1.8 0.8
0.6
1.6
0.4
1.4 0.2
0
1.4 1.6 1.8 0 0.5 1
Empirical Empirical
Figure 6.10: Diagnostic GPD plot for sea data return levels.
134 CHAPTER 6. EXTREME VALUE ANALYSIS
help statistics
What’s new
Readme - New features, bug fixes, and changes
in STATISTICS.
Parameter estimation
fitbeta - Parameter estimates for Beta data
fitchi2 - Parameter estimates for
Chi squared data
fitexp - Parameter estimates for
Exponential data
fitgam - Parameter estimates for Gamma data
fitgengam - Parameter estimates for
Generalized Gamma data
fitgenpar - Parameter estimates for
Generalized Pareto data
fitgenparml - Internal routine for fitgenpar
(ML estimates for GPD data)
fitgenparrange - Parameter estimates for GPD model
over a range of thresholds
fitgev - Parameter estimates for GEV data
fitgumb - Parameter estimates for Gumbel data
fitinvnorm - Parameter estimates for
Inverse Gaussian data
fitlognorm - Parameter estimates for Lognormal data
fitmarg2d - Parameter estimates for MARG2D data
fitmargcnd2d - Parameter estimates for DIST2D data
fitnorm - Parameter estimates for Normal data
fitray - Parameter estimates for Rayleigh data
fitraymod - Parameter estimates for
Truncated Rayleigh data
fitt - Parameter estimates for
Student’s T data
fitweib - Parameter estimates for Weibull data
fitweib2d - Parameter estimates for 2D Weibull data
fitweibmod - Parameter estimates for
truncated Weibull data
6.4. SUMMARY OF STATISTICAL PROCEDURES IN WAFO 135
Moments
mombeta - Mean and variance for the Beta
distribution
mombin - Mean and variance for the Binomial
distribution
momchi2 - Mean and variance for the Chi squared
distribution
momexp - Mean and variance for the Exponential
distribution
momf - Mean and variance for Snedecor’s F
distribution
momfrech - Mean and variance for the Frechet
distribution
momgam - Mean and variance for the Gamma
distribution
momgengam - Mean and variance for the Generalized
Gamma distribution
momgenpar - Mean and variance for the Generalized
Pareto distribution
momgev - Mean and variance for the GEV
distribution
momgumb - Mean and variance for the Gumbel
distribution
momhyge - Mean and variance for the Hypergeometric
distribution
mominvnorm - Mean and variance for the Inverse
Gaussian distribution
momlognorm - Mean and variance for the Lognormal
distribution
mommarg2d - Mean and variance for the MARG2D
distribution
mommargcnd2d - Mean and variance for the MARGCND2D
distribution
momnorm - Mean and variance for the Normal
distribution
mompois - Mean and variance for the Poisson
distribution
momray - Mean and variance for the Rayleigh
distribution
momt - Mean and variance for the Student’s T
distribution
momweib - Mean and variance for the Weibull
distribution
momweib2d - Mean and variance for the 2D Weibull
distribution
140 CHAPTER 6. EXTREME VALUE ANALYSIS
Extremes
decluster - Decluster peaks over threshold values
extremalidx - Extremal Index measuring the dependence
of data
findpot - Find indices to Peaks over threshold
values
fitgev - Parameter estimates for GEV data
fitgenpar - Parameter estimates for Generalized
Pareto data
prb2retper - Return period from Probability of
exceedance
retper2prb - Probability of exceedance from return
period
Threshold selection
fitgenparrange - Parameter estimates for GPD model vs
thresholds
disprsnidx - Dispersion Index vs threshold
reslife - Mean Residual Life, i.e., mean excesses
vs thresholds
6.4. SUMMARY OF STATISTICAL PROCEDURES IN WAFO 141
Regression models
logit - Logit function.
logitinv - Inverse logit function.
regglm - Generalized Linear Model regression
reglm - Fit multiple Linear Regression Model.
reglogit - Fit ordinal logistic regression model.
regnonlm - Non-Linear Model Regression
regsteplm - Stepwise predictor subset selection for
Linear Model regression
Factor analysis
princomp - Compute principal components of X
Descriptive Statistics
ranktrf - Rank transformation of data material.
spearman - Spearman’s rank correlation coefficient
mean - Computes sample mean (Matlab)
median - Computes sample median value (Matlab)
std - Computes standard deviation (Matlab)
var - Computes sample variance (Matlab)
var2corr - Variance matrix to correlation matrix
conversion
cov - Computes sample covariance matrix
(Matlab)
corrcoef - Computes sample correlation coefficients
(Matlab toolbox)
skew - Computes sample skewness
kurt - Computes sample kurtosis
lmoment - L-moment based on order statistics
percentile - Empirical quantile (percentile)
iqrange - Computes the Inter Quartile Range
range - Computes the range between the maximum
and minimum values
Statistical plotting
clickslct - Select points in a plot by clicking
with the mouse
histgrm - Plot histogram
plotbox - Plot box-and-whisker diagram
plotdensity - Plot density.
plotexp - Plot data on Exponential distribution
paper
142 CHAPTER 6. EXTREME VALUE ANALYSIS
Hypothesis Tests
anovan - multi-way analysis of variance (ANOVA)
testgumb - Tests if shape parameter in a GEV is
equal to zero
testmean1boot - Bootstrap t-test for the mean equal to 0
testmean1n - Test for mean equals 0 using
one-sample T-test
testmean2n - Two-sample t-test for mean(x) equals
mean(y)
testmean1r - Wilcoxon signed rank test for
H0: mean(x) equals 0
testmean2r - Wilcoxon rank-sum test for
H0: mean(x) equals mean(y)
Design of Experiments
yates - Calculates main and interaction effects
using Yates’ algorithm.
ryates - Reverse Yates’ algorithm to give
estimated responses
fitmodel - Fits response by polynomial
alias - Alias structure of a fractional design
cdr - Complete Defining Relation
cl2cnr - Column Label to Column Number
cnr2cl - Column Number to Column Label
ffd - Two-level Fractional Factorial Design
getmodel - Return the model parameters
sudg - Some Useful Design Generators
plotresponse - Cubic plot of responses
nplot - Normal probability plot of effects
Misc
comnsize - Calculates common size of all non-scalar
arguments
dgammainc - Incomplete gamma function with derivatives
gammaincln - Logarithm of incomplete gamma function.
parsestatsinput - Parses inputs to pdfxx, prbxx, invxx and
rndxx functions
createfdata - Distribution parameter struct constructor
getdistname - Return the distribution name
Demo
demofitgenpar - Script to check the variance of estimated
parameters
144 CHAPTER 6. EXTREME VALUE ANALYSIS
Appendix A
Histograms are among the most popular ways to visually present data. They are particular
examples of density estimates and their appearance depends on both the choice of origin
and the width of the intervals (bins) used. In order for the histogram to give useful infor-
mation about the true underlying distribution, a sufficient amount of data is needed. This
is even more important for histograms in two dimensions or higher. Also the discontinuity
of the histograms may cause problems, e.g., if derivatives of the estimate are required.
An effective alternative to the histogram is the kernel density estimate (KDE), which
may be considered as a “smoothed histogram”, only depending on the bin-width and not
depending on the origin, see [80].
where n is the number of datapoints, X1 , X2 , . . . , Xn , is the data set, and hs is the smooth-
ing parameter or window width. The kernel function Kd is usually a unimodal, symmetric
probability density function. This ensures that the KDE itself is also a density. How-
ever, kernels that are not densities are also sometimes used [see 92], but these are not
implemented in the Wafo toolbox.
To illustrate the method, consider the kernel estimator as a sum of “bumps” placed
at the observations. The shape of the bumps are given by the kernel function while the
width is given by the smoothing parameter, hs . Fig. A.1 shows a KDE constructed using
7 observations from a standard Gaussian distribution with a Gaussian kernel function.
One should note that the 7 points used here, is purely for clarity in illustrating how the
kernel method works. Practical density estimation usually involves much higher number
of observations.
Fig. A.1 also demonstrates the effect of varying the smoothing parameter, hs . A too
small value for hs may introduce spurious bumps in the resulting KDE (top), while a
145
146 APPENDIX A. KERNEL DENSITY ESTIMATION
too large value may obscure the details of the underlying distribution (bottom). Thus the
choice of value for the smoothing parameter, hs , is very important. How to select one will
be elaborated further in the next section.
The particular choice of kernel function, on the other hand, is not very important since
suboptimal kernels are not suboptimal by very much, [see 92, pp. 31]. However, the kernel
that minimizes the mean integrated square error is the Epanechnikov kernel, and is thus
chosen as the default kernel in the software, see Eq. (A.8). For a discussion of other kernel
functions and their properties, see [92].
where Φ−1 is the standard normal quantile function. The use of σ bIQR guards against
outliers if the distribution has heavy tails. A reasonable approach is to use the smaller of
σ
bs and σbIQR in order to lessen the chance of oversmoothing, [see 80, pp. 47].
Various other automatic methods for selecting hs are available and are discussed in
[80] and in more detail in [92].
hs = 0.31
0.5
0.4
0.3
Density
0.2
0.1
0
−4 −3 −2 −1 0 1 2 3 4
hs = 0.63
0.5
0.4
0.3
Density
0.2
0.1
0
−4 −3 −2 −1 0 1 2 3 4
hs = 1.3
0.5
0.4
0.3
Density
0.2
0.1
0
−4 −3 −2 −1 0 1 2 3 4
x
Figure A.1: Smoothing parameter, hs , impact on KDE: True density (dotted) com-
pared to KDE based on 7 observations (solid) and their individual kernels (dashed).
148 APPENDIX A. KERNEL DENSITY ESTIMATION
easily can be estimated using the basic KDE. One would then backtransform the estimate
of g to obtain the estimate for f .
Suppose that Yi = t(Xi ), where t is an increasing differentiable function defined on
the support of f . Then a standard result from statistical distribution theory is that
A simple illustrative example comes from the problem of estimating the Rayleigh
density. This density is very difficult to estimate by direct kernel methods. However, if we
√
apply the transformation Yi = Xi to the data, then the normal plot of the transformed
data, Yi , becomes approximately linear. Fig. A.2 shows that the transformation KDE is a
better estimate around 0 than the ordinary KDE.
0.6 0.6
0.5 0.5
Density
Density
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0 0
0 1 2 3 4 5 0 1 2 3 4 5
where H is a symmetric positive definite d×d matrix called the bandwidth matrix. A simpli-
fication of Eq. (A.6) can be obtained by imposing the restriction H = diag(h21 , h22 , . . . , h2d ).
Then Eq. (A.6) reduces to
n
1 X x − Xj 1 x − Xj 2 x − Xj d
fX (x; h) =
b Kd , ,..., , (A.7)
n ni=1 hi
Q
h1 h2 hd
j=1
The multivariate Epanechnikov kernel also forms the basis for the optimal spherically
symmetric multivariate kernel and is given by
d+2
1 − xT x 1xT x≤1 ,
Kd (x) = (A.8)
2 vd
Appendix B
0
1
2
Knowledge of which kind of spectral density is suitable to describe sea state data are well
3
established from experimental studies. Qualitative considerations of wave measurements
0
indicate that the spectra may be divided into 3 parts, (see Fig. B.1):
1
2 dominated by wind sea but significantly influenced by swell components.
1. Sea states
3
2. More or less pure wind seas or, possibly, swell component located well inside the
0
wind frequency band.
1
3. Sea states
2 more or less dominated by swell but significantly influenced by wind sea.
3
15
Impossible
area
10
S(w)
S(w)
S(w)
0
10
Hm0
0 w w w
5
10 5 1 2 3
0
5
0
0 5 10 15 20 25
Tp
Figure B.1: Qualitative indication of spectral variability.
One often uses some parametric form of the spectral density. The three most important
parametric spectral densities implemented in Wafo will be described in the following
sections.
151
152 APPENDIX B. STANDARDIZED WAVE SPECTRA
A standard value for the peakedness parameter, γ, is 3.3. However, a more correct
approach is to relate γ to Hm0 and Tp , and use
n o
γ = exp 3.484 1 − 0.1975 (0.036 − 0.0056 Tp / Hm0 ) Tp4 /Hm0
p
2
. (B.2)
where SJ+ is the Jonswap spectrum defined by Eq. (B.1). The parameters Hm0, i , ωp, i , Ni ,
Mi , and αi for i = 1, 2, are the significant wave height, angular peak frequency, spectral
shape and normalization parameters for the primary and secondary peak, respectively.
These parameters are fitted to 20 000 spectra divided into 146 different classes of Hm0
and Tp obtained at the Statfjord field in the North Sea in the period from 1980 to 1989.
The measured Hm0 and Tp values for the data range from 0.5 to 11 meters and from 3.5
to 19 seconds, respectively.
B.2. TORSETHAUGEN SPECTRUM 153
Given Hm0 and Tp these parameters are found by the following steps. The borderline
between wind dominated and swell dominated sea states is defined by the fully developed
sea, for which
1/3
Tp = Tf = 6.6 Hm0 , (B.5)
while for Tp < Tf , the local wind sea dominates the spectral peak, and if Tp > Tf , the
swell peak is dominating.
For each of the three types a non-dimensional period scale is introduced by
Tf − Tp
l u = ,
Tf − Tlu
where
( √
2 Hm0 if Tp ≤ Tf (Lower limit),
Tlu =
25 if Tp > Tf (Upper limit),
defines the lower or upper value for Tp . The significant wave height for each peak is given
as
q
Hm0,1 = Rpp Hm0 Hm0,2 = 1 − Rpp 2 H
m0 ,
where
l u 2
Rpp = 1 − A10 exp − + A10 ,
A1
( (
0.5 if Tp ≤ Tf , 0.7 if Tp ≤ Tf ,
A1 = A10 =
0.3 if Tp > Tf , 0.6 if Tp > Tf .
Tp, 1 = Tp ,
Tf + 2
if Tp ≤ Tf ,
Tp, 2 = (N −1)/M2 /Γ((N −1)/M ) 1/(N2 −1)
M2 (N2 /M2 )N 2
2 2
if Tp > Tf ,
1.28 (0.4) 2 {1−exp(−Hm0, 2 /3)}
where
0.857
2 π Hm0,
2
1
if Tp ≤ Tf ,
g Tp
γT = 0.857
1 + 6 lu 2 πg H
T2
m0
if Tp > Tf .
f
154 APPENDIX B. STANDARDIZED WAVE SPECTRA
Preliminary comparisons with spectra from other areas indicate that the empirical pa-
rameters in the Torsethaugen spectrum can be dependent on geographical location. This
spectrum is implemented as a matlab function torsethaugen.m in the Wafo toolbox.
where Hm0, i , ωp, i , and λi for i = 1, 2, are significant wave height, angular peak frequency,
and spectral shape parameter for the low and high frequency components, respectively.
The values of these parameters are determined from an analysis of data obtained in
the North Atlantic. The source of the data is the same as that for the development of
the Pierson-Moskowitz spectrum, but analysis is carried out on over 800 spectra including
those in partially developed seas and those having a bimodal shape. In contrast to the
Jonswap and Torsethaugen spectra, which are parameterized as function of Hm0 and Tp ,
Ochi and Hubble, [59] gave, from a statistical analysis of the data, a family of wave spectra
consisting of 11 members generated for a desired sea severity (Hm0 ) with the coefficient
of 0.95.
The values of the six parameters as functions of Hm0 are given as:
where d1 = 0 and the remaining empirical constants ai , bi (i = 1, 2), and d2 , are given in
Table B.1. (See also the function ochihubble.m in the Wafo toolbox.)
Member no. 1 given in Table B.1 defines the most probable spectrum, while member
no. 2 to 11 define the 0.95 percent confidence spectra.
A significant advantage of using a family of spectra for design of marine systems is that
one of the family members yields the largest response such as motions or wave induced
forces for a specified sea severity, while anothers yield the smallest response with confidence
coefficient of 0.95.
Rodrigues and Soares [67], used the Ochi-Hubble spectrum with 9 different param-
eterizations representing 3 types of sea state categories: swell dominated (a), wind sea
dominated (b) and mixed wind sea and swell system with comparable energy (c). Each
category is represented by 3 different inter-modal distances between the swell and the
B.3. OCHI-HUBBLE SPECTRUM 155
Table B.1: Empirical parameter values for the Ochi-Hubble spectral model.
wind sea spectral components. These three subgroups are denoted by I, II and III, respec-
tively. The exact values for the six parameters are given in Table B.2. (See the function
ohspec3.m in the Wafo toolbox.)
Wave models
Generally the wind generated sea waves is a non-linear random process. Non-linearities
are important in the wave-zone, i.e., from the crest to 1-2 wave amplitudes below the
trough. Below this zone linear theory is acceptable. However, there are unsolved physical
problems associated with the modelling of breaking waves. In practice, linear theory is
used to simulate irregular sea and to obtain statistical estimates. Often a transformation
of the linear model is used to emulate the non-linear behavior of the sea surface, but as
faster computers are becoming available also higher order approximations will become
common in ocean engineering practice. In the following sections we will outline these wave
models. Only long-crested sea is used here either recorded at a fixed spatial location or at
a fixed point in time.
E[|An |2 ] = 2 Sηη
+
(|ωn |)∆ω (C.3)
The individual frequencies, ωn and wavenumbers, kn are related through the linear dis-
persion relation
ω 2 = g k tanh(k d) (C.4)
157
158 APPENDIX C. WAVE MODELS
where g and d are the acceleration of gravity and water depth, respectively. For deep water
Eq. (C.4) simplifies to
ω2 = g k (C.5)
It implies the following relation between the wave frequency spectrum and the wave num-
ber spectrum
+ 2ω +
Sηη (ω) = S (k) (C.6)
g ηη
Without loss of generality it is assumed that ηl has zero expectation. It is also assumed
that η is ergodic, i.e., any ensemble average may be replaced by the corresponding time-
space average. This means that one single realization of η is representative of the random
field. Here it is also assumed ω−j = −ωj , k−j = −kj and A−j = Āj where Āj is the
complex conjugate of Aj . The matlab program spec2sdat.m in WAFO use the Fast Fourier
Transform (FFT) to evaluate Eq. (C.1).
the simulated data to have a prescribed target spectrum. Thus a more correct approach
is to eliminate the second order effects from the spectrum before using it in the non-linear
simulation. One way to do this is to extract the linear components from the spectrum by a
fix-point iteration on the spectral density using the non-linear simulation program so that
the simulated data will have approximately the prescribed target spectrum. This method
is implemented as matlab function spec2linspec.m available in the WAFO toolbox. To
accomplish convergence, the same seed is used in each call of the non-linear simulation
program.
0
10
−1
10
−2
10
−3
10
0 0.5 1 1.5 2 2.5 3
Frequency [rad/s]
Figure C.1: Target spectrum, ST (ω), (solid) and its linear component, SL (ω) (dash-
dot) compared with STN LS (dash) and SLN LS (dot), i.e., spectra of non-linearly simu-
lated data using input spectrum ST (ω) (method 1) and SL (ω) (method 2), respec-
tively.
Fig.C.1 demonstrates the differences in the spectra obtained from data simulated using
these methods. The solid line is the target spectrum, ST (ω), and the dash-dotted line is
its linear component, SL (ω), obtained using method 2. The spectra STN LS (dashed) and
SLN LS (dotted) are estimated from non-linearly simulated data using the ST (ω) and SL (ω)
spectra, respectively. As expected STN LS is higher than ST , while SLN LS is indistinguishable
from ST . It is also worth noting that the difference between the spectra is small, but
have some impact on the higher order moments. For instance, the 2 and 4 parameters
calculated from STN LS increase with 6.1% and 2.5%, respectively. The corresponding values
calculated from SLN LS increase with only 0.5% and 0.2%, respectively.
The small difference between ST (ω) and SL (ω) also lends some support to the view
noted earlier, that the difference frequency effect can not fully explain the high values of
the spectrum in the lower frequency part as found by [97].
The effects these methods have are discussed further in [15] and especially on wave
steepness parameters. The second order non-linear model explained here is implemented in
WAFO as spec2nlsdat.m. This is a very efficient implementation that calculate Eqs. (C.7)
to (C.9) in the bi-frequency domain using a one-dimensional FFT. This is similar to the
WAVSIM program of [56], but is made even more efficient by summing over non-zero
spectral values only and by eliminating the need for saving the computed results to the
hard drive. WAVSIM use 40 s to evaluate a transform with 32000 time steps/frequencies
compared with 2 s for spec2nlsdat.m on a Pentium M 1700 MHz with 1 GB of RAM. Thus
160 APPENDIX C. WAVE MODELS
the use of second order random waves should now become common in ocean engineering
practice.
spec2nlsdat.m also allows finite water depth and any spectrum as input, in contrast
to WAVSIM, which only uses infinite water depth and the JONSWAP spectrum.
where µ and σ are the mean and standard deviation, respectively, of the true process.
The unitless coefficients c3 and c4 are chosen so that the transformed model match the
skewness, ρ3 , and excess, ρ4 , of the true process. [96] improved the parameterizations by
minimizing lack-of-fit errors on ρ3 and ρ4 , giving
ρ3 1 − 0.015 |ρ3 | + 0.3 ρ23
c3 = (C.13)
6 1 + 0.2 ρ4
c4 = 0.1 (1 + 1.25 ρ4 )1/3 − 1 c41 (C.14)
1−0.1 (ρ4 +3)0.8
1.43 ρ23
c41 = 1 − (C.15)
ρ4
These results apply for 0 ≤ 3/2 ρ23 < ρ4 < 12, which include most cases of practical interest.
One may then estimate c3 and c4 using the sample skewness, ρ̂3 , but restrict ρ4 so that
ρ4 = min(max(3 ρ̂23 /2, ρ̂4 ), min(4 (4ρ̂3 /3)2 , 12)). ρ̂4 is the sample excess and (4ρ̂3 /3)2 is the
leading excess contribution for narrow banded Stokes waves as found by [52].
Bibliography
[1] S. Åberg and G. Lindgren. Height distribution of stochastic Lagrange ocean waves.
Probabilistic Engineering Mechanics, 23(4):359–363, 2008. 3.1.2
[4] P. Ailliot and V. Monbet. Markov-swithching autoregressive models for wind time
series. Eniviron. Modell. Sorftw., 30:92–101, 2012. 4
[6] J.-M. Azaı̈s and M. Wschebor. Level sets and extrema of random processes and fields.
John Wiler and Sons, Hoboken, 2009. 3.1.2
[7] A. Baxevani, K. Podgórski, and I. Rychlik. Velocities for moving random surfaces.
Prob. Eng. Mech., 18(3):251–271, 2003. 3.1.2
[8] A. Baxevani and I. Rychlik. Maxima for Gaussian seas. Ocean Eng., 33:895–911,
2006. 3.1.2
[9] C. Beardah and M. Baxter. MATLAB routines for kernel density estimation and the
graphical representation of archaeological data. Analecta Praehistorica Leidensia,
pages 179–184, 1996. A.2
[10] S. Borg. Xs - a statistical program package in splus for extreme-value analysis. Dept.
of Mathematical Statistics, Lund University, 1992. 6.2.1, 6.2.2
161
162 BIBLIOGRAPHY
[12] P. Brodtkorb, D. Myrhaug, and H. Rue. Joint distribution of wave height and wave
crest velocity from reconstructed data. In Proc. 9’th Int. Offshore and Polar Eng.
Conf., ISOPE, Brest, France, volume III, pages 66–73, June 1999. 3
[13] P. Brodtkorb, D. Myrhaug, and H. Rue. Joint distributions of wave height and wave
steepness parameters. In Proc. 27’th Int. Conf. on Coastal Eng., ICCE, Sydney,
Australia, volume 1, pages 545–558, July 2000. Paper No. 162. C.2
[14] P. Brodtkorb, D. Myrhaug, and H. Rue. Joint distribution of wave height and wave
crest velocity from reconstructed data with application to ringing. Int. J. Offshore
and Polar Eng., 11(1):23–32, March 2001. 1.1, 3
[17] E. Buows, H. Gunther, W. Rosenthal, and C. Vincent. Similarity of the wind wave
spectrum in finite depth water: 1 spectral form. J. Geophys. Res., 90(C1):975–986,
1985. 2
[20] C. R. Dietrich and G. N. Newsam. Fast and exact simulation of stationary Gaussian
processes through circulant embedding of the covariance matrix. SIAM J. Sci. Comp.,
18(4):1088–1107, July 1997. 1.3
[21] M. Frendahl, G. Lindgren, and I. Rychlik. Fatigue analysis toolbox, 1993. Dept. of
Math. Stat., Lund Univ., Sweden. 1.1
[22] M. Frendahl and I. Rychlik. Rainflow analysis: Markov method. Int. J. Fatigue,
15:265–272, 1993. 1.3, 1.4.4, 5.1.1
[24] A. Genz and K.-S. Kwong. Numerical evaluation of singular multivariate normal
distributions. J. Stat. Comp. Simul., 68:1–21, 2000. 4.2.2
[25] J. Hamilton. A new approach to the economic analysis analysis of nonstationary time
series and the business cycle. Econometrica, 57:357–384, 1989. 4
BIBLIOGRAPHY 163
[27] S. Haver and K. A. Nyhus. A wave climate description for long term response calcu-
lations. In Proc. 5’th Int. Symp. on Offshore Mech. and Arctic Eng., OMAE, Tokyo,
Japan, volume 4, pages 27–34, 1986. B.1
[28] J. Hosking and J. Wallis. Parameter and quantile estimation for the generalized
pareto distribution. Technometrics, 1987. 6.2.2
[30] In Wafo module lagrange. Wafo Lagrange – a Wafo module for analysis of random
Lagrange waves, 2017. (document)
[31] P. Johannesson. Matlab Toolbox: Rainflow Cycles for Switching Processes, V. 1.0.
Department of Mathematical Statistics, Lund Institute of Technology, 1997. TFMS–
7008. 5.4.6
[32] P. Johannesson. Rainflow cycles for switching processes with Markov structure. Prob.
Eng. Inform. Sci., 12(2):143–175, 1998. 1.3, 4, 5.4.6
[33] P. Johannesson. Rainflow Analysis of Switching Markov Loads. PhD thesis, Math.
Stat., Center for Math. Sci., Lund Univ., Sweden, 1999. 1.1, 1.3, 5.1.1, 5.4.6
[36] R. Langley. A statistical analysis of non-linear random waves. Ocean Eng., 14(5):389–
407, 1987. C.2
[37] G. Lindgren. Slepian models for the stochastic shape of individual Lagrange sea
waves. Advances in Applied Probability, 38(2):430–450, 2006. 3.1.2
[40] G. Lindgren. Stationary stochastic processes – theory and applications. CRC Press,
Boca Raton, 2013. 2
164 BIBLIOGRAPHY
[41] G. Lindgren. Gaussian integrals and Rice series in crossing distributions – how to
compute statistical distributions of excursions, extremes, oscillations and other topo-
graphical features of Gaussian processes, May 2017. submitted. 4.2.2
[42] G. Lindgren and S. Åberg. First Order Stochastic Lagrange Model for Asymmetric
Ocean Waves. Journal of Offshore Mechanics and Arctic Engineering, 131(3):031602–
1–031602–8, 2009. 3.1.2
[43] G. Lindgren, D. Bolin, and F. Lindgren. Non-traditional stochastic models for ocean
waves. The European Physical Journal Special Topics, 185:209–224, 2010. 3.1.2
[44] G. Lindgren and K. Broberg. Cycle range distributions for Gaussian processes exact
and approximative results. Extremes, 7(1):69, 2004. 4, 4.3.3
[45] G. Lindgren, H. Rootzén, and M. Sandsten. Stationary stochastic processes for sci-
entists and engineers. CRC Press, Boca Raton, 2014. 2, 4
[46] G. Lindgren and I. Rychlik. Slepian models and regression approximations in crossing
and extreme value theory. Int. Stat. Rev., 59:195–225, 1991. 1.1, 1.4.4, 4.2.1, 4.2.2
[47] G. Lindgren, I. Rychlik, and M. Prevosto. The relation between wave length and
wave period distributions in random Gaussian waves. Int. J. Offshore and Polar
Eng., 8(4):258–264, December 1998. 4.2.1
[48] M. Longuet-Higgins. On the joint distribution wave periods and amplitudes of sea
waves. J. Geophys. Res., 80:2688–2694, 1975. 3.3.2
[50] U. Machado. Probability density functions for nonlinear random waves and responses.
Ocean Eng., 3(8):1027–1050, 2003. C.3
[51] U. Machado and I. Rychlik. Wave statistics in nonlinear random sea. Extremes,
6(6):125–146, 2003. 3.3.3
[53] S. R. Massel. Ocean Surface Waves: Their Physics and Prediction, volume 11 of
Advances on ocean engineering. World Scientific, 1996. 1.3
[54] M. Matsuishi and T. Endo. Fatigue of metals subject to varying stress. Paper
presented to Japan Soc. Mech. Engrs, Jukvoka, Japan, 1968. 5.1.3
[55] C. Mercardier. Numerical bounds for the distribution of maxima of some one- and
two-parameter gaussian processes. Adv. Appl. Probab., 38:149–170, 2006. 3.1.2
[56] A. Nestegård and T. Stokka. A third-order random wave model. In Proc. 5’th Int.
Offshore and Polar Eng. Conf., ISOPE, The Hague, The Netherlands, volume III,
pages 136–142, June 1995. C.2, C.2
BIBLIOGRAPHY 165
[57] M. Ochi and K. Ahn. Non-Gaussian probability distribution of coastal waves. In Proc.
24’th Int. Conf. on Coastal Eng., ICCE, Kobe, Japan, volume 1, pages 482–496, 1994.
C.3
[59] M. Ochi and E. Hubble. On six parameter wave spectra. In Proc. 15’th Int. Conf.
on Coastal Eng., ICCE, volume 1, pages 301–328, 1976. B.3
[60] M. K. Ochi. Ocean Waves, The Stochastic Approach. Ocean Tech. Series 6. Campridge
University Press, 1998. 3.1.1
[61] J. Pickands. Statistical inference using extreme order statistics. Annals of Statistics,
3:119–131, 1975. 6.2.2
[62] K. Podgórski and I. Rychlik. Spatial size of waves. Marine Structures, 50:55–71,
2016. 3.1.2
[63] K. Podgórski, I. Rychlik, and U. Machado. Exact distributions for apparent waves in
irregular seas. Ocean Eng., 27(1):979–1016, 2000. 1.1, 4
[64] K. Podgórski, I. Rychlik, J. Rydén, and E. Sjö. How big are the big waves? Int. J.
Offshore and Polar Eng., 10:161–169, 2000. 1.1
[65] K. Podgórski, I. Rychlik, and E. Sjö. Statistics for velocities of Gaussian waves. Int.
J. Offshore and Polar Eng., 10(2):91–98, 2000. 3.1.2
[66] P. Prescott and A. Walden. Maximum likelihood estimation of the parameters of the
generalized extreme-value distribution. Biometrika, 67:723–724, 1980. 6.2.1
[67] G. Rodriguez and C. Guedes Soares. Wave period distribution in mixed sea states. In
Proc. ETCE/OMAE2000 Joint Conf. Energy for the New millenium, New Orleans,
LA, 2000. B.3
[68] I. Rychlik. A new definition of the rainflow cycle counting method. Int. J. Fatigue,
9:119–121, 1987. 5.1.3, 5.1
[70] I. Rychlik. Rain-Flow-Cycle distribution for ergodic load processes. SIAM J. Appl.
Math., 48:662–679, 1988. 5.1.1
[71] I. Rychlik. Confidence bands for linear regressions. Comm. Stat. Simul., 21(2):333–
352, 1992. 4.2.2
[72] I. Rychlik. Simulation of load sequences from rainflow matrices: Markov method.
Stat. Research Report 29, Dept. of Mathematical Statistics, Lund, Sweden, 1995.
5.2.1, 5.2.3
166 BIBLIOGRAPHY
[74] I. Rychlik and M. R. Leadbetter. Analysis of ocean waves by crossing- and oscillation-
intensities. In Proc. 7’th Int. Offshore and Polar Eng. Conf., ISOPE, Honolulu, USA,
1997. 3.3.3
[75] I. Rychlik and G. Lindgren. CROSSREG – a technique for first passage and wave
density analysis. Prob. Eng. Inform. Sci., 7:125–148, 1993. 1.1
[77] I. Rychlik, G. Lindgren, and Y. Lin. Markov based correlations of damage cycles in
Gaussian and non-Gaussian loads. Prob. Eng. Mech., 10(2):103–115, 1995. 5.1.1
[80] B. W. Silverman. Density Estimation for Statistics and Data Analysis. Number 26
in Monographs on Stat. and Appl. Prob. Chapman and Hall, 1986. 1.3, A, A.1.1
[81] E. Sjö. Crossings and Maxima in Gaussian Fields and Seas. PhD thesis, Math. Stat.,
Center for Math. Sci., Lund Univ., Sweden, 2000. ISBN91-628-4299-4. 3.1.2
[84] M. A. Tayfun. Breaking limited wave heights. J. Waterway, Port, Coastal and Ocean
Div., ASCE, 107(2):59–69, May 1981. 1.3
[85] M. A. Tayfun. Distribution of large wave heights. J. Waterway, Port, Coastal and
Ocean Eng., ASCE, 116(6):686–707, November/December 1990. 1.3
[86] K. Torsethaugen. A two peak wave spectral model. In Proc. 12’th Int. Conf. on
Offshore Mech. and Arctic Eng., OMAE, Glasgow, Scotland, 1993. B.2
[87] K. Torsethaugen. Model for doubly peaked wave spectrum. Lifetime and fatigue
strength estimation implications. Int. Workshop on Floating structures in Coastal
zone, Hiroshima, November 1994. B.2
BIBLIOGRAPHY 167
[88] K. Torsethaugen. Model for doubly peaked wave spectrum. Technical Report No.
STF22 A96204, SINTEF Civ. and Env. Eng., Trondheim, Norway, 1996. 1.4, B.2
[89] K. Torsethaugen et al. Characteristica for extreme sea states on the Norwegian
continental shelf. Technical Report No. STF60 A84123, Norwegian Hydrodyn. Lab.,
Trondheim, 1984. B.1
[90] M. Tucker. Recommended standard for wave data sampling and near-real-time pro-
cessing. Ocean Eng., 20(5):459–474, 1993. 6
[91] WAFO-group. WAFO - a matlab toolbox for analysis of random waves and loads - a
tutorial. http://www.maths.lth.se/matstat/wafo/, 2000. Math. Stat., Center for
Math. Sci., Lund Univ., Sweden. (document)
[92] M. Wand and M. Jones. Kernel Smoothing. Number 60 in Monographs on Stat. and
Appl. Prob. Chapman and Hall, 1995. 1.3, A.1, A.1, A.1.1, A.1.1, A.1.2, A.2
[93] S. Winterstein. Nonnormal responses and fatigue damage. J. Eng. Mech., ASCE,
111(10):1291–1295, 1985. C.3.1
[94] S. Winterstein. Nonlinear vibration models for extremes and fatigue. J. Eng. Mech.,
ASCE, 114(10):1772–1790, 1988. 2.2.4, C.3
[95] S. Winterstein and A. Jha. Random models of second order waves and local wave
statistics. In Proc. 10’th Int. Eng. Mech. Speciality Conf., ASCE, pages 1171–1174,
1995. C.3
[96] S. Winterstein, T. Ude, and G. Kleiven. Springing and slow-drift responses: Pre-
dicted extremes and fatigue vs. simulation. In Proc. 7’th Int. Behaviour of Offshore
Structures, BOSS, volume 3, pages 1–15, 1994. C.3.1
[97] H. T. Wist. Statistical Properties of Successive Ocean Wave Parameters. PhD thesis,
Norwegian Univ. of Sci. and Technology, NTNU, Trondheim, Norway, 2003. Dr. Ing.
thesis,. C.2
[98] I. Young. Wind generated ocean waves. Elsevier Ocean Engineering Book Series,
2:239, 1999. 6
168 BIBLIOGRAPHY
Index of m-files in the tutorial
169
170 INDEX OF M-FILES IN THE TUTORIAL
ochitr, 28 spec2vhpdf, 84
perioddef, 46, 55, 63 spec2wave, 41
phi1, 34 specinterp, 35
plotedf, 52, 126 spreading, 32
plotflag, 8 spwaveplot, 50, 81
plotgumb, 120 testgaussian, 30
plotkde, 123 tmaspec, 32
plotnorm, 31, 120 torsethaugen, 32, 152
plotreslife, 128 tp2lc, 100
plotspec, 9, 11 tp2mm, 101
plotweib, 120 tp2rfc, 13, 101
pmspec, 152 tranproc, 50
rate, 48 trgauss, 69, 99
reconstruct, 35, 50 trraylpdf, 52, 58
reslife, 132 wallop, 32
rind, 75 wavedef, 46, 62
rindoptset, 88 wavemodels, 55
rndgenpar, 126 waveplot, 8, 21
rndgev, 126
rotspec, 76
sarmasim, 40
seamovie, 12, 41, 42
seasim, 41
simoptset, 11, 12, 42
skew, 29
snplot, 113
spec, 32
spec2AcAt, 87
spec2Acdf, 72, 73, 79
spec2bw, 54, 61
spec2char, 54, 60
spec2cmat, 13, 87, 107
spec2cov, 26
spec2dt, 36
spec2field, 12, 41, 42
spec2ldat, 41
spec2mmtpdf, 87, 88, 98
spec2mom, 24, 54
spec2nlsdat, 41
spec2sdat, 8, 35, 73, 103
spec2skew, 29, 55, 103
spec2spec, 32, 73
spec2tccpdf, 77
spec2thpdf, 84
spec2tpdf, 9, 70, 72
spec2tpdf2, 76
Index
apparent wave, 67
height, 46
encountered directional spectrum, 33
period, 46
encountered sea, 46
wave, 45
endurance limit, 94
apparent wave
Epanechnikov kernel, 146
extraction of, 48
multivariate, 149
bandwidth matrix, 148 Expected exceedance, 128
FAT, 2
covariance function, 25
fatigue, 93–96, 110–117
computation from spectrum, 25
damage, 110
crest, 67
life, 110
amplitude, 67
distribution, 114
height, 67
limit, 94
length, 70–76
Fourier inversion, 25
period, 67, 70–76
frequency function, 25
crest densities, see wve distributions55
crossing intensity, 20 Generalized Extreme Value
calculation from rainflow matrix, 111 characteristics, 122
estimation from data, 99 distribution, GEV, 13, 123
Rice’s formula, 57 parameter estimation, 123
crossing spectrum, 20, 94, 109 Generalized Pareto
cycle analysis, 99 characteristics, 122
distribution, GPD, 13, 125
damage, 95, 110, 111 parameter estimation, 125
intensity, 95 Gullfaks C platform, 82
rainflow, 95 Gumbel distribution
datastructures, 17 characteristics, 119
Declustering, 130 probability paper, 120
directional spectra, 10
dispersion index, 130 irregularity factor, 20, 94, 109
dispersion relation, 45 irreularity factor, 100
downcrossing ISSC, 152
amplitude, 67
Jonswap spectrum, 31, 71, 103
definition, 66
period, 67 Lagrange waves, 46
171
172 INDEX
upcrossing
amplitude, 67
definition, 66
period, 67
wave, 67
WAT, 2
wave
crest, 67
direction, 11
length, 76–81
period, 67, 76–81
trough, 67
wave characteristics, 45–66
computation from spectrum, 60
definitions, 62, 67
estimation from data, 48–53
wave distributions
approximative densities
Cavanié et al., 56
Longuet-Higgins, 55
Rayleigh approximation, 57
computation of densities
crest length and period, 70–76
joint crest height/period, 82–86
joint crest/trough height, 86–87
min-to-max amp./period, 87–89
wave length and period, 76–81
estimation of densities
joint crest period and height, 53
crest height, 51
wave period, 48
exact, 69
wave models, 53–59
Cavanié et al., 56
Longuet-Higgins, 55
wavenumber, 33
weakest link, 119
Weibull distribution
characteristics, 119