MHKiT-Software / MHKiT-MATLAB

MHKiT-MATLAB provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
15 stars 23 forks source link

jonswap_spectrum bug #132

Open ckberinger opened 1 month ago

ckberinger commented 1 month ago

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

simmsa commented 1 month ago

@ckberinger, thank you for reporting this! I can reproduce this issue and have submitted #133 to test for and fix this bug. I will follow up with you after we review #133.