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
find peaks of vector or matrix possibly rainflow filtered | |
Calculates (and plots) a JONSWAP spectral density | |
Plot contents of pdf structures | |
Create or alter RIND OPTIONS structure. | |
Transforms between different types of spectra | |
Joint density of amplitude and period/wave-length characteristics | |
Prints a caption "made by WAFO" in current figure. | |
Clear variables and functions from memory. |
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)')
Comments or corrections to the WAFO group