汽车功率平衡(驱动力,等速百公里油耗,动力特性,爬坡度)图的Matlab程序
汽车动力性matlab仿真源程序
汽车动力性matlab仿真源程序clcn=[1500:500:5500];%转速范围T=[78.59 83.04 85.01 86.63 87.09 85.87 84.67 82.50 80.54];%对应各转矩dt=polyfit(n,T,3);%对发动机输出转矩特性进行多项式拟合,阶数取4n1=1000:100:5500;%t=polyval(dt,n1);figure(1)title('发动机外特性')plot(n1,t,n,T,'o'),grid on%图示发动机输出转矩特性%汽车驱动力计算G=input('整车重力/N,G=');%输入970*9.8ig=[3.416 1.894 1.28 0.914 0.757];%变速器速比k=1:5;%5个前进档r=0.272;i0=4.388;eta=0.9;ngk=[800 800 800 800 800];ngm=[5500 5500 5500 5500 5500];ugk=0.377.*r.*ngk(k)./(ig(k).*i0);%计算每一档发动机800rpm 时的最低行驶速度ugm=0.377.*r.*ngm(k)./(ig(k).*i0);%计算每一档发动机5400rpm最高行驶速度for k=1:5%依次计算5个档的驱动力u=ugk(k):ugm(k);n=ig(k)*i0.*u./r/0.377;t=54.8179+2.2441.*(n./100)-4.8003.*(n./1000).^2+2.815e-10.*n.^3Ft=t.*ig(k).*i0*eta/r;figure(2)plot(u,Ft)hold on,grid on %保证K的每次循环的图形都保留显示end%行驶阻力计算f0=0.009;f1=0.002;f4=0.0003;%三者都是轿车滚动阻力系数% disp'空气阻力系数Cd=0.3--0.41,迎风面积A=1.7--2.1'Cd=input('空气阻力系数Cd=');%输入0.3A=input('迎风面积/m2,A=');%输入2.3u=0:10:180;f=f0+f1.*(u./100)+f4.*(u./100).^4;Ff=G*f;%计算滚动阻力Fw=Cd*A.*u.^2./21.15;%计算空气阻力F=Ff+Fw;%滚动阻力、空气阻力之和title('驱动力-阻力图(五档速比为3.416 1.894 1.28 0.914 0.757)')plot(u,F,'mo-');grid on%图解法求最高车速for u=50:180;k=5;n=ig(k)*i0.*u./r/0.377;t=54.8179+2.2441.*(n./100)-4.8003.*(n./1000).^2+2.815e-10.*n.^3;Ft=t.*ig(k).*i0*eta/r;f=f0+f1.*(u./100)+f4.*(u./100).^4;Ff=G*f;Fw=Cd*A.*u.^2./21.15;F=Ff+Fw;if abs(Ft-F)<1;umax=u;breakendenddisp('== == =汽车动力性能仿真计算结果== == =')disp('驱动力-行驶阻力平衡图及最高车速')fprintf('汽车理论最高车速(驱动力与行驶阻力曲线交点)Vmax=%3.3f km/h\n',umax)(注:文档可能无法思考全面,请浏览后下载,供参考。
Matlab程序模拟汽车理论中的数据特性图1
车辆理论作业第三组第一大题确定一辆轻型货车的动力性能 1、绘制发动机的使用外特性曲线 n=600:1:4000 N=n/1000T=-19.313+295.27*n/1000-165.44*N.*N+40.874*N.*N.*N-3.8445*N.*N.*N .*NPe=T.*n/9550 %发动机的净功率 figure(1) plot(n,T) xlabel('转速n') ylabel('转矩T') figure(2) plot(n,Pe) xlabel('转速n') ylabel('功率Pe')5001000150020002500300035004000100110120130140150160170180转速n转矩T5001000150020002500300035004000010203040506070转速n功率P e2、绘制驱动力---行驶阻力平衡图 i0=6.17; %减速器的传动比 ig(1)=6.09 % 一档的传动比 ig(2)=3.09 ig(3)=1.71 ig(4)=1.00 nT=0.85 r=0.367 f=0.013 m1=3880 m2=9590 CdA=2.77 Ff1=m1*9.8*f Ff2=m2*9.8*fft1=T*ig(1)*i0*nT/r %一档所产生的驱动力 ft2=T*ig(2)*i0*nT/r ft3=T*ig(3)*i0*nT/r ft4=T*ig(4)*i0*nT/r Ft=[ft1;ft2;ft3;ft4]';ua1=0.377*r*n/(ig(1)*i0) %一档的速度 ua2=0.377*r*n/(ig(2)*i0) ua3=0.377*r*n/(ig(3)*i0) ua4=0.377*r*n/(ig(4)*i0) ua=[ua1;ua2;ua3;ua4]';fw1=CdA*ua1.^2/21.15+Ff1 %一档的行驶阻力 fw2=CdA*ua2.^2/21.15+Ff1 fw3=CdA*ua3.^2/21.15+Ff1 fw4=CdA*ua4.^2/21.15+Ff1Fz1=[fw1;fw2;fw3;fw4]'; figure(3)plot(ua,Ft) %绘制各档的驱动力曲线hold onplot(ua,Fz1) %绘制行驶阻力曲线 hold onplot(ua4,Ff2) %绘制滚动阻力曲线 xlabel('ua/(km.h)')ylabel('F/N')title('汽车驱动力-行驶阻力平衡图')text(20,12000,'Ft1'); text(30,6000,'Ft2'); text(40,4000,'Ft3'); text(80,3000,'Ft4');text(90,2200,'(空载)Ff+fw'); text(105,1450,'满载Ff')102030405060708090200040006000800010000120001400016000ua/(km.h)F /N汽车驱动力-行驶阻力平衡图Ft1Ft2Ft3Ft4(空载)Ff+Fw满载Ff一档的驱动力很大,可用于爬坡且坡度较大;二档用于直接原地起步加速 3、绘制动力特性图D=(Ft-Fw)/(m1*9.8) %求动力因数f1=0.0076+0.000056*ua %一定车速条件下的滚动阻力 figure(4) plot(ua,D) hold onplot(ua,f1) text(20,0.3,'I') text(20,0.154,'II') text(40,0.1,'III') text(80,0.05,'IV') text(110,0.025,'f') title('汽车动力特性图') xlabel('ua/(km.h)') ylabel('D')1020304050607080900.050.10.150.20.250.30.350.40.45IIIIIIIVf汽车动力特性图ua/(km.h)DIf=0.218Iw1=1.798 Iw2=3.598die1=1+(Iw1+Iw2)/(m1*r^2)+(If*i0^2*nT*ig(1).^2)/(m1*r^2);%一档的旋转质量换算系数die2=1+(Iw1+Iw2)/(m1*r^2)+(If*i0^2*nT*ig(2).^2)/(m1*r^2); die3=1+(Iw1+Iw2)/(m1*r^2)+(If*i0^2*nT*ig(3).^2)/(m1*r^2); die4=1+(Iw1+Iw2)/(m1*r^2)+(If*i0^2*nT*ig(4).^2)/(m1*r^2); die=[die1;die2;die3;die4]';a1=9.8*D(:,1)/die1-9.8*f/die1; %求一档的加速度 a2=9.8*D(:,2)/die2-9.8*f/die2; a3=9.8*D(:,3)/die3-9.8*f/die3; a4=9.8*D(:,4)/die4-9.8*f/die4; aI=1./a1 %求一档的加速度倒数 aII=1./a2 aIII=1./a3 aIV=1./a4aa=[aI,aII,aIII,aIV]';figure(5) %绘制各档的加速度倒数曲线 plot(ua1,aI) hold on plot(ua2,aII) hold onplot(ua3,aIII) hold onplot(ua4,aIV)axis([5 99 0.01 10])10203040506070809012345678910aI aII aIIIaIV加速度倒数曲线ua/(km.h)1/a由图可知,加速度倒数没有交点,则可以在每档达到最大车速时换挡 nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=6.17;If=0.218; Iw1=1.798;Iw2=3.598;L=3.950;a=2.000;hg=0.9;m=3880;g=9.8; G=m*g; ig=[6.09 3.09 1.71 1.00 ]; nmin=600;nmax=4000; u1=0.377*r*nmin./ig/i0; u2=0.377*r*nmax./ig/i0;deta=0*ig; for i=1:4deta(i)=1+(Iw1+Iw2)/(m*r^2)+(If*(ig(i))^2*i0^2*nT)/(m*r^2); endua=[0:0.01:99];N=length(ua);n=0;Tq=0;Ft=0;inv_a=0*ua;delta=0*ua; Ff=G*f;Fw=CDA*ua.^2/21.15; for i=1:N k=i;if ua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000)^.4;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff-Fw(i)); delta(i)=0.01*inv_a(i)/3.6; elseif ua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft-Ff-Fw(i)); delta(i)=0.01*inv_a(i)/3.6;else ua(i)<=u2(4)n=ua(i)*(ig(4)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i)); delta(i)=0.01*inv_a(i)/3.6; enda=delta(1:k); t(i)=sum(a); endplot(t,ua,'b','LineWidth',2);axis([0 100 0 100]);title('四档汽车二档原地起步换挡加速时间曲线'); xlabel('时间t (s )');ylabel('速度ua (km/h )');1020304050607080901000102030405060708090100四档汽车二档原地起步换挡加速时间曲线时间t (s )速度u a (k m /h )第二大题n=600:1:4000 N=n/1000T=-19.313+295.27*n/1000-165.44*N.*N+40.874*N.*N.*N-3.8445*N.*N.*N .*NPe=T.*n/9550 figure(1) plot(n,T)text(1000,120,'转矩T') hold on plot(n,Pe)text(2000,20,'发动机净功率Pe')5001000150020002500300035004000020406080100120140160180转矩T发动机净功率Pei0=6.17; ig(1)=6.09 ig(2)=3.09 ig(3)=1.71 ig(4)=1.00 nT=0.85 r=0.367 f=0.013 m1=3880 m2=9590 CdA=2.77ua1=0.377*r*n/(ig(1)*i0) ua2=0.377*r*n/(ig(2)*i0) ua3=0.377*r*n/(ig(3)*i0) ua4=0.377*r*n/(ig(4)*i0); ua=10:1:100Pf=m1*9.8*f.*ua/(3600) Pw=CdA*ua.^3/(76140) figure(2) plot(ua1,Pe) hold on plot(ua2,Pe) hold on plot(ua3,Pe) hold onplot(ua4,Pe) hold onplot(ua,(Pf+Pw)/nT)010203040506070809010010203040506070评价:一二三档的后备功率都比较大,可在一定坡度的道路上直接启动加速; 在最高档达到最高车速时,n0=[815 1207 1614 2012 2603 3006 3403 3884]B00=[1326.8 1354.7 1284.4 1122.9 1141.0 1051.2 1233.9 1129.7] B10=[-416.46 -303.98 -189.75 -121.59 -98.893 -73.714 -84.478 -45.291] B20=[72.379 36.657 14.524 7.0035 4.4763 2.8593 2.9788 0.71113]B30=[-5.8629 -2.0533 -0.51184 -0.18517 -0.091077 -0.05138 -0.047449 -0.00075215]B40=[0.17768 0.043072 0.0068164 0.0018555 0.00068906 0.00035032 0.00028230 -0.000038568] B0=spline(n0,B00,n) B1=spline(n0,B10,n) B2=spline(n0,B20,n) B3=spline(n0,B30,n) B4=spline(n0,B40,n)Pf3=m1*9.8*f.*ua3/(3600) Pw3=CdA*ua3.^3/(76140) Pf4=m1*9.8*f.*ua4/(3600) Pw4=CdA*ua4.^3/(76140) Ff1=m1*9.8*ffz3=CdA*ua3.^2/21.15+Ff1 fz4=CdA*ua4.^2/21.15+Ff1 %Pe3=fz3.*ua3./(3600*nT); %Pe4=fz4.*ua4./(3600*nT); Pe3=(Pf3+Pw3)/nTPe4=(Pf4+Pw4)/nTb3=B0+B1.*Pe3+B2.*Pe3.^2+B3.*Pe3.^3+B4.*Pe3.^4 b4=B0+B1.*Pe4+B2.*Pe4.^2+B3.*Pe4.^3+B4.*Pe4.^4Qs4=Pe4.*b4./(1.02*ua4*7.10*9.8) Qs3=Pe3.*b3./(1.02*ua3*7.10*9.8) figure(3)plot(ua4,Qs4) hold on plot(ua3,Qs3)01020304050607080901.41.61.822.22.42.62.8n=600:1:4000 N=n/1000T=-19.313+295.27*n/1000-165.44*N.*N+40.874*N.*N.*N-3.8445*N.*N.*N .*NPe=T.*n/9550 i0=6.17; ig(1)=6.09 ig(2)=3.09 ig(3)=1.71 ig(4)=1.00 nT=0.85 r=0.367 f=0.013 m1=3880 m2=9590 CdA=2.77ua1=0.377*r*n/(ig(1)*i0) ua2=0.377*r*n/(ig(2)*i0) ua3=0.377*r*n/(ig(3)*i0) ua4=0.377*r*n/(ig(4)*i0);n0=[815 1207 1614 2012 2603 3006 3403 3884]B00=[1326.8 1354.7 1284.4 1122.9 1141.0 1051.2 1233.9 1129.7] B10=[-416.46 -303.98 -189.75 -121.59 -98.893 -73.714 -84.478 -45.291]B20=[72.379 36.657 14.524 7.0035 4.4763 2.8593 2.9788 0.71113]B30=[-5.8629 -2.0533 -0.51184 -0.18517 -0.091077 -0.05138 -0.047449 -0.00075215]B40=[0.17768 0.043072 0.0068164 0.0018555 0.00068906 0.00035032 0.00028230 -0.000038568]B0=spline(n0,B00,n)B1=spline(n0,B10,n)B2=spline(n0,B20,n)B3=spline(n0,B30,n)B4=spline(n0,B40,n)Pf3=m1*9.8*f.*ua3/(3600) %三档的滚动阻力功率Pw3=CdA*ua3.^3/(76140) %三档的的空气阻力功率Pf4=m1*9.8*f.*ua4/(3600)Pw4=CdA*ua4.^3/(76140)Ff1=m1*9.8*fPe3=(Pf3+Pw3)/nT %三档的发动机净功率Pe4=(Pf4+Pw4)/nT %四档的发动机净功率b3=B0+B1.*Pe3+B2.*Pe3.^2+B3.*Pe3.^3+B4.*Pe3.^4b4=B0+B1.*Pe4+B2.*Pe4.^2+B3.*Pe4.^3+B4.*Pe4.^4Qs4=Pe4.*b4./(1.02*ua4*7.10) %四档的百公里油耗Qs3=Pe3.*b3./(1.02*ua3*7.10) %三档的百公里油耗ua=[25 40 50]ss=[50 250 250]fz=CdA*ua.^2/21.15+Ff1 %匀速条件下的阻力Pee=fz.*ua/(3600*nT);b=spline(b4,Pe4,Pee) %匀速条件下的燃油消耗率Qsy=Pee.*b./(1.02*ua*7.10)a=[0.2 0.2 -0.36]dt1=1/(3.6*0.2)dt2=1/(3.6*0.2)dt3=1/(3.6*(0.36))ua11=25:1:40ua22=40:1:50ua33=50:-1:25b11=spline(ua4,b4,ua11) %在加速条件下的各个速度节点的燃油消耗率b22=spline(ua4,b4,ua22)b33=spline(ua4,b4,ua33)If=0.218Iw1=1.798Iw2=3.598die4=1+(Iw1+Iw2)/(m1*r^2)+(If*i0^2*nT*ig(4).^2)/(m1*r^2);Pej1=(m1*9.8*f.*ua11/(3600)+CdA.*ua11.^3/(76140)+(die4*m1.*ua11/3600)*0.2)/nT %在三个加速条件下的各个速度节点Pej2=(m1*9.8*f.*ua22/(3600)+CdA.*ua22.^3/(76140)+(die4*m1.*ua22/3 600)*0.2)/nT %的发动机净功率Pej3=(m1*9.8*f.*ua33/(3600)+CdA.*ua33.^3/(76140)+(die4*m1.*ua33/3 600)*0.2)/nT %Qstj1=Pej1.*b11/(367.1*7.10) %在三中加速条件下的,各自的单位时间的燃油消耗量Qstj2=Pej2.*b22/(367.1*7.10)Qstj3=Pej3.*b33/(367.1*7.10)i11=size(Qstj1)i22=size(Qstj2)i33=size(Qstj3)i1=i11(2)i2=i22(2)i3=i33(2)Qt1=Qstj1(2:i1-1)Qt2=Qstj2(2:i2-1)Qt3=Qstj3(2:i3-1)q1=((Qstj1(1)+Qstj1(i1))*dt1./2+sum(Qt1)*dt1)/10q2=((Qstj2(1)+Qstj2(i2))*dt2./2+sum(Qt2)*dt2)/10q3=((Qstj3(1)+Qstj3(i3))*dt3./2+sum(Qt3)*dt3)/10Qall=(q1+q2+q3+Qsy(:,1)+Qsy(:,2)+Qsy(:,3))*100/1075q1 =5.8526q2 =4.9810 q3 =6.0186 Qall =2.7916第三大题(1)m0=4880; %空载质量m/kghg0=0.845; %空载质心高L0=3.95; %空载轴距a0=2.100; %空载质心至前轴距离m=9290; %满载质量m/kghg=1.170; %满载质心高L=3.95; %满载轴距a=2.950; %满载质心至前轴距离BB=0.38; %B为制动力分配系数g=9.8;G=m*g;b=L-a;G0=m0*g;b0=L0-a0;Fu1 =0:1000:100000;Fu2=1/2*(G/hg*(b^2+4*hg*L/G*Fu1).^0.5-(G*b/hg+2*Fu1));Fu02=1/2*(G0/hg0*(b0^2+4*hg0*L0/G0*Fu1).^0.5-(G0*b0/hg0+2*Fu1));F2=(1-B)*Fu1/B;plot(Fu1,Fu2) %绘制满载时的I曲线hold onplot(Fu1,Fu02) %绘制空载时的I曲线hold onplot(Fu1,F2); %%绘制beta曲线title('beta线和I曲线')text(30000,50000,'beta曲线')text(25000,10000,'空载时I曲线')text(25000,30000,'满载时I曲线')xlabel('Fu1')ylabel('Fu2')figure(2)fe=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9];for i=1:10Fxb1fk=0:100:120000;Fxb1rk=0:100:120000;Fxb2fk=(L0-fe(i)*hg0)/(fe(i)*hg0).*Fxb1fk-G0*b0/hg0;Fxb2rk=(-1*fe(i)*hg0)/(L0+fe(i)*hg0).*Fxb1rk+fe(i)*G0*a0/(L0+fe(i )*hg0);plot(Fxb1fk,Fxb2fk)hold onplot(Fxb1rk,Fxb2rk,'r')hold onendxlabel('Fxb1')ylabel('Fxb2')axis([0 120000 0 40000])title('空载时的f、r线组图')figure(3)for i=1:10Fxb1fk=0:100:220000;Fxb1rk=0:100:220000;Fxb2fk=(L-fe(i)*hg)/(fe(i)*hg).*Fxb1fk-G*b/hg;Fxb2rk=(-1*fe(i)*hg)/(L+fe(i)*hg).*Fxb1rk+fe(i)*G*a/(L+fe(i)*hg); plot(Fxb1fk,Fxb2fk)hold onplot(Fxb1rk,Fxb2rk,'r')hold onendxlabel('Fxb1')ylabel('Fxb2')axis([0 220000 0 80000])title('满载时的f、r线组图')012345678910x 104-2024681012141618x 104beta 线和I 曲线beta 曲线空载时I 曲线满载时I 曲线Fu1F u 2024681012x 10400.511.522.533.54x 104Fxb1F x b 2空载时的f 、r 线组图00.20.40.60.81 1.21.4 1.6 1.822.2x 105012345678x 104Fxb1F x b 2满载时的f 、r 线组图(2)-(3)m0=4880; %空载质量m/kghg0=0.845; %空载质心高L0=3.95; %空载轴距a0=2.100; %空载质心至前轴距离m=9290; %满载质量m/kghg=1.170; %满载质心高L=3.95; %满载轴距a=2.950; %满载质心至前轴距离BB=0.38; %B 为制动力分配系数g=9.8;G=m*g;b=L-a;G0=m0*g;b0=L0-a0;z=0:0.1:1; %制动强度fef=B*z*L./(b+z*hg);fef0=B*z*L0./(b0+z*hg0);fer=(1-B)*z*L./(a-z*hg);fer0=(1-B)*z*L0./(a0-z*hg0);figure(1)plot(z,fef,z,fef0,z,fer,z,fer0,z,z)text(0.8,1.5,'空车后轮')text(0.8,1.2,'满载后轮')text(0.7,0.6,'满载前轮')text(0.8,0.4,'空车前轮')figure(2)Ef=z./fef*100Ef0=z./fef0*100Er=z./fer*100Er0=z./fer0*100plot(fef,Ef,fer,Er)hold onplot(fef0,Ef0,fer0,Er0)axis([0 1 0 100])text(0.3,90,'Ef')text(0.8,90,'Er 满载')text(0.3,70,'Er 空载')00.10.20.30.40.50.60.70.80.9100.20.40.60.811.21.41.61.82空车后轮满载后轮满载前轮空车前轮00.10.20.30.40.50.60.70.80.910102030405060708090100Ef Er 满载Er 空载m0=4880;hg=0.845;l=3.950;a=2.100;b=1.850;beita=0.38;g=9.8;G0=m0*g ;m=9290;Hg=1.170;L=3.950;A=2.950;B=1.050;beita=0.38;g=9.8;G=m*g;t1=0.02;t2=0.02;ua0=30;fai=0.80;z=0:0.01:1.0;faifk=beita*z*l./(b+z*hg);faifm=beita*z*L./(B+z*Hg);fairk=(1-beita)*z*l./(a-z*hg);fairm=(1-beita)*z*L./(A-z*Hg);Efk=z./faifk*100;Efm=z./faifm*100;Erk=z./fairk*100;Erm=z./fairm*100;ak1=Erk(81)*g*fai/100;am1=Erm(81)*g*fai/100;Sk1=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*ak1);Sm1=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*am1);disp('空载时,汽车制动距离Sk1=');disp(Sk1);disp('满载时,汽车制动距离Sm1=');disp(Sm1);ak2=fai*g*a/(l+fai*hg);am2=fai*g*A/(L+fai*Hg);ak3=fai*g*b/(l-fai*hg);am3=fai*g*B/(L-fai*Hg);Sk2=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*ak2);Sm2=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*am2);Sk3=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*ak3);Sm3=(t1+t2/2)*ua0/3.6+ua0^2/(25.92*am3);disp('空载时,前制动器损坏,汽车制动距离Sk2=');disp(Sk2);disp('满载时,前制动器损坏,汽车制动距离Sm2=');disp(Sm2);disp('空载时,后制动器损坏,汽车制动距离Sk3=');disp(Sk3);disp('满载时,后制动器损坏,汽车制动距离Sm3=');disp(Sm3);空载时,汽车制动距离Sk1=7.8668满载时,汽车制动距离Sm1=5.6354空载时,前制动器损坏,汽车制动距离Sk2=10.0061满载时,前制动器损坏,汽车制动距离Sm2=7.5854空载时,后制动器损坏,汽车制动距离Sk3=8.0879满载时,后制动器损坏,汽车制动距离Sm3=12.9629。
汽车运用作业matlab程序
1.31)绘制驱动力与行驶阻力平衡图利用Matlab画图,具体语句如下:n=600:1:4000;Ttq=-19.313+295.27*n/1000-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; io=5.83;t=0.844;r=0.367;ig1=5.56;ua=0.377*r*n/(ig1*io);Ft1=Ttq*ig1*io*t/r;plot(ua,Ft1)hold on;n=600:1:4000;Ttq=-19.313+295.27*n/1000-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; io=5.83;t=0.844;r=0.367;ig2=2.769;ua=0.377*r*n/(ig2*io);Ft2=Ttq*ig2*io*t/r;plot(ua,Ft2)hold on;n=600:1:4000;Ttq=-19.313+295.27*n/1000-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; io=5.83;t=0.844;r=0.367;ig3=1.644;ua=0.377*r*n/(ig3*io);Ft3=Ttq*ig3*io*t/r;plot(ua,Ft3)hold on;n=600:1:4000;Ttq=-19.313+295.27*n/1000-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; io=5.83;t=0.844;r=0.367;ig4=1.00;ua=0.377*r*n/(ig4*io);Ft4=Ttq*ig4*io*t/r;plot(ua,Ft4)hold on;n=600:1:4000;Ttq=-19.313+295.27*n/1000-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4; io=5.83;t=0.844;r=0.367;ig5=0.793;ua=0.377*r*n/(ig5*io);Ft5=Ttq*ig5*io*t/r;plot(ua,Ft5)hold on;m=3880;f=0.012;g=9.8;CdA=2.77;u=0:1:120;Ff=m*g*f;Fw=CdA*u.^2/21.15;Fr=Ff+Fw;Ft5=Ttq*ig5*io*t/r;Ff=m*g*f;Fw=CdA*u.^2/21.15;Fr=Ff+Fw;plot(u,Fr)运行生成图像如下:2)求汽车最高车速,最大爬坡度及克服该坡度时相应的附着率当Ft=Ff+Fw时,汽车处于稳定状态,并达到最高车速由图可知Umax=101km/h最大爬坡度及附着率:一档时有最大爬坡度,由驱动力与阻力图当ua=8.037km/h时: Gsin错误!未找到引用源。
汽车理论matlab作业
一、确定一轻型货车的动力性能。
1)绘制汽车驱动力与行驶阻力平衡图;2)求汽车最高车速与最大爬坡度;3)绘制汽车行驶加速度倒数曲线;用计算机求汽车用Ⅱ档起步加速行驶至 70km/h 所需的加速时间。
已知数据略。
(参见《汽车理论》习题第一章第3题)解题程序如下:用Matlab语言(1)绘制汽车驱动力与行驶阻力平衡图m1=2000; m2=1800; mz=3880;g=9.81; r=0.367; CdA=2.77; f=0.013; nT=0.85;ig=[5.56 2.769 1.644 1.00 0.793]; i0=5.83;If=0.218; Iw1=1.798; Iw2=3.598;Iw=2*Iw1+4*Iw2;for i=1:69n(i)=(i+11)*50;Ttq(i)=-19.313+295.27*(n(i)/1000)-165.44*(n(i)/1000)^2+40.874*(n(i)/1000)^3-3 .8445*(n(i)/1000)^4;endfor j=1:5for i=1:69Ft(i,j)=Ttq(i)*ig(j)*i0*nT/r;ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Fz(i,j)=CdA*ua(i,j)^2/21.15+mz*g*f;endendplot(ua,Ft,ua,Ff,ua,Ff+Fw)title('汽车驱动力与行驶阻力平衡图');xlabel('ua(km/h)');ylabel('Ft(N)');gtext('Ft1')gtext('Ft2')gtext('Ft3')gtext('Ft4')gtext('Ft5')gtext('Ff+Fw')for k=1:175n1(k)=3300+k*0.1;Ttq(k)=-19.313+295.27*(n1(k)/1000)-165.44*(n1(k)/1000)^2+40.874*(n1(k)/1000)^33.8445*(n1(k)/1000)^4;Ft(k)=Ttq(k)*ig(5)*i0*nT/r;ua(k)=0.377*r*n1(k)/(ig(5)*i0);Fz(k)=CdA*ua(k)^2/21.15+mz*g*f;E(k)=abs((Ft(k)-Fz(k)));endfor k=1:175if(E(k)==min(E))disp('汽车最高车速=');disp(ua(k));disp('km/h');endendfor p=1:150n2(p)=2000+p*0.5;Ttq(p)=-19.313+295.27*(n2(p)/1000)-165.44*(n2(p)/1000)^2+40.874*(n2(p)/1000) ^3-3.8445*(n2(p)/1000)^4;Ft(p)=Ttq(p)*ig(1)*i0*nT/r;ua(p)=0.377*r*n2(p)/(ig(1)*i0);Fz(p)=CdA*ua(p)^2/21.15+mz*g*f;af(p)=asin((Ft(p)-Fz(p))/(mz*g));endfor p=1:150if(af(p)==max(af))i=tan(af(p));disp('汽车最大爬坡度=');disp(i);endend汽车最高车速=99.0679km/h汽车最大爬坡度=0.3518(3)计算2档起步加速到70km/h所需时间for i=1:69n(i)=(i+11)*50;Ttq(i)=-19.313+295.27*(n(i)/1000)-165.44*(n(i)/1000)^2+40.874*(n(i)/1000)^3-3 .8445*(n(i)/1000)^4;endfor j=1:5for i=1:69deta=1+Iw/(mz*r^2)+If*ig(j)^2*i0^2*nT/(mz*r^2);ua(i,j)=0.377*r*n(i)/(ig(j)*i0);-mz*g*f)/(deta*mz);if(a(i,j)<=0)a(i,j)=a(i-1,j);endif(a(i,j)>0.05)b1(i,j)=a(i,j);u1(i,j)=ua(i,j);elseb1(i,j)=a(i-1,j);u1(i,j)=ua(i-1,j);endb(i,j)=1/b1(i,j);endendx1=u1(:,1);y1=b(:,1);x2=u1(:,2);y2=b(:,2);x3=u1(:,3);y3=b(:,3);x4=u1(:,4);y4=b(:,4);x5=u1(:,5);y5=b(:,5);plot(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5);title('加速度倒数时间曲线');axis([0 120 0 30]);xlabel('ua(km/h)');ylabel('1/aj');gtext('1/a1')gtext('1/a2')gtext('1/a3')gtext('1/a4')gtext('1/a5')for i=1:69A=ua(i,3)-ua(69,2);if (A<1&A>0)j=i;endB=ua(i,4)-ua(69,3);if(B<2&B>0)k=i;endif(ua(i,4)<=70)m=i;endendt=ua(1,2)*b(1,2);for p1=2:69t1(p1)=(ua(p1,2)-ua(p1-1,2))*(b(p1,2)+b(p1-1,2))*0.5;endfor p2=j:69t2(p2)=(ua(p2,3)-ua(p2-1,3))*(b(p2,3)+b(p2-1,3))*0.5;t=t+t2(p2);endfor p3=k:mt3(p3)=(ua(p3,4)-ua(p3-1,4))*(b(p3,4)+b(p3-1,4))*0.5;t=t+t3(p3);endt=t+(ua(j,3)-ua(69,2))*b(69,2)+(ua(k,4)-ua(69,3))*b(69,3)+(70-ua(m,4))*b(m,4);tz=t/3.6;disp('加速时间=');disp(tz);disp('s');加速时间=29.0585s二、计算与绘制题1 中货车的1)汽车功率平衡图;2)最高档与次高档的等速百公里油耗曲线。
河南工业大学汽车理论VB绘制汽车驱动力与行驶阻力平衡图_汽车功率平衡图。
3.2 实验记录(核心代码及调试过程)1.核心代码:'.............驱动力与行驶阻力平衡图Private Sub Command1_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, j, n As IntegerDim Ft, Ff, Fw, Umax, Uumax As SinglePicture1.Scale (-20, 18000)-(150, -2000)Picture1.Line (0, 0)-(125, 0): Picture1.Line (0, 0)-(0, 16000)Picture1.CurrentX = 125: Picture1.CurrentY = -300: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 125: Picture1.CurrentY = 192: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 16000: Picture1.Print "F/N"Picture1.CurrentX = -2: Picture1.CurrentY = 16000: Picture1.Print "↑"Picture1.CurrentX = -5: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 120 Step 20Picture1.Line (i, 0)-(i, 200)Picture1.CurrentX = i - 5: Picture1.CurrentY = -10: Picture1.Print iNext iFor i = 1000 To 15000 Step 1000Picture1.Line (0, i)-(1.5, i)Picture1.CurrentX = -15: Picture1.CurrentY = i + 50: Picture1.Print iNext iPicture1.DrawWidth = 2For n = 600 To 4000Tq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000) ^ 3 - 3.8445 * (n / 1000) ^ 4For j = 1 To 5Ft = Tq * i0 * ηt * x(j) / rFf = f * 9.8 * mUa = 0.377 * r * n / (i0 * x(j))Fw = 0.5 * 1.2258 * ca * (Ua / 3.6) ^ 2Picture1.Circle (Ua, Ft), 0.1, vbBluePicture1.Circle (Ua, (Ff + Fw)), 0.1, vbRedUmax = UmaxIf Ua > Umax ThenUmax = UaElseUmax = UmaxEnd IfNext jNext nUumax = CInt(Umax * 100) / 100Picture1.CurrentX = 40: Picture1.CurrentY = 16000: Picture1.Print "最高车速为:"; Uumax; "km/h"End Sub'...........动力特性图Private Sub Command3_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, j, n As IntegerDim Ft, Fw, D As SinglePicture1.Scale (-20, 90)-(150, -10)Picture1.Line (0, 0)-(125, 0): Picture1.Line (0, 0)-(0, 85)Picture1.CurrentX = 125: Picture1.CurrentY = -3: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 125: Picture1.CurrentY = 0.9: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 85: Picture1.Print "D"Picture1.CurrentX = -2: Picture1.CurrentY = 85: Picture1.Print "↑"Picture1.CurrentX = -5: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 120 Step 20Picture1.Line (i, 0)-(i, 1)Picture1.CurrentX = i - 5: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 20 To 80 Step 20Picture1.Line (0, i)-(2, i)Picture1.CurrentX = -10: Picture1.CurrentY = i + 1: Picture1.Print "0"; i / 200Next iPicture1.DrawWidth = 2For n = 600 To 4000For j = 1 To 5Tq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000) ^ 3 - 3.8445 * (n / 1000) ^ 4Ft = Tq * i0 * ηt * x(j) / rUa = 0.377 * r * n / (i0 * x(j))Fw = 0.5 * 1.2258 * ca * (Ua / 3.6) ^ 2D = 200 * (Ft - Fw) / (m * 9.8)If D > 0 ThenPicture1.Circle (Ua, D), 0.1, vbBlueEnd IfNext jNext nEnd Sub'.............功率平衡图Private Sub Command4_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, j, n As IntegerDim Pe, Pf, Pw As SinglePicture1.Scale (-20, 80)-(150, -10)Picture1.Line (0, 0)-(125, 0): Picture1.Line (0, 0)-(0, 75)Picture1.CurrentX = 125: Picture1.CurrentY = -3: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 125: Picture1.CurrentY = 0.9: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 75: Picture1.Print "Pe/kw"Picture1.CurrentX = -2: Picture1.CurrentY = 75: Picture1.Print "↑"Picture1.CurrentX = -5: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 120 Step 20Picture1.Line (i, 0)-(i, 1)Picture1.CurrentX = i - 5: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 10 To 70 Step 10Picture1.Line (0, i)-(2, i)Picture1.CurrentX = -10: Picture1.CurrentY = i + 1: Picture1.Print iNext iPicture1.DrawWidth = 2For n = 600 To 4000For j = 1 To 5Tq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000) ^ 3 - 3.8445 * (n / 1000) ^ 4Pe = Tq * n / 9550Ua = 0.377 * r * n / (i0 * x(j))Pf = (m * f * Ua / 3600) / ηtPw = (ca * Ua ^ 3 / 76140) / ηtPicture1.Circle (Ua, Pe), 0.1, vbBluePicture1.Circle (Ua, (Pf + Pw)), 0.1, vbRedNext jNext nEnd Sub'...........外特性曲线Private Sub Command5_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, n As IntegerDim Pe As SinglePicture1.Scale (-400, 250)-(5000, -20)Picture1.Line (0, 0)-(4500, 0): Picture1.Line (0, 0)-(0, 200)Picture1.CurrentX = 4300: Picture1.CurrentY = -3: Picture1.Print "n(r/min)"Picture1.CurrentX = 4500: Picture1.CurrentY = 3: Picture1.Print "→"Picture1.CurrentX = 100: Picture1.CurrentY = 200: Picture1.Print "Ttq(N*m)"Picture1.CurrentX = 100: Picture1.CurrentY = 80: Picture1.Print "Pe(kw)"Picture1.CurrentX = -60: Picture1.CurrentY = 205: Picture1.Print "↑"Picture1.CurrentX = -5: Picture1.CurrentY = -1: Picture1.Print "0"For i = 500 To 4000 Step 500Picture1.Line (i, 0)-(i, 3)Picture1.CurrentX = i - 200: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 20 To 180 Step 20Picture1.Line (0, i)-(50, i)Picture1.CurrentX = -300: Picture1.CurrentY = i + 3: Picture1.Print iNext iPicture1.DrawWidth = 2For n = 600 To 4000Tq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000)^ 3 - 3.8445 * (n / 1000) ^ 4Pe = Tq * n / 9550Picture1.Circle (n, Pe), 2, vbRed Picture1.Circle (n, Tq), 2, vbBlue Next nEnd Sub2.数据图表:驱动力与行驶阻力平衡图:动力特性图:爬坡度图:发动机外特性曲线:发动机功率平衡图:3.2 实验记录(核心代码及调试过程)1.核心代码:'.........加速度的倒数曲线Private Sub Command7_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, j, n As IntegerDim Ff, Ft, Fw, a, δ As SinglePicture1.Scale (-20, 160)-(150, -10)Picture1.Line (0, 0)-(125, 0): Picture1.Line (0, 0)-(0, 150)Picture1.CurrentX = 125: Picture1.CurrentY = -3: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 125: Picture1.CurrentY = 1.8: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 150: Picture1.Print "1/a"Picture1.CurrentX = -2: Picture1.CurrentY = 150: Picture1.Print "↑"Picture1.CurrentX = -5: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 120 Step 20Picture1.Line (i, 0)-(i, 1.5)Picture1.CurrentX = i - 5: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 10 To 140 Step 10Picture1.Line (0, i)-(2, i)Picture1.CurrentX = -10: Picture1.CurrentY = i + 1: Picture1.Print i / 10Next iPicture1.DrawWidth = 2For n = 600 To 4000For j = 1 To 5Tq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000) ^ 3 - 3.8445 * (n / 1000) ^ 4Ft = Tq * i0 * ηt * x(j) / rUa = 0.377 * r * n / (i0 * x(j))Fw = 0.5 * 1.2258 * ca * (Ua / 3.6) ^ 2Ff = f * 9.8 * mδ = 1 + Iw / (m * r ^ 2) + If1 * x(j) ^ 2 * i0 ^ 2 * ηt / (m * r ^ 2) a = (Ft - Ff - Fw) / (δ * m)If a > 0 ThenPicture1.Circle (Ua, 10 / a), 0.1, vbBlueEnd IfNext jNext nEnd Sub'..............直接挡加速时间曲线Private Sub Command8_Click()Picture1.DrawWidth = 1Picture1.ClsDim i, n As IntegerDim Ff, Ft, Fw, a, δ, t, tt As SinglePicture1.Scale (-10, 90)-(60, -10)Picture1.Line (0, 0)-(55, 0): Picture1.Line (0, 0)-(0, 75)Picture1.CurrentX = 53: Picture1.CurrentY = -3: Picture1.Print "t(s)"Picture1.CurrentX = 55: Picture1.CurrentY = 0.9: Picture1.Print "→"Picture1.CurrentX = 2: Picture1.CurrentY = 75: Picture1.Print "Ua(km/h)"Picture1.CurrentX = -0.7: Picture1.CurrentY = 75: Picture1.Print "↑"Picture1.CurrentX = -3: Picture1.CurrentY = -1: Picture1.Print "0"For i = 10 To 50 Step 10Picture1.Line (i, 0)-(i, 1)Picture1.CurrentX = i - 1.5: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 10 To 70 Step 10Picture1.Line (0, i)-(1, i)Picture1.CurrentX = -5: Picture1.CurrentY = i + 1: Picture1.Print iNext it = 0For Ua = 0 To 70 Step 0.01n = Ua * i0 * x(4) / 0.377 / rIf n >= 600 ThenTq = -19.313 + 295.27 * (n / 1000) - 165.44 * (n / 1000) ^ 2 + 40.874 * (n / 1000) ^ 3 - 3.8445 * (n / 1000) ^ 4Ft = Tq * i0 * ηt * x(4) / rFw = 0.5 * 1.2258 * ca * (Ua / 3.6) ^ 2Ff = f * 9.8 * mδ = 1 + Iw / (m * r ^ 2) + If1 * x(4) ^ 2 * i0 ^ 2 * ηt / (m * r ^ 2)a = (Ft - Ff - Fw) / (δ * m)t = t + 1 * 0.01 / a / 3.6Picture1.Circle (t, Ua), 0.1, vbBlueEnd IfNext Uatt = CInt(t * 100) / 100Picture1.CurrentX = 15: Picture1.CurrentY = 80: Picture1.Print "0-70(km/h)直接挡加速时间为:"; tt; "s"End Sub2.数据图表:加速度曲线图:加速度倒数曲线:直接挡加速时间图:3.2 实验记录(核心代码及调试过程)1.核心代码'.........最高挡百公里耗油量Private Sub Command1_Click()Dim n(1 To 8), B0(1 To 8), B1(1 To 8), B2(1 To 8), B3(1 To 8), B4(1 To 8)n(1) = 815: n(2) = 1207: n(3) = 1614: n(4) = 2012: n(5) = 2603: n(6) = 3006: n(7) = 3403: n(8) = 3804B0(1) = 1326.8: B0(2) = 1354.7: B0(3) = 1284.4: B0(4) = 1122.9: B0(5) = 1141#: B0(6) = 1051.2: B0(7) = 1233.9: B0(8) = 1129.7B1(1) = -416.46: B1(2) = -303.98: B1(3) = -189.75: B1(4) = -121.59: B1(5) = -98.893: B1(6) = -73.714: B1(7) = -84.478: B1(8) = -45.291B2(1) = 72.379: B2(2) = 36.657: B2(3) = 14.524: B2(4) = 7.0035: B2(5) = 4.4763: B2(6) = 2.8593: B2(7) = 2.9788: B2(8) = 0.71113B3(1) = -5.8629: B3(2) = -2.0553: B3(3) = -0.51184: B3(4) = -0.18517: B3(5) = -0.091077: B3(6) = -0.05138: B3(7) = -0.047449: B3(8) = -0.00075215B4(1) = 0.17768: B4(2) = 0.043072: B4(3) = 0.0068164: B4(4) = 0.0018555: B4(5) = 0.00068906: B4(6) = 0.00035032: B4(7) = 0.0002823: B4(8) = -0.000038568Picture1.Scale (-10, 50)-(150, -10)Picture1.Line (0, 0)-(120, 0): Picture1.Line (0, 0)-(0, 45)Picture1.CurrentX = 120: Picture1.CurrentY = -3: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 120: Picture1.CurrentY = 1: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 45: Picture1.Print "Qs(L/100km)"Picture1.CurrentX = -2.5: Picture1.CurrentY = 46: Picture1.Print "↑"Picture1.CurrentX = -3: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 100 Step 20Picture1.Line (i, 0)-(i, 1)Picture1.CurrentX = i - 6: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 10 To 40 Step 10Picture1.Line (0, i)-(3, i)Picture1.CurrentX = -12: Picture1.CurrentY = i + 1: Picture1.Print iNext ig = 3880 * 9.8f = 0.013CdA = 2.77ηt = 0.85i0 = 5.83r = 0.367Uamin = 0.377 * r * n(1) / (0.793 * i0)Qmin = 100Picture1.DrawWidth = 2For ua = Uamin To 100 Step 0.01Pe = (g * f * ua / 3600 + CdA * ua ^ 3 / 76140) / ηtnn = 0.793 * i0 * ua / (0.377 * r)For i = 1 To 7If nn >= n(i) And nn <= n(i + 1) ThenB0B0 = B0(i) + (B0(i + 1) - B0(i)) * (nn - n(i)) / (n(i + 1) - n(i))B1B1 = B1(i) + (B1(i + 1) - B1(i)) * (nn - n(i)) / (n(i + 1) - n(i))B2B2 = B2(i) + (B2(i + 1) - B2(i)) * (nn - n(i)) / (n(i + 1) - n(i))B3B3 = B3(i) + (B3(i + 1) - B3(i)) * (nn - n(i)) / (n(i + 1) - n(i))B4B4 = B4(i) + (B4(i + 1) - B4(i)) * (nn - n(i)) / (n(i + 1) - n(i))End IfNext iBe = B0B0 + B1B1 * Pe + B2B2 * Pe ^ 2 + B3B3 * Pe ^ 3 + B4B4 * Pe ^ 4Qs = Pe * Be / (1.02 * 7 * ua)Picture1.PSet (ua, Qs), vbBlueIf Qs < Qmin ThenQmin = QsUj = uaEnd IfNext uaText1.Text = CInt(Uj * 100) / 100Text2.Text = CInt(Qmin * 100) / 100End Sub'..............次高挡百公里耗油量Private Sub Command2_Click()Picture1.ClsPicture1.DrawWidth = 1Dim n(1 To 8), B0(1 To 8), B1(1 To 8), B2(1 To 8), B3(1 To 8), B4(1 To 8)n(1) = 815: n(2) = 1207: n(3) = 1614: n(4) = 2012: n(5) = 2603: n(6) = 3006: n(7) = 3403: n(8) = 3804B0(1) = 1326.8: B0(2) = 1354.7: B0(3) = 1284.4: B0(4) = 1122.9: B0(5) = 1141#: B0(6) = 1051.2: B0(7) = 1233.9: B0(8) = 1129.7B1(1) = -416.46: B1(2) = -303.98: B1(3) = -189.75: B1(4) = -121.59: B1(5) = -98.893: B1(6) = -73.714: B1(7) = -84.478: B1(8) = -45.291B2(1) = 72.379: B2(2) = 36.657: B2(3) = 14.524: B2(4) = 7.0035: B2(5) = 4.4763: B2(6) = 2.8593: B2(7) = 2.9788: B2(8) = 0.71113B3(1) = -5.8629: B3(2) = -2.0553: B3(3) = -0.51184: B3(4) = -0.18517: B3(5) = -0.091077: B3(6) = -0.05138: B3(7) = -0.047449: B3(8) = -0.00075215B4(1) = 0.17768: B4(2) = 0.043072: B4(3) = 0.0068164: B4(4) = 0.0018555: B4(5) = 0.00068906: B4(6) = 0.00035032: B4(7) = 0.0002823: B4(8) = -0.000038568Picture1.Scale (-10, 50)-(150, -10)Picture1.Line (0, 0)-(120, 0): Picture1.Line (0, 0)-(0, 45)Picture1.CurrentX = 120: Picture1.CurrentY = -3: Picture1.Print "Ua(km/h)"Picture1.CurrentX = 120: Picture1.CurrentY = 1: Picture1.Print "→"Picture1.CurrentX = 5: Picture1.CurrentY = 45: Picture1.Print "Qs(L/100km)"Picture1.CurrentX = -2.5: Picture1.CurrentY = 46: Picture1.Print "↑"Picture1.CurrentX = -3: Picture1.CurrentY = -1: Picture1.Print "0"For i = 20 To 100 Step 20Picture1.Line (i, 0)-(i, 1)Picture1.CurrentX = i - 6: Picture1.CurrentY = -1: Picture1.Print iNext iFor i = 10 To 40 Step 10Picture1.Line (0, i)-(3, i)Picture1.CurrentX = -12: Picture1.CurrentY = i + 1: Picture1.Print iNext iPicture1.DrawWidth = 2m = 3880g = 3880 * 9.8f = 0.013CdA = 2.77ηt = 0.85i0 = 5.83r = 0.367Qmin = 100For ua = 25 To 100 Step 0.01Pe = (g * f * ua / 3600 + CdA * ua ^ 3 / 76140) / ηtnn = 0.793 * i0 * ua / (0.377 * r)For i = 1 To 7If nn >= n(i) And nn <= n(i + 1) ThenB0B0 = B0(i) + (B0(i + 1) - B0(i)) * (nn - n(i)) / (n(i + 1) - n(i)) B1B1 = B1(i) + (B1(i + 1) - B1(i)) * (nn - n(i)) / (n(i + 1) - n(i)) B2B2 = B2(i) + (B2(i + 1) - B2(i)) * (nn - n(i)) / (n(i + 1) - n(i)) B3B3 = B3(i) + (B3(i + 1) - B3(i)) * (nn - n(i)) / (n(i + 1) - n(i)) B4B4 = B4(i) + (B4(i + 1) - B4(i)) * (nn - n(i)) / (n(i + 1) - n(i)) End IfNext iBe = B0B0 + B1B1 * Pe + B2B2 * Pe ^ 2 + B3B3 * Pe ^ 3 + B4B4 * Pe ^ 4Qs = Pe * Be / (1.02 * 7 * ua)Picture1.PSet (ua, Qs), vbRedIf Qs < Qmin ThenQmin = QsUj = uaEnd IfNext uaText1.Text = CInt(Uj * 100) / 100Text2.Text = CInt(Qmin * 100) / 100End Sub2.数据图表:最高档等速百公里燃油消耗量曲线图:次高档等速百公里燃油消耗量曲线图:河南工业大学第 页21。
汽车理论课后作业matlab编程详解带注释分析解析
1.3matlab 程序:(1)%驱动力- 行驶阻力平衡图%货车相关参数。
m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.000.793];y=0.85;r=0.367;f=0.013;CdA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;n=600:10:4000;%发动机转数转换成汽车行驶速度。
ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;%计算各档位驱动力。
Tq=-19.313+295.27*( n/1000)-165.44*(门/1000)人2+40.874*(门/1000)人3-3.8445*( n/IOOO).%;Ft1=Tq*ig(1)*i0*y/r;Ft2=Tq*ig(2)*i0*y/r;Ft3=Tq*ig(3)*i0*y/r;Ft4=Tq*ig(4)*i0*y/r;Ft5=Tq*ig(5)*i0*y/r;%计算行驶阻力。
Fz仁m*g*f+2.77*ua1.A2/21.15;Fz2=m*g*f+2.77*ua2.A2/21.15;Fz3=m*g*f+2.77*ua3.A2/21.15;Fz4=m*g*f+2.77*ua4.A2/21.15;Fz5=m*g*f+2.77*ua5.A2/21.15;%驱动力- 行驶阻力平衡图。
plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5,ua1,Fz1, 'k' ,ua2,Fz2,'k' ua3,Fz3, 'k' ,ua4,Fz4, 'k' ,ua5,Fz5, 'k' );title( ' 驱动力- 行驶阻力平衡图');xlabel( 'ua(km/s)' );ylabel( 'Ft(N)' );legend( 'Ft1' , 'Ft2' , 'Ft3' , 'Ft4' , 'Ft5' ,‘Ff+Fw')%求最高车速。
汽车理论课后习题MATLAB编程-武汉理工版
汽车理论课后习题MATLAB编程1.3 确定一轻型货车的动力性能(货车可装用4挡或5挡变速器,任选其中的一种进行整车性能计算):1)绘制汽车驱动力与行驶阻力平衡图。
2)求汽车最高车速,最大爬坡度及克服该坡度时相应的附着率。
3)绘制汽车行驶加速度倒数曲线,用图解积分法求汽车用2档起步加速行驶至70km/h的车速-时间曲线,或者用计算机求汽车用2档起步加速行驶至70km/h的加速时间。
解:(1) 求汽车驱动力与行驶阻力平衡图和汽车最高车速:n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;ua=[0:5:120];Ff=G*f;Fw=CDA*ua.^2/21.15;Fz=Ff+Fw;plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5,ua,Fz);title('驱动力-行驶阻力平衡图');xlabel('ua(km/s)');ylabel('Ft(N)');gtext('Ft1'),gtext('Ft2'),gtext('Ft3'),gtext('Ft4'),gtext('Ft5'),gtext('Ff+Fw');zoom on;[x,y]=ginput(1);zoom off;disp('汽车最高车速=');disp(x);disp('km/h');汽车最高车速=99.3006km/h(2)求汽车最大爬坡度程序:n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;Ff=G*f;Fw1=CDA*ua1.^2/21.15;Fz1=Ff+Fw1;Fi1=Ft1-Fz1;Zoom on;imax=100*tan(asin(max(Fi1/G)));disp('汽车最大爬坡度=');disp(imax);disp('%');汽车最大爬坡度=35.2197%(3)求最大爬坡度相应的附着率和求汽车行驶加速度倒数曲线程序:clearn=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;Fw1=CDA*ua1.^2/21.15;Fw2=CDA*ua2.^2/21.15;Fw3=CDA*ua3.^2/21.15;Fw4=CDA*ua4.^2/21.15;Fw5=CDA*ua5.^2/21.15;Ff=G*f;deta1=1+(Iw1+Iw2)/(m*r^2)+(If*ig(1)^2*i0^2*nT)/(m*r^2);deta2=1+(Iw1+Iw2)/(m*r^2)+(If*ig(2)^2*i0^2*nT)/(m*r^2);deta3=1+(Iw1+Iw2)/(m*r^2)+(If*ig(3)^2*i0^2*nT)/(m*r^2);deta4=1+(Iw1+Iw2)/(m*r^2)+(If*ig(4)^2*i0^2*nT)/(m*r^2);deta5=1+(Iw1+Iw2)/(m*r^2)+(If*ig(5)^2*i0^2*nT)/(m*r^2);a1=(Ft1-Ff-Fw1)/(deta1*m);ad1=1./a1;a2=(Ft2-Ff-Fw2)/(deta2*m);ad2=1./a2;a3=(Ft3-Ff-Fw3)/(deta3*m);ad3=1./a3;a4=(Ft4-Ff-Fw4)/(deta4*m);ad4=1./a4;a5=(Ft5-Ff-Fw5)/(deta5*m);ad5=1./a5;plot(ua1,ad1,ua2,ad2,ua3,ad3,ua4,ad4,ua5,ad5);axis([0 99 0 10]);title('汽车的加速度倒数曲线');xlabel('ua(km/h)');ylabel('1/a');gtext('1/a1');gtext('1/a2');gtext('1/a3');gtext('1/a4');gtext('1/a5');a=max(a1);af=asin(max(Ft1-Ff-Fw1)/G);C=tan(af)/(a/L+hg*tan(af)/L);disp('假设后轮驱动,最大爬坡度相应的附着率=');disp(C);假设后轮驱动,最大爬坡度相应的附着率=0.4219(4) >>clearnT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;If=0.218;Iw1=1.798;Iw2=3.598;L=3.2;a=1.947;hg=0.9;m=3880;g=9.8;G=m*g; ig=[5.56 2.769 1.644 1.00 0.793];nmin=600;nmax=4000;u1=0.377*r*nmin./ig/i0;u2=0.377*r*nmax./ig/i0;deta=0*ig;for i=1:5deta(i)=1+(Iw1+Iw2)/(m*r^2)+(If*(ig(i))^2*i0^2*nT)/(m*r^2);endua=[6:0.01:99];N=length(ua);n=0;Tq=0;Ft=0;inv_a=0*ua;delta=0*ua;Ff=G*f;Fw=CDA*ua.^2/21.15;for i=1:Nk=i;if ua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(4)n=ua(i)*(ig(4)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elsen=ua(i)*(ig(5)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(5)*i0*nT/r;inv_a(i)=(deta(5)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;enda=delta(1:k);t(i)=sum(a);endplot(t,ua);axis([0 80 0 100]);title('汽车2档原地起步换挡加速时间曲线');xlabel('时间t(s)');ylabel('速度ua(km/h)');>> ginputans =25.8223 70.073725.7467 70.0737所以汽车2档原地起步换挡加速行驶至70km/h的加速时间约为25.8s2.7已知货车装用汽油发动机的负荷特性与万有特性。
基于matlab来确定一轻型五档货车的动力性
确定以轻型五档货车的动力性:解:1.绘制汽车驱动力与行驶阻力平衡图Matlab 编写程序如下n=600:4000; r=0.367; nt=0.85; f=0.013; CA=2.77; io=5.83; m=3880; g=9.8; Tq=-19.313+295.27.*n./1000-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;ig1=5.56; Ua1=0.377.*r.*n./(ig1.*io); Ft1=Tq.*ig1.*io.*nt./r;ig2=2.769; Ua2=0.377.*r.*n./(ig2.*io); Ft2=Tq.*ig2.*io.*nt./r;ig3=1.644; Ua3=0.377.*r.*n./(ig3.*io); Ft3=Tq.*ig3.*io.*nt./r;ig4=1.00; Ua4=0.377.*r.*n./(ig4.*io); Ft4=Tq.*ig4.*io.*nt./r;ig5=0.793; Ua5=0.377.*r.*n./(ig5.*io); Ft5=Tq.*ig5.*io.*nt./r;Fr=m.*g.*f+(CA/21.15).*Ua5.^2;plot(Ua1,Ft1,Ua2,Ft2,Ua3,Ft3,Ua4,Ft4,Ua5,Ft5,Ua5,Fr);02040608010012002000400060008000100001200014000Ua(Km/h)F t (K N )驱动力行驶阻力平衡图2.求最高车速,最大爬坡度及相应附着率2.1 最高车速Uamaxfunction Uamax=Uamax(Ua5)r=0.367; nt=0.85; f=0.013; CA=2.77; io=5.83; m=3880; g=9.8;ig5=0.793; n=Ua5.*ig5.*io./(0.377.*r);Tq=-19.313+295.27.*n./1000-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;Ft5=Tq.*ig5.*io.*nt./r;Fr=m.*g.*f+(CA/21.15).*Ua5.^2;Uamax=Ft5-Fr;>> x=fzero(@Uamax,99)x =99.08342.2 最大爬坡度 imaxr=0.367; nt=0.85; f=0.013; CA=2.77; io=5.83; m=3880; g=9.8;Tq=-19.313+295.27.*n./1000-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;ig1=5.56; Ua1=0.377.*r.*n./(ig1.*io);i=(Tq.*ig1.*io.*nt./r-m.*g.*f)./(m.*g);imax=m>> imaximax =0.33252.3 该爬坡度时的附着率Co>> a=1.947; L=3.2; hg=0.9; q=0.3325;Co=q./(a./L+hg.*q./L)Co =0.47373.绘制加速度倒数曲线,计算二档起步加速至70Km/s 的时间Matlab 编写程序如下n=600:4000; r=0.367; nt=0.85; f=0.013; CA=2.77; io=5.83; m=3880; g=9.8; Iw1=1.798; Iw2=3.598; If=0.218;Tq=-19.313+295.27.*n./1000-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;ig1=5.56; Ua1=0.377.*r.*n./(ig1.*io); inv_a1=(m+(Iw1+Iw2)./r.^2+(If.*ig1.^2.*io.^2.*nt)./r.^2)./(Tq.*ig1.*io.*nt./r-m.*g.*f-(CA./21.15).*Ua1.^2);ig2=2.769; Ua2=0.377.*r.*n./(ig2.*io);inv_a2=(m+(Iw1+Iw2)./r.^2+(If.*ig2.^2.*io.^2.*nt)./r.^2)./(Tq.*ig2.*io.*nt./r-m.*g.*f-(CA./21.15).*Ua2.^2);ig3=1.644; Ua3=0.377.*r.*n./(ig3.*io); inv_a3=(m+(Iw1+Iw2)./r.^2+(If.*ig3.^2.*io.^2.*nt)./r.^2)./(Tq.*ig3.*io.*nt./r-m.*g.*f-(CA./21.15).*Ua3.^2);ig4=1.00; Ua4=0.377.*r.*n./(ig4.*io); inv_a4=(m+(Iw1+Iw2)./r.^2+(If.*ig4.^2.*io.^2.*nt)./r.^2)./(Tq.*ig4.*io.*nt./r-m.*g.*f-(CA./21.15).*Ua4.^2);ig5=0.793; Ua5=0.377.*r.*n./(ig5.*io); inv_a5=(m+(Iw1+Iw2)./r.^2+(If.*ig5.^2.*io.^2.*nt)./r.^2)./(Tq.*ig5.*io.*nt./r-m.*g.*f-(CA./21.15).*Ua5.^2);axis([0 80 0 10]);plot(Ua1,inv_a1,Ua2,inv_a2,Ua3,inv_a3,Ua4,inv_a4,Ua5,inv_a5);01020304050607080012345678910Ua(Km/h)i n v a加速度倒数曲线求加速时间tr=0.367;io=5.83;n1=4000;nt=0.85;ig=[5.56 2.769 1.644 1.000.793];If=0.218;Iw1=1.798;Iw2=3.598;m=3880;g=9.8;f=0.013;CA=2.77;for i=1:2Ua=0.377.*r.*n1./(io.*ig(i)):0.00001:0.377.*r.*n1./(io.*ig(i+1));n=Ua.*io.*ig(i+1)./(0.377.*r);Tq=-19.313+295.27.*(n./1000)-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;Ft=Tq.*ig(i+1).*io.*nt./r;Fw=m.*g.*f+(CA./21.15).*Ua.^2;p=1+(Iw1+Iw2+If.*ig(i+1).^2.*io.^2.*nt)./(m.*r.^2);inv_a=p.*m./(Ft-Fw);s=0;s=s+trapz(Ua,inv_a);endUa=0.377.*r.*n1./(io.*ig(3)):0.00001:70;n=Ua.*io.*ig(4)./(0.377.*r);Tq=-19.313+295.27.*(n./1000)-165.44.*(n./1000).^2+40.874.*(n./1000).^3-3.8445.*(n./1000).^4;Ft=Tq.*ig(4).*io.*nt./r;Fw=m.*g.*f+(CA./21.15).*Ua.^2;Iw1=1.798;Iw2=3.598;p=1+(Iw1+Iw2+If.*ig(4).^2.*io.^2.*nt)./(m.*r.^2); inv_a=p.*m./(Ft-Fw);acctime=(s+trapz(Ua,inv_a))./3.6acctime =19.64950.4737。
汽车理论习题Matlab程序
1.3 确定一轻型货车的动力性能(货车可装用4挡或5挡变速器,任选 其中的一种进行整车性能计算):1)绘制汽车驱动力与行驶阻力平衡图。
2)求汽车最高车速,最大爬坡度及克服该坡度时相应的附着率。
3)绘制汽车行驶加速度倒数曲线,用图解积分法求汽车用2档起步加速行驶至70km/h 的车速-时间曲线,或者用计算机求汽车用2档起步加速行驶至70km/h 的加速时间。
轻型货车的有关数据:汽油发动机使用外特性的Tq-n 曲线的拟合公式为23419.313295.27()165.44()40.874() 3.8445()1000100010001000q n n n n T =-+-+-式中,Tq 为发动机转矩(N•m );n 为发动机转速(r/min )。
发动机的最低转速n min =600r/min,最高转速n max =4000r/min 。
装载质量 2000kg 整车整备质量 1800kg 总质量 3880kg 车轮半径 0.367m 传动系机械效率 ηt =0.85 滚动阻力系数 f =0.013 空气阻力系数×迎风面积 C D A =2.77m 2 主减速器传动比 i 0=5.83飞轮转动惯量 I f =0.218kg•m 2 二前轮转动惯量 I w1=1.798kg•m 2 四后轮转动惯量 I w2=3.598kg•m 2质心至前轴距离(满载) a=1.974m 质心高(满载) hg=0.9m解:Matlab 程序:(1) 求汽车驱动力与行驶阻力平衡图和汽车最高车速程序: n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;m=3880;g=9.8;nmin=600;nmax=4000; G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83; L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598; Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;ua=[0:5:120];Ff=G*f;Fw=CDA*ua.^2/21.15;Fz=Ff+Fw;plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5,ua,Fz);title('驱动力-行驶阻力平衡图');xlabel('ua(km/s)');ylabel('Ft(N)');gtext('Ft1'),gtext('Ft2'),gtext('Ft3'),gtext('Ft4'),gtext('Ft5'),gtext('Ff+Fw'); zoom on;[x,y]=ginput(1);zoom off;disp('汽车最高车速=');disp(x);disp('km/h');汽车最高车速=99.3006km/h(2)求汽车最大爬坡度程序:n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;Ff=G*f;Fw1=CDA*ua1.^2/21.15;Fz1=Ff+Fw1;Fi1=Ft1-Fz1;Zoom on;imax=100*tan(asin(max(Fi1/G)));disp('汽车最大爬坡度=');disp(imax);disp('%');汽车最大爬坡度=35.2197%(3)求最大爬坡度相应的附着率和求汽车行驶加速度倒数曲线程序:clearn=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;Fw1=CDA*ua1.^2/21.15;Fw2=CDA*ua2.^2/21.15;Fw3=CDA*ua3.^2/21.15;Fw4=CDA*ua4.^2/21.15;Fw5=CDA*ua5.^2/21.15;Ff=G*f;deta1=1+(Iw1+Iw2)/(m*r^2)+(If*ig(1)^2*i0^2*nT)/(m*r^2); deta2=1+(Iw1+Iw2)/(m*r^2)+(If*ig(2)^2*i0^2*nT)/(m*r^2); deta3=1+(Iw1+Iw2)/(m*r^2)+(If*ig(3)^2*i0^2*nT)/(m*r^2); deta4=1+(Iw1+Iw2)/(m*r^2)+(If*ig(4)^2*i0^2*nT)/(m*r^2); deta5=1+(Iw1+Iw2)/(m*r^2)+(If*ig(5)^2*i0^2*nT)/(m*r^2); a1=(Ft1-Ff-Fw1)/(deta1*m);ad1=1./a1;a2=(Ft2-Ff-Fw2)/(deta2*m);ad2=1./a2;a3=(Ft3-Ff-Fw3)/(deta3*m);ad3=1./a3;a4=(Ft4-Ff-Fw4)/(deta4*m);ad4=1./a4;a5=(Ft5-Ff-Fw5)/(deta5*m);ad5=1./a5;plot(ua1,ad1,ua2,ad2,ua3,ad3,ua4,ad4,ua5,ad5);axis([0 99 0 10]);title('汽车的加速度倒数曲线');xlabel('ua(km/h)');ylabel('1/a');gtext('1/a1');gtext('1/a2');gtext('1/a3');gtext('1/a4');gtext('1/a5'); a=max(a1);af=asin(max(Ft1-Ff-Fw1)/G);C=tan(af)/(a/L+hg*tan(af)/L);disp('假设后轮驱动,最大爬坡度相应的附着率=');disp(C);假设后轮驱动,最大爬坡度相应的附着率=0.4219(4) >>clearnT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;If=0.218;Iw1=1.798;Iw2=3.598;L=3.2;a=1.947;hg=0.9;m=3880;g=9.8;G=m*g; ig=[5.56 2.769 1.644 1.00 0.793];nmin=600;nmax=4000;u1=0.377*r*nmin./ig/i0;u2=0.377*r*nmax./ig/i0;deta=0*ig;for i=1:5deta(i)=1+(Iw1+Iw2)/(m*r^2)+(If*(ig(i))^2*i0^2*nT)/(m*r^2);endua=[6:0.01:99];N=length(ua);n=0;Tq=0;Ft=0;inv_a=0*ua;delta=0*ua;Ff=G*f;Fw=CDA*ua.^2/21.15;for i=1:Nk=i;if ua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(4)n=ua(i)*(ig(4)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elsen=ua(i)*(ig(5)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(5)*i0*nT/r;inv_a(i)=(deta(5)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;enda=delta(1:k);t(i)=sum(a);endplot(t,ua);axis([0 80 0 100]);title('汽车2档原地起步换挡加速时间曲线');xlabel('时间t(s)');ylabel('速度ua(km/h)');>> ginputans =25.8223 70.073725.7467 70.0737所以汽车2档原地起步换挡加速行驶至70km/h的加速时间约为25.8s2.7已知货车装用汽油发动机的负荷特性与万有特性。
汽车理论习题Matlab程序
1、3确定一轻型货车得动力性能(货车可装用4挡或5挡变速器,任选其中得一种进行整车性能计算):1)绘制汽车驱动力与行驶阻力平衡图。
2)求汽车最高车速,最大爬坡度及克服该坡度时相应得附着率.3)绘制汽车行驶加速度倒数曲线,用图解积分法求汽车用2档起步加速行驶至70km/h得车速—时间曲线,或者用计算机求汽车用2档起步加速行驶至70km/h得加速时间。
轻型货车得有关数据:汽油发动机使用外特性得Tq-n曲线得拟合公式为式中,Tq为发动机转矩(N•m);n为发动机转速(r/min)。
发动机得最低转速n min=600r/min,最高转速n max=4000r/min。
装载质量2000kg整车整备质量1800kg总质量3880kg车轮半径0、367m传动系机械效率ηt=0、85滚动阻力系数f=0、013空气阻力系数×迎风面积C DA=2、77m2主减速器传动比i0=5、83飞轮转动惯量If=0、218kg•m2二前轮转动惯量Iw1=1、798kg•m2四后轮转动惯量I w2=3、598kg•m 2变速器传动比ig(数据如下表)轴距L=3、2m质心至前轴距离(满载)a=1、974m质心高(满载)hg=0、9m解:Matlab程序:(1) 求汽车驱动力与行驶阻力平衡图与汽车最高车速程序:n=[600:10:4000];Tq=-19、313+295、27*(n/1000)-165、44*(n/1000)、^2+40、874*(n/1000)、^3-3、8445*(n/1000)、^4;m=3880;g=9、8;nmin=600;nmax=4000;G=m*g;ig=[5、56 2、769 1、644 1、00 0、793];nT=0、85;r=0、367;f=0、013;CDA=2、77;i0=5、83;L=3、2;a=1、947;hg=0、9;If=0、218;Iw1=1、798;Iw2=3、598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0、377*r*n/ig(1)/i0;ua2=0、377*r*n/ig(2)/i0;ua3=0、377*r*n/ig(3)/i0;ua4=0、377*r*n/ig(4)/i0;ua5=0、377*r*n/ig(5)/i0;ua=[0:5:120];Ff=G*f;Fw=CDA*ua、^2/21、15;Fz=Ff+Fw;plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5,ua,Fz);title('驱动力-行驶阻力平衡图');xlabel('ua(km/s)');ylabel('Ft(N)');gtext('Ft1'),gtext(’Ft2'),gtext(’Ft3'),gtext('Ft4'),gtext('Ft5'),gtext(’Ff+Fw’);zoomon;[x,y]=ginput(1);zoom off;disp('汽车最高车速=’);disp(x);disp(’km/h’);汽车最高车速=99、3006km/h(2)求汽车最大爬坡度程序:n=[600:10:4000];Tq=—19、313+295、27*(n/1000)—165、44*(n/1000)、^2+40、874*(n/1000)、^3-3、8445*(n/1000)、^4;m=3880;g=9、8;nmin=600;nmax=4000;G=m*g;ig=[5、562、7691、6441、00 0、793];nT=0、85;r=0、367;f=0、013;CDA=2、77;i0=5、83;L=3、2;a=1、947;hg=0、9;If=0、218;Iw1=1、798;Iw2=3、598;Ft1=Tq*ig(1)*i0*nT/r;ua1=0、377*r*n/ig(1)/i0;Ff=G*f;Fw1=CDA*ua1、^2/21、15;Fz1=Ff+Fw1;Fi1=Ft1—Fz1;Zoomon;imax=100*tan(asin(max(Fi1/G)));disp('汽车最大爬坡度=’);disp(imax);disp(’%’);汽车最大爬坡度=35、2197%(3)求最大爬坡度相应得附着率与求汽车行驶加速度倒数曲线程序:clearn=[600:10:4000];Tq=-19、313+295、27*(n/1000)-165、44*(n/1000)、^2+40、874*(n/1000)、^3-3、8445*(n/1000)、^4;m=3880;g=9、8;nmin=600;nmax=4000;G=m*g;ig=[5、56 2、7691、644 1、00 0、793];nT=0、85;r=0、367;f=0、013;CDA=2、77;i0=5、83;L=3、2;a=1、947;hg=0、9;If=0、218;Iw1=1、798;Iw2=3、598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0、377*r*n/ig(1)/i0;ua2=0、377*r*n/ig(2)/i0;ua3=0、377*r*n/ig(3)/i0;ua4=0、377*r*n/ig(4)/i0;ua5=0、377*r*n/ig(5)/i0;Fw1=CDA*ua1、^2/21、15;Fw2=CDA*ua2、^2/21、15;Fw3=CDA*ua3、^2/21、15;Fw4=CDA*ua4、^2/21、15;Fw5=CDA*ua5、^2/21、15;Ff=G*f;deta1=1+(Iw1+Iw2)/(m*r^2)+(If*ig(1)^2*i0^2*nT)/(m*r^2); deta2=1+(Iw1+Iw2)/(m*r^2)+(If*ig(2)^2*i0^2*nT)/(m*r^2);deta3=1+(Iw1+Iw2)/(m*r^2)+(If*ig(3)^2*i0^2*nT)/(m*r^2); deta4=1+(Iw1+Iw2)/(m*r^2)+(If*ig(4)^2*i0^2*nT)/(m*r^2);deta5=1+(Iw1+Iw2)/(m*r^2)+(If*ig(5)^2*i0^2*nT)/(m*r^2);a1=(Ft1-Ff-Fw1)/(deta1*m);ad1=1、/a1;a2=(Ft2-Ff—Fw2)/(deta2*m);ad2=1、/a2;a3=(Ft3-Ff-Fw3)/(deta3*m);ad3=1、/a3;a4=(Ft4-Ff—Fw4)/(deta4*m);ad4=1、/a4;a5=(Ft5-Ff-Fw5)/(deta5*m);ad5=1、/a5;plot(ua1,ad1,ua2,ad2,ua3,ad3,ua4,ad4,ua5,ad5);axis([099 010]);title('汽车得加速度倒数曲线');xlabel('ua(km/h)’);ylabel('1/a');gtext('1/a1');gtext('1/a2’);gtext(’1/a3');gtext('1/a4');gtext('1/a5');a=max(a1);af=asin(max(Ft1—Ff—Fw1)/G);C=tan(af)/(a/L+hg*tan(af)/L);disp(’假设后轮驱动,最大爬坡度相应得附着率=');disp(C);假设后轮驱动,最大爬坡度相应得附着率=0、4219(4) >>clearnT=0、85;r=0、367;f=0、013;CDA=2、77;i0=5、83;If=0、218;Iw1=1、798;Iw2=3、598;L=3、2;a=1、947;hg=0、9;m=3880;g=9、8;G=m*g;ig=[5、56 2、7691、644 1、00 0、793];nmin=600;nmax=4000;u1=0、377*r*nmin、/ig/i0;u2=0、377*r*nmax、/ig/i0;deta=0*ig;fori=1:5deta(i)=1+(Iw1+Iw2)/(m*r^2)+(If*(ig(i))^2*i0^2*nT)/(m*r^2);endua=[6:0、01:99];N=length(ua);n=0;Tq=0;Ft=0;inv_a=0*ua;d elta=0*ua;Ff=G*f;Fw=CDA*ua、^2/21、15;for i=1:Nk=i;ifua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0、377;Tq=-19、313+295、27*(n/1000)-165、44*(n/1000)^2+40、874*(n/1000)^3—3、8445*(n/1000)^4;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff—Fw(i));delta(i)=0、01*inv_a(i)/3、6;elseifua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0、377;Tq=—19、313+295、27*(n/1000)—165、44*(n/1000)^2+40、874*(n/1000)^3-3、8445*(n/1000)^4;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft—Ff-Fw(i));delta(i)=0、01*inv_a(i)/3、6;elseif ua(i)〈=u2(4)n=ua(i)*(ig(4)*i0/r)/0、377;Tq=—19、313+295、27*(n/1000)—165、44*(n/1000)^2+40、874*(n/1000)^3-3、8445*(n/1000)^4;Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i));delta(i)=0、01*inv_a(i)/3、6;elsen=ua(i)*(ig(5)*i0/r)/0、377;Tq=-19、313+295、27*(n/1000)-165、44*(n/1000)^2+40、874*(n/1000)^3-3、8445*(n/1000)^4;Ft=Tq*ig(5)*i0*nT/r;inv_a(i)=(deta(5)*m)/(Ft-Ff—Fw(i));delta(i)=0、01*inv_a(i)/3、6;enda=delta(1:k);t(i)=sum(a);endplot(t,ua);axis([080 0100]);title('汽车2档原地起步换挡加速时间曲线’);xlabel(’时间t(s)’);ylabel(’速度ua(km/h)');>〉ginputans =25、8223 70、073725、746770、0737所以汽车2档原地起步换挡加速行驶至70km/h得加速时间约为25、8s2、7已知货车装用汽油发动机得负荷特性与万有特性。
汽车理论图形MATLAB程序
汽车理论图形MATLAB程序功率平衡图m=1230;g=9.8;ig=[3.615 2.053 1.393 1.031 0.837]; i0=3.75;r=0.31;yt=0.9;f=0.017;CD=0.31;A=2.2;np=6000;Pemax=83;%绘制汽车驱动力与行驶阻力平衡图for i=1:56;n=500:100:6000;Pe(i)=Pemax*(n(i)/np+(n(i)/np)^2-(n(i)/np)^3); Tq(i)=9549*Pe(i)/n(i);endfor j=1:5for i=1:56Ft(i,j)=Tq(i)*ig(j)*i0*yt/r;ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Fz(i,j)=m*g*f+CD*A*(ua(i,j)^2)/21.15;endendfigureplot(ua,Ft,ua,Fz);title('汽车驱动力与行驶阻力平衡图');xlabel('ua(km/h)');ylabel('Ft(N)');text(20,6700,'Ft1');text(40,4000,'Ft2');text(50,2800,'Ft3');text(80,2000,'Ft4');text(100,1600, 'Ft5');text(100,800,'Ff+Fw');for k=1:56;n=500:100:6000;Pe(k)=Pemax*(n(k)/np+(n(k)/np)^2-(n(k)/np)^3); Tq(k)=9549*Pe(k)/n(k);Ft(k)=T q(k)*ig(4)*i0*yt/r;ua(k)=0.377*r*n(k)/(ig(4)*i0);Fz(k)=m*g*f+CD*A*(ua(k)^2)/21.15;E(k)=abs((Ft(k)-Fz(k)));end[Emin,kmin]=min(E);Umax=ua(kmin)加速度曲线图m=1230;g=9.8;ig=[3.615 2.053 1.393 1.031 0.837]; i0=3.75;r=0.31;yt=0.9;f=0.017;CD=0.31;A=2.2;np=6000;Pemax=83;deta=[1.33 1.12 1.07 1.05 1.04];for i=1:56;n=500:100:6000;Pe(i)=Pemax*(n(i)/np+(n(i)/np)^2-(n(i)/np)^3); Tq(i)=9549*Pe(i)/n(i);endfor j=1:5for i=1:56Ft(i,j)=Tq(i)*ig(j)*i0*yt/r;ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Fz(i,j)=m*g*f+CD*A*(ua(i,j)^2)/21.15;a(i,j)=(Ft(i,j)-Fz(i,j))/(deta(j)*m);b(i,j)= 1./a(i,j);endendx1=ua(:,1);y1=b(:,1);x2=ua(:,2);y2=b(:,2);x3=ua(:,3);y3=b(:,3);x4=ua(:,4);y4=b(:,4);x5=ua(:,5);y5=b(:,5);figureplot(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5);axis([0 185 0 15]);title('汽车行驶加速度倒数曲线');xlabel('ua(km/h)');ylabel('1/a');汽车二挡原地起步加速时间nT=0.9;r=0.31;f=0.0177;CD=0.31;A=2.2;;i0=3.75;m=3880;g=9.8;Pemax=83;np=6000;G=m*g; ig=[3.615 2.053 1.393 1.031 0.837];nmin=600;nmax=6000;u1=0.377*r*nmin./ig/i0;u2=0.377*r*nmax./ig/i0;deta=[1.33 1.12 1.07 1.05 1.04];ua=[1:0.01:180];N=length(ua);n=0;T q=0;Ft=0;inv_a=0*ua;del ta=0*ua; Ff=G*f;Fw=CD*A*ua.^2/21.15;for i=1:Nk=i;if ua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0.377;Tq=9549*(Pemax*(n/np+(n/np)^2-(n/np)^3))/n;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0.377;Tq=9549*(Pemax*(n/np+(n/np)^2-(n/np)^3))/n;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(4)n=ua(i)*(ig(4)*i0/r)/0.377;Tq=9549*(Pemax*(n/np+(n/np)^2-(n/np)^3))/n;Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elsen=ua(i)*(ig(5)*i0/r)/0.377;Tq=9549*(Pemax*(n/np+(n/np)^2-(n/np)^3))/n;Ft=Tq*ig(5)*i0*nT/r;inv_a(i)=(deta(5)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;enda=delta(1:k);t(i)=sum(a);endplot(t,ua);axis([0 80 0 100]);title('汽车2档原地起步换挡加速时间曲线'); xlabel('时间t(s)'); ylabel('速度ua(km/h)');功率平衡图m=1230;g=9.8;ig=[3.615 2.053 1.393 1.031 0.837]; i0=3.75;r=0.31;yt=0.9;f=0.017;CD=0.31;A=2.2;np=6000;Pemax=83;deta=[1.33 1.12 1.07 1.05 1.04];for j=1:5for i=1:56;n=500:100:6000;Pe(i)=Pemax*(n(i)/np+(n(i)/np)^2-(n(i)/np)^3);Tq(i)=9549*Pe(i)/n(i);ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Pz(i,j)=(m*g*f*ua(i,j)/3600+CD*A*ua(i,j)^3/76140)/yt; endendplot(ua,Pe,ua,Pz);title('功率平衡图');xlabel('ua(km/h)');ylabel('P(kW)');text(40,90,'一档Pe');text(80,90,'二档Pe');text(110,90,'三档Pe');text(150,90,'四档Pe');text(200,90,'五档Pe');text(100,25,'Pz');%绘制最高档和次高档的等速百公里油耗曲线n0=[815,1207,1614,2012,2603,3006,3403,3804];for j=1:5for i=1:8Pd(i)=Pemax*(n0(i)/np+(n0(i)/np)^2-(n0(i)/np)^3); Td(i)=9549*Pd(i)/n0(i);u(i,j)=0.377*r*n0(i)/(ig(j)*i0);endendb(1)=1326.8-416.46*Pd(1)+72.379*Pd(1)^2-5.8629*Pd(1)^3+0.17768*Pd(1)^4;b(2)=1354.7-303.98*Pd(2)+36.657*Pd(2)^2-2.0553*Pd(2)^3+0.043072*Pd(2)^4;b(3)=1284.4-189.75*Pd(3)+14.524*Pd(3)^2-0.51184*Pd(3)^3+0.0068164*Pd(3)^4;b(4)=1122.9-121.59*Pd(4)+7.0035*Pd(4)^2-0.18517*Pd(4)^3+0.0018555*Pd(4)^4;b(5)=1141.0-98.893*Pd(5)+4.4763*Pd(5)^2-0.091077*Pd(5)^3+0.00068906*Pd(5)^4;b(6)=1051.2-73.714*Pd(6)+2.8593*Pd(6)^2-0.05138*Pd(6)^3+0.00035032*Pd(6)^4;b(7)=1233.9-84.478*Pd(7)+2.9788*Pd(7)^2-0.047449*Pd(7)^3+0.00028230*Pd(7)^4;b(8)=1129.7-45.291*Pd(8)+0.71113*Pd(8)^2+0.00075215*Pd(8)^3-0.000038568*Pd(8)^4; u1=u(:,1)';u2=u(:,2)';u3=u(:,3)';u4=u(:,4)';u5=u(:,5)';B1=polyfit(u1,b,3);B2=polyfit(u2,b,3);B3=polyfit(u3,b,3);B4=polyfit(u4,b,3);B5=polyfit(u5,b,3);for k=1:56bh(k,1)=polyval(B1,ua(k,1));bh(k,2)=polyval(B2,ua(k,2));bh(k,3)=polyval(B3,ua(k,3));bh(k,4)=polyval(B4,ua(k,4));bh(k,5)=polyval(B5,ua(k,5));endfor i=1:5for k=1:56Q(k,i)=Pz(k,i)*bh(k,i)/(1.02*ua(k,i)*7.10);endendplot(ua(:,4),Q(:,4),ua(:,5),Q(:,5));axis([0 185 0 20]);title('最高档(五档)和次高档(四档)等速百公里油耗图'); xlabel('ua(km/h)');ylabel('Qs(L/100km)');text(90,10,'四档');text(125,10,'五档');爬坡度图m=1230;g=9.8;G=m*g;ig=[3.615 2.053 1.393 1.031 0.837]; i0=3.75;r=0.31;yt=0.9;f=0.017;CD=0.31;A=2.2;np=6000;Pemax=83;for i=1:56;n=500:100:6000;Pe(i)=Pemax*(n(i)/np+(n(i)/np)^2-(n(i)/np)^3);Tq(i)=9549*Pe(i)/n(i);endfor j=1:5for i=1:56Ft(i,j)=Tq(i)*ig(j)*i0*yt/r;ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Fz(i,j)=m*g*f+CD*A*(ua(i,j)^2)/21.15;F=Ft-Fz;I=tan(asin(Ft/G))*100;endendplot(ua,I);hold on;title('汽车的爬坡度图');xlabel('ua(km/h)');ylabel('i(%)');text(50,55,'一档');text(50,35,'二档');text(100,22,'三档');text(150,15,'四档');text(200,13,'五档');动力因数图m=1230;g=9.8;G=m*g;ig=[3.615 2.053 1.393 1.031 0.837]; i0=3.75;r=0.31;yt=0.9;f=0.017;CD=0.31;A=2.2;np=6000;Pemax=83;%绘制汽车驱动力与行驶阻力平衡图for i=1:56;n=500:100:6000;Pe(i)=Pemax*(n(i)/np+(n(i)/np)^2-(n(i)/np)^3); Tq(i)=9549*Pe(i)/n(i);endfor j=1:5for i=1:56Ft(i,j)=Tq(i)*ig(j)*i0*yt/r;ua(i,j)=0.377*r*n(i)/(ig(j)*i0); Fw(i,j)=CD*A*(ua(i,j)^2)/21.15; F=Ft-Fw;D=F/G;endendplot(ua,D);hold on;axis([0 190 0 0.6]);title('汽车的动力特性图'); xlabel('ua(km/h)');ylabel('动力因数)');text(40,0.5,'一档');text(60,0.3,'二档');text(100,0.2,'三档');text(140,0.1,'四档');text(140,0.04,'五档');。
汽车理论1.3和2.7matlab编程答案
孙野 200812681.3(1)绘制汽车驱动力与行驶阻力平衡图 选用5挡变速器进行整车性能计算发动机转速与汽车行驶速度之间的关系:0377.0i i rn u g a = 发动机使用外特性的T q -n 曲线拟合公式:432)1000(8445.3)1000(874.40)1000(44.165)1000(27.295313.19n n n n T q -+-+-=汽车驱动力:ri i T F Tg q t η0=行驶阻力:2215.2115.21a D a D j w i f u A C mgf dt du m u A C Gi Gf F F F F +=+++=+++δ用matlab 编写程序如下: m1=2000; m2=1800; mz=3880; g=9.81; r=0.367; CdA=2.77; f=0.013; nT=0.85; ig=[5.56 2.769 1.644 1.00 0.793];i0=5.83; If=0.218; Iw1=1.798; Iw2=3.598; %输入已知参数 Iw=2*Iw1+4*Iw2; fori=1:69n(i)=(i+11)*50;Ttq(i)=-19.313+295.27*(n(i)/1000)-165.44*(n(i)/1000)^2+40.874*(n(i)/1000)^3-3.8445*(n(i)/1000)^4; end %从600~4000rpm 油拟合公式计算发动机转距 for j=1:5 fori=1:69Ft(i,j)=Ttq(i)*ig(j)*i0*nT/r; ua(i,j)=0.377*r*n(i)/(ig(j)*i0);Fz(i,j)=CdA*ua(i,j)^2/21.15+mz*g*f;endend%计算各档位下的驱动力和行驶阻力plot(ua,Ft,ua,Fz)title('汽车驱动力与行驶阻力平衡图'); xlabel('ua(km/h)');ylabel('Ft(N)');%作汽车驱动力与行驶阻力平衡图得到汽车驱动力与行驶阻力平衡图如下:(2)①计算汽车最高车速Matlab程序如下:for k=1:175 n1(k)=3300+k*0.1;Ttq(k)=-19.313+295.27*(n1(k)/1000)-165.44*(n1(k)/1000)^2+40.874*(n1(k)/1000)^33.8445*(n1(k)/1000)^4;Ft(k)=Ttq(k)*ig(5)*i0*nT/r;ua(k)=0.377*r*n1(k)/(ig(5)*i0);Fz(k)=CdA*ua(k)^2/21.15+mz*g*f;E(k)=abs((Ft(k)-Fz(k)));end%从3300rpm开始以0.1rpm为步长搜索直到找到for k=1:175 %驱动力与行驶阻力之差绝对值最小点(Ⅴ档处) if(E(k)==min(E))%通过其他检验程序可估计出该点大致位置(3310rpm附近) disp('汽车最高车速='); disp(ua(k));disp('km/h');end%输出结果end汽车最高车速=98.7627km/h计算得汽车最高车速为98.7627km/h。
汽车动力性计算matlab程序
%% 汽车动力性计算(自己编的动力性计算程序,供大家计算动力性时参考,具体参数大家根据所给程序对应输入,并对坐标轴数值按需要进行修改)clc; clear;close all;%%根据所给发动机数据拟合外特性曲线(发动机数据按照你所得到的数据进行输入)n_test=[500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200];T_test=[975 1108 1298 1496 1546 1620 1670 1785 1974 1974 1970 1889 1829 1748 1669 1700 1524 1105];figure(1)plot(n_test,T_test,'g');hold ongrid on%p=polyfit(n_test,T_test,7);p=polyfit(n_test,T_test,2);n=[450:1:2200];Ttq=polyval(p,n);plot(n,Ttq,'k');xlabel('发动机转速n(r/min)');ylabel('发动机转矩Ttq(N*m)');title('发动机转矩曲线');legend('测试曲线','拟合曲线');%%所给车型动力总成相关参数ig=[3.07 2.16 1.48 1.0 0.82];i0=4.0; eta=0.78; r=0.57; M=25000; g=9.8; c=1.5; f0=0.01; f1=0.0002; f4=0.0005; CD=1; A=8;Iw=3.6;If=0.04;%% 发动机外特性曲线图figure(2)hold ongrid onfor i=length(n);Pe=Ttq.*n/9550;end[AX,H1,H2]=plotyy(n,Ttq,n,Pe);xlabel('发动机转速n(r/min)');ylabel('发动机转矩Ttq(N*m)');ylabel(AX(2),'发动机功率Pe(Kw)');title('发动机外特性曲线');%% 各挡位速度曲线%计算各挡位车速for i=1:length(ig);ua(i,:)=0.377*r*n/ig(i)/i0;end%计算各档位最高车速uamax=ua(:,length(ua(1,:)));figure(3)hold onfor i=1:length(ig);plot(n,ua(i,:),'k');endhold ongrid onxlabel('转速n(r/min)');ylabel('各挡位车速(km/h)');title('各挡位车速-转速表');legend('1挡车速','2挡车速','3挡车速','4挡车速','5挡车速'); %% 驱动力和行驶阻力平衡图%计算滚动阻力系数for i=1:length(ig);f(i,:)=f0+f1*(ua(i,:)/100)+f4*(ua(i,:)/100).^4;end%计算滚动阻力for i=1:length(ig);Ff(i,:)=c*M*g*f(i,:);end%计算空气阻力for i=1:length(ig);Fw(i,:)=CD*A*(ua(i,:).^2)/21.15; end%计算行驶阻力for i=1:length(ig);F(i,:)=Ff(i,:)+Fw(i,:);end%计算汽车驱动力for i=1:length(ig);Ft(i,:)=Ttq*ig(i)*i0*eta/r;endfigure(4)hold onfor i=1:length(ig);plot(ua(i,:), Ft(i,:),'k');plot(ua(i,:), F(i,:),'r');plot(ua(i,:), Ff(i,:),'b');endhold ongrid onxlabel('车速(km/h)');ylabel('驱动力、行驶阻力(N)');legend('驱动力Ft','行驶阻力Ff+Fw','滚动阻力Ff'); title('驱动力-行驶阻力平衡图');%% 汽车功率平衡图%计算各档位功率for i=1:length(ig);P(i,:)=Ft(i,:).*ua(i,:)/(3600*eta);end%计算风阻阻力功率for i=1:length(ig);Pw(i,:)=CD*A*ua(i,:).^3/(76140*eta);end%计算滚动阻力功率for i=1:length(ig);Pf(i,:)=M*g*f(i,:).*ua(i,:)/(3600*eta);end%计算总阻力功率for i=1:length(ig);Pz(i,:)=Pw(i,:)+Pf(i,:);endfigure(5)hold onfor i=1:length(ig);plot(ua(i,:), P(i,:),'k');plot(ua(i,:), Pz(i,:),'r');endhold ongrid onxlabel('车速(km/h)');ylabel('发动机功率、阻力功率(kW)');legend('发动机功率P','阻力功率Pz','Location','NorthWest'); title('功率平衡图');%% 动力特性图(动力因数图)for i=1:length(ig);D(i,:)= (Ft(i,:)- Fw(i,:))/M/g;endfigure(6)hold onfor i=1:length(ig);plot(ua(i,:), D(i,:),'k');plot(ua(i,:), f(i,:),'r');endhold ongrid onxlabel('车速(km/h)');ylabel('动力因数D');legend('动力因数D','滚动阻力系数f');title('动力特性图');%% 爬坡度曲线图for i=1:length(ig);I(i,:)= (tan(asin((Ft(i,:)-(Ff(i,:)+Fw(i,:)))/(M*g))))*100; endfigure(7)hold onfor i=1:length(ig);if i==1plot(ua(i,:),I(i,:),'r');elseplot(ua(i,:),I(i,:),'k');endendhold ongrid onxlabel('车速(km/h)');ylabel('最大爬坡度(%)');legend('Ⅰ挡','高速档');title('爬坡度曲线图');%% 加速度曲线图deta=1+1/M*4*Iw/r^2+1/M*If*ig.^2*i0^2*eta/r^2; for i=1:length(ig);a(i,:)=(Ft(i,:)-Ff(i,:)-Fw(i,:))./deta(i)/M;if i==5for j=1:length(n)if a(i,j)<0a(i,j)=0;elseendendendendfigure(8)hold onfor i=1:length(ig);if i==1plot(ua(i,:),a(i,:),'r'); elseplot(ua(i,:),a(i,:),'k');endendhold ongrid onxlabel('车速(km/h)');ylabel('加速度a(m/s^2)');legend('Ⅰ档','高速档');title('加速度曲线图');axis([0 120 0 1.5])%% 加速度倒数曲线for i=1:length(ig);for j=1:length(n)b(i,j)=1./a(i,j);endendfigure(9)hold onfor i=1:length(ig)plot(ua(i,:),b(i,:),'k');endhold ongrid onxlabel('车速(km/h)');ylabel('各档加速度倒数1/a');legend('各档加速度倒数1/a曲线','Location','NorthWest'); title('各档加速度倒数曲线图');axis([0 120 0 10])ad1=b(1,:);ad2=ua(1,:);for i=1:(length(ig)-1);for j=1:length(n)if ua(i+1,j)>=ua(i,length(n)) flag(i)=j;break;endendad1=[ad1 b(i+1,j:length(n))]; ad2=[ad2 ua(i+1,j:length(n))];endfigure(10)hold onplot(ad2,ad1,'k');hold ongrid onxlabel('车速(km/h)');ylabel('加速度倒数1/a');legend('加速度倒数1/a曲线','Location','NorthWest');title('加速度倒数曲线图');axis([0 120 0 10])%% 加速时间曲线k=length(n);for i=1:length(ig);t(i,1)=0;for j=2:kt(i,j)=abs(ua(i,j)-ua(i,j-1))*(b(i,j)+b(i,j-1))/2;endendfor i=1:length(ig);for j=1:kat(i,j)=sum(t(i,1:j))/3.6;endendtotalat=at(1,:);for i=1:(length(ig)-1);for j=flag(i):ktotalat=[totalat totalat(length(totalat))+t(i+1,j)/3.6];endendfigure(11)hold onplot(totalat,ad2,'k');hold ongrid onxlabel('时间(s)');ylabel('车速(km/h)');legend('加速时间','Location','NorthWest'); title('加速时间曲线图');axis([0 100 0 120])Welcome To Download !!!欢迎您的下载,资料仅供参考!。
汽车理论习题Matlab程序文件
1.3 确定一轻型货车的动力性能(货车可装用4挡或5挡变速器,任选 其中的一种进行整车性能计算):1)绘制汽车驱动力与行驶阻力平衡图。
2)求汽车最高车速,最大爬坡度及克服该坡度时相应的附着率。
3)绘制汽车行驶加速度倒数曲线,用图解积分法求汽车用2档起步加速行驶至70km/h 的车速-时间曲线,或者用计算机求汽车用2档起步加速行驶至70km/h 的加速时间。
轻型货车的有关数据:汽油发动机使用外特性的Tq -n 曲线的拟合公式为23419.313295.27()165.44()40.874() 3.8445()1000100010001000q n n n n T =-+-+- 式中,Tq 为发动机转矩(N•m );n 为发动机转速(r/min )。
发动机的最低转速n min =600r/min,最高转速n max =4000r/min 。
装载质量 2000kg整车整备质量 1800kg总质量 3880kg车轮半径 0.367m传动系机械效率 ηt =0.85滚动阻力系数 f =0.013空气阻力系数×迎风面积 C D A =2.77m 2主减速器传动比 i 0=5.83飞轮转动惯量 I f =0.218kg•m 2二前轮转动惯量 I w1=1.798kg•m 2四后轮转动惯量 I w2=3.598kg•m 2变速器传动比 ig(数据如下表)轴距L=3.2m质心至前轴距离(满载)a=1.974m质心高(满载)hg=0.9m解:Matlab程序:(1) 求汽车驱动力与行驶阻力平衡图和汽车最高车速程序:n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;ua=[0:5:120];Ff=G*f;Fw=CDA*ua.^2/21.15;Fz=Ff+Fw;plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5,ua,Fz);title('驱动力-行驶阻力平衡图');xlabel('ua(km/s)');ylabel('Ft(N)');gtext('Ft1'),gtext('Ft2'),gtext('Ft3'),gtext('Ft4'),gtext('Ft5'),gtext('Ff+Fw'); zoom on;[x,y]=ginput(1);zoom off;disp('汽车最高车速=');disp(x);disp('km/h');汽车最高车速=99.3006km/h(2)求汽车最大爬坡度程序:n=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;Ff=G*f;Fw1=CDA*ua1.^2/21.15;Fz1=Ff+Fw1;Fi1=Ft1-Fz1;Zoom on;imax=100*tan(asin(max(Fi1/G)));disp('汽车最大爬坡度=');disp(imax);disp('%');汽车最大爬坡度=35.2197%(3)求最大爬坡度相应的附着率和求汽车行驶加速度倒数曲线程序:clearn=[600:10:4000];Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/10 00).^4;m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.56 2.769 1.644 1.00 0.793];nT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;L=3.2;a=1.947;hg=0.9;If=0.218;Iw1=1.798;Iw2=3.598;Ft1=Tq*ig(1)*i0*nT/r;Ft2=Tq*ig(2)*i0*nT/r;Ft3=Tq*ig(3)*i0*nT/r;Ft4=Tq*ig(4)*i0*nT/r;Ft5=Tq*ig(5)*i0*nT/r;ua1=0.377*r*n/ig(1)/i0;ua2=0.377*r*n/ig(2)/i0;ua3=0.377*r*n/ig(3)/i0;ua4=0.377*r*n/ig(4)/i0;ua5=0.377*r*n/ig(5)/i0;Fw1=CDA*ua1.^2/21.15;Fw2=CDA*ua2.^2/21.15;Fw3=CDA*ua3.^2/21.15;Fw4=CDA*ua4.^2/21.15;Fw5=CDA*ua5.^2/21.15;Ff=G*f;deta1=1+(Iw1+Iw2)/(m*r^2)+(If*ig(1)^2*i0^2*nT)/(m*r^2); deta2=1+(Iw1+Iw2)/(m*r^2)+(If*ig(2)^2*i0^2*nT)/(m*r^2); deta3=1+(Iw1+Iw2)/(m*r^2)+(If*ig(3)^2*i0^2*nT)/(m*r^2); deta4=1+(Iw1+Iw2)/(m*r^2)+(If*ig(4)^2*i0^2*nT)/(m*r^2); deta5=1+(Iw1+Iw2)/(m*r^2)+(If*ig(5)^2*i0^2*nT)/(m*r^2); a1=(Ft1-Ff-Fw1)/(deta1*m);ad1=1./a1;a2=(Ft2-Ff-Fw2)/(deta2*m);ad2=1./a2;a3=(Ft3-Ff-Fw3)/(deta3*m);ad3=1./a3;a4=(Ft4-Ff-Fw4)/(deta4*m);ad4=1./a4;a5=(Ft5-Ff-Fw5)/(deta5*m);ad5=1./a5;plot(ua1,ad1,ua2,ad2,ua3,ad3,ua4,ad4,ua5,ad5);axis([0 99 0 10]);title('汽车的加速度倒数曲线');xlabel('ua(km/h)');ylabel('1/a');gtext('1/a1');gtext('1/a2');gtext('1/a3');gtext('1/a4');gtext('1/a5'); a=max(a1);af=asin(max(Ft1-Ff-Fw1)/G);C=tan(af)/(a/L+hg*tan(af)/L);disp('假设后轮驱动,最大爬坡度相应的附着率=');disp(C);假设后轮驱动,最大爬坡度相应的附着率=0.4219(4)>>clearnT=0.85;r=0.367;f=0.013;CDA=2.77;i0=5.83;If=0.218;Iw1=1.798;Iw2=3.598;L=3.2;a=1.947;hg=0.9;m=3880;g=9.8; G=m*g; ig=[5.56 2.769 1.644 1.00 0.793];nmin=600;nmax=4000;u1=0.377*r*nmin./ig/i0;u2=0.377*r*nmax./ig/i0;deta=0*ig;for i=1:5deta(i)=1+(Iw1+Iw2)/(m*r^2)+(If*(ig(i))^2*i0^2*nT)/(m*r^2);endua=[6:0.01:99];N=length(ua);n=0;Tq=0;Ft=0;inv_a=0*ua;delta=0*ua;Ff=G*f;Fw=CDA*ua.^2/21.15;for i=1:Nk=i;if ua(i)<=u2(2)n=ua(i)*(ig(2)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(2)*i0*nT/r;inv_a(i)=(deta(2)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(3)n=ua(i)*(ig(3)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(3)*i0*nT/r;inv_a(i)=(deta(3)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elseif ua(i)<=u2(4)n=ua(i)*(ig(4)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(4)*i0*nT/r;inv_a(i)=(deta(4)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;elsen=ua(i)*(ig(5)*i0/r)/0.377;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000)^2+40.874*(n/1000)^3-3.8445*(n/100 0)^4;Ft=Tq*ig(5)*i0*nT/r;inv_a(i)=(deta(5)*m)/(Ft-Ff-Fw(i));delta(i)=0.01*inv_a(i)/3.6;enda=delta(1:k);t(i)=sum(a);endplot(t,ua);axis([0 80 0 100]);title('汽车2档原地起步换挡加速时间曲线');xlabel('时间t(s)');ylabel('速度ua(km/h)');>> ginputans =25.8223 70.073725.7467 70.0737所以汽车2档原地起步换挡加速行驶至70km/h 的加速时间约为25.8s2.7已知货车装用汽油发动机的负荷特性与万有特性。
mathlab汽车动力匹配程序
附:计算使用的MATLAB程序代码及其含义%不同i0对应车速为40、50、60时的发动机转数clearclcclose allr=0.4275; %车轮半径u0=[40 50 60]; %速度i0=[4.22 4.68 4.88 5.01 5.28 5.48]; %主减速比n=(i0'*u0)/(0.377*r); %对应发动机转数n%加速燃油消耗率clearclcclose allyita=0.89;G=9160*9.8;f=0.02;CDA=4.64;a=0.1704;Iw1=1.798;Iw2=3.598;r=0.4 275;m=9160;If=0.218;ig=1;i0=[4.22,4.68,4.88,5.01,5.28,5.48];for x=1:1:6n=1000:100:2800; %等距取数ua5=(0.377*r.*n)/i0(x); %求转数对应车速F5=f*G+CDA*(ua5.^2)/21.15; %求阻力P_fw5=F5.*ua5./(yita*3.6*1000); %阻力功率ua0=50:1:60; %50到60公里加速ua1=50:1:60;delta=1+(Iw1+Iw2)/(m*r^2)+(If*ig^2*i0(x)^2*yita)/(m*r^2);%求旋转质量换算系数P0=(G*f.*ua0./3600+CDA.*ua0.^3/76140+(delta*m.*ua0/3600)*a)/yita;%初速度为ua0时的阻力功率P=(G*f.*ua1/3600+CDA.*ua1.^3/76140+(delta*m.*ua1/3600)*a)/yita;%末速度为ua1时的阻力功率b1=0.0133.*P.^2-2.0715.*P+287.47; %燃油消耗率Qt=P.*b1./(367.1.*8); %燃油消耗i1=size(Qt); %求Qt向量长度i=i1(2);Qt1=Qt(2:i-1);dt=1/(3.6*a); %速度每增加1km/h所需要的时间q=(Qt(1)+Qt(i))*dt./2+sum(Qt1)*dt; %加速段燃油消耗量qend%减速油耗clearclcclose allua1=60;ua2=40;a=0.2584;Qi=191;Q=(8*Qi)/(367.1*8); %计算怠速燃油消耗Qd=((ua1-ua2)*Q)/(3.6*a); %减速燃油消耗Qd%六工况油耗clearclcclose allQ=[237.1422 238.6344 241.21566 241.6732 244.3986 246.7512];Qs=(Q./(125+175+1000))*100 %六工况燃油消耗量clearclcclose alln1=linspace(0,50000); %先求各个档位的驱动力nmax=2800;nmin=1000;r=0.4275;yita=0.89;CDA=4,64;f=0.02;G=(9160)*9.8;ig= [8.69,5.01,2.91,1.7,1.00];i0=5.01;for i=1:1:5 %i为档数uamax(i)=chesu(nmax,r,ig(i),i0); %计算各个档位的最大速度与最小速度uamin(i)=chesu(nmin,r,ig(i),i0);ua(i,:)=linspace(uamin(i),uamax(i),30);n(i,:)=zhuansu(ua(i,:),r,ig(i),i0); %计算各个档位的转速范围Ttq(i,:)=zhuanju(n(i,:)); %求出各档位的转矩范围Ft(i,:)=qudongli(Ttq(i,:),ig(i),i0,yita,r); %求出驱动力F(i,:)=f*G+CDA*(ua(i,:).^2)/21.15; %求出滚动阻力和空气阻力的和delta(i,:)=1+(1.798+3.598+0.218*(ig(i)^2)*(i0^2)*yita)/(9160*r^2); %转动质量换算系数a(i,:)=1./(delta(i,:).*14000./(Ft(i,:)-F(i,:))); %求出加速度c=1./a(i,:);plot(ua,c);title('加速度倒数曲线');xlabel('ua'); %x轴名称ylabel('1/a'); %y轴名称F2(i,:)=Ft(i,:)-F(i,:);endtemp1(1,:)=ua(2,:)/3.6; %下面分各个档位进行积分,求出加速时间temp1(2,:)=1./a(2,:);n1=1;for j1=1:1:30if ua(3,j1)>max(ua(2,:))&&ua(3,j1)<=90temp2(1,n1)=ua(3,j1)/3.6;temp2(2,n1)=1./a(3,j1);n1=n1+1;endendn2=1;for j1=1:1:30if ua(4,j1)>max(ua(3,:))&&ua(4,j1)<=90;temp3(1,n2)=ua(4,j1)/3.6;temp3(2,n2)=1./a(4,j1);n2=n2+1;endendn3=1;for j1=1:1:30if ua(5,j1)>max(ua(4,:))&&ua(5,j1)<=90;temp4(1,n3)=ua(5,j1)/3.6;temp4(2,n3)=1./a(5,j1);n3=n3+1;endendy=temp1(1,1)*temp1(2,1)+qiuji(temp1(1,:),temp1(2,:))+qiuji(temp2(1,:),t emp2(2,:))+qiuji(temp3(1,:),temp3(2,:))+qiuji(temp4(1,:),temp4(2,:));ygtext('ig1'),gtext('ig2'),gtext('ig3');gtext('ig4');gtext('ig5');function ua=chesu(n,r,ig,i0); %由转速计算车速ua=0.377*r.*n/(ig*i0);function n=zhuansu(ua,r,ig,i0); %求转速n=ig*i0.*ua./(0.377*r);endfunction y=zhuanju(n); %求转矩函数y=-6.4e-5*n.^2+0.2453*n+139.69;function y=qudongli(Ttq,ig,i0,yita,r); %求驱动力函数y=(ig*i0*yita.*Ttq)/r;end%C曲线clearclcclose allb=[18.2417 18.5902 18.7999 18.9809]; %燃油消耗t=[36.1848 33.8979 32.0154 28.4538]; %加速时间plot(b,t,'+r') %绘制i0散点图用+表示hold on; %保持图像b1=linspace(b(1),b(4),100); %b1到b4划100点t1=spline(b,t,b1); %三次样条差值plot(b1,t1); %绘制c曲线title('燃油经济性—加速时间曲线'); %图表标题xlabel('百公里油耗(L/100km)'); %x轴名称ylabel('加速时间s'); %y轴名称gtext('i0=4.22'),gtext('i0=5.01'),gtext('i0=5.28');gtext('i0=5.48');%驱动力图clearclcclose allm=9160;uamax=90; %最大车速imax=0.3; %最大爬坡度Ttqmax=380; %发动机最大转矩nPemax=2800; %最大功率转数d=0.855; %轮胎直径r=d/2; %轮胎半径Ttq=[331,341,355,367,375,386,370,351,340,323]; %发动机转矩n=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800]; %发动机转数io=(0.377*r*2800)/uamax; %最小传动比afamax=atan(imax); %最大爬坡度角度aitT=0.89;g=9.8;f=0.02;ig1=8.69;ig5=1;ig4=1.7ig3=2.91;ig2=5.01;ua1=(0.377*r*n)/(ig1*io); %一档对应车速ua2=(0.377*r*n)/(ig2*io);ua3=(0.377*r*n)/(ig3*io);ua4=(0.377*r*n)/(ig4*io);ua5=(0.377*r*n)/(ig5*io);Ft1=(Ttq*ig1*io*aitT)/(1000*r); %一档对应驱动力Ft2=(Ttq*ig2*io*aitT)/(1000*r);Ft3=(Ttq*ig3*io*aitT)/(1000*r);Ft4=(Ttq*ig4*io*aitT)/(1000*r);Ft5=(Ttq*ig5*io*aitT)/(1000*r);figure,plot(ua1,Ft1,ua2,Ft2,ua3,Ft3,ua4,Ft4,ua5,Ft5);title('驱动力图');xlabel('车速/(km/h)'),ylabel('驱动力(kN)') ;gtext('ig1'),gtext('ig2'),gtext('ig3');gtext('ig4');gtext('ig5');%动力特性图clearclcclose allTtq=[331,341,355,367,375,386,370,351,340,323]; %发动机转矩io=5.01;nt=0.89; %机械效率%r=0.4275;g=9.8;m=9160;G=m*g;CDA=4.64;n=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800]; %发动机转数ig1=8.69;ua=0.377*r*n/ig1/io; %1档对应车速D=(Ttq.*ig1.*io.*nt/r-CDA*ua.*ua/21.15)/G; %求1档动力因数plot(ua,D);hold on;ig2=5.01;ua=0.377*r*n/ig2/io;D=(Ttq.*ig2.*io.*nt/r-CDA*ua.*ua/21.15)/G;plot(ua,D);hold on;ig3=2.91;ua=0.377*r*n/ig3/io;D=(Ttq.*ig3.*io.*nt/r-CDA*ua.*ua/21.15)/G;plot(ua,D);hold on;ig4=1.7;ua=0.377*r*n/ig4/io;D=(Ttq.*ig4.*io.*nt/r-CDA*ua.*ua/21.15)/G;plot(ua,D);hold on;ig5=1;ua=0.377*r*n/ig5/io;D=(Ttq.*ig5.*io.*nt/r-CDA*ua.*ua/21.15)/G;plot(ua,D);title('汽车动力特性图D-ua');xlabel('ua(km/h)');ylabel('D');gtext('ig1'),gtext('ig2'),gtext('ig3');gtext('ig4');gtext('ig5');%爬坡度图clearclcclose allTtq=[331,341,355,367,375,386,370,351,340,323];io=5.01;nt=0.89; %机械效率r=0.4275;g=9.8;ma=9160;CDA=4.64;n=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800]; %发动机转数G=ma.*g; %汽车重力f=0.02;ig1=8.69; %1档传动比ua=0.377*r.*n/ig1/io; %相应发动机转数对应的车速a=namelengthmax; %标识符的最长长度a=asin((Ttq.*ig1.*io.*nt/r-(G.*cos(a).*f+CDA*ua.*ua/21.15))/G); %计算1档爬角度i=100*tan(a); %计算爬坡度plot(ua,i);hold on;ig2=5.01;ua=0.377*r.*n/ig2/io;a=namelengthmax;a=asin((Ttq.*ig2.*io.*nt/r-(G.*cos(a).*f+CDA*ua.*ua/21.15))/G);i=100*tan(a);plot(ua,i);hold on;ig3=2.91;ua=0.377*r.*n/ig3/io;a=namelengthmax;a=asin((Ttq.*ig3.*io.*nt/r-(G.*cos(a).*f+CDA*ua.*ua/21.15))/G);i=100*tan(a);plot(ua,i);hold on;ig4=1.7;ua=0.377*r.*n/ig4/io;a=namelengthmax;a=asin((Ttq.*ig4.*io.*nt/r-(G.*cos(a).*f+CDA*ua.*ua/21.15))/G);i=100*tan(a);plot(ua,i);hold on;ig5=1;ua=0.377*r.*n/ig5/io;a=namelengthmax;a=asin((Ttq.*ig5.*io.*nt/r-(G.*cos(a).*f+CDA*ua.*ua/21.15))/G);i=100*tan(a);plot(ua,i);title('汽车爬坡度图');xlabel('ua(km/h)');ylabel('i(%)');gtext('ig1'),gtext('ig2'),gtext('ig3');gtext('ig4');gtext('ig5');%功率平衡图clearclcclose allm=9160;uamax=90;imax=0.3;Ttqmax=380; %最大转矩nPemax=2800; %最大功率转数d=0.855;r=d/2;Pe=[33.8,42.7,51.5,62.0,72.8,78.5,84.5,89.2,92.8,97.0,92,81]; %发动机转矩n=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800,3000,3200 ]; %发动机转数B1=2.45;H=2.76;CD=0.92;io=5.01;afamax=atan(imax); %最大爬坡度aitT=0.89;f=0.02;g=9.8;ig1=8.69;ig5=1;ig4=1.7ig3=2.91;ig2=5.01;ua1=(0.377*r*n)/(ig1*io); %1档车速ua2=(0.377*r*n)/(ig2*io);ua3=(0.377*r*n)/(ig3*io);ua4=(0.377*r*n)/(ig4*io);ua5=(0.377*r*n)/(ig5*io);nzuli=[0,1000,1200,1400,1600,1800,2000,2200,2400,2600,2800];uazuli=(0.377*r*nzuli)/(ig5*io); %计算阻力功率的车速Pf=m*g*f*uazuli/3600; %滚动阻力功率CDA=4.64; %迎风面积Pw=CDA*uazuli.^3/76140; %空气阻力功率figure,plot(ua1,Pe,ua2,Pe,ua3,Pe,ua4,Pe,ua5,Pe,uazuli,(Pf+Pw)/aitT);title('功率平衡图'); %图表标题xlabel('车速/(km/h)'),ylabel('功率/kW')zoom on;[x,y]=ginput(1);zoom off;disp(x)gtext('ig1'),gtext('ig2'),gtext('ig3');gtext('ig4');gtext('ig5');gtext( 'Pf+Pw/ηt');%等速百公里油耗图clearclcclose allm=9160;uamax=90;imax=0.3;Ttqmax=420;nPemax=2800;d=0.855;r=d/2;b=[219.2,209.9,206.2,199.4,205.5,208.0,214.1,220.7,223.1,229.8]; %各转速燃油消耗率Pe=[33.8,42.7,51.5,62.0,72.8,78.5,84.5,89.2,92.8,97.0]; %各转速对应功率n=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800]; %转数B1=2.45; %车宽H=1.8725; %车高CD=0.8;io=(0.377*r*2800)/uamax; %求最小传动比afamax=atan(imax); %最大爬坡度所对应的坡道角aitT=0.89; %传动系机械效率g=9.8;f=0.02;ig1=(m*g*(f*cos(afamax)+sin(afamax))*r)/(Ttqmax*io*aitT); %1档传动比igmax=ig1*io; %最大传动比ig5=1; %五档传动比ua5=(0.377*r*n)/(ig5*io); %5挡车速nzuli=[1000,1200,1400,1600,1800,2000,2200,2400,2600,2800]; %计算阻力功率的发动机转速uazuli=(0.377*r*nzuli)/(ig5*io); %计算阻力功率的车速Pf=m*g*(0.0076+0.000056*uazuli).*uazuli/3600; %滚动阻力功率A=B1*H; %迎风面积Pw=CD*A*uazuli.^3/76140; %空气阻力功率P=(Pf+Pw)/aitT; %阻力功率Qs=P.*b./(1.02.*ua5*8); %燃油消耗量figure,plot(ua5,Qs); %绘图title('等速百公里油耗');xlabel('ua/(km/h)'),ylabel('Qs/(L/100km)')C曲线为汽车主减速器对主传动比(i0)值不同时,相应传动比对应的汽车的动力性(100公里加速时间)和经济性(百公里油耗),通常运用此曲线来进行最小传动比的优化,已获得最优的燃油经济性和动力性的匹配。