How do I calculate the transformation matrix for converting a state space model to observable canonical form?
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 12 de Mayo de 2021
Editada: MathWorks Support Team
el 29 de Mzo. de 2024
I have been using "ssform" to transform the identified system to the canonical form. What algorithm is used in "ssform"? After "ssform" returns the canonical form, I computed the transformation matrix based on the two A matrices. But when I apply that transformation to the C matrix, the result looks nothing like the canonical form that is given by "ssform".
Respuesta aceptada
MathWorks Support Team
el 29 de Mzo. de 2024
Editada: MathWorks Support Team
el 29 de Mzo. de 2024
We recommend obtaining the transformation matrix via one of the following commands:
[sysc,T] = canon(sys,'companion');
or
[sysc,T] = canon(sys,'canonical');
Please note that "sysc=ssform(sys,'Form','canonical')" uses "[sysc,T] = canon(sys,'companion')" to compute 'sysc'. As noted in our documentation, the companion canonical form is the same as the observable canonical form (see https://www.mathworks.com/help/control/ref/dynamicsystem.canon.html#mw_78697154-9c08-4155-81e2-425d89456ca7). In both cases, the transformation matrix is the controllability matrix constructed from the state matrix (A) and the first column of the input matrix (B). The transformation matrix is computed in the following file, which you can open and inspect for more information about the algorithm:
C:\Program Files\MATLAB\R2021a\toolbox\shared\controllib\engine\+ltipack\@ssdata\canon.m
Here is an example code snippet demonstrating how to use the transformation matrix for your convenience:
%transform to canonical form
sysc=ssform(sys,'Form','canonical');
[sysc,T] = canon(sys,'companion');
%compute the transform matrix
T = ctrb(sys.A,sys.B(:,1));
% Check transformation of state matrix
T\sys.A*T
sysc.A
% Check transformation of output matrix
sys.C*T
sysc.C
% Check transformation of input matrix
T\sys.B
sysc.B
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!