

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!


%lazo abierto A=[0 1 0 0; 5.1503 0 0 0; 0 0 0 1; -0.4905 0 0 0] B=[0; -.25; 0; 0.5] C=[1 0 0 0; 0 0 1 0] D=[0 ; 0] x0=[0.1 0 0 0];t=linspace(0,1); [y,x,t]=initial(A,B,C,D,x0,t); h=figure(1); subplot(221),plot(t,x(:,1)), grid minor title('x_1: posic angular bola') subplot(222),plot(t,x(:,2)), grid minor title('x_2: veloc angular bola') subplot(223),plot(t,x(:,3)), grid minor title('x_3: posic lineal carrito') subplot(224),plot(t,x(:,4)), grid minor title('x_4: veloc lineal carrito') set(h,'name','Planta sincontrol','numbertitle','off')
t=linspace(0,3); x0=[0.1 0 0 0]; A=[0 1 0 0; 5.1503 0 0 0; 0 0 0 1; -0.4905 0 0 0] B=[0; -.25; 0; 0.5] C=[1 0 0 0; 0 0 1 0] D=[0 ; 0] kc=1.0e+003[-2.0194 -0.6832 -0.6524 -0.2936] Ac=A-Bkc [y,x,t]=initial(Ac,B,C,D,x0,t); u=kcx'; figure(3),plot(t,u), title('esfuerzo de control'),hold on h=figure(2); subplot(221) ,plot(t,x(:,1)), grid minor title('x_1: posic angular bola'), hold on subplot(222),plot(t,x(:,2)), grid minor title('x_2: veloc angular bola'),hold on subplot(223),plot(t,x(:,3)), grid minor title('x_3: posic lineal carrito'),hold on subplot(224),plot(t,x(:,4)), grid minor title('x_4: veloc lineal carrito'),hold on set(h,'name','Regulador de estados','numbertitle','off') x0=[0.2 0 0.2 0]; [y,x,t]=initial(Ac,B,C,D,x0,t); u=kcx'; h=figure(2); subplot(221),plot(t,x(:,1),'g'), subplot(222),plot(t,x(:,2),'g'), subplot(223),plot(t,x(:,3),'g'), subplot(224),plot(t,x(:,4),'g'), figure(3) plot(t,u,'g') grid minor