用matlab分析四杆机构.doc_第1页
用matlab分析四杆机构.doc_第2页
用matlab分析四杆机构.doc_第3页
用matlab分析四杆机构.doc_第4页
用matlab分析四杆机构.doc_第5页
免费预览已结束,剩余3页可下载查看

下载本文档

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

文档简介

首先创建函数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,L2,L3,L4th2=0:1/6:2*pi; %曲柄输入角度从0至360度,步长为pi/6th34=zeros(length(th2),2); %建立一个N行2列的零矩阵,第一列存放options=optimset(display,off); %_3,第二列存放_3for m=1:length(th2) %建立for循环,求解_3,_4th34(m,:)=fsolve(fourbarposition,1 1, %调用fsove函数求解关于_3,_4options,th2(m),L2,L3,L4,L1); %的非线性超越方程,结果保存在th34中endy=L2*sin(th2)+L3*sin(th34(:,1); %连杆3的D端点Y坐标值x=L2*cos(th2)+L3*cos(th34(:,1); %连杆3的D端点X坐标值xx=L2*cos(th2); %连杆3的C端点X坐标值yy=L2*sin(th2); %连杆3的C端点Y坐标值figure(1)plot(x;xx,y;yy,k,0 L1,0 0, %绘制连杆3的几个位置点k-,x,y,ko,xx,yy,ks)title(连杆3的几个位置点)xlabel(水平方向)ylabel(垂直方向)axis equal%XY坐标均衡th2=0:2/72:2*pi; %重新细分曲柄输入角度_2,步长为5度th34=zeros(length(th2),2);options=optimset(display,off);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的角位移图axis(0 360 0 170)%确定XY边界值grid%图形加网格xlabel(主动件转角theta_2(度)ylabel(从动件角位移(度)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(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)text(220,130,连杆3角速度(omega_3)gridxlabel(主动件转角theta_2(度)ylabel(从动件角速度(radcdot s-1)title(角速度线图)for i=1:length(th2)C=-L3*sin(th34(i,1) L4*sin(th34(i,2);L3*cos(th34(i,1) -L4*cos(th34(i,2);D=w22*L2*cos(th2(i)+w3(i)2*L3*cos(th34(i,1)-w4(i)2*L4*cos(th34(i,2);.w22*L2*sin(th2(i)+w3(i)2*L3*sin(th34(i,1)-w4(i)2*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)text(50,50000,摇杆4角加速度(alpha_4)text(220,12000,连杆3角加速度(alpha_3)gridxlabel(从动件角加速度)ylabel(从动件角加速度(radcdot s-2)title(角加速度线图)disp 曲柄转角连杆转角-摇杆转角-连杆角速度-摇杆角速度-连杆加速度-摇杆加速度ydcs=th2*180/pi,th34(:,1)*180/pi,th34(:,2)*180/pi,w3,w4,a3,a4;disp(ydcs) * * * * * * 平面四杆机构的运动分析 * * * * * *曲柄转角 连杆转角-摇杆转角-连杆角速度-摇杆角速度-连杆加速度-摇杆加速度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.0010 0.0039 0.0092 -0.0124 -0.0086 0.8946 6.05200.0015 0.0037 0.0091 -0.0119 -0.0065 1.4143 6.29820.0020 0.0034 0.0090 -0.0114 -0.0043 1.7801 6.31740.0025 0.0032 0.0089 -0.0107 -0.0021 2.0027 6.14670.0030 0.0030 0.0089 -0.0100 0.0000 2.1046 5.83390.0035 0.0028 0.0089 -0.0093 0.0020 2.1134 5.42720.0040 0.0026 0.0090 -0.0085 0.0038 2.0566 4.96870.0045 0.0025 0.0091 -0.0078 0.0054 1.9578 4.49180.0050 0.0023 0.0092 -0.0072 0.0069 1.8356 4.01980.0055 0.0022 0.0093 -0.0065 0.0082 1.7040 3.56800.0060 0.0021 0.0095 -0.0060 0.0094 1.5725 3.14500.0065 0.0019 0.0097 -0.0055 0.0104 1.4474 2.75450.0070 0.0018 0.0099 -0.0050 0.0113 1.3328 2.39680.0075 0.0017 0.0102 -0.0045 0.0121 1.2307 2.07020.0080 0.0017 0.0104 -0.0041 0.0128 1.1425 1.77160.0085 0.0016 0.0107 -0.0037 0.0134 1.0687 1.49710.0090 0.0015 0.0110 -0.0034 0.0138 1.0095 1.24260.0095 0.0014 0.0112 -0.0030 0.0142 0.9653 1.00350.0100 0.0014 0.0115 -0.0027 0.0145 0.9364 0.77520.0105 0.0013 0.0118 -0.0024 0.0148 0.9232 0.55300.0110 0.0013 0.0121 -0.0020 0.0149 0.9269 0.33190.0115 0.0013 0.0124 -0.0017 0.0150 0.9485 0.10690.0120 0.0012 0.0127 -0.0014 0.0150 0.9899 -0.12760.0125 0.0012 0.0130 -0.0010 0.0149 1.0530 -0.37730.0130 0.0012 0.0133 -0.0006 0.0147 1.1404 -0.64810.0135 0.0012 0.0136 -0.0002 0.0145 1.2544 -0.94550.0140 0.0012 0.0139 0.0002 0.0141 1.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.0155 0.0012 0.0147 0.0020 0.0121 1.9807 -2.44950.0160 0.0013 0.0149 0.0027 0.0112 2.2018 -2.87350.0165 0.0013 0.0151 0.0035 0.0101 2.4071 -3.27540.0170 0.0014 0.0153 0.0044 0.0089 2.5697 -3.61860.0175 0.0015 0.0155 0.0053 0.0076 2.6616 -3.86500.0180 0.0016 0.0156 0.0063 0.0063 2.6609 -3.98490.0185 0.0018 0.0157 0.0072 0.0049 2.5591 -3.96740.0190 0.0019 0.0158 0.0080 0.0035 2.3638 -3.82440.0195 0.0021 0.0159 0.0088 0.0022 2.0959 -3.58660.0200 0.0023 0.0159 0.0095 0.0010 1.7823 -3.29310.0205 0.0025 0.0159 0.0100 -0.0001 1.4487 -2.98150.0210 0.0027 0.0159 0.0105 -0.0011 1.1152 -2.68090.0215 0.0029 0.0159 0.0108 -0.0020 0.7942 -2.41030.0220 0.0031 0.0158 0.0111 -0.0028 0.4916 -2.17940.0225 0.0033 0.0158 0.0112 -0.0035 0.2086 -1.99130.0230 0.0036 0.0157 0.0112 -0.0042 -0.0565 -1.84500.0235 0.0038 0.0156 0.0111 -0.0048 -0.3071 -1.73750.0240 0.0040 0.0155 0.0110 -0.0054 -0.5475 -1.66500.0245 0.0042 0.0154 0.0108 -0.0060 -0.7817 -1.62330.0250 0.0044 0.0153 0.0104 -0.0065 -1.0139 -1.60890.0255 0.0046 0.0151 0.0100 -0.0071 -1.2479 -1.61810.0260 0.0048 0.0150 0.0096 -0.0077 -1.4868 -1.64800.0265 0.0050 0.0148 0.0090 -0.0082 -1.7336 -1.69550.0270 0.0052 0.0146 0.0084 -0.0088 -1.9905 -1.75740.0275 0.0054 0.0145 0.0076 -0.0095 -2.2588 -1.83040.0280 0.0055 0.0143 0.0068 -0.0101 -2.5391 -1.91000.0285 0.0056 0.0141 0.0058 -0.0108 -2.8305 -1.99100.0290 0.0057 0.0138 0.0048 -0.0115 -3.1300 -2.06600.0295 0.0058 0.0136 0.0037 -0.0122 -3.4326 -2.12550.0300 0.0059 0.0133 0.0024 -0.0130 -3.7297 -2.15720.0305 0.0059 0.0131 0.0011 -0.0137 -4.0091 -2.14510.0310 0.0059 0.0128 -0.0004 -0.0145 -4.2538 -2.06960.0315 0.0059 0.0125 -0.0019 -0.0152 -4.4419 -1.90790.0320 0.0058 0.0122 -0.0035 -0.0158 -4.5473 -1.63520.0325 0.0058 0.0119 -0.0051 -0.0163 -4.5411 -1.22730.0330 0.0056 0.0115 -0.0066 -0.0166 -4.3954 -0.66610.0335 0.0055 0.0112 -0.0081 -0.0167 -4.08

温馨提示

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

评论

0/150

提交评论