1.3matlab程序:(1)%驱动力-行驶阻力平衡图%货车相关参数。m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.562.7691.6441.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*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;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;%计算行驶阻力。Fz1=m*g*f+2.77*ua1.^2/21.15;Fz2=m*g*f+2.77*ua2.^2/21.15;Fz3=m*g*f+2.77*ua3.^2/21.15;Fz4=m*g*f+2.77*ua4.^2/21.15;Fz5=m*g*f+2.77*ua5.^2/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')%求最高车速。[x,y]=ginput(1);disp(‘汽车最高车速=');disp(x);disp('km/h');(2)%汽车最大爬坡度clearclc%汽车相关参数。m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.562.7691.6441.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;Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;Ft1=Tq*ig(1)*i0*y/r;%一档时爬坡能力最强。ua1=0.377*r*n/ig(1)/i0;Ff=G*f;%滚动阻力。Fw1=CdA*ua1.^2/21.15;%空气阻力。Fz1=Ff+Fw1;Fi1=Ft1-Fz1;Fmax=max(Fi1/G);imax=100*tan(asin(Fmax));disp('汽车最大爬坡度=');disp(imax),disp('%');(3)%求汽车加速度倒数曲线和最大爬坡度显得附着率。clearclcm=3880;%汽车相关参数。g=9.8;nmin=600;nmax=4000;G=m*g;ig=[5.562.7691.6441.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;%发动机转速范围。Tq=-19.313+295.27*(n/1000)-165.44*(n/1000).^2+40.874*(n/1000).^3-3.8445*(n/1000).^4;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;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;%滚动阻力。q1=1+(Iw1+Iw2)/(m*r^2)+(If*ig(1)^2*i0^2*y)/(m*r^2);%求各档位下的汽车旋转质量换算系数。q2=1+(Iw1+Iw2)/(m*r^2)+(If*ig(2)^2*i0^2*y)/(m*r^2);q3=1+(Iw1+Iw2)/(m*r^2)+(If*ig(3)^2*i0^2*y)/(m*r^2);q4=1+(Iw1+Iw2)/(m*r^2)+(If*ig(4)^2*i0^2*y)/(m*r^2);q5=1+(Iw1+Iw2)/(m*r^2)+(If*ig(5)^2*i0^2*y)/(m*r^2);a1=(Ft1-Ff-Fw1)/(q1*m);%求出汽车加速度。a2=(Ft2-Ff-Fw2)/(q2*m);a3=(Ft3-Ff-Fw3)/(q3*m);a4=(Ft4-Ff-Fw4)/(q4*m);a5=(Ft5-Ff-Fw5)/(q5*m);ad1=1./a1;;%求加速度倒数。ad2=1./a2;ad3=1./a3;ad4=1./a4;ad5=1./a5;plot(ua1,ad1,ua2,ad2,ua3,ad3,ua4,ad4,ua5,ad5);%绘制加速度倒数曲线。axis([0100010]);title('汽车的加速度倒数曲线');xlabel('ua(km/h)');ylabel('1/a');legend('ad1','ad2','ad3','ad4','ad5')%求最大爬坡度时的附着率。Fz=Ft1-Ff-Fw1;aa=asin(max(Fz)/G);%最大爬坡角度。C=tan(aa)/(a/L+hg*tan(aa)/L);%附着率。disp('假设后轮驱动,最大爬坡度相应的附着率=);disp(C);(4)%求汽车2档原地起步换挡加速行驶至70km/h的加速时间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;ig=[5.562.7691.6441.000.793];G=m*g;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;delta=0*ua;Ff=G*f;Fw=CDA*ua.^2/21.15;fori=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;elseifua(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([0800100]);title('汽车2档原地起步换挡加速时间曲线');xlabel('时间t(s)');ylabel('速度ua(km/h)');2.7matlab程序:(1)%绘制汽车功率平衡图。clear%汽车参数。ig=[5.562.7691.6441.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;m=3880;g=9.8;G=m*g;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;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;P1=Tq.*ig(1)*i0.*ua1./(3600*r);%各档位下发动机的输出功率。P2=Tq.*ig(2)*i0.*ua2./(3600*r);P3=Tq.*ig(3)*i0.*ua3./(3600*r);P4=Tq.*ig(4)*i0.*ua4./(3600*r);P5=Tq.*ig(5)*i0.*ua5./(3600*r);ua=0:0.2:120;Ff=G*f;Fw=CdA*ua.^2/21.15;Pf=Ff*ua/3600;%克服滚动阻力的功率Pw=Fw.*ua/3600;%克服空气阻力的功率。P6=(Pf+Pw)./y;plot(ua1,P1,ua2,P2,ua3,P3,ua4,P4,ua5,P5,ua,P6);%绘制汽车功率平衡图。axis([01200100]);title('汽车功率平衡图');xlabel('ua(km/h)');ylabel('Pe(kw)');lege