MHKiT-MATLAB
MHKiT-MATLAB copied to clipboard
jonswap_spectrum bug
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, 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.
Hi @ckberinger, we believe fixed this in #136, and merged this fix into the v0.5.0 release yesterday. Let us know if this fixes your specific issue with the jonswap_spectrum function.
One sidenote, this issue helped us troubleshoot an another issue with the WDRT additions included in the latest release that was caused by this bug. Thank you for reporting this!
Hey @simmsa this looks great! I am glad it was able to help with another issue!
It is great to have your help! I am going to close this.