clear all close all %%%%%%%%%%%%% Contínuo %%%%%%%%%%%%%% n = 1; d = [10 1 0]; Gc = tf(n,d) nd = 20*[1 0.1]; dd = [1 2]; Cc = tf(nd,dd) MFc = feedback(Cc*Gc,1); [yc,tc] = step(MFc,15); %sisotool(Gc,Cc) figure plot(tc,yc,'b') hold on grid %%%%%%%%%%%%%% T = 0.2 s %%%%%%%%%%%%%% T = 0.2; Gd1 = c2d(Gc,T) %Segurador de Ordem Zero Cd1 = c2d(Cc,T,'matched') %Mapeamento de Polos e Zeros %sisotool(Gd1,Cd1) MFd1 = feedback(Cd1*Gd1,1); [yd,td] = step(MFd1,15); stairs(td,yd,'r') %%%%%%%%%%%%%% T = 1 s %%%%%%%%%%%%%% T = 1; Gd2 = c2d(Gc,T) Cd2 = c2d(Cc,T,'matched') %sisotool(Gd2,Cd2) MFd2 = feedback(Cd2*Gd2,1); [yd2,td2] = step(MFd2,15); stairs(td2,yd2,'g') %%%%%%%%%%%%%% T = 1 s - Projeto por Lugar da Raízes %%%%%%%%%%%%%% T = 1; Gd3 = c2d(Gc,T) Cd3 = 10*tf([1 -0.9048],[1 0.4],T) %sisotool(Gd3,Cd3) MFd3 = feedback(Cd3*Gd3,1); [yd3,td3] = step(MFd3,15); stairs(td3,yd3,'m') legend('Contínuo','Discreto (T0 = 0.2 s)','Discreto (T0 = 1 s)','Discreto - LR (T0 = 1 s)','Location','southeast') xlabel('t (s)') ylabel('y(t)')