您好,欢迎访问三七文档
1.3n=600:1:4000;r=0.367;i0=5.83;eff=0.85;f=0.013;m=3880;g=9.8;G=m*g;CdA=2.77;a=1.947;hg=0.9;L=3.2;Iw1=1.798;Iw2=3.598;Iw=Iw1+Iw2;If=0.218;Ttq=-19.313+295.27*n/1000-165.44*power(n,2)/1000000+40.874*power(n,3)/1000000000-3.8445*power(n,4)/1000000000000;forig=[5.562.7691.6441.000.793];Ua=0.377*r*n/ig/i0;Ft=Ttq*ig*i0*eff/r;Ff=m*g*f;Fw=CdA*power(Ua,2)/21.12;Fs=Ff+Fw;plot(Ua,Ft,Ua,Fs);holdon;endtext(15,13000,'F_t_1');text(20,7000,'F_t_2');text(40,4000,'F_t_3');text(55,2500,'F_t_4');text(70,1900,'F_t_5');text(105,2100,'F_f+F_w');xlabel('u_akm/h');ylabel('F_tN');title('驱动力-行驶阻力平衡图');[x,y]=ginput(1);disp('汽车的最高车速');disp(x);disp('km/h');Ua=0.377*r*n/ig/i0;Ft=Ttq*5.56*i0*eff/r;Ff=m*g*f;Fw=CdA*power(Ua,2)/21.12;Fs=Ff+Fw;i=atan((Ft-Fs)/G);disp('汽车的最大爬坡度');disp(max(i));C=max(i)/(a/L+hg/L*max(i));disp('克服最大爬坡度时的附着率');disp(C);figure;forig=[5.562.7691.6441.000.793];Ua=0.377*r*n/ig/i0;Ft=Ttq*ig*i0*eff/r;q=1+Iw/(m*r^2)+If*ig^2*i0^2*eff/(m*r^2);Ff=m*g*f;Fw=CdA*power(Ua,2)/21.12;Fs=Ff+Fw;Ac=(Ft-Fs)/q/m;plot(Ua,1./Ac);holdon;endaxis([098010]);text(5,0.5,'1');text(10,1,'2');text(20,1.5,'3');text(30,2.5,'4');text(40,4,'5');title('行驶加速度倒数曲线');xlabel('Ua/(km/h)');ylabel('1/a');figure;u(1)=0.377*r*600/i0/2.769;dt=0.01;w=1;t(1)=0;ig=2.769;while(u(w)99.08)n(w)=u(w)*ig*i0/0.377/r;Ttq(w)=-19.313+295.27*n(w)/1000-165.44*(n(w)/1000)^2+40.874*(n(w)/1000)^3-3.8445*(n(w)/1000)^4;Ft(w)=Ttq(w)*ig*i0*eff/r;Ff=G*f;Fw(w)=CdA*u(w)^2/21.15;q=1+Iw/(m*r^2)+If*ig^2*i0^2*eff/(m*r^2);a(w)=3.6*(Ft(w)-(Ff+Fw(w)))/q/m;u(w+1)=u(w)+a(w)*dt;if(u(w+1)=0.377*4000*r/2.769/i0)ig=1.644;endif(u(w+1)=0.377*4000*r/1.644/i0)ig=1.00;endif(u(w+1)=0.377*4000*r/1.00/i0)ig=0.793;endt(w+1)=(w+1)*dt;w=w+1;endplot(t,u);holdonu=70;plot(t,u);axis([0600100]);title('2挡原地起步加速时间曲线');xlabel('时间t/s'),ylabel('车速u/(km/h)');[x1,y1]=ginput(1);disp('加速到70km/h的时间');disp(x1);2.7n=600:1:4000;r=0.367;i0=5.83;eff=0.85;f=0.013;m=3880;g=9.8;G=m*g;CdA=2.77;a=1.947;hg=0.9;L=3.2;Iw1=1.798;Iw2=3.598;Iw=Iw1+Iw2;If=0.218;Ttq=-19.313+295.27*n/1000-165.44*power(n,2)/1000000+40.874*power(n,3)/1000000000-3.8445*power(n,4)/1000000000000;forig=[5.56,2.769,1.644,1.00,0.793]Ua=0.377*r*n/ig/i0;Pe=Ttq.*n/9550;plot(Ua,Pe);holdon;endPmax=max(Pe);plot(Ua,Pmax);Ua=0:0.1:max(Ua);Pf=G*f*Ua/3600;Pw=CdA*Ua.^3/76140;plot(Ua,(Pf+Pw)/eff);text(10,50,'1');text(15,35,'2');text(30,40,'3');text(40,30,'4');text(70,40,'5');text(110,80,'(P_f+P_w)/η');xlabel('u_akm/h');ylabel('F_tN');title('驱动力-行驶阻力平衡图');title('汽车的功率平衡图'),xlabel('Ua/(km/h)'),ylabel('P/kw');figure;n1=[815,1207,1614,2012,2603,3006,3403,3804];b0=[1326.8,1354.7,1284.4,1122.9,1141.0,1051.2,1233.9,1129.7];b1=[-416.46,-303.98,-189.75,-121.59,-98.893,-73.714,-84.478,-45.291];b2=[72.379,36.657,14.524,7.0035,4.4763,2.8593,2.9788,0.71113];b3=[-5.8629,-2.0553,-0.51184,-0.18517,-0.091077,-0.05138,-0.047449,-0.00075215];b4=[0.17768,0.043072,0.0068164,0.0018555,0.00068906,0.00035032,0.00028230,-0.000038568];B0=spline(n1,b0,n);B1=spline(n1,b1,n);B2=spline(n1,b2,n);B3=spline(n1,b3,n);B4=spline(n1,b4,n);pg=7;forig=[1.00,0.793]Ua=0.377*r*n/ig/i0;Pf=G*f*Ua/3600;Pw=CdA*Ua.^3/76140;P=(Pf+Pw)/eff;b=B0+B1.*P+B2.*P.^2+B3.*P.^3+B4.*P.^4;Q=P.*b./(1.02*Ua*pg);plot(Ua,Q);holdon;endaxis([01001228]);text(40,14,'四挡');text(80,16,'五档');title('最高挡与次高挡等速百公里油耗曲线'),xlabel('Ua/(km/h)'),ylabel('百公里油耗Qs/(L/100km)');3主函数:i0=[5.17,5.43,5.83,6.17,6.33];fori=1:1:5y(i)=jiasushijian(i0(i));endy;fori=1:1:5b(i)=youhao(i0(i));endb;plot(b,y,'+r');holdon;b1=linspace(b(1),b(5),100);y1=spline(b,y,b1);plot(b1,y1);text(13.4,27.5,'i_0=5.17');text(13.6,27.6,'i_0=5.43');text(13.9,27.2,'i_0=5.83');text(14.1,26.6,'i_0=6.17');text(14.2,26.2,'i_0=6.33');title('燃油经济性—加速时间曲线');xlabel('百公里油耗(L/100km)');ylabel('加速时间s');子函数1functiony=jiasushijian(i0)n1=linspace(0,5000);nmax=4000;nmin=600;r=0.367;yita=0.85;CDA=2.77;f=0.013;G=(3880)*9.8;ig=[6.09,3.09,1.71,1.00];fori=1:1:4uamax(i)=chesu(nmax,r,ig(i),i0);uamin(i)=chesu(nmin,r,ig(i),i0);ua(i,:)=linspace(uamin(i),uamax(i),100);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)/(3880*r^2);a(i,:)=1./(delta(i,:).*3880./(Ft(i,:)-F(i,:)));F2(i,:)=Ft(i,:)-F(i,:);endtemp1(1,:)=ua(2,:)/3.6;temp1(2,:)=1./a(2,:);n1=1;forj1=1:1:100ifua(3,j1)max(ua(2,:))&&ua(3,j1)=70temp2(1,n1)=ua(3,j1)/3.6;temp2(2,n1)=1./a(3,j1);n1=n1+1;endendn2=1;forj1=1:1:100ifua(4,j1)max(ua(3,:))&&ua(4,j1)=70;temp3(1,n2)=ua(4,j1)/3.6;temp3(2,n2)=1./a(4,j1);n2=n2+1;endendy=temp1(1,1)*temp1(2,1)+qiuji(temp1(1,:),temp1(2,:))+qiuji(temp2(1,:),temp2(2,:))+qiuji(temp3(1,:),temp3(2,:));end子函数2function[ua]=chesu(n,r,ig,i0)ua=0.377*r*n/i0./ig;end子函数3function[q]=jiasu(umax,umin,ig,a,ua0,i0)globalfGCDAyitamrIfIw1Iw2pgB0B1B2B3B4n;ua1=umin:1:umax;delta=1+(Iw1+Iw2)/(m*r^2)+(If*ig^2*i0^2*yita)/(m*r^2);P0=(G*f.*ua0./3600+CDA.*ua0.^3/76140+(delta*m.*ua0/3600)*a)/yita;P=(G*f.*ua1/3600+CDA.*ua1.^3/76140+(delta*m.*ua1/3600)*a)/yita;dt=1/(3.6*a)fori=1:1:3401b0(i)=B0(i)+B1(i)*P0(i)+B2(i)*(P0(i))^2+B3(i)
本文标题:汽车理论编程题
链接地址:https://www.777doc.com/doc-7037522 .html