TAY90FUN is an internal integrand function to tay90pdf Call: y = tay90fun(u,x,b) u = integration variable x = normalized waveheight b = correlation coefficient, i.e., cov(At^2,Ac^2)
Tayfun (1990) PDF of large wave heights |
001 function y=tay90fun(u,x,b,pdfstr ) 002 %TAY90FUN is an internal integrand function to tay90pdf 003 % 004 % Call: y = tay90fun(u,x,b) 005 % 006 % u = integration variable 007 % x = normalized waveheight 008 % b = correlation coefficient, i.e., cov(At^2,Ac^2) 009 % 010 011 %k=find(~isreal(u)) 012 %k=find(~isreal(x)) 013 %k=find(~isreal(a)) 014 %k=find(~isreal(b)) 015 if nargin<4|isempty(pdfstr) 016 pdfstr='pdf'; 017 end 018 %pdf=strcmp(pdfstr,'pdf'); 019 A=0.25./(1-b.^2); 020 [y ierr] =besseli(0,u.*x.^2.*b.*A,1); 021 switch ierr(1), 022 case 0, %computation OK 023 case 1, error('Illegal arguments.') 024 case 2, error('Overflow. Return Inf.') 025 case 3, disp('Some loss of accuracy in argument reduction.') 026 case 4, error('Complete loss of accuracy, z or nu too large.') 027 case 5, error('No convergence. Return NaN.') 028 end 029 030 031 y=sqrt(u)/2.*x.^3.*A.*exp(-A.*x.^2.*(2-u-abs(u.*b)) ).*y; 032 033 %y=sqrt(u)/2.*x.^3./(1-b.^2).*exp(-x.^2./(1-b.^2).*(1-u/2-abs(real(u.*b/2)))).*y;%/0.73263369802690; 034 return 035
Comments or corrections to the WAFO group