% EESC/USP - SEM 538 - Sistemas de Controle II % Exercício - Formas canônicas - 2016 % close all clear all G = tf([1 2],[1 7 12]) figure step(G) grid %Forma Canônica Controlável Ac = [-7 -12; 1 0]; Bc= [1; 0]; Cc =[1 2]; Dc=0; Sc = ss(Ac,Bc,Cc,Dc); [Yc,t,Xc] = step(Sc,2.5); figure subplot(1,2,1) plot(t,Yc) ylabel('Y') grid subplot(1,2,2) plot(t,Xc) ylabel('X') grid %Forma Canônica Modal Am = [-4 0; 0 -3]; Bm= [1; 1]; Cm =[2 -1]; Dm=0; Sm = ss(Am,Bm,Cm,Dm); [Ym,t,Xm] = step(Sm,2.5); figure subplot(1,2,1) plot(t,Ym) ylabel('Y') grid subplot(1,2,2) plot(t,Xm) ylabel('Z') grid % A,B,C,D para Forma Canônica Controlável A =[2.0000 -10.0000; 3.0000 -9.0000]; B =[0.7071; 0.7071]; C =[-0.7071 2.1213]; D=0; S = ss(A,B,C,D); [Y,t,X] = step(S,2.5); figure subplot(1,2,1) plot(t,Y) ylabel('Y') grid subplot(1,2,2) plot(t,X) ylabel('X') grid [Abar,Bbar,Cbar,t] = ctrbf(A,B,C); Dbar =0; Sbar = ss(Abar,Bbar,Cbar,Dbar); [Ybar,t,Xbar] = step(Sbar,2.5); figure subplot(1,2,1) plot(t,Ybar) ylabel('Y') grid subplot(1,2,2) plot(t,Xbar) ylabel('X') grid