You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- New comprehensive state constraint example (`example-state-constraint.md`) demonstrating first-order and second-order (Bryson-Denham) state constraints
16
+
- Direct method implementation with parametric OCP for both touch point and boundary arc cases
17
+
- Indirect methods for touch point (2-arc) and boundary arc (3-arc) cases with shooting functions
18
+
- Theoretical references: Bryson et al. (1963), Jacobson et al. (1971), Bryson & Ho (1975)
19
+
- Hamiltonian-based adjoint chain explanations for boundary arc dynamics
20
+
21
+
### Changed
22
+
23
+
-**Documentation organization**:
24
+
- Extracted state constraint section from `example-double-integrator-energy.md` into dedicated example file
25
+
- Added cross-references between energy minimization and state constraint examples
**Major version release** with complete solve architecture redesign. This release introduces breaking changes from v1.1.6 (last stable release). See [BREAKING.md](BREAKING.md) for detailed migration guide.
Copy file name to clipboardExpand all lines: docs/src/example-double-integrator-energy.md
+1-146Lines changed: 1 addition & 146 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,149 +166,4 @@ plot(indirect_sol)
166
166
- You can use [MINPACK.jl](@extref Tutorials Resolution-of-the-shooting-equation) instead of [NonlinearSolve.jl](https://docs.sciml.ai/NonlinearSolve).
167
167
- For more details about the flow construction, visit the [Compute flows from optimal control problems](@ref manual-flow-ocp) page.
168
168
- In this simple example, we have set an arbitrary initial guess. It can be helpful to use the solution of the direct method to initialise the shooting method. See the [Goddard tutorial](@extref Tutorials tutorial-goddard) for such a concrete application.
169
-
170
-
## State constraint
171
-
172
-
The following example illustrates both direct and indirect solution approaches for the energy minimization problem with a state constraint on the maximal velocity. The workflow demonstrates a practical strategy: a direct method on a coarse grid first identifies the problem structure and provides an initial guess for the indirect method, which then computes a precise solution via shooting based on Pontryagin's Maximum Principle.
173
-
174
-
!!! note
175
-
176
-
The direct solution can be refined using a finer discretization grid for higher accuracy.
177
-
178
-
### Direct method: constrained case
179
-
180
-
We add the path constraint
181
-
182
-
```math
183
-
v(t) \le 1.2.
184
-
```
185
-
186
-
Let us model, solve and plot the optimal control problem with this constraint.
The solution has three phases (unconstrained-constrained-unconstrained arcs), requiring definition of Hamiltonian flows for each phase and a shooting function to enforce boundary and switching conditions.
216
-
217
-
### Indirect method: constrained case
218
-
219
-
Under the normal case, the pseudo-Hamiltonian reads:
220
-
221
-
```math
222
-
H(x, p, u, \mu) = p_1 v + p_2 u - \frac{u^2}{2} + \mu\, g(x),
223
-
```
224
-
225
-
where $g(x) = v_{\max} - v$. Along a boundary arc we have $g(x(t)) = 0$; differentiating gives:
Because the adjoint vector is continuous at both the entry time $t_1$ and the exit time $t_2$, the unknowns are $p_0 \in \mathbb{R}^2$ together with $t_1$ and $t_2$. The target condition supplies two equations, $g(x(t_1)) = 0$ enforces the state constraint, and $p_2(t_1) = 0$ encodes the switching condition.
To reconstruct the constrained trajectory, concatenate the flows as follows: an unconstrained arc until $t_1$, a boundary arc from $t_1$ to $t_2$, and a final unconstrained arc from $t_2$ to $t_f$.
303
-
This composition yields the full solution (state, costate, and control), which we then plot alongside the direct method for comparison.
0 commit comments