您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 机械/模具设计 > 平面六杆机构的运动分析Matlab代码
平面六杆机构的运动分析M代码%参数赋值clc,clearl0=22;l1=40;l2=55;l3=55;l4=44;l5=35;M=-1;Omiga1=10;Theta1=0:0.01:360;Theta1=Theta1*pi/180;%求解各个构件位移、速度、加速度A=2*l1*l2*sin(Theta1);B=2*l2*(l1*cos(Theta1)-l0);C=l1^2+l2^2+l0^2-l3^2-2*l1*l0*cos(Theta1);E=2*l1*l3*sin(Theta1);F=2*l3*(l1*cos(Theta1)-l0);G=l2^2-l1^2-l3^2-l0^2+2*l1*l0*cos(Theta1);Theta3=2*atan((E+M*sqrt(E.^2+F.^2-G.^2))./(F-G));Theta31=Theta3-30;S=l5.*cos(Theta31)-sqrt(-l5^2.*sin(Theta31).^2+l4^2);Theta2=2*atan((A+M*sqrt(A.^2+B.^2-C.^2))./(B-C));Theta4=atan(l5.*sin(Theta31)./(l5.*cos(Theta31)-S));Omiga2=Omiga1*l1*sin(Theta1-Theta3)./(l2*sin(Theta3-Theta2));Omiga3=Omiga1*l1*sin(Theta1-Theta2)./(l3*sin(Theta3-Theta2));Omiga4=((-l5).*Omiga3.*cos(Theta31))./(l4.*cos(Theta4));Vf=-l5.*Omiga3.*sin(Theta31)+l4.*Omiga4.*sin(Theta4);Alfa3=(Omiga1^2*l1*cos(Theta1-Theta2)+Omiga2.^2*l2-Omiga3.^2*l3.*cos(Theta3-Theta2))./(l3*sin(Theta3-Theta2));Alfa2=(-Omiga1^2*l1*cos(Theta1-Theta3)+Omiga3.^2*l3-Omiga2.^2*l2.*cos(Theta2-Theta3))./(l2*sin(Theta2-Theta3));Alfa4=(l5.*Alfa3.*cos(Theta31)+l4.*Omiga4.^2.*sin(Theta4)-l5.*Omiga3.^2.*sin(Theta31))./(l4.*cos(Theta4));Af=(-l5).*Omiga3.^2.*cos(Theta31)+l4.*(Omiga4.^2.*cos(Theta4)+Alfa4.*sin(Theta4))-l5.*Alfa3.*sin(Theta31);%绘图Theta1=Theta1*180/pi;Subplot(3,1,1)plot(Theta1,Theta2),gridonxlabel('曲柄转角(^。)');ylabel('BC杆角位移(rad)');Subplot(3,1,2)plot(Theta1,Omiga2),gridonxlabel('曲柄转角(^。)');ylabel('BC杆角速度(rad/s)');Subplot(3,1,3)plot(Theta1,Alfa2),gridonxlabel('曲柄转角(^。)');ylabel('BC杆角加速度(rad/s^2)');Subplot(3,1,1)plot(Theta1,Theta3),gridonxlabel('曲柄转角(^。)');ylabel('CD杆角位移(rad)');Subplot(3,1,2)plot(Theta1,Omiga3),gridonxlabel('曲柄转角(^。)');ylabel('CD杆角速度(rad/s)');Subplot(3,1,3)plot(Theta1,Alfa3),gridonxlabel('曲柄转角(^。)');ylabel('CD杆角加速度(rad/s^2)');Subplot(3,1,1)plot(Theta1,Theta4*180/pi),gridonxlabel('曲柄转角(^。)');ylabel('EF杆角位移(rad)');Subplot(3,1,2)plot(Theta1,Omiga4),gridonxlabel('曲柄转角(^。)');ylabel('EF杆角速度(rad/s)');Subplot(3,1,3)plot(Theta1,Alfa4),gridonxlabel('曲柄转角(^。)');ylabel('EF杆角加速度(rad/s^2)');Subplot(3,1,1)plot(Theta1,S),gridonxlabel('曲柄转角(^。)');ylabel('滑块F位移(mm)');Subplot(3,1,2)plot(Theta1,Vf),gridonxlabel('曲柄转角(^。)');ylabel('滑块F速度(mm/s)');Subplot(3,1,3)plot(Theta1,Af),gridonxlabel('曲柄转角(^。)');ylabel('滑块F加速度(mm/s^2)');学生:许建平指导老师:张俊BC杆CD杆EF杆滑块F
本文标题:平面六杆机构的运动分析Matlab代码
链接地址:https://www.777doc.com/doc-5819765 .html