Consider the vertical (1D) descent of a spacecraft onto the lunar surface. The descent phase starts at $t=0$, and the touchdown happens at (free) final time $t=T$. Because of the lack of atomosphere, the spacecraft needs to use thrust to negate free fall due to gravity, and thereby ensure soft landing.
Let $g$ be the constant (lunar) acceleration due to gravity during the descent. Suppose the mass of the fuel at time $t$ is $m(t)$, which changes over $0\leq t \leq T$ since the fuel is burnt to generate the thrust $\tau = -k\dot{m}$, where the velocity of exhaust gas w.r.t. the spacecraft is a constant $k>0$. Let $h(t)$ be the altitude of the spacecraft above the lunar surface at time $t$. From Newton's law (force balance), we have
$$m\ddot{h} = \tau - mg = -k\dot{m} - mg.$$The initial conditions are given: $h(0):=h_{0}>0$, $\dot{h}(0)=v_{0}<0$, $m(0)=m_{0}>0$. The terminal constraints are: $h(T)=0$, $\dot{h}(T)=0$; however $m(T)$ is free. Here, the control $u$ is the rate of fuel consumption, i.e., $\dot{m} = u$. The engine imposes the constraint: $-\alpha \leq u \leq 0$, for some known constant $\alpha>0$.
Since the spacecraft would like to return to Earth, the control objective is to maximize the fuel remaining $m(T)$ at touchdown, i.e., to minimize the fuel consumed: $m_{0} - m(T)$.
(a.1) Clearly define the state vector $x = (x_{1}, x_{2}, x_{3})^{\top}\in\mathbb{R}^{3}$ and write the optimal control problem in standard Mayer form.
(a.2) Rewrite the same optimal control problem in Lagrange form.
(a.3) Prove that the above optimal control problem is equivalent to minimizing $T$, i.e., the most fuel economic descent is also the fastest descent.
(b.1) For the optimal control problem in part (a.3), write the Hamiltonian $H$, the costate ODEs, the PMP, and the transversality condition.
(b.2) Prove that there does not exist any subinterval of $[0,T]$ where the optimal control is singular.
[Hint: If possible, assume that there exist a finite subinterval $[t_{1},t_{2}]$ with $0< t_{1} < t_{2} < T$, where the optimal control is singular. Then prove by contradiction. Use the physical condition that $x_{3}(t)>0$ for all $t\in[0,T]$, even though we did not explicitly enforce that as part of the necessary condition.]
(b.3) Using (b.1)-(b.2), argue that the optimal control $u^{*}$ must take extreme values, i.e., $u^{*}(t)\in\{-\alpha,0\}$ for all $t\in[0,T]$. However, it is not yet clear how many switchings are possible.
(b.4) It is rather technical to prove that at most one switching is possible in this problem, i.e., $u^{*}$ is bang-bang. We will not prove this. Instead, use this information to show that the optimal control policy is to either use full thrust from $t=0$ to $t=T$, or to use a period of zero thrust (free fall) followed by full thrust until touchdown, depending on certain switching curve in the state space.
In this exercise, we will use the direct optimal control solver ICLOCS (http://www.ee.ic.ac.uk/ICLOCS/default.htm) within MATLAB environment to numerically solve the problem in (a.3). Follow download instructions here: http://www.ee.ic.ac.uk/ICLOCS/Downloads.html (requires IPOPT; we do not recommend fmincon). Check out the "Example Problems" tab and its dropdown list. Solve a listed simple example problem to reproduce the plots in the website before coding up our problem in (a.3). Plot the optimal control and optimal state trajectories for (a.3) via ICLOCS. Does your numerical solution corroborate the analytical findings in part (b)?