Академический Документы
Профессиональный Документы
Культура Документы
Presentacion .......................................................................................................................
Definir Constantes que se usarn ...........................................................................................
Inicializar variables .............................................................................................................
condiciones iniciales ............................................................................................................
lazo ...................................................................................................................................
graficos .............................................................................................................................
1
1
1
1
1
2
Presentacion
%JORGE NINAZUNTA
%FECHA: 16/10/2015
%SIMULACION-SISTEMA DE ELECTROMECNICO
clc
clear all
Inicializar variables
x=zeros(4,size(t,2)); %%size(C,1) -> numero de filas
y=zeros(size(C,1),size(t,2)); %%size(C,1)->indica el numero de salidas del sistema
condiciones iniciales
x(:,1)=[0;0;0;0];
y(:,1)=C*x(:,1)+D*u;
lazo
for i=1:size(t,2)-1
graficos
figure(1)
plot(t,x(1,:),t,x(2,:),'.',t,x(3,:),'r--o',t,x(4,:),'y','LineWidth',2)
legend('Voltaje en Capacitor','Corriente Inductor','Desplazamiento X','Velocidad')
xlabel('tiempo')
ylabel('estados')
figure(2)
plot(t,y(1,:),'LineWidth',5)
legend('Desplazamiento X')
figure(3)
plot(x(1,:),x(2,:))
xlabel('Voltaje en Capacitor')
ylabel('Corriente Inductor')
title('Trayectoria 1')
figure(4)
plot(x(3,:),x(4,:),'r')
xlabel('Desplazamiento X')
ylabel('Velocidad')
title('Trayectoria 2')