wiki/ RocketScience/ vertical shoot problem

Vertical Shoot Problem

Here we consider the optimization of an ideal rocket moving straight up against the pull of gravity, but with no atmosphere.

With only gravity to consider the solution should be obvious based on the derivation of the rocket equation. Because we want to maximize burnout velocity we would want to minimize burn time. However doing a formal optimization problem with this simple setup is a good place to start in learning how to optimize trajectories.

  1. Vertical Shoot Problem
    1. Setup
      1. Equations of Motion
    2. Constraint Equations
    3. Boundary Conditions
    4. Calculus of Variations
      1. Augmented Function
      2. Euler-Lagrange Conditions
      3. Transversality Condition
    5. References

Setup

To get rid of all the really hard math we make a number of simplifying assumptions in our setup.

Lets pretend:

  1. The Earth is flat
  2. Gravity points down at 1 g (g0) everywhere
  3. There is no atmosphere (conservative forces only)
  4. The rocket is constrained to only move vertically
  5. The rocket is an ideal rocket, with thrust straight down and with a fixed propellant velocity (Isp)

And then we add one interesting part:

  1. The engine is throttleable

Because the engine is throttleable we have something to optimize. We want to know what throttle setting as a function of time makes our rocket go the highest, thus we have set up an optimization problem where we are going to find and optimal function for some minimization (or maximization) of a solution to the equations of motion.

Equations of Motion

Lets start with a diagram:

Figure 1 — Setup to the vertical shoot problem

Figure 1 -- Setup to the vertical shoot problem

Figure 2 — Rocket parameters

Figure 1 -- Setup to the vertical shoot problem

The rocket moves my exchanging momentum,

So the equations of motion would be:

v = \dot{x}

\dot{v} = - \frac{v_e \dot{m}}{m} - g

Where:

The thing we want to change is m dot, which we will introduce as a parameter u. This is what we are going to throttle.

u = - \dot m

Which makes the acceleration

\dot{v} = \frac{v_e u}{m} - g

Constraint Equations

Now we build a set of constraint equations using what we know about the system. We put them in the form of

f_i = \mathrm{constraint} = 0

Velocity:

f_1 = \dot x - v = 0

Acceleration:

f_2 = \dot{v} + g - \frac{v_e u}{m} = 0

Throttle:

f_3 = u + \dot m = 0

But we also want to introduce one more constraint: that there is a maximum throttle setting on the rocket. So we say that u can be between 0 and umax

0 \le u \le u_{\mathrm{max}}

There is a problem though, we need this in the fi form and not as an inequality. So we create a dummy parameter α and cleverly make it only exist when u is in the range we want. We can do this by picking a function that is only real in a certain range.

\alpha^2 = u(u_{\mathrm{max}} - u)

Think about this for a moment, you see how α can only be a real number when u is between 0 and umax. This yields one more constraint equation

f_4 = u(u_{\mathrm{max}} - u) - \alpha^2 = 0

We now have 4 constraint equations and 5 dependent variables, plus time.

Boundary Conditions

We have 3 differential equations (velocity, acceleration, and mass) so we would expect 8 boundary conditions (2n + 2 — two for each thing differentiated with time, plus two for time). Lets list the ones we know:

And we are missing two:

Calculus of Variations

We have set up the problem as a calculus of variations problem. The idea is to find the time history of all the functions (e.g., u(t)) which are consistent with all the boundary conditions and constraint equations and at the same time minimizes some function J.

Lets let J be

J = -x_f

Because minimizing -x is the same as maximizing x (maximizing the altitude of the rocket).

Augmented Function

First lets make an augmented function F by combining all the constraints with undetermined Lagrangian multipliers (p).

F = \sum_{i} p_i f_i

Adding f1 through f4 gives us

F = p_1(\dot x - v) + p_2\left(\dot v + g - \frac{v_e u}{m}\right) + p_3(\dot m + u) + p_4\left[u(u_{\mathrm{max}} - u) - \alpha^2\right]

Euler-Lagrange Conditions

When there is an extrema we can be guaranteed that the so called Euler-Lagrange conditions are true. The Euler-Lagrange conditions are

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot y_i}\right) - \frac{\partial F}{\partial y_i} = 0

For each of our dependent variables (yi). Finding each condition:

x:

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot x}\right) - \frac{\partial F}{\partial x} = \frac{d}{dt}\left(p_1\right) - 0 = 0

\dot p_1 = 0

v:

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot v}\right) - \frac{\partial F}{\partial v} = \frac{d}{dt}\left(p_2\right) + p_1 = 0

\dot p_2 = -p_1

m:

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot m}\right) - \frac{\partial F}{\partial m} = \frac{d}{dt}\left(p_3\right) - p_2 \frac{v_e u}{m^2} = 0

\dot p_3 = p_2\frac{v_e u}{m^2}

u:

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot u}\right) - \frac{\partial F}{\partial u} = 0 - p_2 \frac{v_e}{m} + p_3 + p_4(u_{\mathrm{max}} - 2u) = 0

p_3 - p_2 \frac{v_e}{m} + p_4(u_{\mathrm{max}} - 2u) = 0

α:

\frac{d}{dt}\left(\frac{\partial F}{\partial \dot \alpha}\right) - \frac{\partial F}{\partial \alpha} = 0 - p_4 \alpha = 0

p_4 \alpha = 0

We now know a little bit of information about what the solution must look like. But we also have to deal with the missing boundary condition tf. So we use the transversality condition.

Transversality Condition

The transversality condition states that for the missing boundary must lie along some curve which we can compute. This looks like

\left[d\phi + \left(F - \sum_{k}\frac{\partial F}{\partial \dot y_k} \dot y_k\right)dt + \sum_{k}\frac{\partial F}{\partial \dot y_k} d y_k \right]_{0}^f = 0

where φ is the variable we are maximizing, in this case x.

References