Home > wafo > wavemodels > jhvnlpdf2.m

jhvnlpdf2

PURPOSE ^

Joint (Vcf,Hd) PDF for non-linear waves with a JONSWAP spectrum.

SYNOPSIS ^

[f,Hrms,Vrms,fA,fB] = jhvnlpdf2(Hd,Vcf,Hm0,Tp,gam,normalizedInput)

DESCRIPTION ^

 JHVNLPDF2 Joint (Vcf,Hd) PDF for non-linear waves with a JONSWAP spectrum. 
  
   CALL: f = jhvnlpdf2(Hd,Vcf,Hm0,Tp,gamma) 
   
   f     = pdf structure evaluated at meshgrid(Vcf,Hd) 
   Hd    = zero down crossing wave height [m] 
   Vcf   = crest front velocity    [m/s] 
   Hm0   = significant wave height [m] 
   Tp    = Spectral peak period    [s] 
   Gamma = Peakedness parameter of the JONSWAP spectrum 
  
  JHVNLPDF2 approximates the joint distribution of (Vcf, Hd), i.e., crest 
  front velocity (Ac/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 (Vcf,Hd) data for 13 classes of 
  GAMMA between 1 and 7. Between 140000 and 150000 zero-downcrossing waves 
  were simulated for each class. 
  JHVNLPDF2 is restricted to the following range for GAMMA:  
   1 <= GAMMA <= 7  
  
  Example: 
  Hm0 = 6;Tp = 9; gam=3.5 
  h = linspace(0,4*Hm0/sqrt(2))';  
  v = linspace(0,4*2*Hm0/Tp)'; 
  fl = jhvpdf2(h,v,Hm0,Tp,gam); 
  f = jhvnlpdf2(h,v,Hm0,Tp,gam); 
  w = linspace(0,40,5*1024+1).'; 
  S = jonswap(w,[Hm0, Tp, gam]); 
  dt = .3; 
  x = spec2nlsdat(S,80000,dt); rate = 4; 
  [vi,hi] = dat2steep(x,rate,1); 
  fk = kdebin([vi,hi],'epan',[],[],.5,128);  
  fk.title = f.title; fk.labx = f.labx;   
  plot(vi,hi,'.'), hold on 
  pdfplot(fl,'g') 
  pdfplot(f),pdfplot(fk,'r'),hold off 
  
  See also  thvpdf

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function [f,Hrms,Vrms,fA,fB] = jhvnlpdf2(Hd,Vcf,Hm0,Tp,gam,normalizedInput) 
002 %JHVNLPDF2 Joint (Vcf,Hd) PDF for non-linear waves with a JONSWAP spectrum. 
003 % 
004 %  CALL: f = jhvnlpdf2(Hd,Vcf,Hm0,Tp,gamma) 
005 %  
006 %  f     = pdf structure evaluated at meshgrid(Vcf,Hd) 
007 %  Hd    = zero down crossing wave height [m] 
008 %  Vcf   = crest front velocity    [m/s] 
009 %  Hm0   = significant wave height [m] 
010 %  Tp    = Spectral peak period    [s] 
011 %  Gamma = Peakedness parameter of the JONSWAP spectrum 
012 % 
013 % JHVNLPDF2 approximates the joint distribution of (Vcf, Hd), i.e., crest 
014 % front velocity (Ac/Tcf) and wave height, for 2nd order Stokes waves with a 
015 % JONSWAP spectral density. The empirical parameters of the model is 
016 % fitted by least squares to simulated (Vcf,Hd) data for 13 classes of 
017 % GAMMA between 1 and 7. Between 140000 and 150000 zero-downcrossing waves 
018 % were simulated for each class. 
019 % JHVNLPDF2 is restricted to the following range for GAMMA:  
020 %  1 <= GAMMA <= 7  
021 % 
022 % Example: 
023 % Hm0 = 6;Tp = 9; gam=3.5 
024 % h = linspace(0,4*Hm0/sqrt(2))';  
025 % v = linspace(0,4*2*Hm0/Tp)'; 
026 % fl = jhvpdf2(h,v,Hm0,Tp,gam); 
027 % f = jhvnlpdf2(h,v,Hm0,Tp,gam); 
028 % w = linspace(0,40,5*1024+1).'; 
029 % S = jonswap(w,[Hm0, Tp, gam]); 
030 % dt = .3; 
031 % x = spec2nlsdat(S,80000,dt); rate = 4; 
032 % [vi,hi] = dat2steep(x,rate,1); 
033 % fk = kdebin([vi,hi],'epan',[],[],.5,128);  
034 % fk.title = f.title; fk.labx = f.labx;   
035 % plot(vi,hi,'.'), hold on 
036 % pdfplot(fl,'g') 
037 % pdfplot(f),pdfplot(fk,'r'),hold off 
038 % 
039 % See also  thvpdf 
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 % History 
048 % By pab 10.01.2004 
049 error(nargchk(3,6,nargin)) 
050  
051 if (nargin < 6|isempty(normalizedInput)),  normalizedInput  = 0;end 
052 if (nargin < 4|isempty(Tp)),  Tp  = 8;end 
053 if (nargin < 3|isempty(Hm0)), Hm0 = 6;end 
054 if (nargin < 5|isempty(gam)) 
055    gam = getjonswappeakedness(Hm0,Tp); 
056 end 
057 displayWarning = 1; 
058 if displayWarning 
059   if any(any(Tp>5*sqrt(Hm0) | Tp<3.6*sqrt(Hm0))) 
060     disp('Warning: Hm0,Tp is outside the JONSWAP range') 
061     disp('The validity of the parameters returned are questionable') 
062   end 
063 end 
064  
065 [V,H] = meshgrid(Vcf,Hd); 
066  
067 f = createpdf(2); 
068 [f.f,Hrms,Vrms,varargout{1:nargout-1}]  = jhvnlpdf(H,V,Hm0,Tp,gam,normalizedInput); 
069 f.x = {Vcf(:),Hd(:)}; 
070   
071 if (normalizedInput) 
072   f.labx = {'Vcf', 'Hd'}; 
073   f.norm = 1; 
074 else 
075   f.norm = 0; 
076   f.labx = {'Vcf [m/s]', 'Hd [m]'}; 
077 end 
078 f.title = 'Joint distribution of (Hd,Vcf) in time'; 
079 f.note = ['Jonswap Hm0=' num2str(Hm0) ' Tp = ' num2str(Tp) ' Gamma = ' num2str(gam)]; 
080 [f.cl,f.pl] = qlevels(f.f); 
081 return

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