08. Goddard problem with a knot
Example 07 used one polynomial across the thrust switch at burnout, causing oscillations. Splitting time near that switch lets each phase use its own polynomial. The physical model is unchanged.
| Item | Definition |
|---|---|
| States | Radial height , velocity , mass |
| Control | Thrust |
| Objective | Maximize final height |
| Phases | Two phases, 25 nodes each; knot fixed at 0.075, final time free |
| New concepts | Knots and discontinuous controls |
Situation
Section titled “Situation”The rocket and objective are the same as Example 07. Its thrust changes from maximum through an intermediate singular arc to zero. The one-phase solution burns out around 0.077, so we place a knot at 0.075:
- Phase 1: , primarily powered ascent.
- Phase 2: , primarily coasting.
These roles are encouraged by the initial guess; the thrust constraints themselves are the same in both phases. All quantities remain dimensionless.
Formulation
Section titled “Formulation”Dynamics
Section titled “Dynamics”Both phases use
See Example 07 for the meaning of each term.
Phases and linkage
Section titled “Phases and linkage”States are continuous, but no thrust continuity condition is imposed. Thrust may jump at the knot.
Boundary conditions
Section titled “Boundary conditions”Constraints and objective
Section titled “Constraints and objective”The knot lower bound is inactive because the equality already fixes .
Parameters
Section titled “Parameters”The parameters match Example 07: , , , , , and , with the additional knot time 0.075.
Initial guess
Section titled “Initial guess”Start with phase times ; optimization moves the knot to 0.075. Height is cubic from 1 to 1.01 and velocity is zero. Mass decreases linearly from 1 to 0.6 in phase 1, then remains 0.6. Thrust starts at maximum throughout phase 1 and zero throughout phase 2.
Results
Section titled “Results”
- Final height: 1.0128, close to Example 07’s 1.0128.
- Thrust drops discontinuously at the knot and remains nearly zero throughout phase 2.
- Mass at the end of phase 1: 0.6000, so almost all propellant is consumed in that phase.
- Final time: 0.200.
Explanation
Section titled “Explanation”Why oscillations decrease
Section titled “Why oscillations decrease”The discontinuity now lies between the final node of phase 1 and the first node of phase 2. Within each phase, thrust is smooth enough for a polynomial. Phase 2 can represent zero thrust directly. Phase 1 also has fewer demands on its polynomial, reducing oscillation around the maximum-to-intermediate transition.
Choosing the knot time
Section titled “Choosing the knot time”This example fixes the knot based on the previous solution. It is slightly earlier than the one-phase burnout estimate 0.079, which makes the rocket consume propellant earlier and slightly reduces final height, around the fifth decimal place. The late rise in phase-1 thrust is consistent with burning the remaining propellant before the fixed knot.
Removing allows the optimizer to choose the knot. Additional conditions, such as consuming propellant by the end of phase 1, may be needed to keep it aligned with burnout.
Try it
Section titled “Try it”- Change
result.equal(ts0, 0.075)to 0.06 or 0.09. An earlier knot may reduce height; a later one may put the thrust jump inside phase 1 and restore oscillations. - Reduce
[25, 25]to[15, 10]and compare accuracy with the 50-node one-phase solution. - Remove the knot-time equality and inspect the optimized knot and thrust history.
uv run python examples/08_goddard_1knot.py