Skip to content

Incorrect @DIN, if the definite integral does not cross a coordinate edge #1997

@AndrewWittenberg

Description

@AndrewWittenberg

Definite Integrals that don't cross at least one coordinate edge are incorrect in Ferret v7.63. This may be related to #1880.

First define a 2-cell axis:

   NOAA/PMEL TMAP
   FERRET v7.63 (optimized)
   Linux 3.10.0-1160.25.1.el7.x86_64 64-bit - 08/25/21
   30-May-23 16:45     

yes? def ax/x=0:4:2/edges/unit="m" xax  ! edges at {0,2,4}; coordinates at {1,3}
yes? let one = 1 + 0*x[gx=xax]
yes? sho grid/x x[gx=xax]
... 
       I     X                       XBOX          XBOXLO
       1>  1                         2          0
       2>  3                         2          2

Integrals that cross at least one cell edge are ok:

yes? list/noh one[x=1.9:2.1@din]  ! 0.2 (correct)
          0.2000
yes? list/noh one[x=0.1:2.2@din]  ! 2.1 (correct)
          2.100
yes? list/noh one[x=1.1:4.2@din]  ! 2.9 (correct; integral correctly stops at x=4.0)
          2.900

Integrals that DON'T cross at least one cell edge are incorrect. This includes integrals that include, but don't cross, an edge.

yes? list/noh one[x=1.9:1.9@din]  ! 2.0 (INCORRECT, should be 0)
          2.000
yes? list/noh one[x=2.0:2.0@din]  ! 2.0 (INCORRECT, should be 0)
          2.000
yes? list/noh one[x=2.1:2.1@din]  ! 2.0 (INCORRECT, should be 0)
          2.000
yes? list/noh one[x=1.9:2.0@din]  ! 2.0 (INCORRECT, should be 0.1)
          2.000
yes? list/noh one[x=2.0:2.1@din]  ! 2.0 (INCORRECT, should be 0.1)
          2.000
yes? list/noh one[x=0.0:1.9@din]  ! 2.0 (INCORRECT, should be 1.9)
          2.000
yes? list/noh one[x=2.1:3.9@din]  ! 2.0 (INCORRECT, should be 1.8)
          2.000
yes? list/noh one[x=2.1:4.0@din]  ! 2.0 (INCORRECT, should be 1.9)
          2.000

It also applies to integrals that extend past the valid domain, so that the outermost edge is reached but not crossed:

yes? list/noh one[x=-0.2:1.9@din] ! 2.0 (INCORRECT, should be 1.9, stopping at x=0)
          2.000
yes? list/noh one[x=2.1:4.2@din]  ! 2.0 (INCORRECT, should be 1.9, stopping at x=4)
          2.000

I'm not sure if this affects averages (@AVE) as well -- do they depend on @DIN?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions