Está en la página 1de 9

# Biela Manivela con anlisis de velocidades y

aceleraciones
clc
opc=0;
m=0;
while opc~=3
q=1;
while q==1
disp('SELECCIONE UNA OPCION : ');
disp('(1) Si vthetam = ctte : '),
disp('(2) Si athetam = ctte ');
disp('(3) SALIR DEL PROGRAMA');
opc=input('');

if opc==1
disp('EJEMPLO BIELA MANIVELA')
disp('Este programa mostrar las graficas de S vs thetam y thetab vs
thetam ')
lm=input('Ingrese la longitud de la manivela en metros lm= ');
lb=input('Ingrese la longitud de la biela en metros lb= ');
segundo vthetam= ');
thetam=0;
thetab=0;
for thetam=0:1:360
a=(thetam*pi)/180;
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;
M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,S,'r');
grid on
figure(1)
hold on

end

end
legend('S vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;
M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,thetab);
grid on
figure(2)
hold on
end

end
legend('thetab vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;
M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,vthetab);

grid on
figure(3)
hold on
end

end
legend('vthetab vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;
M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,vS,'r');
grid on
figure(4)
hold on
end
end
legend('vS vs thetam')

else if opc==2
disp('EJEMPLO BIELA MANIVELA')
disp('Este programa mostrar las graficas de S vs thetam y thetab vs
thetam ')
lm=input('Ingrese la longitud de la manivela en metros lm= ');
lb=input('Ingrese la longitud de la biela en metros lb= ');
athetam=input('Ingrese la aceleracin de la biela athetam= ');
vthetam=0;
thetam=0;
thetab=0;
for thetam=0:1:360
a=(thetam*pi)/180;
vthetam=sqrt(2*athetam*a);

S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;

M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
A1=-lm*(cos(a))*(vthetam^2)-lm*sin(a)*athetamlb*cos(c)*(vthetab^2);
B2=lm*sin(a)*(vthetam^2)+lm*cos(a)*athetam+lb*sin(c)*(vthetab^2);
N=[lb*sin(c) 1;
lb*cos(c) 0];
G=[A1 ;
B2 ];
H=(N^-1)*G;
aS=H(2,1);
athetab=H(1,1);

hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,S,'r');
grid on
figure(1)
hold on
end

end
legend('S vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
vthetam=sqrt(2*athetam*a);
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);

thetab=(c*180)/pi;

M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
A1=-lm*(cos(a))*(vthetam^2)-lm*sin(a)*athetamlb*cos(c)*(vthetab^2);
B2=lm*sin(a)*(vthetam^2)+lm*cos(a)*athetam+lb*sin(c)*(vthetab^2);
N=[lb*sin(c) 1;
lb*cos(c) 0];
G=[A1 ;
B2 ];
H=(N^-1)*G;
aS=H(2,1);
athetab=H(1,1);

hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,thetab,'r');
grid on
figure(2)
hold on
end

end
legend('thetab vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
vthetam=sqrt(2*athetam*a);
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;

M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;
lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
A1=-lm*(cos(a))*(vthetam^2)-lm*sin(a)*athetamlb*cos(c)*(vthetab^2);
B2=lm*sin(a)*(vthetam^2)+lm*cos(a)*athetam+lb*sin(c)*(vthetab^2);
N=[lb*sin(c) 1;
lb*cos(c) 0];
G=[A1 ;
B2 ];
H=(N^-1)*G;
aS=H(2,1);
athetab=H(1,1);

hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,athetab,'r');
grid on
figure(3)
hold on
end

end
legend('athetab vs thetam')
for thetam=0:1:360
a=(thetam*pi)/180;
vthetam=sqrt(2*athetam*a);
S=lm*cos(a)+sqrt((lb^2)-(lm^2)*(sin(a)^2));
b=(thetam*pi)/180;
c=asin((lm*sin(b))/lb);
thetab=(c*180)/pi;

M=[lb*sin(c) 1;
lb*cos(c) 0];
f=[-lm*sin(a)*vthetam ;

lm*cos(a)*vthetam];
X=(M^-1)*f;
vS=X(2,1);
vthetab=X(1,1);
A1=-lm*(cos(a))*(vthetam^2)-lm*sin(a)*athetamlb*cos(c)*(vthetab^2);
B2=lm*sin(a)*(vthetam^2)+lm*cos(a)*athetam+lb*sin(c)*(vthetab^2);
N=[lb*sin(c) 1;
lb*cos(c) 0];
G=[A1 ;
B2 ];
H=(N^-1)*G;
aS=H(2,1);
athetab=H(1,1);

hold on
if (((lb^2)-(lm^2)*(sin(a)^2))>=0 )
plot(thetam,aS,'r');
grid on
figure(4)
hold on
end

end
legend('aS vs thetam')
else
disp('USTED SELECCIONO SALIR DEL PROGRAMA');
q=q+1;
end
end
end
end