You are on page 1of 1

clear all

%parametros iniciales
LM=input('Ingrese valor de la manivela:');
LB=input('Ingrese valor de la biela:');
tM=0:1:360;
%ecuaciones de posicion
tB=asind((LM/LB)*sind (tM));
S= LM*cosd (tM)+ LB*cosd (tB);
%graficos
subplot(2,1,1);
if LB<LM
a=asind(LB/LM);

tM1=0:1:a;
tM2=360-a:1:360;

tB1=asind(real((LM/LB)*sind (tM1)));
S1= LM*cosd (tM1)+ LB*cosd (tB1);

tB2=asind(real((LM/LB)*sind (tM2)));
S2= LM*cosd (tM2)+ LB*cosd (tB2);
figure(1)
subplot (2,1,1)
plot(tM1,tB1,'--b','linewidth',4);
hold on
plot(tM2,tB2,'--b','linewidth',4);
xlabel ('\theta_M[grados]','fontsize',18,'fontweight','b' );
ylabel ('\theta_B[grados]','fontsize',18,'fontweight','b' );
title ('Mecanismo BIELA-MANIVELA','fontsize',18,'fontweight','b');
grid on
subplot (2,1,2);
plot (tM1,S1,'b','linewidth',2);
hold on
plot (tM2,S2,'b','linewidth',2);
xlabel ('\theta_M[grados]','fontsize',18,'fontweight','b' );
ylabel ('S','fontsize',18,'fontweight','b' );
grid on;
else
plot (tM,tB,'--b','linewidth',4);
xlabel ('\theta_M[grados]','fontsize',18,'fontweight','b' );
ylabel ('\theta_B[grados]','fontsize',18,'fontweight','b' );
title ('Mecanismo BIELAMANIVELA','fontsize',18,'fontweight','b');
grid on;
subplot (2,1,2);
plot (tM,S,'b','linewidth',2);
xlabel ('\theta_M[grados]','fontsize',18,'fontweight','b' );
ylabel ('S','fontsize',18,'fontweight','b' );
grid on;
end

You might also like