Add comprehensive state constraint example with Bryson-Denham problem#758
Merged
Add comprehensive state constraint example with Bryson-Denham problem#758
Conversation
- Create new autonomous example-state-constraint.md with state constraint variant - Remove state constraint section from example-double-integrator-energy.md - Add cross-references between the two examples - Add state constraint example to Basic Examples menu in make.jl
… example - Rename 'Adding a state constraint' -> 'First-order state constraint' - Add explanation of constraint order for order-1 case - Add new 'Second-order state constraint' section (Bryson-Denham problem) - Explain order-2 via two differentiations of g(x) - Show two cases: touch point (a=1/4) and boundary arc (a=1/9) - Direct method only, solutions superimposed on same plot - Add Bryson et al. 1963 reference
Contributor
- Correct three-regime description: unconstrained (a>=1/4), touch point (1/6<=a<=1/4), boundary arc (a<1/6) - Use a=1/5 (touch point) and a=1/7 (boundary arc) as example values - Add Bryson & Ho (1975) Applied Optimal Control as [^3]
- Two unconstrained arcs joined at t1 with costate jump [Δpq, 0] - Shooting unknowns: p0 (2D), t1, Δpq (4 equations) - Initial guess extracted from direct solution sol_touch - Flow concatenation: fs_bd * (t1, [Δpq, 0], fs_bd) - Analytical verification: pq = ±4.8, jump = 9.6, cost = 2.24
- Three arcs: unconstrained → boundary arc → unconstrained - Flow: fs_arc * (t1, [Δpq1,0], fc_bd) * (t2, [Δpq2,0], fs_arc) - 6 unknowns: p0 (2D), t1, t2, Δpq1, Δpq2 - 6 conditions: x(tf)=xf (×2), q(t1)=a, v(t1)=0, pv(t1+)=0, pq(t1+)=0 - Initial guess extracted from sol_arc - Symmetry check: Δpq1 = Δpq2, t2 = 1 - t1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a comprehensive state constraint example to the documentation, starting from the extraction of a first-order constraint example and extending it with a detailed second-order constraint (Bryson-Denham problem) treatment.
Initial commit (76e5a30): Extracted the state constraint example from
example-double-integrator-energy.mdinto a separate autonomous file example-state-constraint.md. This refactoring improves documentation organization by:make.jlMain additions:
Second-order state constraint (Bryson-Denham problem): Added a complete treatment of the position constraint
q(t) ≤ awith boundary conditionsx(0) = (0,1),x(1) = (0,-1), including:1/6 ≤ a ≤ 1/4, boundary arc regime fora < 1/6Direct method: Implemented parametric OCP via
make_ocp(a)function to avoid code duplication, solving both cases (a=0.2 touch point, a=0.1 boundary arc) in a single workflowIndirect methods:
Code quality improvements:
findallpatternreturn nothingto shooting functions