Controllable Companion form for a MIMO system

60 views (last 30 days)
Hi I have this state-space system and I want to find out about It's controllable canonical form using MATLAB. My problem is Compreal() only works when you have SISO system and my system has two inputs(Using compreal only gave me canonical form for the first input and it's not considering the second input). What should I do about this and how can I represent controllable canonical form for this kind of system? (Also I have check the rank of controllablity matrix and It has rank of 4 similar to my A matrix so system is controllable)
A=[-0.978707531551846 2.37478961356718e-14 7.42345117560053e-14 0.318698761698607;
-2.63927929244335e-14 -2.00000000000000 -3 -4.93782914225613e-16;
8.09939070469741e-19 -3.33066907387547e-16 -1.00000000000000 5.83814072314816e-19;
-0.135043844787908 -3.13829005324231e-15 -2.83836564755302e-14 -3.02129246844816];
B=[-0.993655438699628 -0.136196562445474;
-2.31027060974740e-14 -1.78885438199983;
1.75613973071755e-14 -0.894427190999916;
-0.360965272521026 0.863803437554497]
C=[-0.951865027888002 0.447213595499936 -0.894427190999894 -0.150081302150705;
-0.397764357325956 -9.25144024323242e-15 -1.40800559951749e-14 1.09495496399803]
D=[0 0;
0 0]

Accepted Answer

Shivam Gothi
Shivam Gothi on 6 Dec 2024 at 7:05
The controllable canonical form for multiple input system is not unique. That is, there may be multiple possible controllable canonical form possible for a multiple input system. This statement is explained in a very nice manner, using the concept of controllability matrix and controllability index in the IEEE paper:
D. Luenberger, "Canonical forms for linear multivariable systems," in IEEE Transactions on Automatic Control, vol. 12, no. 3, pp. 290-293, June 1967, doi: 10.1109/TAC.1967.1098584. keywords: {MIMO;Matrices;Control systems;Controllability;Control design;Design engineering;Differential equations;Contracts},
The above sited paper discribes the possible ways to convert a multiple input system into the controllable canonical form.
The file exchange link attached by you in the comments section, works on the similiar principle as discussed in the above paper.
Comming to your question:
" I have found a code file but I can't find the logic behind of this and how It can gives controllable canonical form for multi-inputs system and I don't know If this works correctly or not ? "
After reviewing the code, I believe it effectively transforms the multiple input system into a controllable canonical form, in accordance with one of the methodologies outlined in the aforementioned IEEE paper.
I am summarising the things I collected from the paper, which will help you to understand the algorithm used in the file-exchange code.
consider the state-space representation of the system:
Assume a transformation matrix "S" that will take the system in its controllable canonical form as demonstrated below:
For a single input system, this transformation matrix is nothing but the controllability matrix "C" as shown below:
Suppose that the number of states are n and it is only a single input system. Under that case, the controllability matrix is of order (n x n). Therefore, if the rank of "C" or "S" matrix is equal to "n" ,it is invertible and we can convert the system into the controllable canonical form. If the rank of "C" matrix is less than "n", it is not invertible and we say that the system cannot be converted to its controllable canonical form.
Now comming to the multiple input case. Suppose that we have "r" number of inputs. Therefore, the controllability matrix "C" will be (n x nr). As it is a rectangular matrix, it is not invertible. Therefore, in this case we cannot take :
We have to make a choice of matrix "S" that will take the system to the controllable canonical form. This choice is not unique. There can be many possible ways to choose "S" matrix. Therefore, the above cited papaer describes some approaches to find the matrix "S" that transforms the sytem into its controllable canonical form.
The approach used in the file exchange code takes:
here, row vectors are noting but the linearly independent row vectors appearing in the inverse of "P" matrix. (Refer to the above cited research paper for the defination of "P" matrix and to get clearity regarding the terms appearing in the above equation.)
According to it , the transformed system has "A" and "B" matrixes of the form:
I tried to run the file-exchange code on your system of equations. I am running it here, in order to demonstrate the results of the transformation.
% Original state-space Plant
A = [-0.978707531551846 2.37478961356718e-14 7.42345117560053e-14 0.318698761698607;
-2.63927929244335e-14 -2.00000000000000 -3 -4.93782914225613e-16;
8.09939070469741e-19 -3.33066907387547e-16 -1.00000000000000 5.83814072314816e-19;
-0.135043844787908 -3.13829005324231e-15 -2.83836564755302e-14 -3.02129246844816];
B = [-0.993655438699628 -0.136196562445474;
-2.31027060974740e-14 -1.78885438199983;
1.75613973071755e-14 -0.894427190999916;
-0.360965272521026 0.863803437554497];
[T,Ad,Bd,ni]=MI_ctrb(A,B) %Using the file-exchange method
T = 4×4
-0.3978 0.4472 0.2236 1.0950 0.2414 -0.8944 -1.5652 -3.4349 -0.0000 0.2236 -0.4472 -0.0000 0.0000 -0.4472 -0.2236 -0.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Ad = 4×4
0 1.0000 0 0 -3.0000 -4.0000 2.0000 2.0000 0 0 0 1.0000 0 0 -2.0000 -3.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Bd = 4×2
0 0 1.0000 0 0 0 0 1.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
ni = 1×2
2 2
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
You can observe that the structure of the transformed matrices "Ad" and "Bd" matches exactly as per the above attached images.
In conclusion, MATLAB does not natively support the transformation of multiple input systems into a controllable canonical form. To achieve this, one should consult research papers that discuss various approaches. If you come across third-party MATLAB code or File Exchange contributions, it is advisable to first verify them against the original resources and methodologies to ensure accuracy and reliability.
I hope you find the information useful !!!
  5 Comments
