資源描述:
《機(jī)械原理設(shè)計(jì)六桿機(jī)構(gòu)c源程序》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、#include#include#definePI3.1415926doublen1=420,a=0.18,b二0.09,LI=0.1,L2=0.38,L3=0.42,L4=0.38,Lce=0.21,Lde=L3-Lce,m3=11,m4=10,m5=11,Lds3=0.07,Les4=0.19,Js3=0.02,Js4=2.&doublea1,a2,a3,a4;〃各桿的位置角度doubletl,t2,t3,t4;〃各桿的角速度doublesl,s2,s3,s4;〃各桿的角加速度doublexf,vf,af;〃滑塊的位
2、移,速度,加速度doubleA,B,C,D,E;doubleg=9.81;doublePr;doubleFunc_360(doublez){if(z<0)returnz=z+360;elsereturnz;}doubleFunc_2PI(doublez){if(z<0)returnz=z+2*PI;elsereturnz;}doubleAngle_To_Radian(doublez)〃角度轉(zhuǎn)弧度{z=PI*z/18();rctumz;}doubleRadian_To_Angle(doublez)〃弧度轉(zhuǎn)角度{z=180*z/PI;returnz;voidYun
3、DongFenXi()〃運(yùn)動(dòng)分析{B=2*L1*L3*sin(a1)-2*L3*b;A=2*L1*L3*cos(al)-2*a*L3;C=a*a+b*b+L1*L1+L3*L3?L2*L2?2*a*L1*cos(al)-2*b*Ll*sin(a1);a3=2*atan((B-sqrt(A*A+B*B-C*C))/(A-C));a2=atan((b-L3*sin(a3)-Ll*sin(al))/(a-L3*cos(a3)-Ll*cos(al)));a4=asin((Ll*sin(a1)+L2*sin(a2)+Lce*sin(a3))/(-L4));xf=a-Ld
4、e*cos(a3)+L4*cos(a4);doublea22=Func_360(Radian_To_Angle(a2));doublea33=Func_360(Radian_To_Angle(a3));doublea44=Func_360(Radian_To_Angle(a4));tl=-2*PI*nl/60;//原動(dòng)件的角速度t3=(t1*L1*sin(a1-a2))/(L3*sin(a2-a3));//3桿的角速度t2=(-tl*Ll*sin(al+a3))/(L2*sin(a3+a2));//3ff的角速度t4=(L2*t2*cos(a2)+Lce*t3
5、*cos(a3)+L1*tl*cos(a1))/(-L4*cos(a4));//4桿的角速度vf=t3*Ldc*sin(a3)-t4*L4*sin(a4);W塊的速度sl=0;//原動(dòng)件的角加速度s3=(t1*t1*L1*cos(a1-a2)+t3*t3*cos(a2-a3)+t2*t2*L2)/(L3*sin(a2-a3));//3桿的角加速度s2=(-tl*tl*Ll*cos(al-a3)-t2*t2*L2*cos(a2-a3)-t3*t3*L3)/(L2*sin(a2-a3));//2桿的角加速度s4=(t2*t2*L2*sin(a2)-s2*L2*co
6、s(a2)+Lcc*t3*t3*sin(a3)-Lcc*s3*cos(a3)+L4*t4*t4*sin(a4)+Ll*tl*tl*sin(a1))/(L4*cos(a4));//4桿的角加速度af=Lde*s3*sin(a3)+Lde*t3*t3*cos(a3)-L4*s4*sin(a4)-L4*t4*t4*cos(a4);〃滑塊加速度cout?H原動(dòng)件位置角度:,'?Radian_To_Angle(al)?n角速度:”vvtlvv“角加速度:"?sl?endl;cout?n2的位置角度:”vva22vv”角速度:“vv2vv”角加速度:,,?s2?endl;
7、cout?n3桿的位置角度:”vva33vv”角速度:“vvt3vv”角加速度:M?s3?endl;cout?H4桿的位置角度:”vva44vv”角速度:"vvi4vv"角加速度:"?s4?endl;coutvv”滑塊的位移:”vvxfvv“滑塊的速度:”vvvfvv"加速度:H?af?cndl;voidJingLiFenXil()〃動(dòng)態(tài)靜力分析{if(a1>=1.146681319&&al<=5.340707511)Pr=2100;elsePr=0;doubleas3x=t3*t3*Lds3*cos(a3)+s3*Lds3*sin(a3);doubleas3
8、y=t3*t3*Lds3*sin(a3