I reading a book about control theory. But that's not why I'm here. I want to minimize this cost function:
$$J = (R_s - Y)^T(R_s - Y) + U^T\bar R U$$
Where: $$Y = Fx_0 + \Phi U$$
And
$$F = \begin{bmatrix} CA\\ CA^2\\ CA^3\\ \vdots \\ CA^{N_p} \end{bmatrix} , \Phi = \begin{bmatrix} CB &0 &0 &\cdots & 0\\ CAB & CB & 0 & \cdots & 0\\ CA^2B& CAB & 0 &\cdots &0 \\ \vdots & \vdots & \vdots & \vdots &\vdots \\ CA^{N_p-1}B & CA^{N_p-2}B & CA^{N_p-3}B & \cdots & CA^{N_p-N_c}B \end{bmatrix}$$
also $x_0$ is a vector. The rest are matrices.
Question:
According to my book, the author got this equation:
$$J = (R_s −Fx_0)^T (R_s −Fx_0)-2U^T \Phi^T (R_s -Fx_0)+U^T (\Phi^T \Phi+ \bar R)U$$
From:
$$J = (R_s - Y)^T(R_s - Y) + U^T\bar R U$$ $$Y = Fx_0 + \Phi U$$
How is that possible? I may feel dumb right now, but I haven't solve it.
Shouln't it be instead:
$$J = (R_s - Fx_0 - \Phi U)^T(R_s - Fx_0 - \Phi U) + U^T\bar R U$$
Litterature:
"Model Predictive Control System Design and Implementation Using MATLAB®.pdf", page 9.
Define a new matrix variable $$\eqalign{ M &= (R_s-Fx_0) \cr }$$ and note that $$ (M-\Phi U) = (R_s-Y) $$ Expand the cost function in terms of this new variable $$\eqalign{ J &= (M-\Phi U)^T(M-\Phi U) + U^TRU \cr &= (M^TM - 2U^T\Phi^TM + U^T\Phi^T\Phi U) + U^TRU \cr &= M^TM - 2U^T\Phi^TM + U^T(\Phi^T\Phi+R)U \cr }$$ Now substitute the definition of $M$ into that last line to recover the author's equation.