codigos para mecanismos 00001 TRENCHE %TRENCHE=a1, a2,a3 %phi(bi,b2,b3 a1=30*pi/180; a2=50*pi/180; a3=80*pi/180; s1=9.43; s2=8.54; s3=6.87 b1=50*pi/180; b2=100*pi/180; b3=150*pi/180; A=[s1*cos(a1) -sin(a1) -1;s2*cos(a2) -sin(a2) B=[(s1^2);(s2)^2;(s3)^2] Ainv=inv(A) X=Ainv*B; k1=X(1) k2=X(2) k3=X(3) r=k1/2% pCAMBIA ESTE VALOR YAAAAAAAA a=k2/(2*r) l=sqrt(a^2+r^2-k3) -1;s3*cos(a3) -sin(a3) 00002 BLOCH CUADRICULA %bloch para cuadricula articulada w2=-2; w3=0.476; w4=-0.514; alfa2=0; alfa3=1.45; alfa4=2.01; r2=w4*(alfa3+i*(w3^2))-w3*(alfa4+i*(w4^2)) r3=w2*(alfa4+i*(w4^2))-w4*(alfa2+i*(w2^2)) r4=w3*(alfa2+i*(w2^2))-w2*(alfa3+i*(w3^2)) r4=-r2-r3-r4 r21=w4*alfa3-w3*alfa4+i*w4*w3*(w3-w4) r22=w2*alfa4-w4*alfa2+i*w2*w4*(w4-w2) r23=w3*alfa2-w2*alfa3+i*w3*w2*(w2-w3) 00003 %modelo del desarrollo de Newton-Raphson cuadrícula articulada clear clc a=116; b=108; c=110; -1]; d=174; t1=335*pi/180; t2=37*pi/180; t3=250*pi/180; t4=150*pi/180; %a+b-c-d f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[f1;f2] %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1) f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1) A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)] B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi t3=t3*pi/180 t4=t4*pi/180 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); A=[-b*sin(t3) c*sin(t4); b*cos(t3) -c*cos(t4)]; B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1)]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt3=X(1); vt4=X(2); t3=t3+vt3; t4=t4+vt4; t3=t3*180/pi t4=t4*180/pi 0004 %ejercicio 6 eslabones en clase cuadricula con coriolis clear clc a=2; b=3.5; c=3; d=3.5; e=7.5; f=5; g=2; h=8.5; t1=90*pi/180; t2=20*pi/180; t3=100*pi/180; %no interfiere t4=75*pi/180 t5=165*pi/180; t6=180*pi/180; t7=90*pi/180; %a-c+d=0 %g+h-f-e=0 %iteracion 1 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); A=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi c=(c+vc) g=g+vg % t5=t5*pi/180 t4=t4*pi/180 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); A=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi c=(c+vc) g=g+vg % t5=t5*pi/180 t4=t4*pi/180 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); A=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi c=(c+vc) g=g+vg % t5=t5*pi/180 t4=t4*pi/180 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); A=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi c=(c+vc) g=g+vg % t5=t5*pi/180 t4=t4*pi/180 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); A=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi c=(c+vc) g=g+vg 00005 %modelo del desarrollo de Newton-Raphson cuadrícula articulada-biela %maniviela clear clc a=4; b=12; c=7; d=12; f=10; g=21; h=14; t1=0*pi/180; t2=150*pi/180; t3=17*pi/180 t4=125*pi/180 t5=337*pi/180; t6=0*pi/180; fprintf('PRIMERA ITERACION'); %a+b-c-d=0 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %f+g-h=0 f3=f*cos(t4)+g*cos(t5)-h*cos(t6); f4=f*sin(t4)+g*sin(t5)-h*sin(t6); fprintf('MATRIZ A'); A=[-b*sin(t3) c*sin(t4) 0 0; b*cos(t3) -c*cos(t4) 0 0; 0 -f*sin(t4) -g*sin(t5) -cos(t6); 0 f*cos(t4) g*cos(t5) -sin(t6) ] fprintf('MATRIZ B negada'); B=-[a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f*cos(t4)+g*cos(t5)-h*cos(t6); f*sin(t4)+g*sin(t5)-h*sin(t6)] %Aa=inv(A) fprintf('MATRIZ INVERSA DE A'); INV=inv(A) X=INV*B; %xx=inv(A)*B fprintf('VALORES DE t3 t4 t5 h'); vt3=X(1); vt4=X(2); vt5=X(3); vh=X(4); fprintf('NUEVOS VALORES INICIALES DE t3 t4 t5 h'); t3=t3+vt3 t4=t4+vt4 t5=t5+vt5 h=h+vh 00006 %codigo posicionamiento 6 barra coriolis clear clc AM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0]; chi=0; a=2; b=3.5; c=3; d=3.5; e=7.5; f=5; g=2; h=8.5; t1=90*pi/180; t2=20*pi/180; t3=100*pi/180; %no interfiere t4=60*pi/180 t5=165*pi/180; t6=180*pi/180; t7=90*pi/180; %a-c+d=0 %g+h-f-e=0 for i=1:10 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); J=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO Jn=inv(J); B=[f1;f2;f3;f4]; X=-Jn*B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) e=0.000001; while abs(vt4)>e & abs(vt5)>e & abs(vg)>e & abs(vc)>e t5=(t5+vt5); t4=(t4+vt4); c=(c+vc); g=g+vg; f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); J=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO Jn=inv(J); B=[f1;f2;f3;f4]; X=-Jn*B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) end %-------------------------------------------------------------M1=[t4*180/pi,t5*180/pi,t2*180/pi]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t4=t4+5*pi/180; end disp (' t2 t3 t4 ') disp (AM); T4=AM(:,1); T5=AM(:,2); T2=AM(:,3); figure(1) plot(T4,T2,T4,T5) title('tetha 2 y tetha 5 en funciión de tetha 4') xlabel('tetha 2') ylabel('tetha 3 y tetha 4') legend('curva tetha 3','curva tetha 4') grid 00007 %MECANISMO DE RETORNO RÁPIDO WHITWOORT %ARTURO MACEDO SILVA %INGENIERÍA MECÁNICA UNSAAC clc, clear AM=[]; chi=0; a=4.1; c=15; d=11.9; t1=90*pi/180; t2=0*pi/180; t4=82*pi/180; % ecuaciones obtenidas del lazo vectorial % R=d*cos(t1)+a*cos(t2)=c*cos(t4); eje real % I=d*sin(t1)+a*sin(t2)=c*sin(t4); eje imaginario for i=1:36 f1=d*cos(t1)+a*cos(t2)-c*cos(t4); f2=d*sin(t1)+a*sin(t2)-c*sin(t4); A=[c*sin(t4) -cos(t4); -c*cos(t4) -sin(t4)]; B=-[d*cos(t1)+a*cos(t2)-c*cos(t4); d*sin(t1)+a*sin(t2)-c*sin(t4)]; X=A\B; vt4=X(1); vc=X(2); k=0.000001; while abs(vt4)>k & abs(vc)>k t4=t4+vt4; c=c+vc; f1=d*cos(t1)+a*cos(t2)-c*cos(t4); %funciones de generacion=0 f2=d*sin(t1)+a*sin(t2)-c*sin(t4); %funciones de generacion=0 A=[c*sin(t4) -cos(t4); -c*cos(t4) -sin(t4)]; %EL JACOBIANO B=-[d*cos(t1)+a*cos(t2)-c*cos(t4); d*sin(t1)+a*sin(t2)-c*sin(t4)]; X=A\B; vt4=X(1); vc=X(2); end M=[t2*180/pi,t4*180/pi,c]; if chi==0 AM=M; chi=1; else AM=[AM;M]; end t2=t2+10*pi/180; end disp (' t2 t4 c ') disp (AM) t2=AM(:,1); t4=AM(:,2); c=AM(:,3); figure(1) plot(t2,t4) title('variación de teta 4') grid figure (2) plot(t2,c,'r') title('variación de c') grid 00008 clc,clear%cuadricula articulada y biela manivela clear AM=[0,0,0,0,0,0,0,0,0,0]; chi=0; a=4; %longitud del eslabón 2 b=12; %longitud del eslabón 3 c=7; %longitud del eslabón 4 d=12; %longitud del eslabón 1 f=10; g=21; h=14; %el angulo t1 es cero y aparece en F1 %si desea considere t1 en su programa porque no siempre es cero t1=0; t2=0*pi/180;%empezamos de cero para que el programa corra desde cero t3=18*pi/180; %arbitrariio t4=125*pi/180; %arbitrario t5=337*pi/180; t6=0*pi/180; for i=1:73 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=f*cos(t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -f*sin(t4) -g*sin(t5) -cos(t6) ; 0 f*cos(t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); k=0.0000001; while (abs(vt3)>k & abs(vt4)>k) & (abs(vdh)>k & abs(vt5)>k) t3=t3+vt3; t4=t4+vt4; t5=t5+vt5; h=h+vdh; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=f*cos(t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(t4)+g*sin(t5)-h*sin(t6); A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -f*sin(t4) -g*sin(t5) -cos(t6) ; 0 f*cos(t4) g*cos(t5) -sin(t6)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,t4*180/pi,t5*180/pi,h]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 t5 h ') disp (AM) T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); t5=AM(:,4); h=AM(:,5); figure(1) plot(T2,T3,'k',T2,T4) title ('t3 y t4') figure (2) plot(T2,h) title('desplazamiento del pistón') 00009 clc,clear%cuadricula articulada y biela manivela clear a=0.02; %longitud del eslabón 2 b=0.04; %longitud del eslabón 3 c=0.04; %longitud del eslabón 4 d=0.03655512754; %longitud del eslabón 1 f=0.07; g=0.07; h=0.0632455532034; t1=123.6900675*pi/180; t2=130*pi/180;%empezamos de cero para que el programa corra desde cero t3=37*pi/180; %arbitrariio t4=15*pi/180; %arbitrario t5=227*pi/180; t6=288.44*pi/180; td=28.56*pi/180; k=(360+td)*pi/180; %A+B+C-D f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); t3=(t3+vt3)*180/pi t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi h=h+vdh %iteracion t3=(t3+vt3)*pi/180; t5=(t5+vt5)*pi/180; t4=(t4+vt4)*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); t3=(t3+vt3)*180/pi t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi h=h+vdh %iteracion t3=(t3+vt3)*pi/180; t5=(t5+vt5)*pi/180; t4=(t4+vt4)*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); t3=(t3+vt3)*180/pi t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi h=h+vdh %iteracion t3=(t3+vt3)*pi/180; t5=(t5+vt5)*pi/180; t4=(t4+vt4)*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); t3=(t3+vt3)*180/pi t5=(t5+vt5)*180/pi t4=(t4+vt4)*180/pi h=h+vdh 00010 clc,clear%cuadricula articulada y coriolis clear a=0.02; %longitud del eslabón 2 b=0.04; %longitud del eslabón 3 c=0.04; %longitud del eslabón 4 d=0.03655512754; %longitud del eslabón 1 f=0.07; g=0.07; h=0.0632455532034; t1=123.6900675*pi/180; t2=130*pi/180;%empezamos de cero para que el programa corra desde cero t3=37*pi/180; %arbitrariio t4=15*pi/180; %arbitrario t5=227*pi/180; t6=288.44*pi/180; td=28.56*pi/180; k=(360+td)*pi/180; %A+B+C-D for i=1:73 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); z=0.0000001; while (abs(vt3)>z & abs(vt4)>k) z (abs(vdh)>z & abs(vt5)>z) t3=t3+vt3; t4=t4+vt4; t5=t5+vt5; h=h+vdh; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); %F+G-H f3=f*cos(k-t4)+g*cos(t5)-h*cos(t6);%el 4 es triangulo f4=f*sin(k-t4)+g*sin(t5)-h*sin(t6); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 f*sin(k-t4) -g*sin(t5) -cos(t6) ; 0 -f*cos(k-t4) g*cos(t5) -sin(t6)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,t4*180/pi,t5*180/pi,h]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 t5 h ') disp (AM) T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); t5=AM(:,4); h=AM(:,5); figure(1) plot(T2,T3,'k',T2,T4) title ('t3 y t4') figure (2) plot(T2,h) title('desplazamiento') 00011 clc a=1.11; %longitud del eslabón 2 b=2.8; %longitud del eslabón 3 c=1; %longitud del eslabón 4 d=2;%longitud del eslabón 1 %angulos iniciales t1=(180)*pi/180; t2=330*pi/180;%empezamos de cero para que el programa corra desde cero t3=230*pi/180; %arbitrariio considere estos ángulos lo más reales t4=320*pi/180;%arbitrario considere estos ángulos lo más reales f1=a*cos(t1)+b*cos(t4)-c*cos(t3)-d*cos(t2); %funciones de generacion=0 f2=a*sin(t1)+b*sin(t4)-c*sin(t3)-d*sin(t2); %funciones de generacion=0 %EL JACOBIANO J=[c*sin(t3) -b*sin(t4); -c*sin(t3) b*cos(t4)] Jn=inv(J); B=[f1;f2] X=-Jn*B vt3=X(1); vt4=X(2); t3=(vt3+t3)*180/pi t4=(vt4+t4)*180/pi %2 iteracion t3=t3*pi/180; t4=t4*pi/180; f1=a*cos(t1)+b*cos(t4)-c*cos(t3)-d*cos(t2); %funciones de generacion=0 f2=a*sin(t1)+b*sin(t4)-c*sin(t3)-d*sin(t2); %funciones de generacion=0 %EL JACOBIANO J=[c*sin(t3) -b*sin(t4); -c*sin(t3) b*cos(t4)] Jn=inv(J); B=[f1;f2] X=-Jn*B vt3=X(1); vt4=X(2); t3=(vt3+t3)*180/pi t4=(vt4+t4)*180/pi %2 iteracion t3=t3*pi/180; t4=t4*pi/180; f1=a*cos(t1)+b*cos(t4)-c*cos(t3)-d*cos(t2); %funciones de generacion=0 f2=a*sin(t1)+b*sin(t4)-c*sin(t3)-d*sin(t2); %funciones de generacion=0 %EL JACOBIANO J=[c*sin(t3) -b*sin(t4); -c*sin(t3) b*cos(t4)] Jn=inv(J); B=[f1;f2] X=-Jn*B vt3=X(1); vt4=X(2); t3=(vt3+t3)*180/pi t4=(vt4+t4)*180/pi 00012 %modelo del desarrollo de Newton-Raphson cuadrícula articulada 5 barras clear clc a=76; b=52; c=126; d=50; e=51.4198405287; t1=(180+76.5042667192)*pi/180; t2=76.1904*pi/180; t3=20.3433*pi/180; t4=70*pi/180; t5=20*pi/180; %a+b-c-d f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi t5=t5*pi/180; t4=t4*pi/180; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t5)-e*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t5)-e*sin(t1); A=[ c*sin(t4) d*sin(t5); -c*cos(t4) -d*cos(t5)]; B=-[f1;f2]; %Aa=inv(A) X=A\B; %xx=inv(A)*B vt4=X(1); vt5=X(2); t4=t4+vt4; t5=t5+vt5; t5=t5*180/pi t4=t4*180/pi 00013 %velocidades de cuadricula articulada12232323232 t2=150*pi/180; t3=18*pi/180; t4=125.3650*pi/180; a=4; b=12; c=7; w2=5; alfa2=0; Jv=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)]; B=[a*w2*sin(t2);-a*w2*cos(t2)]; X=Jv\B; w3=X(1) w4=X(2) %aceleraciones Ja=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)]; B1=[a*(w2)^2*cos(t2)+a*alfa2*sin(t2)+b*(w3)^2*cos(t3)-c*(w4)^2*cos(t4); a*(w2)^2*sin(t2)-a*alfa2*cos(t2)+b*(w3)^2*sin(t3)-c*(w4)^2*sin(t4)]; Y=Ja\B1; alfa3=Y(1) alfa4=Y(2) %velociddes de centro de gravedad rcg2o2=2; vcg2=w2*rcg2o2 rcg4o4=3.5; vcg4=w4*rcg4o4 bcg3=4; vcg3x=-a*w2*sin(t2)-bcg3*w3*sin(t3); vcg3y=a*w2*cos(t2)+bcg3*w3*cos(t3); vcg3=((vcg3x)^2+(vcg3y)^2)^0.5 %aceleraciones de centro de gravedad anA=((w2)^2)*a; acg2=anA*rcg2o2/a anB=((w4)^2)*c; ancg4=anB*rcg4o4/c atcg4=alfa4*rcg4o4 acg4=((ancg4)^2+(atcg4)^2)^0.5 acg3x=-a*(w2)^2*cos(t2)-a*alfa2*sin(t2)-bcg3*alfa3*sin(t3)-bcg3*(w3)^2*cos(t3) acg3y=-a*(w2)^2*sin(t2)+a*alfa2*cos(t2)+bcg3*alfa3*cos(t3)-bcg3*(w3)^2*sin(t3) acg3=((acg3x)^2+(acg3y)^2)^0.5 00014 clc,clear%cuadricula articulada y biela manivela clear AM=[0,0,0,0,0,0,0,0,0,0]; chi=0; a=1; %longitud del eslabón 2 b=4; %longitud del eslabón 3 c=3; %longitud del eslabón 4 d=4.21; e=6%longitud del eslabón 1 f=6.5; g=5; h=7.5; %el angulo t1 es cero y aparece en F1 %si desea considere t1 en su programa porque no siempre es cero t1=331.61*pi/180; t2=100*pi/180;%empezamos de cero para que el programa corra desde cero t3=1*pi/180; %arbitrariio t4=85*pi/180; %arbitrario t5=185*pi/180; t6=90*pi/180; t7=180*pi/180; te=15.08*pi/180; for i=1:73 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=e*cos(t4+te)+f*cos(t5)-g*cos(t6)-h*cos(t7);%el 4 es triangulo f4=e*sin(t4+te)+f*sin(t5)-g*sin(t6)-h*sin(t7); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -e*sin(t4+te) -f*sin(t5) -cos(t7) ; 0 e*cos(t4+te) f*cos(t5) -sin(t7)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); k=0.0000001; while (abs(vt3)>k & abs(vt4)>k) & (abs(vdh)>k & abs(vt5)>k) t3=t3+vt3; t4=t4+vt4; t5=t5+vt5; h=h+vdh; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=e*cos(t4+te)+f*cos(t5)-g*cos(t6)-h*cos(t7);%el 4 es triangulo f4=e*sin(t4+te)+f*sin(t5)-g*sin(t6)-h*sin(t7); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -e*sin(t4+te) -f*sin(t5) -cos(t7) ; 0 e*cos(t4+te) f*cos(t5) -sin(t7)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,t4*180/pi,t5*180/pi,h]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 t5 h ') disp (AM) T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); t5=AM(:,4); h=AM(:,5); figure(1) plot(T2,T3,'k',T2,T4) title ('t3 y t4') figure (2) plot(T2,h) title('desplazamiento del pistón') 00015 clear clc AM=[0,0,0,0,0,0,0,0,0,0]; chi=0; a=1.11; b=2.8; c=1; d=2; f=3.5; g=7.2; e=5.79; t1=180*pi/180; t2=270*pi/180;%probar valores para teta 2 porque este manda t3=230*pi/180; t4=320*pi/180; t6=210*pi/180; for i=1:30 f1=a*cos(t1)+b*cos(t4)-c*cos(t3)-d*cos(t2); f2=a*sin(t1)+b*sin(t4)-c*sin(t3)-d*sin(t2); %g+h-f-ee f3=e*cos(t1)+d*cos(t2)+f*cos(t3)-g*cos(t6); f4=e*sin(t1)+d*sin(t2)+f*sin(t3)-g*sin(t6); A=[c*sin(t3) -b*sin(t4) 0 0; -c*cos(t3) b*cos(t4) 0 0; -f*sin(t3) 0 g*sin(t6) -cos(t6); f*cos(t3) 0 -g*sin(t6) -sin(t6)]; B=-[f1; f2; f3; f4]; X=inv(A)*B; vt3=X(1); vt4=X(2) ; vt6=X(3); vg=X(4); k=0.000001; while (abs(vt3)>k & abs(vt4)>k) & (abs(vg)>k & abs(vt6)>k) t3=t3+vt3; t4=t4+vt4; t6=t6+vt6; g=g+vg; f1=a*cos(t1)+b*cos(t4)-c*cos(t3)-d*cos(t2); f2=a*sin(t1)+b*sin(t4)-c*sin(t3)-d*sin(t2); %g+h-f-ee f3=e*cos(t1)+d*cos(t2)+f*cos(t3)-g*cos(t6); f4=e*sin(t1)+d*sin(t2)+f*sin(t3)-g*sin(t6); A=[c*sin(t3) -b*sin(t4) 0 0; -c*cos(t3) b*cos(t4) 0 0; -f*sin(t3) 0 g*sin(t6) -cos(t6); f*cos(t3) 0 -g*sin(t6) -sin(t6)]; B=-[f1; f2; f3; f4]; X=inv(A)*B; vt3=X(1); vt4=X(2) ; vt6=X(3); vg=X(4); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,t4*180/pi,t6*180/pi,g]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 t6 G ') disp (AM) T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); T6=AM(:,4); g=AM(:,5); figure(1) plot(T2,T3,'k',T2,T4) title ('t3 y t4') figure (2) plot(T2,g) title('desplazamiento del pistón') 00016 %codigo posicionamiento 6 barra coriolis clear clc AM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0]; chi=0; a=2; b=3.5; c=3; d=3.5; e=7.5; f=5; g=2; h=8.5; t1=90*pi/180; t2=20*pi/180; t3=100*pi/180; %no interfiere t4=60*pi/180 t5=165*pi/180; t6=180*pi/180; t7=90*pi/180; %a-c+d=0 %g+h-f-e=0 for i=1:10 f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); J=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO Jn=inv(J); B=[f1;f2;f3;f4]; X=-Jn*B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) e=0.000001; while abs(vt4)>e & abs(vt5)>e & abs(vg)>e & abs(vc)>e t5=(t5+vt5); t4=(t4+vt4); c=(c+vc); g=g+vg; f1=a.*cos(t2)-c.*cos(t4)+d*cos(t1); f2=a.*sin(t2)-c.*sin(t4)+d*sin(t1); f3=g*cos(t6)+h*cos(t7)-f*cos(t5)-e*cos(t4); f4=g*sin(t6)+h*sin(t7)-f*sin(t5)-e*sin(t4); J=[-cos(t4) c*sin(t4) 0 0; -sin(t4) -c*cos(t4) 0 0; 0 e*sin(t4) f*sin(t5) cos(t6); 0 -e*cos(t4) -f*cos(t5) sin(t6)]; %EL JACOBIANO Jn=inv(J); B=[f1;f2;f3;f4]; X=-Jn*B vc=X(1) vt4=X(2) vt5=X(3) vg=X(4) end %-------------------------------------------------------------M1=[t4*180/pi,t5*180/pi,t2*180/pi]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t4=t4+5*pi/180; end disp (' t2 t3 t4 ') disp (AM); T4=AM(:,1); T5=AM(:,2); T2=AM(:,3); figure(1) plot(T4,T2,T4,T5) title('tetha 2 y tetha 5 en funciión de tetha 4') xlabel('tetha 2') ylabel('tetha 3 y tetha 4') legend('curva tetha 3','curva tetha 4') grid 00017 %CUADRICULA lear clc AM=[0,0,0,0,0,0,0,0,0,0]; chi=0; a=63; b=130; c=40; d=52; t1=90*pi/180; t2=0*pi/180; t3=142*pi/180; %no interfiere t4=180*pi/180; %a+b-c-d for i=1:73 f1=a*cos(t2)+b*cos(t3)-c*cos(t1)-d*cos(t4); f2=a*sin(t2)+b*sin(t3)-c*sin(t1)+d*sin(t4); %jacobiano A=[-b*sin(t3) -cos(t1) ; b*cos(t3) -sin(t1) ]; B=-[f1;f2]; X=A\B; vt3=X(1); vc=X(2); k=0.0000001; while (abs(vt3)>k & (abs(vc))>k) t3=t3+vt3; c=c+vc; f1=a*cos(t2)+b*cos(t3)-c*cos(t1)-d*cos(t4); f2=a*sin(t2)+b*sin(t3)-c*sin(t1)+d*sin(t4); %jacobiano A=[-b*sin(t3) -cos(t1) ; b*cos(t3) -sin(t1) ]; B=-[f1;f2]; X=A\B; vt3=X(1); vc=X(2); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,c]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 c ') disp (AM) T2=AM(:,1); T3=AM(:,2); c=AM(:,3); figure(1) plot(T2,T3,'k',T2,c) title ('t3 y t4') figure (2) plot(T2,c) title('desplazamiento del pistón en mm') 00018 %GENERACION %TRENCHE=a1, a2,a3 %phi(bi,b2,b3 a1=32.77*pi/180; a2=55*pi/180; a3=84.73*pi/180; b1=24.02*pi/180; b2=50*pi/180; b3=75.98*pi/180; A=[cos(a1) -cos(b1) 1;cos(a2) -cos(b2) 1;cos(a3) -cos(b3) B=[cos(a1-b1);cos(a2-b2);cos(a3-b3)] Ainv=inv(A) X=Ainv*B; k1=X(1) k2=X(2) k3=X(3) d=10% pCAMBIA ESTE VALOR YAAAAAAAA a=d/k1 b=d/k2 c=sqrt(((a)^2)+((b)^2)+((d)^2)-(2*a*b*k3)) z1=d+b z2=a+c 1]; 00019 clc,clear%cuadricula articulada y biela manivela clear AM=[0,0,0,0,0,0,0,0,0,0]; chi=0; a=1; %longitud del eslabón 2 b=4; %longitud del eslabón 3 c=3; %longitud del eslabón 4 d=4.21; e=6%longitud del eslabón 1 f=6.5; g=5; h=7.5; %el angulo t1 es cero y aparece en F1 %si desea considere t1 en su programa porque no siempre es cero t1=331.61*pi/180; t2=0*pi/180;%empezamos de cero para que el programa corra desde cero t3=1*pi/180; %arbitrariio t4=85*pi/180; %arbitrario t5=185*pi/180; t6=90*pi/180; t7=180*pi/180; te=15.08*pi/180; for i=1:73 f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=e*cos(t4+te)+f*cos(t5)-g*cos(t6)-h*cos(t7);%el 4 es triangulo f4=e*sin(t4+te)+f*sin(t5)-g*sin(t6)-h*sin(t7); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -e*sin(t4+te) -f*sin(t5) -cos(t7) ; 0 e*cos(t4+te) f*cos(t5) -sin(t7)]; B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); k=0.0000001; while (abs(vt3)>k & abs(vt4)>k) & (abs(vdh)>k & abs(vt5)>k) t3=t3+vt3; t4=t4+vt4; t5=t5+vt5; h=h+vdh; f1=a*cos(t2)+b*cos(t3)-c*cos(t4)-d*cos(t1); f2=a*sin(t2)+b*sin(t3)-c*sin(t4)-d*sin(t1); f3=e*cos(t4+te)+f*cos(t5)-g*cos(t6)-h*cos(t7);%el 4 es triangulo f4=e*sin(t4+te)+f*sin(t5)-g*sin(t6)-h*sin(t7); % t3 t4 t5 h A=[-b.*sin(t3) c.*sin(t4) 0 0; b.*cos(t3) -c.*cos(t4) 0 0; 0 -e*sin(t4+te) -f*sin(t5) -cos(t7) ; 0 e*cos(t4+te) f*cos(t5) -sin(t7)]; %EL JACOBIANO B=-[f1;f2;f3;f4]; X=A\B; vt3=X(1); vt4=X(2); vt5=X(3); vdh=X(4); end %-------------------------------------------------------M1=[t2*180/pi,t3*180/pi,t4*180/pi,t5*180/pi,h]; if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 t5 h ') disp (AM) T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); t5=AM(:,4); h=AM(:,5); figure(1) plot(T2,T3,'k',T2,T4) title ('t3 y t4') figure (2) plot(T2,h) title('desplazamiento del pistón') 00020 %TRENCHE BIELA MANIVELA %TRENCHE=a1, a2,a3 %phi(bi,b2,b3 a1=30*pi/180; a2=50*pi/180; a3=80*pi/180; s1=9.43; s2=8.54; s3=6.87 b1=50*pi/180; b2=100*pi/180; b3=150*pi/180; A=[s1*cos(a1) -sin(a1) -1;s2*cos(a2) -sin(a2) B=[(s1^2);(s2)^2;(s3)^2] Ainv=inv(A) X=Ainv*B; k1=X(1) k2=X(2) k3=X(3) r=k1/2% pCAMBIA ESTE VALOR YAAAAAAAA a=k2/(2*r) l=sqrt(a^2+r^2-k3) -1;s3*cos(a3) -sin(a3) 00021 %INGENIERIA MECANICA UNSAAC %ARTURO MACEDO SILVA %PROGRAMA CUADRICULA ARTICULADA %POSICIONAMIENTO, VELOCIDADES ANGULARES, ACELERACIONES ANGULARES clc,clear%ejemplo planteado en la página 413 Mabie clear AM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0]; chi=0; a=3; %longitud del eslabón 2 b=8; %longitud del eslabón 3 c=6; %longitud del eslabón 4 d=7; %longitud del eslabón 1 %angulos iniciales t1=0*pi/180; t2=0*pi/180;%empezamos de cero para que el programa corra desde cero t3=22.07*pi/180; %arbitrariio considere estos ángulos lo más reales t4=76.11*pi/180; %arbitrario considere estos ángulos lo más reales w2=5;%velocidad angular del eslabón2 dato alfa2=1;%aceleración angular del eslabón 2 dato for k=1:73 f1=a.*cos(t2)+b.*cos(t3)-c.*cos(t4)-d*cos(t1) %funciones de generacion=0 f2=a.*sin(t2)+b.*sin(t3)-c.*sin(t4)-d*sin(t1) %funciones de generacion=0 -1]; A=[-b.*sin(t3) c.*sin(t4);b.*cos(t3) -c.*cos(t4)]%EL JACOBIANO B=-[a.*cos(t2)+b.*cos(t3)-c.*cos(t4)-d*cos(t1); a.*sin(t2)+b.*sin(t3)-c.*sin(t4)-d*sin(t1)] X=A\B vt3=X(1) vt4=X(2) k=0.000001; while abs(vt3)>k & abs(vt4)>k t3=t3+vt3; t4=t4+vt4; f1=a.*cos(t2)+b.*cos(t3)-c.*cos(t4)-d*cos(t1) f2=a.*sin(t2)+b.*sin(t3)-c.*sin(t4)-d*sin(t1) A=[-b.*sin(t3) c.*sin(t4); b.*cos(t3) -c.*cos(t4)]; %EL JACOBIANO B=-[a.*cos(t2)+b.*cos(t3)-c.*cos(t4)-d*cos(t1); a.*sin(t2)+b.*sin(t3)-c.*sin(t4)-d*sin(t1)]; X=A\B; vt3=X(1); vt4=X(2); end %-------------------------------------------------------------%ecuaciones de velocidades % definimos velocidades angulares w3,w4 Jv=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)]; B=[a*w2*sin(t2);-a*w2*cos(t2)]; X=Jv\B; w3=X(1); w4=X(2); %-----------------------------------------------------%definimos aceleraciones angulares alfa3 y alfa4 %observe que el Jacobiano se mantiene, y la matriz B considera las %aceleraciones tangenciales y normales Ja=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)]; acel=[a*alfa2*sin(t2)+a*w2^2*cos(t2)+b*w3^2*cos(t3)-c*w4^2*cos(t4); -a*alfa2*cos(t2)+a*w2^2*sin(t2)+b*w3^2*sin(t3)-c*w4^2*sin(t4)]; Y=Ja\acel; alfa3=Y(1); alfa4=Y(2); %velocidades de A y B (puntos) Va=a*w2*(-sin(t2)+i*cos(t2)); angle(Va) Vax=a*w2*(-sin(t2)); Vay=a*w2*(cos(t2)); VA=sqrt(Vax^2+Vay^2); angBA=atand(Vay/Vax)+180; Vba=b*w3*(-sin(t3)+cos(t3)); Vbax=b*w3*(-sin(t3)); Vbay=b*w3*(cos(t3)); VBA=sqrt(Vbax^2+Vbay^2); angA=atand(Vbay/Vbax)+180; Vb=c*w4*(-sin(t4)+cos(t4)); Vbx=c*w4*(-sin(t4)); Vby=c*w4*(cos(t4)); VB=sqrt(Vbx^2+Vby^2); angB=atand(Vby/Vbx)+180; %aceleraciones de A y B Aa=a*alfa2*(-sin(t2)+i*cos(t2))-a*w2^2*(cos(t2)+i*sin(t2)); Aax=-a*alfa2*sin(t2)-a*w2^2*cos(t2); Aay=a*alfa2*cos(t2)-a*w2^2*sin(t2); AA=sqrt(Aax^2+Aay^2); Aba=b*alfa3*(-sin(t3)+i*cos(t3))-b*w3^2*(cos(t3)+i*sin(t3)); Abax=-b*alfa3*sin(t3)-b*w3^2*cos(t3); Abay=b*alfa3*cos(t3)-b*w3^2*sin(t3); ABA=sqrt(Abax^2+Abay^2); Ab=c*alfa4*(-sin(t4)+i*cos(t4))-c*w4^2*(cos(t4)+i*sin(t4)); Abx=-c*alfa4*sin(t4)-c*w4^2*cos(t4); Aby=c*alfa4*cos(t4)-c*w4^2*sin(t4); AB=sqrt(Abx^2+Aby^2); M1=[t2*180/pi,t3*180/pi,t4*180/pi,w3,w4,alfa3,alfa4,Vbx,Vby,VB,Abx,Aby,AB,Abax,A bay] if chi==0 AM=M1; chi=1; else AM=[AM;M1]; end t2=t2+5*pi/180; end disp (' t2 t3 t4 w3 w4 alfa3 alfa4 Vbx Vby VB Abx Aby AB') disp (AM); T2=AM(:,1); T3=AM(:,2); T4=AM(:,3); w3=AM(:,4); w4=AM(:,5); ALFA3=AM(:,6); ALFA4=AM(:,7); Vbx=AM(:,8); Vby=AM(:,9); VB=AM(:,10); Abx=AM(:,11); Aby=AM(:,12); AB=AM(:,13); Abax=AM(:,14); Abay=AM(:,15); figure(1) plot(T2,T3,T2,T4,'linewidth',1.0') title('tetha 3 y tetha 4 en funciión de tetha 2') xlabel('tetha 2') ylabel('tetha 3 y tetha 4') legend('curva tetha 3','curva tetha 4') grid figure(2) plot(T2,w3,'k','linewidth',1.0') hold on plot(T2,w4,'r','linewidth',1.0') grid on title('Velocidades angulares W3 y W4 en función de tetha 2') xlabel('tetha 2') ylabel('Velocidades angulares W3 y W4') legend('curva velocidad angular W3','curva velocidad angular W4') figure(3) plot(T2,ALFA3,'linewidth',1.0') hold on plot(T2,ALFA4,'r','linewidth',1.0')% ojo grid on title('Aceleraciones angulares alfa3 y alfa4 en fución de tetha 2') xlabel('tetha 2') ylabel('Aceleraciones angulares alfa3 y alfa4') legend('curva aceleracion angular alfa3','curva aceleracion angular alfa4') figure(4) plot(T2,Vbx,T2,Vby,T2,VB,'k','linewidth',1.0') title('velocidad Vbx, Vby,VB') xlabel('tetha 2') ylabel('V bax,VB') grid figure(5) plot(T2,Abx,T2,Aby,T2,AB,'k','linewidth',1.0') title('aceleracion,Abx,Aby,AB') xlabel('tetha 2') ylabel('Abx,Aby,AB') grid figure (6) plot(T2,Abax,T2,Abay) 00022 %INGENIERIA MECANICA UNSAAC %ARTURO MACEDO SILVA %PROGRAMA CUADRICULA ARTICULADA %POSICIONAMIENTO, VELOCIDADES ANGULARES, ACELERACIONES ANGULARES clc,clear%ejemplo planteado en la página 413 Mabie clear AM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0]; chi=0; a=3; %longitud del eslabón 2 b=8; %longitud del eslabón 3 c=6; %longitud del eslabón 4 d=7; %longitud del eslabón 1 %angulos iniciales t1=0*pi/180; t2=60*pi/180;%empezamos de cero para que el programa corra desde cero t3=22.81*pi/180; %arbitrariio considere estos ángulos lo más reales t4=71.8*pi/180; %arbitrario considere estos ángulos lo más reales w2=5;%velocidad angular del eslabón2 dato alfa2=1;%aceleración angular del eslabón 2 dato %-------------------------------------------------------------- %ecuaciones de velocidades % definimos velocidades angulares w3,w4 Jv=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)] B=[a*w2*sin(t2);-a*w2*cos(t2)] X=Jv\B; w3=X(1) w4=X(2) %-----------------------------------------------------%definimos aceleraciones angulares alfa3 y alfa4 %observe que el Jacobiano se mantiene, y la matriz B considera las %aceleraciones tangenciales y normales Ja=[-b*sin(t3) c*sin(t4);b*cos(t3) -c*cos(t4)] acel=[a*alfa2*sin(t2)+a*w2^2*cos(t2)+b*w3^2*cos(t3)-c*w4^2*cos(t4); -a*alfa2*cos(t2)+a*w2^2*sin(t2)+b*w3^2*sin(t3)-c*w4^2*sin(t4)] Y=Ja\acel; alfa3=Y(1) alfa4=Y(2) 00023 %TRENCHE CUADRICULA %TRENCHE=a1, a2,a3 %phi(bi,b2,b3 a1=(73)*pi/180; a2=(98)*pi/180; a3=(125)*pi/180; b1=(50)*pi/180; b2=(100)*pi/180; b3=(150)*pi/180; A=[cos(a1) -cos(b1) 1;cos(a2) -cos(b2) 1;cos(a3) -cos(b3) B=[cos(a1-b1);cos(a2-b2);cos(a3-b3)] Ainv=inv(A) X=Ainv*B; k1=X(1) k2=X(2) k3=X(3) d=1% pCAMBIA ESTE VALOR YAAAAAAAA a=d/k1 b=d/k2 c=sqrt(((a)^2)+((b)^2)+((d)^2)-(2*a*b*k3)) z1=d+b z2=a+c 00024 %velocidades de biela-manivela t2=300*pi/180; t3=14.33*pi/180; a=1; b=3.5; c=3.891; w2=5; 1]; alfa2=0; Jv=[-b*sin(t3) -1;b*cos(t3) 0]; B=[a*w2*sin(t2);-a*w2*cos(t2)]; X=Jv\B; w3=X(1) d_punto=X(2) %aceleraciones Ja=[-b*sin(t3) -1;b*cos(t3) 0]; B1=[a*(w2)^2*cos(t2)+a*alfa2*sin(t2)+b*(w3)^2*cos(t3); a*(w2)^2*sin(t2)-a*alfa2*cos(t2)+b*(w3)^2*sin(t3)]; Y=Ja\B1; alfa3=Y(1) d_dospuntos=Y(2) 00025 %velocidades de biela-manivela t2=300*pi/180; t3=14.33*pi/180; a=1; b=3.5; c=3.891; w2=5; alfa2=0; Jv=[-b*sin(t3) -1;b*cos(t3) 0]; B=[a*w2*sin(t2);-a*w2*cos(t2)]; X=Jv\B; w3=X(1) d_punto=X(2) %aceleraciones Ja=[-b*sin(t3) -1;b*cos(t3) 0]; B1=[a*(w2)^2*cos(t2)+a*alfa2*sin(t2)+b*(w3)^2*cos(t3); a*(w2)^2*sin(t2)-a*alfa2*cos(t2)+b*(w3)^2*sin(t3)]; Y=Ja\B1; alfa3=Y(1) d_dospuntos=Y(2)