用matlab分析四杆机构_第1页
用matlab分析四杆机构_第2页
用matlab分析四杆机构_第3页
用matlab分析四杆机构_第4页
用matlab分析四杆机构_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、首先创建函数foutbarposition,函数fsolve通过他确定。function t=fourbarposition(th,th2,l2,l3,l4,l1)t=l2*cos(th2)+l3*cos(th(1 )-l4*cos(th(2)-l1 l2*sin(th2)+l3*sin(th(1)-l4*sin(th(2);主程序如下:disp *平面四杆机构的运动分析*l1=304.8;l2=101.6;l3=254.0;l4=177.8; %给定己知量,各杆长 l1 丄2丄3丄4 th2=0:1/6:2*pi;%曲柄输入角度从0至360度,步长为pi/6th34=zeros(length

2、(th2),2);%建立一个n行2列的零矩阵,第一列存放options=optimset('displaytoff);%9_3,第二列存放 0_3for m=1:length(th2)%建立 for 循环,求解 0_3, 0_4th34(m,:)=fsolve('fourbarposition,1 1,.%调用 fsove 函数求解关丁 8_3, 0_4options,th2(m),l2,l3,l4,l1);%的非线性超越方程,结果保存在th34中endy=l2*sin(th2)+l3*sin(th34(:,1 )*);%连杆 3 的 d 端点 丫 坐标值x=l2*cos(th

3、2)+l3*cos(th34(:,iy); %连杆 3 的 d 端点 x 坐标值 xx=l2*cos(th2);%连杆3的c端点x坐标侑yy=l2*sin(th2);%连杆3的c端点丫坐标值figure(1)plot(x;xx,y;yy/k0 l1,0 0,. %绘制连杆 3 的几个位置点'k-.x.y/koxx.yy/ks*)title。连杆3的几个位置点')xlabef水平方向')ylabel(唾直方向')axis equal %xy坐标均衡th2=0:2/72:2*pi; %重新细分曲柄输入角度8_2,步长为5度th34=zeros(length(th2)

4、,2);options 二 optimset('displaytoff);for m=1:length(th2)th34(m,:)=fsolve('fourbarposition,1 1,.options,th2(m),l2,l3 ,l4,l1 );endfigure(2)plot(th2*180/pi,th34(:,1 ),th2*180/pi,th34(:,2) %绘制连杆 3 的角位移关于曲柄 2 的角位移 图plot(th2*180/pi,th34(:,1 )*180/pi,.th2*180/pi,th34(:,2)*180/pi) %绘制摇杆4的角位移关于曲柄2的角位

5、移图axis(o 360 0 170) %确定 xy 边界值grid %图形加网格xlabel('主动件转角 theta_2(度)')ylabelc从动件角位移(度)')title。角位移线图)text(120,120/§杆 4 角位移?text(150,40,连杆 3 角位移')w2=250; %设定曲柄角速度for i=1:length(th2)a=-l3*sin(th34(i,1) l4*sin(th34(i,2);.l3*cos(th34(i,1) -l4*cos(th34(i,2);b=w2*l2*sin(th2(i); -w2*l2*cos

6、(th2(i);w=inv(a)*b;w3(i)=w(1);w4(i)=w(2);endfigure(3)plot(th2*180/pi,w3,th2*180/pi,w4); %绘制角速度线图axis(0 360-175 200)text(50,160;摇杆 4 角速度(omega_4)1)text(220,130;连杆 3 角速度(omega_3)1)gridxlabef主动件转角theta_2(度)')ylabef 从动件角速度(radcdot sa-1)*)title。角速度线图jfor i=1:length(th2)c=-l3*sin(th34(i,1) l4*sin(th34

7、(i,2);.l3*cos(th34(i,1) -l4*cos(th34(i,2);d=w2a2*l2*cos(th2(i)+w3(i)a2*l3*cos(th34(i,1)-w4(i)a2*l4*cos(th34(i,2);.w2a2*l2*sin(th2(i)+w3(i)a2*l3*sin(th34(i,1)-w4(i)a2*l4*sin(th34(i,2);a=inv(c)*d;a3(i)=a(1);a4(i)=a(2);endfigure (4)plot(th2*180/pi,a3,th2*180/pi,a4);% 绘制角加速度线图axis(0 360 -70000 65000)tex

8、t(50,50000,'摇杆 4 角加速度(alpha_4)f)text(220,12000;连杆 3 角加速度(alpha_3)1)gridxlabelc从动件角加速度')ylabef 从动件角加速度(radcdot sa-2)')title。角加速度线图jdisp,曲柄转角连杆转角摇杆转角连杆角速度摇杆角速度连杆加速度摇杆加速度,ydcs=th2,*180/pi,th34(:,1)*180/pi,th34(:,2)*180/pi,w3,w4',a3,a4,;disp(ydcs)» *平面四杆机构的运动分析*曲柄转角连杆转角摇杆转角连杆角速度摇杆角速

9、度连杆加速度摇杆加速度1.0e+004* 0 0.0044 0.0097 -0.0125 -0.0125 -0.5478 4.84580.0005 0.0042 0.0094 -0.0126 -0.0107 0.2300 5.56300.00100.00390.0092-0.0124-0.00860.89466.05200.00150.00370.0091-0.0119-0.00651.41436.29820.00200.00340.0090-0.0114-0.00431.78016.31740.00250.00320.0089-0.0107-0.00212.00276.14670.00300

10、.00300.0089-0.01000.00002.10465.83390.00350.00280.0089-0.00930.00202.11345.42720.00400.00260.0090-0.00850.00382.05664.96870.00450.00250.0091-0.00780.00541.95784.49180.00500.00230.0092-0.00720.00691.83564.01980.00550.00220.0093-0.00650.00821.70403.56800.00600.00210.0095-0.00600.00941.57253.14500.0065

11、0.00190.0097-0.00550.01041.44742.75450.00700.00180.0099-0.00500.01131.33282.39680.00750.00170.0102-0.00450.01211.23072.07020.00800.00170.0104-0.00410.01281.14251.77160.00850.00160.0107-0.00370.01341.06871.49710.00900.00150.0110-0.00340.01381.00951.24260.00950.00140.0112-0.00300.01420.96531.00350.010

12、00.00140.0115-0.00270.01450.93640.77520.01050.00130.0118-0.00240.01480.92320.55300.01100.00130.0121-0.00200.01490.92690.33190.01150.00130.0124-0.00170.01500.94850.10690.01200.00120.0127-0.00140.01500.9899-0.12760.01250.00120.0130-0.00100.01491.0530-0.37730.01300.00120.0133-0.00060.01471.1404-0.64810

13、.01350.00120.0136-0.00020.01451.2544-0.94550.01400.00120.01390.00020.01411.3967-1.27430.0145 0.0012 0.0142 0.0008 0.0136 1.5677 -1.63680.0150 0.0012 0.0144 0.0013 0.0129 1.7648 2.03140.01550.00120.01470.00200.01211.9807 -2.44950.01600.00130.01490.00270.01122.2018 -2.87350.01650.00130.01510.00350.010

14、12.4071 -3.27540.01700.00140.01530.00440.00892.5697 -3.61860.01750.00150.01550.00530.00762.6616 -3.86500.01800.00160.01560.00630.00632.6609 -3.98490.01850.00180.01570.00720.00492.5591 -3.96740.01900.00190.01580.00800.00352.3638 -3.82440.01950.00210.01590.00880.00222.0959 -3.58660.02000.00230.01590.0

15、0950.00101.7823 -3.29310.02050.00250.01590.0100-0.00011.4487 -2.98150.02100.00270.01590.0105-0.00111.1152 -2.68090.02150.00290.01590.0108-0.00200.7942 -2.41030.02200.00310.01580.0111-0.00280.4916 -2.17940.02250.00330.01580.0112-0.00350.2086 -1.99130.02300.00360.01570.0112-0.0042-0.0565 -1.84500.0235

16、0.00380.01560.0111-0.0048-0.3071 -1.73750.02400.00400.01550.0110-0.0054-0.5475 -1.66500.02450.00420.01540.0108-0.0060-0.7817 -1.62330.02500.00440.01530.0104-0.0065-1.0139 -1.60890.02550.00460.01510.0100-0.0071-1.2479 1.61810.02600.00480.01500.0096-0.0077-1.4868 -1.64800.02650.00500.01480.0090-0.0082

17、-1.7336 -1.69550.02700.00520.01460.0084-0.0088-1.9905 -1.75740.02750.00540.01450.0076-0.0095-2.2588 -1.83040.02800.00550.01430.0068-0.0101-2.5391 1.91000.02850.00560.01410.0058-0.0108-2.8305 -1.99100.0290 0.0057 0.0138 0.0048 -0.0115 -3.1300 -2.06600.02950.00580.01360.0037-0.0122-3.4326-2.12550.0300

18、0.00590.01330.0024-0.0130-3.7297-2.15720.03050.00590.01310.0011-0.0137-4.0091-2.14510.03100.00590.0128-0.0004 0.0145-4.2538-2.06960.03150.00590.0125-0.0019-0.0152-4.4419-1.90790.03200.00580.0122-0.0035-0.0158-4.5473-1.63520.03250.00580.0119-0.0051 0.0163-4.5411-1.22730.03300.00560.0115-0.0066-0.0166-4.3954-0.66610.03350.00550.0112-0.0081 0.0167-4.08890.05510.03400.00530.0109-0.0095-0.0166-3.61290.92430.03450.00510.0105-0.0106-0.0161-2.97811.90580.03500.00490.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论