How would I find the solution of explicit MPC with piecewise u?

76 Views Asked by At

If I want to use this kind of system model

x(k+1)=$A$x(k)+$\overbrace{[\Phi_1\ \Phi_2]}^{B}\begin{bmatrix} u(k)\\ u(k+1)\\ \end{bmatrix}$

(Assume that the input is linearly interpolated between sample times) to solve the cost function

$J(k) = \min_u \sum_{j=1}^{N_p-1} \|x(k+j|k)\|_{Q_i}^2 + \sum_{j=0}^{N_c-1} \|u(k+j)\|_{P_i}^2$ by using explicit MPC.

\begin{equation} \begin{aligned} \begin{bmatrix} x(k+1|k)\\ x(k+2|k) \\ \vdots \\ \vdots \\ \vdots \\ x(k+N_p-1|k)\\ x(k+N_P|k) \\ \end{bmatrix} &= \overbrace{\begin{bmatrix} A\\ A^2\\ A^3\\ \vdots \\ A^{N_p} \end{bmatrix}}^{M_x}x(k)+\overbrace{\begin{bmatrix} B &0 &\cdots & 0\\ AB & B & \cdots & 0\\ \vdots & \vdots & \ddots &\vdots \\ A^{N_{p}-1}B & A^{N_{p}-2}B & \cdots & A^{N_{p}-N_{c}}B\end{bmatrix}}^{M_u}\begin{bmatrix} u(k|k)\\ u(k+1|k) \\ u(k+1|k) \\ u(k+2|k) \\ \vdots \\ \vdots \\ u(k+N_c-1|k)\\ u(k+N_c-1|k)\\ u(k+N_c|k) \\ \end{bmatrix}\\ \end{aligned} \end{equation}

\begin{equation} \begin{aligned} \label{Kostenfunktion} \mathbf{H}&=\mathbf{M}_{u}^{T}\mathbf{Q}\mathbf{M}_{u}+\mathbf{P}\\ \mathbf{f}^T&=-\mathbf{M}_{u}^{T}\mathbf{Q}(-\mathbf{M}_{x}x_{k})\\ \mathbf{u}&=-inv(\mathbf{H})*\mathbf{f}\\ \end{aligned} \end{equation}

should I still choose the first $u=[1\ 0\ 0\ 0... 0]^T\mathbf{u}$ as optimal input other $u=[1\ 1\ 0\ 0... 0]^T\mathbf{u}$ during the optimization?

1

There are 1 best solutions below

1
On BEST ANSWER

You could do a coordinate transformation such that it could be written into a more standard form. For your original system I use the following notation

$$ x[k+1] = A\,x[k] + B_1\,u[k] + B_2\,u[k+1] \tag{1} $$

and the new coordinates are defined as

$$ z[k] = x[k] - B_2\,u[k]. \tag{2} $$

Increasing the index in $(2)$ and substituting in $(1)$ gives

$$ z[k+1] = A\,x[k] + B_1\,u[k]. \tag{3} $$

Solving $(2)$ for $x[k]$ and substituting that into $(3)$ gives the following standard form state space model

\begin{align} z[k+1] &= A\,(z[k] + B_2\,u[k]) + B_1\,u[k], \tag{4a} \\ &= A\,z[k] + (\underbrace{A\,B_2 + B_1}_{B})\,u[k]. \tag{4b} \end{align}

The cost function now has to be written in terms of $z[k]$ instead of $x[k]$

$$ J(k) = \min_u \sum_{j=1}^{N_p-1} \|z[k+j|k] + B_2\,u[k+j]\|_{Q_i}^2 + \sum_{j=0}^{N_c-1} \|u[k+j]\|_{P_i}^2, \tag{5} $$

where the terms in the first summation can also be written as

\begin{align} \|z[k+j|k] + B_2\,u[k+j]\|_{Q_i}^2 &= (z[k+j|k] + B_2\,u[k+j])^\top Q_i\,(z[k+j|k] + B_2\,u[k+j]), \\ &= z[k+j|k]^\top Q\,z[k+j|k] + 2\,z[k+j|k]^\top N\,u[k+j] + u[k+j]^\top R\,u[k+j], \end{align}

with $Q = Q_i$, $N = Q_i\,B_2$ and $R = B_2^\top Q_i\,B_2$.