Practica
Practica
clear
clc
%Angulos Iniciales
Theta1 = -102;
Theta2in = 0;
Theta2fin = 360;
cont = 1;
theta4(cont,1) = Theta4;
theta2c(cont,1) = Theta2;
Angulotran = abs(Theta3-Theta4);
if Angulotran>90
Angulo = 180 - Angulotran;
else
Angulo = Angulotran;
end
anguloc(cont,1) = Angulo;
Z1 = d*(cosd(Theta1) + 1i*sind(Theta1) );
Z2 = a*(cosd(Theta2) + 1i*sind(Theta2));
Z3= b*(cosd(Theta3) + 1i*sind(Theta3));
Z4 = c*(cosd(Theta4) + 1i*sind(Theta4));
Z6 = f*(cosd(Theta5) + 1i*sind(Theta5));
Z = [0 Z2 Z2+Z3 Z2+Z3-Z4];
ZZ = [0 Z2 Z2+Z3 Z2+Z3-Z6 ];
ground1 = [0 Z2+Z3-Z4];
ground2 = [Z2+Z3-Z4 Z2+Z3-Z6];
subplot(4,1,1)
plot(Z,'Color','b','Marker','o','LineWidth',2)
hold on
plot(ZZ,'Color','b','Marker','o','LineWidth',2)
plot(ground1,'Color','k','Marker','o','LineStyle','--','LineWidth',2)
plot(ground2,'Color','k','Marker','o','LineStyle','--','LineWidth',2)
z6(cont,1) = Z6;
hc(cont,1) = h;
xlim([-2.5 8])
ylim([-4 4])
grid on
hold off
title('Mecanismo')
subplot(4,1,2)
plot(theta2c,theta4,'Color','r','LineWidth',1)
grid on
xlim([Theta2in Theta2fin])
title('Theta2 vs Theta4')
subplot(4,1,3)
plot(theta2c,hc,'Color','r','LineWidth',1)
xlim([Theta2in Theta2fin])
grid on
title('Theta2 vs Corredera')
subplot(4,1,4)
plot(theta2c,anguloc,'Color','r','LineWidth',1)
hold on
plot(theta2c,transc,'Color','b','LineWidth',1)
hold off
xlim([Theta2in Theta2fin])
ylim([0 90])
grid on
title('Theta2 vs angulo de transmision')
legend('B','C')
pause(0.005)
cont = cont + 1;
end