MHKiT-Software / MHKiT-Python

MHKiT-Python 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
47 stars 45 forks source link

Spectral bandwidth function #139

Closed fleming79 closed 1 year ago

fleming79 commented 2 years ago

This function always returns 1 for spectrums that I've passed. Do you have a ref for this function? Perhaps the brackets in the denominator are erroneous?

https://github.com/MHKiT-Software/MHKiT-Python/blob/dd927ba0e6eaaa1e5e829a48be1c62d02b0a25f7/mhkit/wave/resource.py#L503

 e = np.sqrt(1- (m2**2)/m0/m4) 
ssolson commented 2 years ago

Hey fleming! Thank you for your interest in MHKiT. Let me see if we can help you out.

@kmruehl I checked out the MHKiT test and the test is essentailly returning the value of 1 (e.g. in test_wave calculated is equal to 0.9999999994879673). I am not sure is this is correct or not so I started looking for a reference. I could not find a reference for this equation in any of the IEC standards or in Falnes or in the Wec-Sim documentation although I certaintly could have used the wrong serach terms. Could you help me find a reference for the spectral bandwidth equation here so we can confirm everything is working as expected?

kmruehl commented 2 years ago

@ssolson I did a quick search and reviewed IEC TC114 62600-101, but cannot find this formula either. It's possible that it's from a textbook, but I do not currently have access to those. However, in my search I found discussion of this parameter, it appears there are many different possible formulas. In short, I think the formula should be revised (or removed) and a citation added.

The most common formulas are:

 e1 = np.sqrt((m1*mn1/m0**2)-1) 
 e2 = v = np.sqrt((m0*m2/m1**2)-1)