Skip to content

Multiple shooting: per-node ps.u0, serial multi-node execution, pairwise matching constraints #98

Description

@AlCap23

What to build

Extend the single-node pipeline (#97) to genuine multiple shooting: ps.u0 becomes a collection of named-state NamedTuples, one TunableParameter set per shooting node (#93) — the number of entries equals the number of shooting nodes (1 for plain single shooting). ps.controls stays a single flat/global named collection, not duplicated per node, since control breakpoints don't care where shooting nodes fall.

Build the full pipeline: ps.u0 (N entries) → Vector{TrajectoryInterval} of length N (coarse, one per node) → each split via #97's mechanism using the global ps.controlsVector{Vector{TrajectoryInterval}} (outer = node, inner = control segment within that node). For this issue, solve the outer vector serially (parallel dispatch is #98).

Matching/continuity constraints between adjacent nodes are a simple pairwise comparison between consecutive nodes' boundary TrajectoryIntervals — last(intervals[i]).output (end state) vs intervals[i+1].ic (the next node's free IC) — touching only the outermost (first/last) elements of each node's inner segment vector. No separate shooting-bookkeeping field is needed (unlike today's Trajectory.shooting, populated during the stitching constructor in multiple_shooting.jl).

Acceptance criteria

  • ps.u0 holds one named-state NamedTuple per shooting node; ps.controls remains global/unduplicated
  • Full Vector{Vector{TrajectoryInterval}} pipeline builds correctly for 2+ nodes
  • Matching constraint for node i+1 is a pure function of two adjacent TrajectoryIntervals (previous node's last segment output, next node's first segment ic)
  • Constraints evaluate to ~0 for a consistent (e.g. forward-solved) initial guess, and nonzero for an inconsistent one
  • Reverse-mode (Zygote) gradient of a scalar loss plus constraints w.r.t. ps.u0/ps.controls matches a forward-mode/finite-difference reference

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions