How to discretize or transform an optimal control problem with free final time?

381 Views Asked by At

Given is the following simple optimal control problem:

$$ \begin{align} &\min_{x, u, t_f} t_f \\ % \text{s.t.} \qquad \dot{x}(t) &= \begin{pmatrix} x_2(t) \\ u(t) \end{pmatrix} \\% x(0) &= (0, 0)^{\top} \\ x(t_f) &= (300, 0)^{\top} \\ x_1(t) &\in [0, 33] \\ x_2(t) &\in [0, 330] \\ u(t) &\in [-2, 1] \end{align} $$

with $x(t) = (x_1(t), x_2(t))^\top$. Here, $t_f$ is the free final time. I'd like to discretize the problem and solve it with a NLP solver. However, how can I handle the $t_f$ variable when discretizing the problem? Is there some transformation technique for the problem?

1

There are 1 best solutions below

0
On BEST ANSWER

Let's handle the general case with free initial and free final time:

$$ \begin{align} &\min_{x, u, t_0, t_f} &\quad& \varphi(t_0, t_f, x(t_0), x(t_f)) \\ &\text{s.t.} & \dot{x}(t) &= f(t, x(t), u(t)) \\ && 0 &= h(t_0, t_f, x(t_0), x(t_f)) \\ && u(t) &\in \mathcal{U} \end{align} $$

Here, $x$ is the state, $u$ the control, $f$ the ODE rhs and $h$ are the boundary conditions. The basic idea is now to map the interval $[0, 1]$ onto the interval $[t_0,t_f]$. For this purpose we introduce the linear time transformation $$ t(\tau) := t_0 + \tau \cdot (t_f - t_0), \quad \tau \in [0, 1] $$ and define $$ \begin{align} \overline{x}(\tau) := x(t(\tau)) = x(t_0 + \tau \cdot (t_f - t_0)), \\ \overline{u}(\tau) := u(t(\tau)) = u(t_0 + \tau \cdot (t_f - t_0)). \end{align} $$

Then, we have by the chain rule:

$$ \begin{align} \frac{d}{d \tau} \overline{x}({\tau}) = t'(\tau) \cdot \dot{x}(t(\tau)) &= (t_f - t_0) \cdot f(t(\tau), x(t(\tau)), u(t(\tau))) \\ &= (t_f - t_0) \cdot f(t(\tau), \overline{x}(\tau), \overline{u}(\tau)). \end{align} $$

By interpreting $t_0$ and $t_f$ as constant states where the initial values $t_0(0)$ and $t_f(0)$ are free, we obtain the optimal control problem:

$$ \begin{align} &\min_{x, u, t_0, t_f} &\quad& \varphi(t_0(0), t_f(1), \overline{x}(0), \overline{x}(1)) \\ % &\text{s.t.} & \frac{d}{d \tau}\overline{x}(\tau) &= (t_0(\tau) - t_f(\tau) ) \cdot f(t(\tau), \overline{x}(\tau), \overline{u}(\tau)) \\ % && \frac{d}{d \tau} t_0(\tau) &= 0 \\ && \frac{d}{d \tau} t_f(\tau) &= 0 \\ && 0 &= h(t_0(0), t_f(1), \overline{x}(0), \overline{x}(1)) \\ && \overline{u}(\tau) &\in \mathcal{U} \end{align} $$

This problem can easily be discretized for $\tau$.

A reference for this transformation technique is chapter 1.2.1 of Optimal Control of ODEs and DAEs (Gerdts, M.).