Skip to content

Matrix size problem (3rd implementation) #1

Description

@tomcelentec

In the third implementation (the numerically robust one), R_L matrix is defined with a size of {(MPC_HP_LEN*SS_Z_LEN + MPC_HU_LEN*SS_U_LEN), MPC_HP_LEN*SS_Z_LEN}.
But R_L is multiplied with dU(k)_optimal during the problem formulation. As dU(k)_optimal has a size of {MPC_HU_LEN*SS_U_LEN,1}, the R_L matrix should have a size of {(MPC_HP_LEN*SS_Z_LEN + MPC_HU_LEN*SS_U_LEN), MPC_HU_LEN*SS_U_LEN}.

This size is confirmed by the fact that GammaLeft is (SQ*CTHETA) over SR :

  • SQ has a size of {MPC_HP_LEN*SS_Z_LEN, MPC_HP_LEN*SS_Z_LEN}
  • CTHETA has a size of {MPC_HP_LEN*SS_Z_LEN, MPC_HU_LEN*SS_U_LEN}
  • Thus, SQ*CTHETA has a size of {MPC_HP_LEN*SS_Z_LEN, MPC_HU_LEN*SS_U_LEN}
  • SR has a size of {MPC_HU_LEN*SS_U_LEN, MPC_HU_LEN*SS_U_LEN}
  • Therefore (SQ*CTHETA) over SR has a size of {(MPC_HP_LEN*SS_Z_LEN + MPC_HU_LEN*SS_U_LEN), MPC_HU_LEN*SS_U_LEN}
  • Q_L * R_L = GammaLeft, so the number of columns of R_L is the number of columns of GammaLeft, which is MPC_HU_LEN*SS_U_LEN and not MPC_HP_LEN*SS_Z_LEN

In your model, it does not seem to be an issue because MPC_HU_LEN*SS_U_LEN is 8 and MPC_HP_LEN*SS_Z_LEN is 14, i.e. MPC_HU_LEN*SS_U_LEN < MPC_HP_LEN*SS_Z_LEN.

Nonetheless, thank you for this amazing open source code
Best regards

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions