Documente Academic
Documente Profesional
Documente Cultură
else
error('Mecanismo Ilicito porque la biela no puede ser mas corta que la
manivela')
end
%VELOCIDADES
rad=deg2rad(1);
deltat=rad/qd;
max=0;
grado=0;
for i=1:(360*vueltas)-2
Velx(i)=(posx(i+1)-posx(i))/(deltat);
Vely(i)=(posy(i+1)-posy(i))/(deltat);
VelT(i)=((Vely(i)*Vely(i))+(Velx(i)*Velx(i)))^0.5;
end
for i=1:(360*vueltas)-3
Acelx(i)=(Velx(i+1)-Velx(i))/(deltat);
Acely(i)=(Vely(i+1)-Vely(i))/(deltat);
AcelT(i)=((Acely(i)*Acely(i))+(Acelx(i)*Acelx(i)))^0.5;
if AcelT(i)> max
max=AcelT(i);
grado=i;
end
end
acelmax= max;
disp ('La Aceleracion maxima en cm/s^2 es:')
disp (acelmax)
disp ('y se alcanza a los')
disp (grado)
disp ('grados')
figure(2)
t=[0:deltat:((360*vueltas)-2)*deltat];
t1=[0:deltat:((360*vueltas)-3)*deltat];
t2=[0:deltat:((360*vueltas)-4)*deltat];
subplot(3,1,1)
plot(t, posx,'g','LineWidth',2)
title 'Posicion/Velocidad/Aceleracion'
xlabel('tiempo(seg)')
ylabel('Pos X (cm)')
subplot(3,1,2)
plot(t1,Velx,'r','LineWidth',2)
xlabel('tiempo(seg)')
ylabel('Vel X (cm/seg)')
subplot(3,1,3)
plot(t2,Acelx,'b','LineWidth',2)
xlabel('tiempo(seg)')
ylabel('Acel X (cm/seg^2)')
figure(3)
subplot(3,1,1)
plot(t, posy,'g','LineWidth',2)
title 'Posicion/Velocidad/Aceleracion'
xlabel('tiempo(seg)')
ylabel('Pos Y (cm)')
subplot(3,1,2)
plot(t1,Vely,'r','LineWidth',2)
xlabel('tiempo(seg)')
ylabel('Vel Y (cm/seg)')
subplot(3,1,3)
plot(t2,Acely,'b','LineWidth',2)
xlabel('tiempo(seg)')
ylabel('Acel Y (cm/seg^2)')
figure(4)
t=[0:deltat:((360*vueltas)-2)*deltat];
t1=[0:deltat:((360*vueltas)-3)*deltat];
t2=[0:deltat:((360*vueltas)-4)*deltat];
subplot(2,1,1)
plot(t1,VelT,'r','LineWidth',2)
title 'Velocidad y Aceleracion Total'
xlabel('tiempo(seg)')
ylabel('Vel (cm/seg)')
subplot(2,1,2)
plot(t2,AcelT,'b','LineWidth',2)
xlabel('tiempo(seg)')
ylabel('Acel (cm/seg^2)')