{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 1. [50 points] Moon Landing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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. \n", "\n", "\n", "\n", "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\n", "\n", "$$m\\ddot{h} = \\tau - mg = -k\\dot{m} - mg.$$\n", "\n", "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$.\n", "\n", "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)$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## (a) [3 + 2 + 5 = 10 points] Optimal Control Problem" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(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**.\n", "\n", "(a.2) Rewrite the same optimal control problem in **Lagrange form**. \n", "\n", "(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**. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## (b) [(1 + 1 + 2 + 1) + 15 + 2 + 8 = 30 points] Analytical Solution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(b.1) For the optimal control problem in part (a.3), write the **Hamiltonian** $H$, the **costate ODEs**, the **PMP**, and the **transversality condition**.\n", "\n", "(b.2) **Prove that** there does not exist any subinterval of $[0,T]$ where the optimal control is singular.\n", "\n", "[**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.]\n", "\n", "(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.\n", "\n", "(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." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## (c) [10 points] Numerical Solution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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)?** " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 2 }