Skip to content

Frequency vector precision #145

Description

@rgcoe

I noticed a funny behavior when working on a case study with a regular wave where energy was bleeding into additional frequencies. After hunting down every other potential source, I found that the frequencies coming back from Nemoh were very slightly (something close to machine epsilon) different from those requested in the calibration file (Nemoh.cal). I haven't dug too much deeper, but I guess this is probably something with either the I/O that we're using with Nemoh of the precision that Nemoh operates at.

>> S.w - b(3).hydro.w

ans =

   1.0e-14 *

         0
   -0.0111
   -0.0222
   -0.0222
   -0.0222
   -0.0444
   -0.0444
   -0.0444
   -0.0444
   -0.0444
   -0.0444
   -0.0444
         0
   -0.0888
         0
         0
   -0.0888
         0
   -0.0888
   -0.0888
   -0.0888
         0
         0
   -0.0888
   -0.0888
         0
   -0.1776
   -0.1776
   -0.1776
         0
         0
   -0.1776
   -0.1776
   -0.1776
         0
   -0.1776
   -0.1776
   -0.1776
   -0.1776
   -0.1776
   -0.1776
         0
   -0.1776
         0
         0
   -0.1776
   -0.1776
   -0.1776
   -0.1776
   -0.1776

With linear interpolation
image

With nearest interpolation
image

My somewhat dirty, but I believe justifiable, fix was to add an option for using nearest interpolation instead of the default linear (f6381c6). While not a big deal, I just thought I'd make a note...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions