Open ajaigit opened 2 years ago
Hi Ajai, Thanks for your feedback. We have Fx is of dimension 4 x 2 and the prediction horizon N=5. The predicted state vector Xk contains N+1 states as its elements which are the N predicted states plus the current state (as in eqn. (8) of the note). The matrix FX contains N+1 blocks of Fx (as in eqn. (12) of the note) corresponds to the N+1 states in Xk. This means FX contains 6 blocks of Fx, and each Fx is of size 4 x 2. So the dimension of FX is 46 x 26 = 24 x 12. This matrix can be multiplied with Xk which is of dimension 12 x 1. In your case FX is of dimension 48 x 24 which can not be multiplied with Xk which is of size 12 x 1. Hope this helps.
Best, Midhun.
On Thu, Apr 7, 2022 at 1:28 AM ajaigit @.***> wrote:
Hello Midhun,
First of all, I am really thankful to you that you uploaded your lectures on YouTube. They were of great help to me. After going through your lectures I wanted to try implementing the code myself, but I think there is some inconsistency between the dimensions of the block-diagonal matrices that you have and that I came up with. If you refer to your code LMPC_1.m. The dimension of the variable FX comes out to be 24x12 but when I tried it on my own to verify the dimension, I get it to be 48x24. And this is how I am calculating the dimension of FX :
Since FX is a block diagonal consisting of Fx matrices which is of dimension 4x2 as its diagonal elements.
Now FX is to be pre-multiplied with Xk ( as per your notes ) which is of dimension 12x1, so the block diagonal matrix must be of size 12x12.
Since every element of the block diagonal matrix of size 4x2, therefore the dimension of the block diagonal should be 48x24.
I am not sure if I am calculating the dimensions in the correct manner , Can you please let me know where i am going wrong ?
Thank you.
— Reply to this email directly, view it on GitHub https://github.com/MIDHUNTA30/MPC-MATLAB/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW4QRSXS2JNM6CETOO6IEN3VDXUGPANCNFSM5SXEXOHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you Midhun for the explanation, appreciate it.
Hello @MIDHUNTA30 ,
First of all, I am really thankful to you that you uploaded your lectures on YouTube. They were of great help to me. After going through your lectures I wanted to try implementing the code myself, but I think there is some inconsistency between the dimensions of the block-diagonal matrices that you have and that I came up with. If you refer to your code
LMPC_1.m
. The dimension of the variableFX
comes out to be 24x12 but when I tried it on my own to verify the dimension, I get it to be 48x24. And this is how I am calculating the dimension ofFX
:Since
FX
is a block diagonal consisting ofFx
matrices which is of dimension 4x2 as its diagonal elements.Now
FX
is to be pre-multiplied withXk
( as per your notes ) which is of dimension 12x1, so the block diagonal matrix must be of size 12x12.Since every element of the block diagonal matrix of size 4x2, therefore the dimension of the block diagonal should be 48x24.
I am not sure if I am calculating the dimensions in the correct manner , Can you please let me know where i am going wrong ?
Thank you.