Skip to content

Direct shooting#561

Open
PierreMartinon wants to merge 21 commits intodevelopfrom
direct_shooting
Open

Direct shooting#561
PierreMartinon wants to merge 21 commits intodevelopfrom
direct_shooting

Conversation

@PierreMartinon
Copy link
Member

@PierreMartinon PierreMartinon commented Feb 23, 2026

First prototype: basic version with fixed step integration between time steps (midpoint).

Notes:

  • implementation shares a lot of common code with collocation, using a new parameter 'control_steps' that corresponds to the number of steps for the inner integration over each time step. With control_steps=1 this is actually the same as collocation. Tests on the truck problem confirm this, with the same NLP dimensions and convergence (objective, iterations, time).
  • currently, the OCP functions are evaluated using only the state values at the time steps, not the recomputed intermediate values. This leads to a lower accuracy of the discretized ODE, and for instance using 25 time steps and 10 control steps is less accurate than a collocation with 250 steps. This is mainly a choice of convenience, since the aim of the direct shooting is to use variable step ODE solvers anyway. This could be improved by recomputing the dynamics as needed, with the updated state values, instead of precomputing all dynamics at once.
  • ADNLPModels only for now. For Examodels we may try the naive approach and loop over constraints components (the performance drop of this vs the current implementation in CTParser could be checked on the collocation discretizer)

Tasks

  • add integral function to discretization API
  • variables bounds
  • objective function
  • constraints function and bounds
  • initial guess
  • solution

@PierreMartinon PierreMartinon changed the base branch from main to develop February 23, 2026 11:26
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Breakage test results
Date: 2026-02-27 11:41:00

Name Latest Stable
OptimalControl compat: v0.17.5-beta compat: v1.0.2-beta

…, free tf, bolza, path constraints): first tests ok with 1 control step ie similar to collocation, and with 50 steps / 20 controls per step as well
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.

1 participant