matlab四杆机构源程序

matlab四杆机构源程序

ID:39682686

大小:73.00 KB

页数:6页

时间:2019-07-09

matlab四杆机构源程序_第1页
matlab四杆机构源程序_第2页
matlab四杆机构源程序_第3页
matlab四杆机构源程序_第4页
matlab四杆机构源程序_第5页
资源描述:

《matlab四杆机构源程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、1.角位移M函数:functiony=jweiyi(x)%Inputparameters%x(1)=theta-1%x(2)=theta-2guessvalue%x(3)=theta-3guessvalue%x(4)=r1%x(5)=r2%x(6)=r3%x(7)=r4%Outputparameters%y(1)=theta-2%y(2)=theta-3theta2=x(2);theta3=x(3);%epsilon=1.0E-6;%f=[x(4)*cos(x(1))+x(5)*cos(thet

2、a2)-x(7)-x(6)*cos(theta3);x(4)*sin(x(1))+x(5)*sin(theta2)-x(6)*sin(theta3)];%whilenorm(f)>epsilonJ=[-x(5)*sin(theta2)x(6)*sin(theta3);x(5)*cos(theta2)-x(6)*cos(theta3)];dth=inv(J)*(-1.0*f);theta2=theta2+dth(1);theta3=theta3+dth(2);f=[x(4)*cos(x(1))+x

3、(5)*cos(theta2)-x(7)-x(6)*cos(theta3);x(4)*sin(x(1))+x(5)*sin(theta2)-x(6)*sin(theta3)];norm(f);end;y(1)=theta2;y(2)=theta3;2.r1旋转360°时,θ2,θ3的M文件程序:r(1)=50;r(2)=150;r(3)=300;r(4)=400;dr=pi/180;th(1)=0;th(2)=58.4119*dr;th(3)=154.7912*dr;y=jweiyi([th(1

4、),th(2),th(3),r(1),r(2),r(3),r(4)])dth=1*dr;fori=1:360y=jweiyi([th(1),th(2),th(3),r(1),r(2),r(3),r(4)]);th23(i,:)=[th(1)/dr,th(2)/dr,th(3)/dr];th(1)=th(1)+dth;th(2)=y(1);th(3)=y(2);endfigure(1)plot(th23(:,1),th23(:,2),th23(:,1),th23(:,3),th23(:,1),th

5、23(:,1))axis([0,360,0,360])gridontitle('角位移线图')xlabel('曲柄转角th(1)')ylabel('从动件转角th(2),th(3)')text(300,50,'角th(2)')text(300,150,'角th(3)')text(200,200,'角th(1)')3.角速度的M函数:functiony=rrrvel(x)%Inputparameters%%x(1)=theta-1%x(2)=theta-2%x(3)=theta-3%x(4)=dt

6、heta-1%x(5)=r1%x(6)=r2%x(7)=r3%%Outputparameters%%y(1)=dtheta-2%y(2)=dtheta-3%A=[-x(6)*sin(x(2))x(7)*sin(x(3));x(6)*cos(x(2))-x(7)*cos(x(3))];B=[x(5)*sin(x(1));-x(5)*cos(x(1))]*x(4);y=inv(A)*B;4.r1旋转360°时ω2,ω3的M文件程序:th(1)=0;dr=pi/180;dth(1)=36;dth(2)

7、=58.4119*dr;dth(3)=154.7912*dr;dth1=1*dr;r(1)=50;r(2)=150;r(3)=300;r(4)=400;forj=1:360x=rrrvel([th(1),dth(2),dth(3),dth(1),r(1),r(2),r(3)]);y=jweiyi([th(1),dth(2),dth(3),r(1),r(2),r(3),r(4)]);dth(2)=y(1);dth(3)=y(2);th(1)=th(1)+dth1;dth23(j,:)=[th(1)

8、/dr,x(1)/dr,x(2)/dr];endfigure(2)plot(dth23(:,1),dth23(:,2),dth23(:,1),dth23(:,3))axis([0,360,-800,2000])gridontitle('角速度线图')xlabel('曲柄旋转角度')ylabel('从动件角速度dth(2),dth(3)(rad/s)')text(250,200,'连杆2角速度')text(50,100,'摇杆3角速度')5.r1旋转360°时,α2,α3程序M文件:r(1)=50

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。