资源描述:
《锁梁扳弯机构 程序.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、PrivateSubCommand1Click()Dimb(6),c(6),d(3),tAsStringpai=Atn(l#)*4/180fi二0To360Step10fi1二fi*paiCall单杆运动分析子程序(0,0,yB,vBx,vBy,aBx,aBy)CallRRP运动分析子程序(1,xB,0,0,0.14273,sr,vsr,asr)t二t+t=tt二tt二tt=tt二tt=tFor0,0,0,xC,yC,++++++0,0,0,0,0.04,0,fil,2.6166667,0,xB,yB,vCx,vBx,vBy,v
2、Cy,aCx,aBx,aBy,0,0.06962,0,0,aCy,fi2,omega2,epsilon2,Fil="xC(m)="vC(m/S)二〃dC(m/S2)二/zomega2(rad/S)=z/epsilon2(rad/S)=vbCrLfStr(fi)+++++NextfiTextl.Text二tEndSubSub单杆运动分析子程序(xA,yA,omega,epsilon,_xm二xA+二yA+vAxvAyymvmx+aAx一**sssxm,ym,Cos(fi+theta)Sin(fi+theta)omega*omega
3、*epsilonvmy=amx=+theta)amy二+theta)EndSubSubRRP运动分析子程序(m,vPy,aPx,aPy,aAy+epsiIon+vbCrLfStr(xC)+vbCrLfStr(vCx)+vbCrLfStr(aCx)+vbCrLfStr(omega2)+vbCrLfStr(epsilon2)+vbCrLfvAx,vAy,vmx,vmy,Sin(fiCos(fiSin(fiaAx,aAy,S,theta,fi,amx,amy)Cos(fitheta)theta)+theta)+theta)*omega
4、*omegaxB,yB,vBx,vBy,aBx,aBy,xP,*Cos(fi*Sin(fiyP,vPx,【2f13,omega3,epsilon3,xC,yC,vCx,vCy,E2=aPx-aBx+-epsilon3京F2=aPy一aBy++epsilon3*omega22*xCB-2(yC-yP)-omegaB八omega22yCB+2(xC-xP)-omegaBepsilon2=(F2*Cos(fi3)-E2*Sin(fi3))aCx,aCy,fi2,omega2,epsilon2,sr,vsr,asr)Dimpi,d2,e
5、,F,yCB,xCB,El,Fl,Q,E2,F2pi二Atn(l#)京4d2二((xB—xP)八2+(yB—yP)八2)e二2*(xP-xB)*Cos(fi3)+2*(yP-yB)*Sin(fi3)F=d2-L22Ife八2〈4*FThenMsgBox〃此位置不能装配〃GoTonlElseEndIfIfm=1Thensr二Abs((-e+(e八2—4京F)八0.5)/2)Else:sr二Abs((~e—(e八2—4*F)八0.5)/2)EndTfxC二xP+sr*Cos(fi3)yC=yP+sr*Sin(fi3)yCB=yC-y
6、BxCB二xC一xBCal1atnl(xB,yB,xC,yC,fi2)El=(vPx-vBx)-sromega3*Sin(fi3)Fl=(vPy-vBy)+sr*omegaB*Cos(fi3)Q二yCB*Sin(fi3)+xCB京Cos(fi3)omega2二(Fl京Cos(fi3)-El京Sin(fi3))/Qvsr=-(Fl*yCB+El*xCB)/QvCx=vBx一omega2*yCBvCy=vBy+omega2*xCB*omegaB京vsr京Sin(fi3)2*(xC-xP)*omegaB*vsr*Cos(fi3)2*(
7、yC—yP)asr二~(F2京yCB+E2京xCB)/QaCx二aBx一omega2aCy二aBy-omega22京xCB一eps订on2*yCB2*yCB+epsilon2*xCBnl:EndSubSubatnl(xl,yl,x2,y2,fi)Dimpi,y21,x21pi=Atn(l#)*4y21二y2-ylx21二x2-xlTfx21=0Then'判断BD线段与x轴的夹角Ify21>0Thenfi=pi/2Elselfy21二0ThenMsgBox〃B、D两点重合,不能确定〃Else:fi二3*pi/2EndIfElseI
8、fx21<0Thenfi二Atn(y21/x21)+piElseTfy21>=0Thenfi=Atn(y21/x21)Else:fi=Atn(y21/x21)+2*piEndIfEndIfEndSubPrivateSubCommand2Click()Dimb(6