Home > wafo > wavemodels > jhsnlpdf2.m

jhsnlpdf2

PURPOSE ^

Joint (Scf,Hd) PDF for non-linear waves with a JONSWAP spectra.

SYNOPSIS ^

[f,Hrms,Srms,fA,fB] = jhsnlpdf2(Hd,Scf,Hm0,Tp,gam, normalizedInput)

DESCRIPTION ^

 JHSNLPDF2 Joint (Scf,Hd) PDF for non-linear waves with a JONSWAP spectra. 
  
   CALL: f = jhsnlpdf2(Hd,Scf,Hm0,Tp,gam) 
   
     f     = pdf evaluated at meshgrid(Scf,Hd) 
     Hd    = zero down crossing wave height [m] 
     Scf   = crest front steepness     
     Hm0   = significant wave height [m] 
     Tp    = Spectral peak period    [s] 
     Gamma = Peakedness parameter of the JONSWAP spectrum 
  
  JHSNLPDF2 approximates the joint PDF of (Scf, Hd), i.e., crest front 
  steepness (2*pi*Ac/(g*Td*Tcf)) and 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 (Scf,Hd) data for 13 
  classes of GAMMA. Between 47000 and 55000 zero-downcrossing waves were 
  simulated for each class of GAMMA. 
  JHSNLPDF2 is restricted to the following range for GAMMA:  
   1 <= GAMMA <= 7  
    
  Example: 
  iseed = 1; 
  Hm0 = 6;Tp = 9; 
  h = linspace(0,4*Hm0/sqrt(2))';  
  s = linspace(0,6*1.25*Hm0/Tp^2)'; 
  f = jhsnlpdf2(h,s,Hm0,Tp); 
  w = linspace(0,40,5*1024+1).'; 
  S = jonswap(w,[Hm0, Tp]); 
  dt = .3; 
  x = spec2nlsdat(S,80000,dt,iseed); rate = 4; 
  [si,hi] = dat2steep(x,rate,2); 
  fk = kdebin([si,hi],'epan',[],[],.5,128);  
  fk.title = f.title; fk.labx = f.labx;   
  plot(si,hi,'.'), hold on 
  pdfplot(f),pdfplot(fk,'r'),hold off 
  
  See also  jhsnlpdf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function [f,Hrms,Srms,fA,fB] = jhsnlpdf2(Hd,Scf,Hm0,Tp,gam, ... 
002                      normalizedInput) 
003 %JHSNLPDF2 Joint (Scf,Hd) PDF for non-linear waves with a JONSWAP spectra. 
004 % 
005 %  CALL: f = jhsnlpdf2(Hd,Scf,Hm0,Tp,gam) 
006 %  
007 %    f     = pdf evaluated at meshgrid(Scf,Hd) 
008 %    Hd    = zero down crossing wave height [m] 
009 %    Scf   = crest front steepness     
010 %    Hm0   = significant wave height [m] 
011 %    Tp    = Spectral peak period    [s] 
012 %    Gamma = Peakedness parameter of the JONSWAP spectrum 
013 % 
014 % JHSNLPDF2 approximates the joint PDF of (Scf, Hd), i.e., crest front 
015 % steepness (2*pi*Ac/(g*Td*Tcf)) and wave height, for 2nd order Stokes 
016 % waves with a JONSWAP spectral density. The empirical parameters of the 
017 % model is fitted by least squares to simulated (Scf,Hd) data for 13 
018 % classes of GAMMA. Between 47000 and 55000 zero-downcrossing waves were 
019 % simulated for each class of GAMMA. 
020 % JHSNLPDF2 is restricted to the following range for GAMMA:  
021 %  1 <= GAMMA <= 7  
022 %   
023 % Example: 
024 % iseed = 1; 
025 % Hm0 = 6;Tp = 9; 
026 % h = linspace(0,4*Hm0/sqrt(2))';  
027 % s = linspace(0,6*1.25*Hm0/Tp^2)'; 
028 % f = jhsnlpdf2(h,s,Hm0,Tp); 
029 % w = linspace(0,40,5*1024+1).'; 
030 % S = jonswap(w,[Hm0, Tp]); 
031 % dt = .3; 
032 % x = spec2nlsdat(S,80000,dt,iseed); rate = 4; 
033 % [si,hi] = dat2steep(x,rate,2); 
034 % fk = kdebin([si,hi],'epan',[],[],.5,128);  
035 % fk.title = f.title; fk.labx = f.labx;   
036 % plot(si,hi,'.'), hold on 
037 % pdfplot(f),pdfplot(fk,'r'),hold off 
038 % 
039 % See also  jhsnlpdf 
040  
041 % Reference   
042 % P. A. Brodtkorb (2004),   
043 % The Probability of Occurrence of Dangerous Wave Situations at Sea. 
044 % Dr.Ing thesis, Norwegian University of Science and Technolgy, NTNU, 
045 % Trondheim, Norway.  
046  
047  
048 error(nargchk(3,6,nargin)) 
049  
050 if (nargin < 6|isempty(normalizedInput)),  normalizedInput  = 0;end 
051 if (nargin < 4|isempty(Tp)),  Tp  = 8;end 
052 if (nargin < 3|isempty(Hm0)), Hm0 = 6;end 
053 if (nargin < 5|isempty(gam)) 
054    gam = getjonswappeakedness(Hm0,Tp); 
055 end 
056 displayWarning = 1; 
057 if displayWarning 
058   if any(any(Tp>5*sqrt(Hm0) | Tp<3.6*sqrt(Hm0))) 
059     disp('Warning: Hm0,Tp is outside the JONSWAP range') 
060     disp('The validity of the parameters returned are questionable') 
061   end 
062 end 
063  
064 [V,H] = meshgrid(Scf,Hd); 
065  
066 f = createpdf(2); 
067 [f.f,Hrms,Srms,varargout{1:nargout-1}]  = jhsnlpdf(H,V,Hm0,Tp,gam,normalizedInput); 
068 f.x = {Scf(:),Hd(:)}; 
069   
070 if (normalizedInput) 
071   f.labx = {'Scf', 'Hd'}; 
072   f.norm = 1; 
073 else 
074   f.norm = 0; 
075   f.labx = {'Scf', 'Hd [m]'}; 
076 end 
077 f.title = 'Joint distribution of (Hd,Scf) in time'; 
078 f.note = ['Stokes waves from Jonswap, Hm0=' num2str(Hm0) ' Tp = ' num2str(Tp) ... 
079       ' Gamma = ' num2str(gam)]; 
080 try 
081   [f.cl,f.pl] = qlevels(f.f); 
082 end 
083 return 
084

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