《平面六杆机构的运动分析(共24页).doc》由会员分享,可在线阅读,更多相关《平面六杆机构的运动分析(共24页).doc(23页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上机械原理大作业(一)平面六杆机构的运动分析 班 级:学 号:姓 名:同 组 者: 完成时间:一题目11 说明如图所示为一片面六杆机构各构件尺寸如表格1所示,又知原动件1以等角速度=1rad/s沿逆时针方向回转,试求各从动件的角位移、角加速度以及E点的位移、速度及加速度的变化情况。12 数据组号L1L2L2L3L4L5L6axGyG1-A26.5105.665.067.587.534.425.0600153.541.7表格1 条件数据13 要求三人一组,编程计算出原动件从0360时(计算点数N=36)所要求各运动变量的大小,并绘制运动线图及点的轨迹曲线。二解题步骤由封闭
2、图形ABCD可得:由封闭图形AGFECD可得于是有:对以上1到4导可得- 写做矩阵形式: 对上述矩阵求导可得:E点横坐标及对应的速度和加速度: E点纵坐标及对应的速度和加速度: 三计算程序框图输入:l1、l2、l2、l3、l4、l5、l6、xG及yG和a2,a3,a5,a6, a1= (I-1)*100调用牛顿迭代法子程序求解位置(1)求得a2,a3,a4,a5及a6,并计算xE,yE调用系数矩阵A子程序,并计算A调用原动件位置参数列阵B子程序,并计算BB(J)=B(J)w1J=1,N 调用高斯消去法子程序求解速度方程(2),求出w2,w3,w4,w5及w6,再求出vEx及vEy调用计算A子程
3、序,并计算其矩阵DA调用计算B子程序,并计算列阵DBw(1)=w2,w(2)=w3w(3)=w4,w(4)=w5DB(K)=DB(K)w1K=1,NI=l,37II=1,NB(K)= -DA(K,II).w1(II)+DB(K)调用高斯消去法子程序求解加速度方程(3),求出a2,a3,a4,a5及a6,并求出aEx及aEy打印结果结 束四源程序1#include stdlib.h #include math.h #include stdio.h int agaus(a,b,n) int n; double a,b; int *js,l,k,i,j,is,p,q; double d,t; js=
4、malloc(n*sizeof(int); l=1; for (k=0;k=n-2;k+) d=0.0; for (i=k;i=n-1;i+) for (j=k;jd) d=t; jsk=j; is=i; if (d+1.0=1.0) l=0; else if (jsk!=k) for (i=0;i=n-1;i+) p=i*n+k; q=i*n+jsk; t=ap; ap=aq; aq=t; if (is!=k) for (j=k;j=n-1;j+) p=k*n+j; q=is*n+j; t=ap; ap=aq; aq=t; t=bk; bk=bis; bis=t; if (l=0) free
5、(js); printf(failn); return(0); d=ak*n+k; for (j=k+1;j=n-1;j+) p=k*n+j; ap=ap/d; bk=bk/d; for (i=k+1;i=n-1;i+) for (j=k+1;j=0;i-) t=0.0; for (j=i+1;j=0;k-) if (jsk!=k) t=bk; bk=bjsk; bjsk=t; free(js); return(1); 2.程序二求解各杆的角度和E点坐标(杆四的角度始终为零,程序中不再求解)/*输出文件 Output.txt*/#include stdio.h#include #include
6、 dnetn.c#include agaus.c#include #define PI 3.979#define ANGLE (PI/180)#define ALPHA (PI*60/180)/*初始杆长:*/static double dLen7=65.0, 26.5, 105.6, 67.5, 87.5, 34.4, 25.0;/*G 点的坐标*/static double dGxy2=153.5,41.7;static double x0 = 0 * ANGLE;main()int i,k;double eps,t,h,xe,ye;int nTemp=0;FILE *pf;/* 各角位移
7、的初始估计值 */static doublex4=36.80*ANGLE,69.57*ANGLE,119.00*ANGLE,48.92*ANGLE;pf = fopen(Output.txt,w);t=0.1; h=0.1; eps=0.; k=100;for (nTemp = 0; nTemp = 36; nTemp+)x0 = nTemp * 10 * ANGLE;i=dnetn(4,eps,t,h,x,k);printf(ni=%dn,i);printf(x0=%lfn,x0);fprintf(pf,%dt,10*nTemp);for (i=0; i=3; i+)printf(x(%d)
8、=%13.7lfn,i,xi/ANGLE);fprintf(pf,%lft,xi/ANGLE);xe=dLen1 * cos(x0)+ dLen2 * cos(x0)+dLen0 * cos(ALPHA-(x0);ye=dLen1 * sin(x0)+ dLen2 * sin(x0)-dLen0 * sin(ALPHA-(x0);printf(xe=%13.7lfnye=%13.7lfn,xe,ye);fprintf(pf,n);printf(n);fclose(pf);getch();/*建立牛顿法矩阵*/void dnetnf(x,y,n) int n;double x,y;y0 = dL
9、en1 * cos(x0) + dLen2 * cos(x0) - dLen3 * cos(x1)- dLen4 ;y1 = dLen1 * sin(x0) + dLen2 * sin(x0) - dLen3 * sin(x1);y2 = dLen1 * cos(x0) + dLen2 * cos(x0) + dLen5* cos(x2) - dLen6 * cos(x3) - dGxy0 +dLen0 * cos(ALPHA-(x0);y3 = dLen1 * sin(x0) + dLen2 * sin(x0) + dLen5* sin(x2) - dLen6 * sin(x3) - dGx
10、y1-dLen0 * sin(ALPHA-(x0);n = n;return;3. 程序三求解各杆的角速度和E点速度(杆四的角速度始终为零,程序中不再求解)/*输出文件Output2.txt*/#include stdio.h#include math.h#include agaus.c#include #define PI 3.979#define ANGLE (PI/180)#define ALPHA (PI*35/180)/*初始杆长:依次为*/static double dLen7=65.0, 26.5, 105.6, 67.5, 87.5, 34.4, 25.0;/* G 点的坐标*
11、/static double dGxy2=153.5,41.7;static double x0 = 0 * ANGLE;static double w1 = 1.0;double Vex,Vey;main()int i,j,nTime;FILE *fInput;FILE *fOutput2;int nX0,nCounter;double dTemp4=0;static double a44= 0.;static double b4=0.;/*将agu_01.C 的输出文件output.txt 作为输入文件,继续计算*/fInput = fopen(output.txt,r);fOutput2
12、 = fopen(output2.txt,w);for(nTime=0;nTime=36;nTime+)fscanf(fInput,%d,&nX0);x0=nX0*ANGLE;printf(x0= %lfn,x0);for (nCounter=0;nCounter4;nCounter+)fscanf(fInput,%lf,&dTempnCounter);for (nCounter=0;nCounter4;nCounter+)dTempnCounter = dTempnCounter * ANGLE;/*建立高斯方程组矩阵*/a00 = - dLen2 * sin(dTemp0);a01 = d
13、Len3 * sin(dTemp1);a02 = 0.;a03 = 0.;a10 = dLen2 * cos(dTemp0);a11 = - dLen3 * cos(dTemp1);a12 = 0.;a13 = 0.;a20 = dLen2 * sin(dTemp0)- dLen0 * sin(ALPHA-(dTemp0);a21 =0.;a22 = dLen5 * sin(dTemp2);a23 = -dLen6 * sin(dTemp3);a30 = dLen2 * cos(dTemp0)+dLen0 * cos(ALPHA-(dTemp0);a31 = 0.;a32 = dLen5 *
14、cos(dTemp2);a33 = - dLen6 * cos(dTemp3);b0 = dLen1 * sin(x0) * w1;b1 = - dLen1 * cos(x0) * w1;b2 = -dLen1* sin(dTemp0)* w1 ;b3 =-dLen1* cos(dTemp0)* w1 ;if (agaus(a,b,4)!=0)for (i=0;i=3;i+)printf(w%d=%lfn,i,bi);fprintf(fOutput2,%lf ,bi); Vex=-dLen1 * sin(x0) * w1-dLen2 * sin(dTemp0) * b0+dLen0 * sin
15、(ALPHA-(dTemp0) *b0;Vey=dLen1 * cos(x0) * w1+dLen2 * cos(dTemp0) * b0+dLen0 * cos(ALPHA-(dTemp0) * b0; printf(Vex=%lfnVey=%lfn,Vex,Vey); fprintf(fOutput2,n);printf(n);fclose(fInput);fclose(fOutput2);getch();4. 程序四求解各杆和点E的角加速度(杆四角加速度始终为零,这里不再求解)/*输出文件Output3.txt*/#include stdio.h#include math.h#inclu
16、de agaus.c#include #define PI 3.979#define ANGLE (PI/180)#define ALPHA (PI*35/180)/*初始杆长:依次为*/static double dLen7=65.0, 26.5, 105.6, 67.5, 87.5, 47.2, 37.8;/*G 点的坐标*/static double dGxy2=153.5,41.7;static double x0 = 0 * ANGLE;static double w1 = 1.0;main()int i,nTime;FILE *fInput2;FILE *fOutput3;int
17、nX0,nCounter;double Aex,Aey;double dSeta5=0.;double dOmiga4 = 0.;static double a44= 0.;static double b4=0.;/*将agu_02.C 的输出文件output2.txt 作为输入文件,继续计算*/fInput2 = fopen(output2.txt,r);fOutput3 = fopen(output3.txt,w);for(nTime=0;nTime=36;nTime+)fscanf(fInput2,%d,&nX0);/*读入角度值*/for (nCounter=0;nCounter5;n
18、Counter+)fscanf(fInput2,%lf,&dSetanCounter);/*读入角速度值*/for (nCounter=0;nCounter4;nCounter+)fscanf(fInput2,%lf,&dOmiganCounter);/*建立高斯方程组矩阵,dSeta0=x1(角度我们草稿的),dSeta1=x2,dSeta2=x3,dSeta3=x5,dSeta4=x6 dOmiga0 =w2, dOmiga1=w3, dOmiga2=w5, dOmiga3=w6*/a00 = - dLen2 * sin(dSeta1);a01 = dLen3 * sin(dSeta2);
19、a02 = 0.;a03 = 0.;a10 = dLen2 * cos(dSeta1);a11 = - dLen3 * cos(dSeta2);a12 = 0.;a13 = 0.;a20 = - dLen0 * sin(ALPHA-(dSeta1)+dLen2 * sin(dSeta1);a21 = 0.;a22 = dLen5 * sin(dSeta3);a23 = -dLen6 * sin(dSeta4);a30 = dLen0 * cos(ALPHA-(dSeta1)+dLen2 * cos(dSeta1);a31 = 0.;a32 = dLen5 * cos(dSeta3);a33 =
20、 - dLen6 * cos(dSeta4);b0 = - ( - dLen2 * cos(dSeta1) * dOmiga0 * dOmiga0+ dLen3 * cos(dSeta2) * dOmiga1 * dOmiga1 ) + dLen1 *cos(dSeta0) * w1 * w1;b1 = - ( - dLen2 * sin(dSeta1) * dOmiga0 * dOmiga0+ dLen3 * sin(dSeta2) * dOmiga1 * dOmiga1 ) + dLen1 *sin(dSeta0) * w1 * w1;b2 = -w1 * w1* dLen1*cos(dS
21、eta0)-dOmiga0 *dOmiga0*(dLen2*cos(dSeta1)+dLen0 * cos(ALPHA-(dSeta1)+dOmiga3 * dOmiga3*dLen6 * cos(dSeta4)-dLen5* cos(dSeta3) * dOmiga2 * dOmiga2;b3 = w1 * w1* dLen1*sin(dSeta0)-dOmiga0 *dOmiga0*(dLen2*sin(dSeta1)-dLen0*sin(ALPHA-(dSeta1)-dOmiga3 * dOmiga3*dLen6 * sin(dSeta4)+ dLen5* sin(dSeta3) * d
22、Omiga2 * dOmiga2;if (agaus(a,b,4)!=0)for (i=0;i=eps) dnetnf(x,b,n); am=0.0; for (i=0; iam) am=z; if (am=eps) l=l-1; if (l=0) free(y); free(b); free(a); printf(failn); return(0); for (j=0; j=n-1; j+) z=xj; xj=xj+h; dnetnf(x,y,n); for (i=0; i=n-1; i+) ai*n+j=yi; xj=z; if (agaus(a,b,n)=0) free(y); free
23、(a); free(b); return(-1); beta=1.0; for (i=0; i=n-1; i+) beta=beta-bi; if (fabs(beta)+1.0=1.0) free(y); free(a); free(b); printf(failn); return(-2); d=h/beta; for (i=0; i=n-1; i+) xi=xi-d*bi; h=t*h; free(y); free(a); free(b); return(k-l); 五计算结果1(单位:度 )2(单位:度 )3(单位:度 )5(单位:度 )6(单位:度 )036.7990569.5731
24、3122.4627792.665441032.7094766.00299106.4997167.798572029.2776164.0731797.1754452.862793026.5973763.7310390.3834344.249194024.6359164.7551184.2478239.672665023.3010866.8646877.8411637.316076022.4901269.7900470.4814435.419577022.1129773.3007761.2722731.876318022.0990377.2093648.8508123.825399022.3963
25、781.3648232.264598.5942310022.9684485.6444213.79708-12.3279311023.7903589.9462-1.88955-33.31912024.8456494.18335-12.74873-50.8843913026.1233198.28029-19.47863-64.721114027.61533102.17026-23.43679-75.5877215029.31424105.7939-25.76743-84.2467516031.21099109.09881-27.29596-91.2615217033.29288112.03937-
26、28.59909-97.0319318035.54172114.57678-30.07522-101.8606819037.93229116.67878-31.9902-106.0039620040.43114118.31896-34.50611-109.6995121042.99573119.4754-37.70212-113.1728422045.57385120.12878-41.59328-116.625323048.10309120.26007-46.14952-120.2108524050.51035119.84805-51.3162-124.0104525052.71117118
27、.86702-57.03775-128.0136226054.60905117.28503-63.28435-132.1156127056.09499115.06345-70.07877-136.1348628057.0483112.15863-77.51645-139.8518129057.33997108.52777-85.77334-143.0681630056.84147104.14138-95.10476-145.6934431055.4427999.00639-105.86689-147.8969432053.0835193.20271-118.69237-150.50439330
28、49.7968986.93055-135.48887-156.6045834045.7547380.55028-164.06049-178.7216335041.2812574.57477-207.28198-226.9752736036.7990569.57313-237.53723-267.33456 1(单位:度 )w2(单位:rad/s)w3(单位:rad/s)w5(单位:rad/s)w6(单位:rad/s)0-0.43443-0.43443-2.42454-2.8371910-0.37901-0.27611-1.50231-1.968520-0.30588-0.11091-0.918
29、78-1.2061430-0.230840.0386-0.56502-0.5861540-0.163070.16142-0.32443-0.0690150-0.105640.25595-0.129070.3848760-0.058060.325270.048060.803970-0.018540.373760.17951.16597800.01490.405460.116711.28627900.043970.4236-0.388620.799141000.070030.43063-1.16737-0.170181100.094080.42829-1.6884-0.946671200.1168
30、0.41789-1.86857-1.347151300.138610.40039-1.87297-1.529481400.159680.37661-1.81572-1.626531500.179960.34725-1.74328-1.703731600.199180.31298-1.66885-1.789361700.216890.27449-1.5923-1.894341800.232460.23246-1.50865-2.020151900.24510.18751-1.41155-2.161372000.253960.14017-1.29477-2.306232100.258090.090
31、8-1.15309-2.4372200.256490.03956-0.98329-2.531192300.24814-0.01365-0.78563-2.564012400.23191-0.06918-0.56583-2.512122500.20665-0.12756-0.33625-2.358052600.17111-0.18948-0.11521-2.093782700.12406-0.255570.0769-1.721942800.06444-0.326130.22384-1.25397290-0.00827-0.400580.32055-0.70581300-0.09331-0.476
32、650.37885-0.09149310-0.18751-0.54910.43120.58577320-0.28388-0.608370.527281.338330-0.37062-0.640050.622262.05413340-0.43232-0.62729-0.677430.7279350-0.45511-0.55802-3.06708-2.90494360-0.43443-0.43443-2.42454-2.837191(单位:度 ) a2 a3 a5 a601.87731-1.41416-9.3572522.276910-0.5276-1.3131412.8394314.4391320-10.21122-16.13634-41.38351-111.46712300.322270.3023-2.24307-1.31208400.710490.38945-2.223782.07264502.165745.80322-21.27313-59.0065460-0.144353.8797415.29502-4.92108702.030953.01559-66.66643-92.75689801.34149-0.79682-5.6969317.35997903.873711.20109