Skip to content

Report grid cost from the solver's own quadrature - #32

Merged
junzis merged 3 commits into
junzis:mainfrom
jubarauna:fix_final_grid_cost
Sep 22, 2026
Merged

junzis merged 3 commits into
junzis:mainfrom
jubarauna:fix_final_grid_cost

Conversation

@jubarauna

Copy link
Copy Markdown
Contributor

The NLP integrates the grid field with the Legendre quadrature at the collocation points, while the reported value summed the per-node grid_cost column, a left-endpoint rectangle rule over the intervals. The two disagree by up
to 20% per solve and by a differing amount between solves of the same problem, so weighted-sum points could sit above the lower convex hull of their own Pareto front, which no weight can produce. Accumulate the grid term
beside the objective during transcription, unscaled by auto_rescale_objective, and expose it as Base.grid_cost_value for TrajectoryResult.grid_cost to prefer. Fuel already avoided this by deriving fuel_cost from mass
differences rather than recomputing the integral.

TrajectoryResult.grid_cost therefore returns a different, correct number; its name, type and units are unchanged and the grid_cost column is untouched. Also assign the winning candidate's objective_value and grid_cost_value in
multi-start, which previously reported the last start solved rather than the trajectory it returned.

jubarauna and others added 3 commits September 16, 2026 16:23
  The NLP integrates the grid field with the Legendre quadrature at the collocation points, while the reported value summed the per-node grid_cost column, a left-endpoint rectangle rule over the intervals. The two disagree by up
  to 20% per solve and by a differing amount between solves of the same problem, so weighted-sum points could sit above the lower convex hull of their own Pareto front, which no weight can produce. Accumulate the grid term
  beside the objective during transcription, unscaled by auto_rescale_objective, and expose it as Base.grid_cost_value for TrajectoryResult.grid_cost to prefer. Fuel already avoided this by deriving fuel_cost from mass
  differences rather than recomputing the integral.

  TrajectoryResult.grid_cost therefore returns a different, correct number; its name, type and units are unchanged and the grid_cost column is untouched. Also assign the winning candidate's objective_value and grid_cost_value in
  multi-start, which previously reported the last start solved rather than the trajectory it returned.
@junzis
junzis merged commit 7cb24b1 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