Documentos de Académico
Documentos de Profesional
Documentos de Cultura
clc
A=L1.*cos(theta1)-L2.*cos(theta2);
B=L1.*sin(theta1)-L2.*sin(theta2);
C=(L3^2-L4^2+A.^2+B.^2)/(2*L3);
D=(L3^2-L4^2-A.^2-B.^2)/(2*L4);
VAx=(omega2*L2).*(-sin(theta2));
VAy=(omega2*L2).*(cos(theta2));
VA=sqrt(VAx.^2+VAy.^2);
VBx=(omega4.*L4).*(-sin(theta4));
VBy=(omega4.*L4).*(cos(theta4));
VB=sqrt(VBx.^2+VBy.^2);
% calculo de la aceleracion en la union A en m/s^2:
aAx=-omega2.^2.*L2.*cos(theta2);
aAy=-omega2.^2.*L2.*sin(theta2);
aA=sqrt(aAx.^2+aAy.^2);
alpha3=(-omega2.^2.*L2.*sin(theta2+theta4)+omega3.^2.*L3.*sin(theta3-
theta4)+omega4.^2.*L4)./(L3.*cos(theta3-theta4));
alpha4=(-omega2.^2.*L2.*sin(theta2+theta3)+omega4.^2.*L4.*sin(theta4-theta3)-
omega3.^2.*L3)./(L4.*cos(theta4-theta3));
aBx=-omega4.^2.*L4.*cos(theta4)-alpha4*L4.*sin(theta4);
aBy=-omega4.^2.*L4.*sin(theta4)+alpha4*L4.*cos(theta4);
aB=sqrt(aBx.^2+aBy.^2);
% posicion puntos A y B
X0=zeros(length(theta2),1)';
Y0=zeros(length(theta2),1)';
R0x=L1.*cos(theta1);
R0y=L1.*sin(theta1);
RAx=L2.*cos(theta2);
RAy=L2.*sin(theta2);
RBx=L3.*cos(theta3);
RBy=L3.*sin(theta3);
RCx=L4.*cos(theta4);
RCy=L4.*sin(theta4);
XA=RAx;
YA=RAy;
XB=XA+RBx;
YB=YA+RBy;
XC=R0x;
YC=R0y;
figure(1)
n=length(theta2);
X=[XA XB XC];
Y=[YA YB YC];
xmin=min(X);
xmax=max(X);
ymin=min(Y);
ymax=max(Y);
for i=1:n
clf()
plot([X0(i),XA(i)],[Y0(i),YA(i)],X0,Y0,'o',[XA(i),YA(i)],'o',[XA(i),XB(i)],
[YA(i),YB(i)],XB,YB,'o',[XB(i),XC(i)],[YB(i),YC(i)],XC,YC,'o',[X0(i),XC(i)],
[Y0(i),YC(i)],'--')
axis([xmin xmax ymin ymax])
pause (0.01)
end
figure(3)
plot(theta2,theta3,theta2,theta4),grid on
title("angulos theta3 y theta4 vs theta2")