Skip to content

Constrain cruise trajectories to recorded ground tracks - #33

Merged
junzis merged 3 commits into
junzis:mainfrom
jubarauna:follow-track
Sep 22, 2026
Merged

junzis merged 3 commits into
junzis:mainfrom
jubarauna:follow-track

Conversation

@jubarauna

@jubarauna jubarauna commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Cruise.follow_track(lat, lon, tolerance_m=1000) for optimizing cruise altitude and speed along a recorded ground track. Boundary nodes lie on an arc-length-parametrized cubic spline; interior collocation and quarter-interval samples stay within the requested tolerance. Progress is ordered from the origin to the destination.

Unlike node-only constraints, the interior checks also restrict excursions between boundary nodes. This remains a sampled numerical constraint, not a continuous-path guarantee. The default tolerance is 1 km; tighter tolerances and sharper bends can require more mesh intervals.

Behavior

  • Validate matching finite 1D coordinate arrays, at least four points, valid latitude/longitude ranges, and no consecutive duplicates.
  • Require endpoints within 1 km of the flight endpoints and snap them to the exact flight boundaries without modifying the input arrays.
  • Preserve turn-rate limits and reject combining a prescribed track with fix_track_angle().
  • Include the reference curve in spatial bounds, seed the trajectory and heading along it, and use its length for the flight-duration seed.
  • Rebuild projected splines for each formulation, including the shared projection used by MultiAircraft.
  • Support fixed Mach, grid objectives, and wind under the existing single-aircraft/fleet restrictions. Keep the original behavior when no track is configured.

The branch includes current main, including PRs #34 and #32.

Validation

  • 33 track tests pass: input validation, endpoint snapping, projection changes, detour bounds, dense trajectory checks, turn-rate checks, fixed Mach with exact grid costs, wind, and fleet solving.
  • On the bowed-track regression, a 1 km tolerance converges with 20 intervals; a 100 m tolerance converges with 40 intervals. Dense verification samples stay within tolerance plus the approximately 2 m reference-sampling resolution.
  • Ruff lint and formatting pass. Type checking passes for the changed implementation and tests.
  • All 94 targeted cruise, track, fleet, continuous-control, grid, waypoint, and wind regression tests pass (pytest ... -n auto). Full GitHub CI is running on the updated branch.

follow_track(lat, lon) accepts a recorded flight track and pins the
lateral (ground-track) movement to it, so the optimizer only varies the
vertical and speed profile. The track is stored as arc-length interpolants
in projected space; each interior node is constrained onto that reference
curve via a monotone arc-length variable. When a track is followed the
default turn-rate limit is skipped, since the recorded heading changes are
reproduced rather than smoothed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@junzis junzis changed the title Follow track Constrain cruise trajectories to recorded ground tracks Sep 22, 2026
@junzis
junzis merged commit 1bc35af into junzis:main Sep 22, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants