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
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 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)')
Comments or corrections to the WAFO group