EWWDIR Computes values of the quadratic transfer function E, for quadratic sea CALL: [Eww]= ewwdir(w,th,wt,tht,h); Eww = a matrix with the quadratic transfer function E(w,th,wt,tht). w,wt = two equally long vectors with angular frequencies. w,wt = two equally long vectors with angular frequencies. h = water depth (default 5000 [m]). Function uses w2k and is used in dirsp2chitwo
returns the constant acceleration of gravity | |
Translates from frequency to wave number | |
Display message and abort function. | |
X and Y arrays for 3-D plots. |
gives parameters in non-central CHI-TWO process for directional Stokes waves. |
001 function [out]=ewwdir(omega,theta,omegat,thetat,h); 002 % EWWDIR Computes values of the quadratic transfer function E, for quadratic sea 003 % 004 % CALL: [Eww]= ewwdir(w,th,wt,tht,h); 005 % 006 % Eww = a matrix with the quadratic transfer function E(w,th,wt,tht). 007 % w,wt = two equally long vectors with angular frequencies. 008 % w,wt = two equally long vectors with angular frequencies. 009 % h = water depth (default 5000 [m]). 010 % 011 % Function uses w2k and is used in dirsp2chitwo 012 013 % 014 %---------------------------------------------------------------------- 015 % References: Marc Prevosto "Statistics of wave crests from second 016 % order irregular wave 3D models" 017 % 018 % Reduces to E(w,wt) from Eq.(6) in R. Butler, U. Machado, I. Rychlik (2002) 019 % if th, tht are constant - longcrested sea eww.m. 020 % By I.R 22.10.04 021 022 g=gravity; 023 eps0=0.000001; 024 if ((length(omega)~=length(omegat))|(length(theta)~=length(thetat))|(length(thetat)~=length(omegat))) 025 error('error in input to eww_new') 026 end 027 028 if nargin<5 | h<=0 029 h=5000; 030 end 031 032 [w wt]=meshgrid(omega,omegat); 033 [th tht]=meshgrid(theta,thetat); 034 wpl=w+wt; 035 036 037 ind=find(abs(w.*wt)<eps0); 038 ind1=find(abs(wpl)<eps0); 039 wpl(ind)=1; 040 w(ind)=1; 041 wt(ind)=1; 042 043 kw=w2k(w,[],h,g); 044 kwx=kw.*cos(th); kwy=kw.*sin(th); 045 kwt=w2k(wt,[],h,g); 046 kwtx=kwt.*cos(tht); kwty=kwt.*sin(tht); 047 kk=sqrt((kwx+kwtx).^2+(kwy+kwty).^2); kkh=g*kk.*tanh(kk*h); 048 Dkwkwt=(2*wpl.*(g^2*((kwx.*kwtx)+(kwy.*kwty))-(w.*wt).^2)+g^2*((kw.^2.*wt)+(kwt.^2.*w))-wt.*w.*(wt.^3+w.^3))... 049 ./(2*w.*wt.*(wpl.^2-kkh)); 050 Dkwkwt(ind1)=0.; 051 out=(1/2/g)*(-g^2*((kwx.*kwtx)+(kwy.*kwty))./(w.*wt)+w.^2+wt.^2+w.*wt+2*wpl.*Dkwkwt); 052 out(ind)=0; 053
Comments or corrections to the WAFO group