THVPDF2 Joint (Vcf,Hd) PDF for linear waves with Torsethaugen spectra. CALL: f = thvpdf2(Hd,Vcf,Hm0,Tp) f = pdf structure evaluated at meshgrid(Vcf,Hd). Hd = zero down crossing wave height Vcf = crest front velocity Hm0 = significant wave height [m]. Tp = Spectral peak period [s]. THVPDF2 approximates the joint PDF of (Vcf, Hd), i.e., crest front velocity (Ac/Tcf) and wave height, for a Gaussian process with a Torsethaugen spectral density. The empirical parameters of the model is fitted by least squares to simulated (Vcf,Hd) data for 600 classes of Hm0 and Tp. Between 50000 and 150000 zero-downcrossing waves were simulated for each class of Hm0 and Tp. THVPDF2 is restricted to the following range for Hm0 and Tp: 0.5 < Hm0 [m] < 12, 3.5 < Tp [s] < 20, and Hm0 < (Tp-2)*12/11. Example: Hm0 = 6; Tp = 8; h = linspace(0,4*Hm0/sqrt(2))'; v = linspace(0,4*2*Hm0/Tp)'; f = thvpdf2(h,v,Hm0,Tp); w = linspace(0,40,5*1024+1).'; S = torsethaugen(w,[Hm0 Tp]); dt = 0.3; x = spec2sdat(S,80000,.2); rate = 8; [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(f),pdfplot(fk,'r'),hold off See also thspdf, thsspdf
PDF class constructor | |
Calculates quantile levels which encloses P% of PDF | |
Joint (Vcf,Hd) PDF for linear waves with Torsethaugen spectra. | |
Display message and abort function. | |
X and Y arrays for 3-D plots. | |
Convert number to string. (Fast version) |
001 function [f,varargout] = thvpdf2(Hd,Vcf,Hm0,Tp,normalizedInput) 002 %THVPDF2 Joint (Vcf,Hd) PDF for linear waves with Torsethaugen spectra. 003 % 004 % CALL: f = thvpdf2(Hd,Vcf,Hm0,Tp) 005 % 006 % f = pdf structure evaluated at meshgrid(Vcf,Hd). 007 % Hd = zero down crossing wave height 008 % Vcf = crest front velocity 009 % Hm0 = significant wave height [m]. 010 % Tp = Spectral peak period [s]. 011 % 012 % THVPDF2 approximates the joint PDF of (Vcf, Hd), i.e., crest 013 % front velocity (Ac/Tcf) and wave height, for a Gaussian process with a 014 % Torsethaugen spectral density. The empirical parameters of the model is 015 % fitted by least squares to simulated (Vcf,Hd) data for 600 classes of 016 % Hm0 and Tp. Between 50000 and 150000 zero-downcrossing waves were 017 % simulated for each class of Hm0 and Tp. 018 % THVPDF2 is restricted to the following range for Hm0 and Tp: 019 % 0.5 < Hm0 [m] < 12, 3.5 < Tp [s] < 20, and Hm0 < (Tp-2)*12/11. 020 % 021 % Example: 022 % Hm0 = 6; 023 % Tp = 8; 024 % h = linspace(0,4*Hm0/sqrt(2))'; 025 % v = linspace(0,4*2*Hm0/Tp)'; 026 % f = thvpdf2(h,v,Hm0,Tp); 027 % w = linspace(0,40,5*1024+1).'; 028 % S = torsethaugen(w,[Hm0 Tp]); 029 % dt = 0.3; 030 % x = spec2sdat(S,80000,.2); rate = 8; 031 % [vi,hi] = dat2steep(x,rate,1); 032 % fk = kdebin([vi,hi],'epan',[],[],.5,128); 033 % fk.title = f.title; fk.labx = f.labx; 034 % plot(vi,hi,'.'), hold on 035 % pdfplot(f),pdfplot(fk,'r'),hold off 036 % 037 % See also thspdf, thsspdf 038 039 % Reference 040 % P. A. Brodtkorb (2004), 041 % The Probability of Occurrence of Dangerous Wave Situations at Sea. 042 % Dr.Ing thesis, Norwegian University of Science and Technolgy, NTNU, 043 % Trondheim, Norway. 044 045 % History 046 % revised pab 10.08.2003 047 % -revised pab 28.11.2002 048 % extended the example 049 % By pab 20.12.2000 050 051 error(nargchk(3,5,nargin)) 052 053 if (nargin < 5|isempty(normalizedInput)), normalizedInput = 0;end 054 if (nargin < 4|isempty(Tp)), Tp = 8;end 055 if (nargin < 3|isempty(Hm0)), Hm0 = 6;end 056 057 [V,H] = meshgrid(Vcf,Hd); 058 059 f = createpdf(2); 060 [f.f,Hrms,Vrms,varargout{1:nargout-1}] = thvpdf(H,V,Hm0,Tp,normalizedInput); 061 f.x = {Vcf(:),Hd(:)}; 062 063 if (normalizedInput) 064 f.labx = {'Vcf', 'Hd'}; 065 f.norm = 1; 066 else 067 f.norm = 0; 068 f.labx = {'Vcf [m/s]', 'Hd [m]'}; 069 end 070 f.title = 'Joint distribution of (Hd,Vcf) in time'; 071 f.note = ['Torsethaugen Hm0=' num2str(Hm0) ' Tp = ' num2str(Tp)]; 072 [f.cl,f.pl] = qlevels(f.f); 073 return 074
Comments or corrections to the WAFO group