function [Apar,Bpar,Cpar,Dpar]= decmpc(Q,A,B,C,D) % % Author: Nasser M. Abbasi, Northeastern University % % functionality: % % decompose state equation A,B,C,D into a controllable/ % and a noncontrollable one. % % arguments: % Q: IN, The transformation matrix . this is the matrix % returned to you from QDECMPC.M (for controllability) % A: IN, the A matrix of the state equation % B: IN, the B matrix of the state equation % C: IN, the C matrix of the state equation % D: IN, the D matrix of the state equation % Apar: OUT, Apar= PAQ % Bpar: OUT, Bpar= PB % Cpar: OUT, Cpar= CQ % Dpar: OUT, Dpar= D % if(nargin ~=5) error('Number if argumets must be 5: Q,A,B,C,D'); end [row,col]= size(A); if(row~= col) error('A matrix supplied is not SQUARE '); end P= inv(Q); Apar= P*A*Q; Bpar= P*B; Cpar= C*Q; Dpar= D;