Bang-Bang Optimal Control
A minimum fuel problem that leads to a bang-bang optimal control.
This problem serves as an example of bang-bang control which often arise when the control input $u(t)$ appears linearly in the cost function. We consider a single double integrator moving in one dimension which has two control inputs with end-point constraints. $$ \begin{array}{ll} \min & J = \int_0^{t_f} u(t) dt\\ \text{s.t.} & \dot{x}(t) = v(t)\\ & \dot{v}(t) = -Gv(t) + u(t) - b(t)\\ & 0 \leq u(t) \leq u_{\max}\\ & 0 \leq b(t) \leq b_{\max}\\ & x(0) = x_0, \quad x(t_f) = x_f\\ & v(0) = 0, \quad v(t_f) = 0 \end{array} $$ In words, $x(t)$ is the position, $v(t)$ is the velocity, $u(t)$ is the forward force while $b(t)$ is the braking force. We assume that $x_0 < x_f$. The vehicle starts at some position $x_0$ at rest and arrives at its destination, $x_f$, and stops.
As usual, we write the Hamiltonian of the optimal control problem. $$ H = u(t) + \lambda_x(t) v(t) - G\lambda_v(t) v(t) + \lambda_v(t) u(t) - \lambda_v(t) b(t) + \mu_u(t) u(t) + \mu_b(t) b(t) $$ We first write the stationarity conditions, $$ \frac{\partial H}{\partial u} = 1 + \lambda_v(t) + \mu_u(t) = 0 \quad \rightarrow \quad \mu_u(t) = -1-\lambda_v(t) $$ and $$ \frac{\partial H}{\partial b} = -\lambda_v(t) + \mu_b(t) = 0 \quad \rightarrow \quad \mu_b(t) = \lambda_v(t) $$ The complementarity condition determines when we are accelerating or braking or neither. $$ \mu_u(t) \left\{ \begin{array}{ll} \leq 0, & u(t) = 0\\ = 0, & 0 < u(t) < u_{\max}\\ \geq 0, & u(t) = u_{\max} \end{array} \right. $$ and $$ \mu_b(t) \left\{ \begin{array}{ll} \leq 0, & b(t) = 0\\ = 0, & 0 < b(t) < b_{\max}\\ \geq 0, & b(t) = b_{\max} \end{array} \right. $$ The co-position is governed by the dynamics, $$ \dot{\lambda}_x(t) = -\frac{\partial H}{\partial x} = 0 \quad \rightarrow \quad \lambda_x(t) = \lambda_x(t_f) $$ which is constant and the co-velocity state is governed by the dynamics, $$ \dot{\lambda}_v(t) = -\frac{\partial H}{\partial v} = -\lambda_x(t) + G \lambda_v(t) \quad \rightarrow \quad \lambda_v(t) = e^{G(t_f-t)} \lambda_v(t_f) + \int_t^{t_f} e^{G(t-\tau)} \lambda_x(t_f) d\tau = e^{G(t_f-t)} \lambda_v(t_f) + \frac{\lambda_x(t_f)}{G} \left[1 - e^{G(t-t_f)} \right] $$ Note that $\lambda_v(t)$ is an exponential function, that is, there does not exist a finite time interval over which $\lambda_v(t) = 0$. This means that $\mu_u(t) = 0$ and $\mu_b(t) = 0$ only for single values of $t$. From the complementarity conditions, this quick switching implies jumps between the minimum input and maximum input. The switching structure we hypothesize is the following: