Академический Документы
Профессиональный Документы
Культура Документы
subplot(3,2,1)
plot(xD1,yD1,'k','LineWidth',1.5)
hold on
plot(xDD,yDD,'g','LineWidth',1.5)
axis([-0.4 0.4 -0.4 0.4]);
hold on
grid on
plot([xA,xD],[yA,yD],'r-x',[xB,xC],[yB,yC],'b-x','LineWidth',1.5)
title('INVERTED SLIDER-CRANK MECHANISM')
text(xA,yA,' A'),...
text(xB,yB,'B'),...
text(xC,yC, 'C'),...
text(xD,yD, 'D'),...
hold off
Codigo para graficar la Aceleracion de coriolis del mecanismo “RTR” INVERTED SLIDER-
CRANK MECHANISM
subplot(3,2,4)
axis([0 370 0 4.5]);
hold on
grid on
plot(qq,aB2B1corT,'r','LineWidth',1.5)
title ('Aceleración de coriolis')
hold off
Trayectoria del punto B y D del mecanismo “RTR” INVERTED SLIDER-CRANK MECHANISM
para una entrada de 360°:
Aceleraciones vB1 (rojo) vB21(azul) vB3(negro)
Aceleración de coriolis
Velocidades Angulares (relativa) w1=w2(rojo) w23(azul) w3(negro)
Código:
%%%%%%%%%%%%tarea completa%%%%%%%%%
clear all
clc
close all
AC = 0.15;
BC = 0.2;
xA = 0;
yA = 0;
q1=0;
xC = AC;
yC = 0;
ang=60;
for ang=1:1:360;
phi=(ang*pi)/180; % ángulo en radianes
phi1=phi;
q1=q1+1;
qq(q1)=ang;
rA = [ xA, yA, 0 ];
rC = [ xC, yC, 0 ];
AD = AC+BC;
xD=AD*cos(phi);
yD=AD*sin(phi);
rD=[xD,yD,0];
xDD(q1)=xD;
yDD(q1)=yD;
% position of B
eqB1 = 'xBsol*sin(phi) = yBsol*cos(phi)';
eqB2 = 'yBsol^2+(xC-xBsol)^2-BC^2 = 0';
solB = solve(eqB1, eqB2, 'xBsol, yBsol');
xBpositions = eval(solB.xBsol);
yBpositions = eval(solB.yBsol);
xB1 = xBpositions(1);
xB2 = xBpositions(2);
yB1 = yBpositions(1);
yB2 = yBpositions(2);
if (phi>=0 && phi<= pi)
if yB1 >= 0
xB=xB1;
yB=yB1;
else xB=xB2;
yB=yB2;
end
end
if (phi>pi && phi<=2*pi)
if yB1 < 0
xB=xB1;
yB=yB1;
else xB=xB2;
yB=yB2;
end
end
rB = [ xB, yB, 0 ];
phi3 = atan((yB-yC)/(xB-xC))+pi;
xD1(q1)=xB;
yD1(q1)=yB;
Omega2 = omega1(3);
omega2 = omega1;
alpha1 = [0 0 0 ];
alpha2 = alpha1;
Alpha1 = alpha1(1);
Alpha2 = alpha1(1);
Alpha1T(q1)=Alpha1
vA = [0 0 0 ];
aA = [0 0 0 ];
vC = [0 0 0 ];
aC = [0 0 0 ];
VB1= [0 0 0 ];
%velocidad vB1
vB1 = vA + cross(omega1,rB);
%descomponer vB1 en i and j
TvB1=sqrt(vB1(1)^2+(vB1(2)^2));
vBB1T(q1)=TvB1
%desvB1=[vB1];
%vBB1(1)=desvB1(1:3:end);
%vBB1(2)=desvB1(2:3:end);
%vBB1X=vBB1(1);
%vBB1Y=vBB1(2);
%vBB1XX(q1)=vBB1X;
%vBB1YY(q1)=vBB1Y;
%aceleracion aB1
aB1 = aA + cross(alpha1,rB) - dot(omega1,omega1)*rB;
TAB1=sqrt(aB1(1)^2+(aB1(2)^2));
AB1T(q1)=TAB1
omega23T(q1)=Omega1-omega3zs
vB21s = eval(solvB.vB21);
Omega3 = [0 0 omega3zs];
%velocidad vB21
VB21 = vB21s*[cos(phi1) sin(phi1) 0];
TvB21=sqrt(VB21(1)^2+(VB21(2)^2));
vBB21T(q1)=TvB21
%descomponer vB1 en i and j
%desvB21=[VB21];
%vBB21(1)=desvB21(1:3:end);
%vBB21(2)=desvB21(2:3:end);
%vBB21X=vBB21(1);
%vBB21Y=vBB21(2);
%vBB21XX(q1)=vBB21X;
%vBB21YY(q1)=vBB21Y;
VB3 = vC + cross(Omega3,rB-rC);
TvB3=sqrt(VB3(1)^2+(VB3(2)^2));
vBB3T(q1)=TvB3
%Velocidades
qvBx=vpa(eqvBx,6);
%Aceleraciones
alpha3z = sym('alpha3z','real'); % alpha3z unknown
alpha3 = [ 0 0 alpha3z ];
aB21 = sym('aB21','real'); % aB21 unknown
% aB2B1 parallel to the sliding direction
aB2B1 = [ aB21*cos(phi1) aB21*sin(phi1) 0 ];
% aB2=aB3=aC+alpha3 x rCB-(omega3)ˆ2 rCB
aB3=aC+cross(alpha3,rB-rC)-dot(Omega3,Omega3)*(rB-rC);
aB2 = aB3;
% aB2B1cor = 2 omega1 x vB2B1
aB2B1cor = 2*cross(omega1,VB21);
% aB2 = aB1 + aB2B1 + aB2B1cor
eqaB = aB2 - ( aB1 + aB2B1 + aB2B1cor );
eqaBx = eqaB(1); % equation component on x-axis
eqaBy = eqaB(2); % equation component on y-axis
solaB = solve(eqaBx,eqaBy);
alpha3zs = eval(solaB.alpha3z);
alpha3T(q1)=alpha3zs
alpha21T(q1)=Alpha1-alpha3zs
aB21s = eval(solaB.aB21);
Alpha3 = [0 0 alpha3zs];
%descomponer AB21
%desvAB21=[AB21];
%ABB21(1)=desvAB21(1:3:end);
%ABB21(2)=desvAB21(2:3:end);
%ABB21X=ABB21(1);
%ABB21Y=ABB21(2);
%ABB21XX(q1)=ABB21X;
%ABB21YY(q1)=ABB21Y;
AB3=aC+cross(Alpha3,rB-rC)-dot(Omega3,Omega3)*(rB-rC);
TAB3=sqrt(AB3(1)^2+(AB3(2)^2));
AB3T(q1)=TAB3
% print the equations for calculating
% alpha3z and aB21
%fprintf('aB2B1cor = [%g, %g, %d] (m/sˆ2)\n', aB2B1cor);
TAB2B2coriolis=sqrt(aB2B1cor(1)^2+(aB2B1cor(2)^2));
aB2B1corT(q1)=TAB2B2coriolis
%des2=[aB2B1cor];
%aB2B1cor(1)=des2(1:3:end);
%aB2B1cor(2)=des2(2:3:end);
%aB2B1corX=aB2B1cor(1);
%aB2B1corY=aB2B1cor(2);
%aB2B1corXx(q1)=aB2B1corX;
%aB2B1corYy(q1)=aB2B1corY;
subplot(3,2,1)
plot(xD1,yD1,'k','LineWidth',1.5)
hold on
plot(xDD,yDD,'g','LineWidth',1.5)
axis([-0.4 0.4 -0.4 0.4]);
hold on
grid on
plot([xA,xD],[yA,yD],'r-x',[xB,xC],[yB,yC],'b-x','LineWidth',1.5)
title('INVERTED SLIDER-CRANK MECHANISM')
text(xA,yA,' A'),...
text(xB,yB,'B'),...
text(xC,yC, 'C'),...
text(xD,yD, 'D'),...
hold off
subplot(3,2,2)
axis([0 370 0 8]);
hold on
grid on
plot([qq],[AB1T],'r',[qq],[AB21T],'b',[qq],[AB3T],'k','LineWidth',1.5)
title ('Aceleraciones vB1 vB21 vB3')
hold off
subplot(3,2,3)
axis([0 370 0 1.5]);
hold on
grid on
plot([qq],[vBB1T],'r',[qq],[vBB21T],'b',[qq],[vBB3T],'k','LineWidth',1.5)
title ('velocidad vB1 vB21 vB3')
hold off
subplot(3,2,4)
axis([0 370 0 4.5]);
hold on
grid on
plot(qq,aB2B1corT,'r','LineWidth',1.5)
title ('Aceleración de coriolis')
hold off
subplot(3,2,5)
axis([0 370 -5 10]);
hold on
grid on
plot([qq],[Omega1T],'r',[qq],[omega23T],'b',[qq],[omega3T],'k','LineWidth
',1.5)
title ('Velocidades Angulares (relativa) w1=w2 w23 w3')
hold off
subplot(3,2,6)
axis([0 370 -20 20]);
hold on
grid on
plot([qq],[Alpha1T],'r',[qq],[alpha21T],'b',[qq],[alpha3T],'k','LineWidth
',1.5)
title ('Aceleraciones Angulares (relativa) alpha1=alpha2 alpha23 alpha3')
hold off
pause(0.01)
end