資源描述:
《機(jī)械原理牛頭刨床matlab源程序.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、七.Matlab編程及繪圖clearall;clc;%初始條件theta1=linspace(-25.72,334.28,100);%單位度theta1=theta1*pi/180;%轉(zhuǎn)換為弧度制W1=80*pi/30;%角速度單位rad/sH=0.6;%行程單位mL1=0.1605;%O2A的長度單位mL3=0.6914;%O3B的長度單位mL4=0.2074;%BF的長度單位mL6=0.370;%O2O3的長度單位mL6u=0.6572;%O3D的長度單位mZ=pi/180;%角度與弧度之間的轉(zhuǎn)換dT=(thet
2、a1(3)-theta1(2))/W1;%時(shí)間間隔forj=1:100t(j)=dT*(j-1);%時(shí)間因素end%求解S3、Theta3、Theta4和SE四個(gè)變量S3=((L6)^2+(L1)^2-2*L6*L1*cos(theta1+pi/2)).^0.5;%求出O3A的值fori=1:100%求解角度theta3、Theta4和SE的長度theta3(i)=acos(L1*cos(theta1(i))/S3(i));theta4(i)=asin((L6u-L3*sin(theta3(i)))/L4);SE(i
3、)=L3*cos(theta3(i))+L4*cos(theta4(i));end%求解完成%求解完成%求解VS3、W3、W4和VE四個(gè)變量fori=1:100J=inv([cos(theta3(i)),-S3(i)*sin(theta3(i)),0,0;sin(theta3(i)),S3(i)*cos(theta3(i)),0,0;0,-L3*sin(theta3(i)),-L4*sin(theta4(i)),-1;0,L3*cos(theta3(i)),L4*cos(theta4(i)),0]);K=J*W1*[
4、-L1*sin(theta1(i));L1*cos(theta1(i));0;0];VS3(i)=K(1);W3(i)=K(2);W4(i)=K(3);VE(i)=K(4);end%求解完成%求解aS3、a3、a4、aE四個(gè)變量fori=1:100J=inv([cos(theta3(i)),-S3(i)*sin(theta3(i)),0,0;sin(theta3(i)),S3(i)*cos(theta3(i)),0,0;0,-L3*sin(theta3(i)),-L4*sin(theta4(i)),-1;0,L3*c
5、os(theta3(i)),L4*cos(theta4(i)),0]);P=W1*W1*[-L1*cos(theta1(i));-L1*sin(theta1(i));0;0];M=[-W3(i)*sin(theta3(i)),-VS3(i)*sin(theta3(i))-S3(i)*W3(i)*cos(theta3(i)),0,0;W3(i)*cos(theta3(i)),VS3(i)*cos(theta3(i))-S3(i)*W3(i)*sin(theta3(i)),0,0;0,-L3*W3(i)*cos(thet
6、a3(i)),-L4*W4(i)*cos(theta4(i)),0;0,-L3*W3(i)*sin(theta3(i)),-L4*W4(i)*sin(theta4(i)),0];N=[VS3(i);W3(i);W4(i);VE(i)];K=J*(-M*N+P);aS3(i)=K(1);a3(i)=K(2);a4(i)=K(3);aE(i)=K(4);end%求解完成%動(dòng)態(tài)靜力分析%初始條件M4=22;M5=3;M6=52;Js4=0.9;Js5=0.015;Fc=1400;Ls4=0.5*L3;Ls5=0.5*L4;
7、%給切削阻力賦值fori=1:100if((abs(SE(1)-SE(i))>0.05*H&&abs(SE(1)-SE(i))<0.95*H)&&(theta1(i)8、Ekk(1)=Ekk(1)-Ekk(100);%動(dòng)能的改變量fori=2:100dEkk(i)=Ekk(i)-Ekk(i-1);%動(dòng)能的改變量endfori=1:100MM(i)=(dEkk(i)+Fc(i)*abs(VE(i)))/W1;%求平衡力矩end%畫圖%畫運(yùn)動(dòng)圖figure(1);plot(t,theta3,'r');holdon;