Home > wafo > papers > wafodemo > wafofig7.m

wafofig7

PURPOSE ^

Joint distribution (pdf) of crest wavelength, Lc, and crest amplitude, Ac

SYNOPSIS ^

wafofig7

DESCRIPTION ^

  WAFOFIG7  Joint distribution (pdf) of crest wavelength, Lc, and crest amplitude, Ac 
            of a JONSWAP spectrum which is truncated outside 0.5*wp and 1.5wp

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function wafofig7
002 % WAFOFIG7  Joint distribution (pdf) of crest wavelength, Lc, and crest amplitude, Ac 
003 %           of a JONSWAP spectrum which is truncated outside 0.5*wp and 1.5wp 
004 %
005 
006   % revised pab Feb2005, updated calls to spec2thpdf
007 global  WAFOFIGNUM
008 
009 if isempty(WAFOFIGNUM)
010   disp('You must start wafodemo in order to run this script')
011   clear global WAFOFIGNUM
012   return
013 end
014 % Use the speed and nit as for the North Sea data
015 global fLcAc NNp Nh Nnit Nspeed 
016 
017 if Nnit<0
018   opt = rindoptset('method',abs(Nnit),'speed',Nspeed);
019 else
020   opt = rindoptset('method',0,'nit',(Nnit),'speed',Nspeed);
021 end
022 % Only need to calculate Globals which is not empty
023 % Poseidon / Japan Sea data
024 if isempty(fLcAc)
025   disp('This takes several  minutes to finish => several hours ... ')
026   disp('depending on input arguments and your computer')
027   Sj=jonswap;
028   % Find the peak frequency
029   ind = findpeaks(Sj.S);
030   % Truncate the spectrum outside 0.5wp and 1.5wp
031   Sj.S(1:floor(ind(1)*.5))=0;
032   Sj.S(floor(ind(1)*1.5):end)=0;
033   Sk=spec2spec(Sj,'k1d');
034   % Calculate the theoretical distribution
035   fLcAc = spec2thpdf(Sk,0,'LcAc',[0 250 NNp],Nh,opt);
036 end
037 pdfplot(fLcAc,'k-')
038 wafostamp('Figure 7','(NR)')

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