Skip to content

feat: ControlledVectorField and ComposedVectorField (state-space control composition)#475

Merged
ocots merged 1 commit into
mainfrom
feat/controlled-composed-vector-field
Jul 5, 2026
Merged

feat: ControlledVectorField and ComposedVectorField (state-space control composition)#475
ocots merged 1 commit into
mainfrom
feat/controlled-composed-vector-field

Conversation

@ocots

@ocots ocots commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Adds the state-space analogues of PseudoHamiltonian / ComposedHamiltonian, for the OpenLoop / ClosedLoop control-flow path (CTFlows Phase A′).

  • Data.ControlledVectorField{F,TD,VD} <: AbstractControlledVectorField{TD,VD} — a controlled vector field fc(t,x,u,v) with an explicit control argument, out-of-place (no mutability trait), dynamics_trait = StateDynamics. Natural + uniform (t,x,u,v) call signatures.
  • Data.ComposedVectorField{TD,VD,CVF,L} <: AbstractVectorField{TD,VD,OutOfPlace} — functor g(t,x,v) = fc(t,x,u(...),v) composing a controlled vector field with an OpenLoop or ClosedLoop control law. The control is read via the law's feedback-dispatched uniform call (open-loop u(t,v), closed-loop u(t,x,v)).

Notes

  • Composed traits are the join of the two inputs, so fc and the law may carry different TD/VD — the composition always goes through the uniform calls, so individual traits need not match. Tested for cross-trait cases (autonomous fc + non-autonomous law → NonAutonomous; fixed fc + variable law → NonFixed).
  • Rejects DynClosedLoop laws (that is the Hamiltonian path — ComposedHamiltonian).
  • Reuses _join_td / _join_vd from the composed-Hamiltonian module.
  • Getters controlled_vector_field, control_law.

Tests

test/suite/data/test_controlled_vector_field.jl and test_composed_vector_field.jl: all call arities, cross-trait joins, contract (AbstractVectorField / OutOfPlace / StateDynamics), type stability (@inferred), and the DynClosedLoop rejection. Full suite green: 4315/4315.

Downstream

CTFlows Phase A′ will use these to wire Flow(fc, law) and Flow(ocp, OpenLoop/ClosedLoop) → a state flow returning a ControlledTrajectory (state + reconstructed control, no costate). Requires a new CTBase beta.

🤖 Generated with Claude Code

…rol composition)

State-space analogues of PseudoHamiltonian / ComposedHamiltonian, for the
OpenLoop / ClosedLoop control-flow path.

- `Data.ControlledVectorField{F,TD,VD} <: AbstractControlledVectorField{TD,VD}` — a
  controlled vector field `fc(t,x,u,v)` with an explicit control argument, out-of-place
  (no mutability trait), `dynamics_trait = StateDynamics`. Natural + uniform (t,x,u,v)
  call signatures.
- `Data.ComposedVectorField{TD,VD,CVF,L} <: AbstractVectorField{TD,VD,OutOfPlace}` —
  functor `g(t,x,v) = fc(t,x,u(...),v)` composing a controlled vector field with an
  OpenLoop or ClosedLoop control law. The control is read via the law's feedback-
  dispatched uniform call (open-loop `u(t,v)`, closed-loop `u(t,x,v)`); composed traits
  are the join of the two inputs, so fc and law may carry different TD/VD. Rejects
  DynClosedLoop (that is the Hamiltonian path). Getters `controlled_vector_field`,
  `control_law`.

Reuses `_join_td` / `_join_vd` from the composed-Hamiltonian module. Tests cover all
call arities, cross-trait joins, contract (AbstractVectorField / OutOfPlace /
StateDynamics), type stability, and the DynClosedLoop rejection. Full suite: 4315/4315.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ocots
ocots merged commit 1b50781 into main Jul 5, 2026
6 checks passed
@ocots
ocots deleted the feat/controlled-composed-vector-field branch July 5, 2026 20:47
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