Sam Chak
Sam Chak on 6 Dec 2024 at 19:26
Indeed, @Shivam Gothi's explanation is outstanding!

Sign in to comment.

More Answers (1)

Sam Chak
Sam Chak on 5 Dec 2024 at 18:04
The following is the result returned by compreal:
%% Original state-space Plant
A = [-0.978707531551846 2.37478961356718e-14 7.42345117560053e-14 0.318698761698607;
-2.63927929244335e-14 -2.00000000000000 -3 -4.93782914225613e-16;
8.09939070469741e-19 -3.33066907387547e-16 -1.00000000000000 5.83814072314816e-19;
-0.135043844787908 -3.13829005324231e-15 -2.83836564755302e-14 -3.02129246844816];
B = [-0.993655438699628 -0.136196562445474;
-2.31027060974740e-14 -1.78885438199983;
1.75613973071755e-14 -0.894427190999916;
-0.360965272521026 0.863803437554497];
C = [-0.951865027888002 0.447213595499936 -0.894427190999894 -0.150081302150705;
-0.397764357325956 -9.25144024323242e-15 -1.40800559951749e-14 1.09495496399803];
D = [0 0;
0 0];
Gp = ss(A, B, C, D);
%% The Transformation matrix is very close to singular
[sys, T] = compreal(Gp);
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 7.660411e-21.
disp(T)
-0.9937 0.8575 -0.4489 -0.7769 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.3610 1.2248 -3.8162 11.5904
det(T) % determinant of Transformation matrix is very close to zero
ans = -1.7372e-35
%% The controllable canonical form (Results maybe inaccurate!)
csys = ss(sys.A', sys.C', sys.B', sys.D')
csys = A = x1 x2 x3 x4 x1 0 1 0 0 x2 0 0 1 0 x3 0 0 0 1 x4 -6 -17 -17 -7 B = u1 u2 x1 1 -7.216e-16 x2 -1 1 x3 1 -4 x4 -1 13 C = x1 x2 x3 x4 y1 1 0 0 0 y2 2.131e+18 3.333e+18 1.366e+18 1.639e+17 D = u1 u2 y1 0 0 y2 0 0 Continuous-time state-space model.
  1 Comment
naiva saeedia
naiva saeedia on 5 Dec 2024 at 18:46
Edited: naiva saeedia on 5 Dec 2024 at 18:46
But tehcnically Compreal only works correctly for a single input system. If you look at B matrix It's not in the form of any canonical form. It should be something like this in controllable canonical form:
Or anything with zeros and ones because we don't have exact controllable canonical form for multi inputs system. I have found a code file but I can't find the logic behind of this and how It can gives controllable canonical form for multi-inputs system and I don't know If this works correctly or not:
https://www.mathworks.com/matlabcentral/fileexchange/21663-multi-input-controllable-canonical-form

Sign in to comment.

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!