Model Predictive Control: Linear MPC with constraints: Matrix sizes unclear.

609 Views Asked by At

I have to put Model Predictive Control constraints in a standard form. The way to achieve this form is shown below. I am struggling with the dimensions of the final matrices $\mathcal{M}$ and $\mathcal{E}$ as seen at bullet $5$.

Given is the following set of input and state contraints

$$-0.1 \leq u(k) \leq 0.1 \quad \text{and} \quad \begin{bmatrix} -10 \\ 10 \end{bmatrix} \leq x(k) \leq \begin{bmatrix} 10 \\ 10 \end{bmatrix}$$

These are the corresponding slides from the lecture where $N$ is the number of prediction steps, $u_{i|k}$ are the inputs for prediction $i$ at step $k$ and $x_{i|k}$ are the states for prediction $i$ at step $k$.

enter image description here

enter image description here

enter image description here

Once again, the constraints are defined as: $$-0.1 \leq u(k) \leq 0.1 \quad \text{and} \quad \begin{bmatrix} -10 \\ 10 \end{bmatrix} \leq x(k) \leq \begin{bmatrix} 10 \\ 10 \end{bmatrix}$$

Rewriting this gives:

$$M=\begin{bmatrix}0\\0\\-1\\1 \end{bmatrix}, \ \ E=\begin{bmatrix}-1\\1\\0\\0 \end{bmatrix} \ \text{and} \ \ b=\begin{bmatrix}0.1\\0.1\\10\\10 \end{bmatrix}$$

I know that $\mathcal{M}$ will have $N$ columns and $\mathcal{E}$ will have $N-1$ columns. Suppose $N = 3$, then $\mathcal{M}$ will have 3 columns and $\mathcal{E}$ will have $4$ but how many rows will they each have?

1

There are 1 best solutions below

2
On BEST ANSWER

How did you count the columns of $\mathcal{E}$ and reached to $(N-1)$. Starting the index from $0$, makes the number of columns up to $N$.

In your case, the number of control input variables is 1 and the constraints are presented in a special form.

Calculating these sizes are very time consuming and error prone. In the Table 3.1 of my thesis, I have a general size of all matrices if the constraints are presented in the way I presented.

I spent a long time to find the correct sizes and I am not going to recalculate. But, considering your case, since you do not have a constraint on $\Delta \boldsymbol u$, you have less constants in that sense. However, in my case every variable has an upper bound and a lower bound while you have considered separate rows for the upper bound and the lower bound which doubles the size of your constraints. So, If I have understood your problem correctly, you have
$$ 2(N_c N_u + N_p N_y) \times N_c N_u $$ constraints where $N_p$ is the prediction horizon. You have shown it with $N$. The symbol $N_c$ is the control horizon which apparently is 1 in your case. $N_y$ is the rows of output vector $\boldsymbol y$. In your case your output is the state matrix with row size of 2. And $N_u$ is the size of the input vector $\boldsymbol u$ which is N.

So the row size of matrix $\mathcal{M}$ is $(4+4N)\times N$.

To be honest, your matrix representation seems hard to use from my view. You write the constraints on the states while in my formulation they are eventually converted to constraints on the inputs and I forget the future states which depend on the inputs.

You assume that matrix $\boldsymbol M_i$ has only one column which in your case is true but that's not the general case.

Now, back to your question, I am not sure where your formulation has come from, it looks like your matrix $\boldsymbol 0$ also has a $4\times1$ size. Your $\mathcal{E}$ and $\mathcal{M}$ matrices each have a $(N+1)$ submatrix with size of $4\times1$ which lead to a size of $(4+4N)$ as I calculated earlier.