programa 1
fprintf('Parametros del Sistema...\n');
R=input('R= ');
L=input('L= ');
C=input('C= ');
te=input('Tiempo de Evaluacion [Escalon] : ');
he=input('Periodo de Muestreo [h=0.1] : ');
ne=te/he;
fprintf('Funcion de Transferencia del Sistema...\n');
num=[1 2 1]
den=[1 3 1]
printsys(num,den);
step(num,den);
a1=1/(R*C); a2=1/(L*C); b1=1/(R*C);
t(1)=0; u(1)=1; x1(1)=0; x2(1)=0;
for i=1:ne
t(i+1)=t(i)+he;
u(i+1)=1;
x1(i+1)=x1(i)+he*x2(i); % S.Euler
x2(i+1)=x2(i)+he*(-a2*x1(i)-a2*x2(i)+b1*u(i)); % S.Euler
end
figure; plot(t,u,'r',t,x1,'g',t,x2,'b'), grid, zoom on
𝑦 = (0 1) (𝑥𝑥1 ) + 𝑢
2