1、汽车理论课后作业matlab编程详细讲解带注释1.3matlab程序:(1)%驱动力-行驶阻力平衡图%货车相关参数。 m=3880;g=9.8;nmin=600;nmax=4000;G=m*g;ig=5.56 2.769 1.644 1.00 0.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
2、.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
3、*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) %求最高车速
4、。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.56 2.769 1.644 1.00 0.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
5、*(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
6、=m*g;ig=5.56 2.769 1.644 1.00 0.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*
7、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+(
8、Iw1+Iw2)/(m*r2)+(If*ig(1)2*i02*y)/(m*r2); %求各档位下的汽车旋转质量换算系数。q2=1+(Iw1+Iw2)/(m*r2)+(If*ig(2)2*i02*y)/(m*r2);q3=1+(Iw1+Iw2)/(m*r2)+(If*ig(3)2*i02*y)/(m*r2);q4=1+(Iw1+Iw2)/(m*r2)+(If*ig(4)2*i02*y)/(m*r2);q5=1+(Iw1+Iw2)/(m*r2)+(If*ig(5)2*i02*y)/(m*r2); a1=(Ft1-Ff-Fw1)/(q1*m); %求出汽车加速度。a2=(Ft2-Ff-Fw2)/(q
9、2*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(0 100 0 10);title(汽车的加速度倒数曲线);xlabel(ua(km/h);ylabel(1/a);legend(ad1,ad2,ad3,ad4,ad5) %求最大爬坡度时的附着率。Fz
10、=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.56 2.769 1.644 1.00 0.793;G=m*g;nmin=600;nmax=
11、4000;u1=0.377*r*nmin./ig/i0;u2=0.377*r*nmax./ig/i0;deta=0*ig;for i=1:5 deta(i)=1+(Iw1+Iw2)/(m*r2)+(If*(ig(i)2*i02*nT)/(m*r2);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:N k=i; if ua(i)=u2(2) n=ua(i)*(ig(2)*i0/r)/0.377; Tq=-19.313+295.27*(n/1000)-
12、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)
13、*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; else n=ua(i)*(ig(5)*i0/r)/0.377; Tq=-19.313+
14、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; end a=delta(1:k); t(i)=sum(a);endplot(t,ua);axis(0 80 0 100);title(汽车2档原地起步换挡加速时间曲线);xlabel(时间t(s));ylabel(速度ua(km/h));2.7matlab程序:(1)%绘制汽车功率平衡图。 cl
15、ear %汽车参数。ig=5.56 2.769 1.644 1.00 0.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)/
16、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; %克服
17、滚动阻力的功率Pw=Fw.*ua/3600; %克服空气阻力的功率。P6=(Pf+Pw)./y; plot(ua1,P1,ua2,P2,ua3,P3,ua4,P4,ua5,P5,ua,P6); %绘制汽车功率平衡图。axis(0 120 0 100);title(汽车功率平衡图);xlabel(ua(km/h);ylabel(Pe(kw);legend(Pe1,Pe2,Pe3,Pe4,Pe5,P(Ff+Fw)(2)%最高档与次高档等速百公里油耗曲线图 clearclcn=600:1:4000; %货车相关参数。m=3880;g=9.8;G=m*g;ig=5.56 2.769 1.644 1.0
18、0 0.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; n0=815 1207 1614 2012 2603 3006 3403 3804;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
19、 4.4763 2.8593 2.9788 0.71113;B30=-5.8629 -2.0553 -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(n
20、0,B40,n); ua4=0.377*r*n/ig(4)/i0; %4、5档车速。ua5=0.377*r*n/ig(5)/i0; Ff=G*f; %滚动阻力。Fz4=Ff+CdA*(ua4.2)/21.15; %4、5档空气阻力。Fz5=Ff+CdA*(ua5.2)/21.15; Pe4=Fz4.*ua4./(y*3.6*1000); %4、5档克服行驶阻力所需功率。Pe5=Fz5.*ua5./(y*3.6*1000); for i=1:1:3401 %计算燃油消耗率。 b4(i)=B0(i)+B1(i)*Pe4(i)+B2(i)*Pe4(i).2+B3(i)*Pe4(i).3+B4(i)*Pe4(i).4;b5(i)=B0(i)+B1(i)*Pe5(i)+B2(i)*Pe5(i).2+B3(i)*Pe5(i).3+B4(i)*Pe5(i).4;end pg=7.0;Q4=Pe4.*b4./(1.02.*ua4.*pg); %计算百公里油耗。Q5=Pe5.*b5./(1.02.*ua5.*pg); plot(ua4,Q4,ua5,Q5); %绘制曲线。axis(0 100 10 30);title(最高档与次高档等速百公里油耗曲线);xlabel(ua(km/h);ylabel(百公里油耗(L/100km));legend(4,5)
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1