You are on page 1of 2

clc, clear all

c=input('ingrese el valor de c=')%Amortiguamiento


m=input('ingrese el valor de m=')%masa
k=input('ingrese el valor de k=')%Constanmte de Resorte
Vo=input('ingrese el valor de Vo=')%Valor inicial de la
velocidad
xo=input('ingrese el valor de xo=')%Valor inicial de la
posicion
e=c./(2.*sqrt(k.*m)) %Calculo del factor de amortiguamiento
Wn=2*e.*k/c%Calculo de La frecuencia natural del sistema
t=-0.5:0.01:5;
if e==1
disp('el Sistema es Criticamente Amortiguado')
Xcrit=(xo.*exp(-Wn.*t) + ((Vo+Wn.*xo).*t.*exp(-
Wn.*t)));%Solucion de la ecuacion diferencial(Un grado de
Libertad)
figure (1)
plot(t,Xcrit,'r','LineWidth',1);title('Respuesta en
el tiempo: Xcrit=(xo.*exp(-Wn.*t) + ((Vo+Wn.*xo).*t.*exp(-
Wn.*t)))');xlabel('Tiempo (s)');ylabel('Amplitud (m)');
legend('Xcrit vs. t')
grid

elseif e<1
disp('el Sistema es SubAmortiguado')
Wd=Wn.*sqrt(1-e.^2)
Ao=sqrt((xo.^2)+((Vo+e.*Wn.*xo)/Wd).^2)%Ampplitud del
sistema
Phi=atan((Wd.*xo)/(Vo+e.*Wn.*xo))%Angulo de Fase
Xalter=Ao.*exp(-e.*Wn.*t).*sin(Wd.*t +Phi);%Solucion
de la ecuacion diferencial(Un grado de Libertad)
F=Ao.*exp(-e.*Wn.*t).*sin(Wd.*t);
R=Ao.*exp(-e.*Wn.*t);
T=-Ao.*exp(-e.*Wn.*t);
figure (2)
plot(t,Xalter,'r',t,R,'g-.',t,T,'g-
.',t,F);title('Respuesta en el tiempo: Xalter=Ao.*exp(-
e.*Wn.*t).*sin(Wd.*t +Phi)');xlabel('Tiempo
(s)');ylabel('Amplitud (m)');
legend('Xalter vs. t','Ao.*exp(-e.*Wn.*t)','-
Ao.*exp(-e.*Wn.*t)','Ao.*exp(-e.*Wn.*t).*sin(Wd.*t)')
grid
X1=exp(-
e*Wn*t).*((xo*cos(Wd*t))+(((Vo+e*Wn*xo)/(Wd))*sin(Wd*t)));
R=Ao.*exp(-e.*Wn.*t);
T=-Ao.*exp(-e.*Wn.*t);
F=Ao.*exp(-e.*Wn.*t).*sin(Wd.*t);
figure (3)
plot(t,X1,t,R,'m-.',t,T,'m-.',t,F);title('Respuesta
en el tiempo: X1=exp(-
e*Wn*t).*(xo*cos(Wd*t)+(((Vo+e*Wn*xo)/(Wd))*sin(Wd*t)))
');xlabel('Tiempo (s)');ylabel('Amplitud (m)');
legend('X1 vs. t','Ao.*exp(-e.*Wn.*t)','-Ao.*exp(-
e.*Wn.*t)','Ao.*exp(-e.*Wn.*t).*sin(Wd.*t)')
grid

else e>1
disp('el Sistema es SobreAmortiguado')
A=-Vo+Wn*xo*(-e+(((e^2)-1)^0.5))/(2*Wn*(((e^2)-
1)^0.5));
B=Vo+Wn*xo*(e+(((e^2)-1)^0.5))/(2*Wn*(((e^2)-
1)^0.5));
Xso=exp(-e*Wn*t).*(((exp(-Wn*(((e^2)-
1)^0.5)*t)*A)+(exp(Wn*(((e^2)-1)^0.5)*t)*B)));%Solucion de la
ecuacion diferencial(Un grado de Libertad)
figure (5)
plot(t,Xso);title('Respuesta en el tiempo
sobreamotiguado');xlabel('Tiempo (s)');ylabel('Amplitud
(m)');
legend('Xso vs. t')
grid
end

You might also like