Home > wafo > wavemodels > jhnlwparfun.m

jhnlwparfun

PURPOSE ^

Wave height, Hd, distribution parameters for Stokes waves with Jonswap spectrum.

SYNOPSIS ^

[A0,B0,C0]= jhnlwparfun(Hm0,Tp,gam,dim)

DESCRIPTION ^

 JHNLWPARFUN Wave height, Hd, distribution parameters for Stokes waves with Jonswap spectrum. 
  
  CALL [a b c] = jhnlwparfun(Hm0,Tp,gamma,dim) 
  
  Hm0   = significant wave height [m]. 
  Tp    = peak period [s] 
  gamma = Peakedness parameter of the JONSWAP spectrum 
  dim   = 'time'  : Hd distribution parameters in time (default) 
  
   JHNLWPARFUN returns the truncated Weibull distribution parameters which 
   approximates the marginal PDF of Hd/Hrms, i.e., 
   zero-downcrossing wave height, for 2nd order Stokes waves with a  
   Jonswap spectral density.   
  
   The empirical parameters of the model is 
   fitted by least squares to simulated Hd data for 13 classes of 
   GAMMA between 1 and 7, given Hm0 = 7 and Tp  = 11;. 
   About 50000 zero-downcrossing waves were simulated for 
   each class of GAMMA for DIM=='time'. 
   JHNLWPARFUN is restricted to the following range for GAMMA and Tp:  
   1 <= GAMMA <= 7, and 3.6*sqrt(Hm0) < Tp < 5*sqrt(Hm0) 
   
   Example: 
   Hm0 = 6;Tp = 9;Hrms = Hm0/sqrt(2); 
   gam = getjonswappeakedness(Hm0,Tp); 
   [a b c] = jhnlwparfun(Hm0,Tp,gam); 
   h = linspace(0,4*Hrms)';  
   F = wtweibcdf(h/Hrms,a,b,c); 
   f = wtweibpdf(h/Hrms,a,b,c)/Hrms; 
   dt = 0.4; w = linspace(0,2*pi/dt,256)'; 
   S = jonswap(w,[Hm0 Tp,gam]); 
   xs = spec2nlsdat(S,80000,dt); rate=8; method=1; 
   [S,H] = dat2steep(xs,rate,method); 
   fk = kdebin(H,'epan',[],[],.5,128); 
   subplot(2,1,1) 
   empdistr(H,[h,F],1) 
   subplot(2,1,2) 
   plot(h,f), hold on, pdfplot(fk,'r'), hold off 
   
   See also  jhvnlpdf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function [A0,B0,C0]= jhnlwparfun(Hm0,Tp,gam,dim) 
002 %JHNLWPARFUN Wave height, Hd, distribution parameters for Stokes waves with Jonswap spectrum. 
003 % 
004 % CALL [a b c] = jhnlwparfun(Hm0,Tp,gamma,dim) 
005 % 
006 % Hm0   = significant wave height [m]. 
007 % Tp    = peak period [s] 
008 % gamma = Peakedness parameter of the JONSWAP spectrum 
009 % dim   = 'time'  : Hd distribution parameters in time (default) 
010 % 
011 %  JHNLWPARFUN returns the truncated Weibull distribution parameters which 
012 %  approximates the marginal PDF of Hd/Hrms, i.e., 
013 %  zero-downcrossing wave height, for 2nd order Stokes waves with a  
014 %  Jonswap spectral density.   
015 % 
016 %  The empirical parameters of the model is 
017 %  fitted by least squares to simulated Hd data for 13 classes of 
018 %  GAMMA between 1 and 7, given Hm0 = 7 and Tp  = 11;. 
019 %  About 50000 zero-downcrossing waves were simulated for 
020 %  each class of GAMMA for DIM=='time'. 
021 %  JHNLWPARFUN is restricted to the following range for GAMMA and Tp:  
022 %  1 <= GAMMA <= 7, and 3.6*sqrt(Hm0) < Tp < 5*sqrt(Hm0) 
023 %  
024 %  Example: 
025 %  Hm0 = 6;Tp = 9;Hrms = Hm0/sqrt(2); 
026 %  gam = getjonswappeakedness(Hm0,Tp); 
027 %  [a b c] = jhnlwparfun(Hm0,Tp,gam); 
028 %  h = linspace(0,4*Hrms)';  
029 %  F = wtweibcdf(h/Hrms,a,b,c); 
030 %  f = wtweibpdf(h/Hrms,a,b,c)/Hrms; 
031 %  dt = 0.4; w = linspace(0,2*pi/dt,256)'; 
032 %  S = jonswap(w,[Hm0 Tp,gam]); 
033 %  xs = spec2nlsdat(S,80000,dt); rate=8; method=1; 
034 %  [S,H] = dat2steep(xs,rate,method); 
035 %  fk = kdebin(H,'epan',[],[],.5,128); 
036 %  subplot(2,1,1) 
037 %  empdistr(H,[h,F],1) 
038 %  subplot(2,1,2) 
039 %  plot(h,f), hold on, pdfplot(fk,'r'), hold off 
040 %  
041 %  See also  jhvnlpdf  
042  
043  
044 % History: 
045 % revised pab 10 jan 2004   
046 % by pab 29.11.2002 
047  
048 error(nargchk(2,4,nargin)) 
049 if nargin<3|isempty(gam), 
050   gam = getjonswappeakedness(Hm0,Tp) 
051 end 
052 if nargin<4|isempty(dim), dim = 'time';end 
053  
054 displayWarning = 0; 
055 if displayWarning 
056   if any(any(Tp>5*sqrt(Hm0) | Tp<3.6*sqrt(Hm0))) 
057     disp('Warning: Hm0,Tp is outside the JONSWAP range') 
058     disp('The validity of the parameters returned are questionable') 
059   end 
060   if any(any(gam>7|gam<1)) 
061     disp('Warning: gamma is outside the valid range') 
062     disp('The validity of the parameters returned are questionable') 
063   end 
064 end 
065  
066 if strncmpi(dim,'t',1)     
067   % LS fit to data 
068   % best fit to jonswap for gamma = 1:.5:7 
069   A0 = -0.01243795213128.*gam + 1.08025514722235; 
070   B0 = -0.03043834819688.*gam + 2.27161821064622; 
071   C0 = -0.01342959276544.*gam + 0.10353423379696; 
072  
073 else % not implemented yet 
074    
075   A0 = []; 
076   B0 = []; 
077   C0 = []; 
078 end 
079  
080 return 
081  
082

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