Home > wafo > wavemodels > ohhcdf.m

# ohhcdf

## PURPOSE

Marginal wave height, Hd, CDF for Ochi-Hubble spectra.

## SYNOPSIS

f = ohhcdf(h,Hm0,def,dim,norm,pdef)

## DESCRIPTION

``` OHHCDF Marginal wave height, Hd, CDF for Ochi-Hubble spectra.

CALL: f = ohhcdf(h,Hm0,def,dim)

f   = cdf evaluated at h.
h   = vectors of evaluation points.
Hm0 = significant wave height [m].
def = defines the parametrization of the spectral density (default 1)
1 : The most probable spectrum  (default)
2,3,...11 : gives 95% Confidence spectra
dim = 'time'  : Hd distribution in time (default)
'space' : Hd distribution in space

OHHCDF approximates the marginal PDF of Hd, i.e.,
zero-downcrossing wave height, for a Gaussian process with a Bimodal
Ochi-Hubble spectral density (ohspec2). The empirical parameters of
the model is fitted by least squares to simulated Hd data for 24
classes of Hm0. Between 50000 and 150000 zero-downcrossing waves were
simulated for each class of Hm0 in DIM=='time'.
Between 50000 and 300000 zero-downcrossing waves were
simulated for each class of Hm0 for DIM=='space'.
OHHCDF is restricted to the following range for Hm0:
0 < Hm0 [m] < 12,  1 <= def < 11,

Example:
Hm0 = 6;def = 8;
h = linspace(0,4*Hm0/sqrt(2))';
f = ohhcdf(h,Hm0,def);
plot(h,f)
dt = 0.4; w = linspace(0,2*pi/dt,256)';
xs = spec2sdat(ohspec2(w,[Hm0, def]),6000); rate=8; method=1;
[S,H] = dat2steep(xs,rate,method);
empdistr(H,[h f],'g')

## CROSS-REFERENCE INFORMATION

This function calls:
 ohhgparfun Wave height, Hd, distribution parameters for Ochi-Hubble spectra. wggamcdf Generalized Gamma cumulative distribution function error Display message and abort function. warning Display warning message; disable or enable warning messages.
This function is called by:

## SOURCE CODE

```001 function f = ohhcdf(h,Hm0,def,dim,norm,pdef)
002 %OHHCDF Marginal wave height, Hd, CDF for Ochi-Hubble spectra.
003 %
004 %  CALL: f = ohhcdf(h,Hm0,def,dim)
005 %
006 %  f   = cdf evaluated at h.
007 %  h   = vectors of evaluation points.
008 %  Hm0 = significant wave height [m].
009 %  def = defines the parametrization of the spectral density (default 1)
010 %        1 : The most probable spectrum  (default)
011 %        2,3,...11 : gives 95% Confidence spectra
012 % dim = 'time'  : Hd distribution in time (default)
013 %       'space' : Hd distribution in space
014 %
015 % OHHCDF approximates the marginal PDF of Hd, i.e.,
016 % zero-downcrossing wave height, for a Gaussian process with a Bimodal
017 % Ochi-Hubble spectral density (ohspec2). The empirical parameters of
018 % the model is fitted by least squares to simulated Hd data for 24
019 % classes of Hm0. Between 50000 and 150000 zero-downcrossing waves were
020 % simulated for each class of Hm0 in DIM=='time'.
021 % Between 50000 and 300000 zero-downcrossing waves were
022 % simulated for each class of Hm0 for DIM=='space'.
023 % OHHCDF is restricted to the following range for Hm0:
024 %  0 < Hm0 [m] < 12,  1 <= def < 11,
025 %
026 % Example:
027 % Hm0 = 6;def = 8;
028 % h = linspace(0,4*Hm0/sqrt(2))';
029 % f = ohhcdf(h,Hm0,def);
030 % plot(h,f)
031 % dt = 0.4; w = linspace(0,2*pi/dt,256)';
032 % xs = spec2sdat(ohspec2(w,[Hm0, def]),6000); rate=8; method=1;
033 % [S,H] = dat2steep(xs,rate,method);
034 % empdistr(H,[h f],'g')
035 %
037
038 % Reference
039 % P. A. Brodtkorb (2004),
040 % The Probability of Occurrence of Dangerous Wave Situations at Sea.
041 % Dr.Ing thesis, Norwegian University of Science and Technolgy, NTNU,
042 % Trondheim, Norway.
043
044 % History
045 % revised pab jan2004
046 % By pab 20.01.2001
047
048
049 error(nargchk(2,4,nargin))
050
051 if nargin<4|isempty(dim), dim  = 'time';end
052 if nargin<3|isempty(def), def  = 1;end
053
054 if Hm0>12| Hm0<=0
055   disp('Warning: Hm0 is outside the valid range')
056   disp('The validity of the Hd distribution is questionable')
057 end
058
059 if def>11|def<1
060   Warning('DEF is outside the valid range')
061   def = mod(def-1,11)+1;
062 end
063
064 Hrms = Hm0/sqrt(2);
065 [A0, B0, C0] = ohhgparfun(Hm0,def,dim);
066 f    = wggamcdf(h/Hrms,A0,B0,C0);
067 return
068 %old calls
069 % pardef = 7;
070 % switch pardef
071 %   case 1
072 %      w    = linspace(0,100,16*1024+1).'; % original spacing
073 %      S = ohspec2(w,[Hm0,def]);
074 %      R  = spec2cov(S);
075 %      %    A0 = sqrt((1-min(R.R)/R.R(1))/2);% Naess (1985)
076 %      A0 = sqrt((1-min(R.R)/R.R(1))/2)+0.03;% Modified approach broadbanded time
077 %      %    A0 = sqrt((1-min(R.R)/R.R(1))/2)+0.1;% Modified approach broadbanded space
078
079 %     B0 = 2;
080 %     C0 = 0;
081 %   case 7,
082 %     global OHHWPAR
083 %     if isempty(OHHWPAR)
085 %     end
086 %     % Truncated Weibull  distribution parameters as a function of Tp, Hm0
087 %     A00 = OHHWPAR.A00s;
088 %     B00 = OHHWPAR.B00s;
089 %     C00 = OHHWPAR.C00s;
090
091 %     Hm00 = OHHWPAR.Hm0;
092 %     if 1,
093 %       method = '*cubic';
094 %       A0 = interp1(Hm00,A00(:,def),Hm0,method);
095 %       B0 = interp1(Hm00,B00(:,def),Hm0,method);
096 %       C0 = interp1(Hm00,C00(:,def),Hm0,method);
097 %     else
098 %       A0 = smooth(Hm00,A00(:,def),1,Hm0);
099 %       B0 = smooth(Hm00,B00(:,def),1,Hm0);
100 %       C0 = smooth(Hm00,C00(:,def),1,Hm0);
101 %     end
102
103 % end
104
105 %Hrms = Hm0/sqrt(2);
106 %f.f    = wtweibcdf(h/Hrms,A0,B0,C0)/Hrms;
107
108 return
109```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003