Skip to content

Commit 1807948

Browse files
committed
Update v2.0 documentation with augment=true and Flow(ocp) features
- Add CTFlows enhancements section in CHANGELOG.md - Document augment=true feature for automatic costate computation - Document Flow(ocp) direct creation from control-free problems - Add comprehensive CTFlows Features section in BREAKING.md - Include migration examples for augmented Hamiltonian approach - Fix linting issues (duplicate headings, list formatting) - Maintain consistent technical tone throughout documentation
1 parent f7d47f7 commit 1807948

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

BREAKING.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Version 2.0.0 represents a major architectural redesign of OptimalControl.jl, in
1010
- **GPU/CPU parameter system** for heterogeneous computing
1111
- **Advanced option routing** with introspection and disambiguation tools
1212
- **New solver integrations** (Uno, MadNCL)
13-
- **Control-free problems** support
13+
- **Control-free problems** support with augmented Hamiltonian approach
14+
- **CTFlows enhancements** with `augment=true` and direct OCP flow creation
1415
- **Modernized reexport system** using `@reexport import`
1516

1617
## Removed Functions
@@ -172,7 +173,7 @@ The old functional approach is no longer supported.
172173

173174
These features are new in v2.0.0 but don't break existing code:
174175

175-
### Control-Free Problems
176+
### Control-Free Problems Support
176177

177178
Support for optimal control problems without control variables:
178179

@@ -220,6 +221,45 @@ using CUDA, MadNLPGPU
220221
sol = solve(ocp, :collocation, :exa, :madnlp, :gpu)
221222
```
222223

224+
## CTFlows Features
225+
226+
### Control-Free Problems
227+
228+
v2.0.0 introduces comprehensive support for control-free problems (optimal control without control variables) with enhanced CTFlows integration:
229+
230+
**Augmented Hamiltonian approach:**
231+
232+
```julia
233+
# v1.1.6: Manual augmented Hamiltonian construction
234+
function H_aug(t, x_, p_)
235+
x, λ = x_
236+
p, _ = p_
237+
return H(t, x, p, λ)
238+
end
239+
f = Flow(Hamiltonian(H_aug))
240+
241+
# v2.0.0: Direct OCP flow creation
242+
f = Flow(ocp)
243+
```
244+
245+
**Automatic costate computation:**
246+
247+
```julia
248+
# v2.0.0: augment=true automatically computes p_λ(tf)
249+
function shoot!(s, p0, λ)
250+
_, px_tf, pλ_tf = f(t0, x0, p0, tf, λ; augment=true)
251+
s[1] = px_tf # p(tf) = 0
252+
s[2] = pλ_tf # p_λ(tf) = 0
253+
end
254+
```
255+
256+
**Mathematical framework:**
257+
258+
- Complete augmented system dynamics with proper transversality conditions
259+
- Automatic handling of Lagrange costs: $p_\lambda(t_f) = 0$
260+
- Automatic handling of Mayer costs: $p_\omega(t_f) = -2\omega$
261+
- Initial conditions: $p_\lambda(t_0) = 0$ by construction
262+
223263
## Dependency Updates
224264

225265
v2.0.0 requires updated versions of CTX packages:

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5555
- Optimal control problems without control variables
5656
- Optimization of constant parameters in dynamical systems
5757
- Full integration with solve pipeline
58+
- **Augmented Hamiltonian approach**: `augment=true` feature in CTFlows for automatic costate computation
59+
- **Simplified flow creation**: `Flow(ocp)` directly creates Hamiltonian flow from control-free problems
60+
- **Mathematical framework**: Complete transversality conditions for variable parameters
61+
- **Documentation**: Comprehensive examples with exponential growth and harmonic oscillator
5862

5963
- **New solvers**:
6064
- **Uno**: CPU-only nonlinear optimization solver (methods with `:uno`)
@@ -78,6 +82,12 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7882
- Organized by source package (ctbase.jl, ctdirect.jl, ctflows.jl, ctmodels.jl, ctparser.jl, ctsolvers.jl)
7983
- Cleaner separation between imported and exported symbols
8084

85+
- **CTFlows enhancements**:
86+
- **Augmented Hamiltonian computation**: `augment=true` automatically computes costates for variable parameters
87+
- **Direct OCP flow creation**: `Flow(ocp)` creates Hamiltonian flow without manual Hamiltonian definition
88+
- **Transversality conditions**: Automatic handling of $p_\lambda(t_f) = 0$ for Lagrange costs and $p_\omega(t_f) = -2\omega$ for Mayer costs
89+
- **Mathematical rigor**: Complete augmented system dynamics with proper initial conditions
90+
8191
- **Strategy registry system**:
8292
- `StrategyRegistry` with metadata for all strategies
8393
- `StrategyMetadata` with id, options, and parameter support

0 commit comments

Comments
 (0)