MHKiT-MATLAB icon indicating copy to clipboard operation
MHKiT-MATLAB copied to clipboard

jonswap_spectrum bug

Open ckberinger opened this issue 9 months ago • 1 comments

Hello,

I found a bug in the jonswap_spectrum code for MHKiT Matlab. The elseif nargin == 4 line has the gamma value placed into the Hs and gamma part of the function. This causes incorrect formulation of the Jonswap function. The correct code is below as the Hs needs to be in the Hs spot of the python function. The gamma value should only change the peakiness of the spectrum, this can be easily seen when plotting the spectrum.

elseif nargin == 4
        S_py=py.mhkit.wave.resource.jonswap_spectrum(frequency,Tp,Hs,pyargs('gamma',varargin{1}));

Cheers, Courtney

ckberinger avatar May 10 '24 19:05 ckberinger