calculate output(y) from a state space model

조회 수: 16 (최근 30일)
Rashmil Dahanayake
Rashmil Dahanayake 2013년 12월 30일
댓글: Rashmil Dahanayake 2013년 12월 31일
I have defined a first order system in state space. How can I calculate Y matrix, if X matrix known
X'=Ax+Bu; Y=Cx;
I attempted to convert the system to a transfer function using tf command. Then can calculate output by y= tf * u The output matrix appears to be in tf data type. I would like to have y in the same data type as x. (full m file attached, following code is an extract of the state space portion)
%Filter Parameters
Lf= 8e-3; % Inductance for output filter
Cf= 400e-6; % Capacitance for output filter
% state space equations for LC filter
A=[zeros(3,3) eye(3)/(3*Cf) -eye(3)/(3*Cf); -eye(3)/Lf zeros(3,3) zeros(3,3);
eye(3,3)/Lload zeros(3,3) -eye(3)*Rload/Lload]; % systemmatrix
B=[zeros(3,3); eye(3)/Lf; zeros(3,3)]; % coefficient for thecontrol variable u
C=eye(9); % coefficient for the output y
D=[zeros(9,3)]; % coefficient for the output y
Ks = 1/3*[-1 0 1; 1 -1 0; 0 1 -1]; % Conversion matrix to transform [iiAB iiBC iiCA] to [iiA iiB iiC]
%Transfer function for inverter output stage
sys= ss(A,B,C,D);
H=tf(sys);
% calculating filtered output
Y=H(1,1) * V_AB;

채택된 답변

Honglei Chen
Honglei Chen 2013년 12월 30일
Once you get the model, sys, you can use lsim to simulate the system behavior. You can find details here
HTH
  댓글 수: 1
Rashmil Dahanayake
Rashmil Dahanayake 2013년 12월 31일
Thanks. [y t]=lsim(sys,u,t) command worked well.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Pulsed Waveforms에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by