Home > wafo > papers > wafodemo > wafofig8.m

wafofig8

PURPOSE ^

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

SYNOPSIS ^

wafofig8

DESCRIPTION ^

 WAFOFIG8  Joint distribution (pdf) of crest wavelength, Lc, and crest amplitude, Ac for extremal waves 
            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 wafofig8
002 %WAFOFIG8  Joint distribution (pdf) of crest wavelength, Lc, and crest amplitude, Ac for extremal waves 
003 %           of a JONSWAP spectrum which is truncated outside 0.5*wp and 1.5wp 
004 %
005 
006 % TODO % This is not implemented. Finish the code!
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 
015 disp('Not implemented yet')
016 return
017 
018 
019 % Use the speed and nit as for the North Sea data
020 global fLcAc NNp Nh Nnit Nspeed 
021 
022 if Nnit<0
023   opt = rindoptset('method',abs(Nnit),'speed',Nspeed);
024 else
025   opt = rindoptset('method',0,'nit',(Nnit),'speed',Nspeed);
026 end
027 
028 % Only need to calculate Globals which is not empty
029 % Poseidon / Japan Sea data
030 if isempty(fLcAc)
031   disp('This takes several  minutes to finish => several hours ... ')
032   disp('depending on input arguments and your computer')
033   Sj=jonswap;
034   % Find the peak frequency
035   ind = findpeaks(Sj.S);
036   % Truncate the spectrum outside 0.5wp and 1.5wp
037   Sj.S(1:floor(ind(1)*.5))=0;
038   Sj.S(floor(ind(1)*1.5):end)=0;
039   Sk=spec2spec(Sj,'k1d');
040   % Calculate the theoretical distribution
041   fLcAc = spec2thpdf(Sk,0,'LcAc',[0 250 NNp],Nh,opt);
042 end
043 pdfplot(fLcAc,'k-')
044 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