Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulations over land (near destination) #295

Open
itsHusky opened this issue Jun 13, 2024 · 0 comments
Open

simulations over land (near destination) #295

itsHusky opened this issue Jun 13, 2024 · 0 comments

Comments

@itsHusky
Copy link

itsHusky commented Jun 13, 2024

Describe the bug
When simulating (propagating) near the destination, there are cases, where the land (and I assume, boundary) detection seems to fail. This is, because the landcrossing may be calculated for a point, which is later not even part of that route. I assume, the land (and boundary) detection itself work fine, but there may be a problem with providing the correct position for these checks.

I debugged the code and here are my findings (which may help).

When propagating to a new position, using Position::Propagate(...), in the loop of the degreeSteps :

  1. Let dlat, dlon be the coordinates of a new position (calculated from a current position: pos->lat, pos->lon and a heading).
  2. If config option "land or boundary crossing" is enabled (user checked these settings in the GUI), new variables dlat1, dlon1 are introduced.
  3. if (dist2end < dist) applies (with dist being the distance that the boat will sail and dist2end being the distance to the destination)
    3.1. A new position is being calculated with the distance to the end
    (interpretation: what position can I reach now, with travelling less distance?)
    3.2 variables dlat1 and dlon1 hold the coordinates of that new position
  4. else, set dlat1 = dlat and dlon1 = dlon
  5. see if CrossesLand(dlat1, ndlon1) // using dlat1 and dlon1 (actually ndlon1)
  6. see if safety margin land ... (not shown here)
  7. see if (EntersBoundary(dlat1, dlon1))
  8. create new Position(dlat, dlon, ...);

On the last point of the list (8.), the new position is created using dlat, dlon. The checks to see if crossing a boundary were however performed using dlat1, dlon1. In the case, where we enter the if in 3., dlat != dlat1, and dlon != dlon1. Assuming, that dlat, dlon were in fact on land, but dlat1, dlon1 were on water, we did check the wrong position, as only dlat, dlon is going to be a new position, completly discarding dlat1, dlon1 (see second screenshot for a visualization).

To Reproduce
I can provide a config and a grib, where the the simulation over land can be easily reproduced. (I can't upload them here, but the config is listed below):
<Configuration Start="Frejus" StartDate="1996-02-22" StartTime="06:00:00" End="Rhonedelt1" dt="12200" Boat="C:\Users\<user>\Desktop\boat-002.xml" Integrator="0" MaxDivertedCourse="130" MaxCourseAngle="180" MaxSearchAngle="120" MaxTrueWindKnots="100" MaxApparentWindKnots="100" MaxSwellMeters="20" MaxLatitude="90" TackingTime="0" WindVSCurrent="0" AvoidCycloneTracks="0" CycloneMonths="1" CycloneDays="0" UseGrib="1" ClimatologyType="4" AllowDataDeficient="0" WindStrength="1" DetectLand="1" SafetyMarginLand="-1" DetectBoundary="1" Currents="0" OptimizeTacking="0" InvertedRegions="0" Anchoring="0" FromDegree="0" ToDegree="150" ByDegrees="5" />

We found out, that with a higher dt, e.g. 3h30, there seem to be more simulations over land.
Maybe, also with a strong wind in the correct direction, the travelled distance may be greather than the distance to the end.

Expected behavior
No simulation over land, if option detect land is checked in the config. (or at least a failed simulation)

Screenshots
Here is a screenshot from the plugin, directly in OpenCPN
Bild_2024-06-13_160435505

Another example: This screenshot is not related to the one above! Here is a visualization from running the plugin as standalone (without opencpn) to show what I mean, regarding the positions: Let's say, we propagte from position (purple), then dlat, dlon is calculated (white), adjusted as we sailed further than the distance to end, so we try to sail the distance to the end (red). Red triangle is used to check for boundary/land crossing, but the new position is created from the white triangle. So, this white position bypassed the whole checks. Shouldn't dlat1, dlon1 be the new position, we are looking for in our route?

Bild_2024-06-13_163125679

Desktop (please complete the following information):

  • WeatherRouting Plugin Version: 1.15.18.3
  • OS: Windows 11
  • OpenCPN version: 5.8.4-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant