matlab计算汽车动力性经济性(已编好程序)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

%%汽车动力性计算(自己编的动力性计算程序,供大家计算动力性时参考,具体参数大家根据所给程序对应输入,并对坐标轴数值按需要进行修改)clc;clear;closeall;%%根据所给发动机数据拟合外特性曲线(发动机数据按照你所得到的数据进行输入)n_test=[100012001400180022002400260028003000320034003600380040004200440046005000];T_test=[201206216218221221227228235246228227223215210208205109];figure(1)plot(n_test,T_test,'g');holdongridonp=polyfit(n_test,T_test,7);n=[1000:1:5000];Ttq=polyval(p,n);plot(n,Ttq,'k');xlabel('发动机转速n(r/min)');ylabel('发动机转矩Ttq(N*m)');title('发动机转矩曲线');legend('测试曲线','拟合曲线');axis([10005000100300]);%%所给车型动力总成相关参数ig=[4.1482.371.5561.1150.8590.686];i0=3.394;eta=0.9;r=0.307;M=1700;g=9.8;c=1.2;f0=0.009;f1=0.00018;f4=0.0003;CD=0.3;A=2.54;Iw=3.0;If=0.04;%%发动机外特性曲线图figure(2)holdongridonfori=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('发动机外特性曲线');%%各挡位速度曲线%计算各挡位车速fori=1:length(ig);ua(i,:)=0.377*r*n/ig(i)/i0;end%计算各档位最高车速uamax=ua(:,length(ua(1,:)));figure(3)holdonfori=1:length(ig);plot(n,ua(i,:),'k');endholdongridonxlabel('转速n(r/min)');ylabel('各挡位车速(km/h)');title('各挡位车速-转速表');legend('1挡车速','2挡车速','3挡车速','4挡车速','5挡车速');axis([100050000270]);%%驱动力和行驶阻力平衡图%计算滚动阻力系数fori=1:length(ig);f(i,:)=f0+f1*(ua(i,:)/100)+f4*(ua(i,:)/100).^4;end%计算滚动阻力fori=1:length(ig);Ff(i,:)=c*M*g*f(i,:);end%计算空气阻力fori=1:length(ig);Fw(i,:)=CD*A*(ua(i,:).^2)/21.15;end%计算行驶阻力fori=1:length(ig);F(i,:)=Ff(i,:)+Fw(i,:);end%计算汽车驱动力fori=1:length(ig);Ft(i,:)=Ttq*ig(i)*i0*eta/r;endfigure(4)holdonfori=1:length(ig);plot(ua(i,:),Ft(i,:),'k');plot(ua(i,:),F(i,:),'r');plot(ua(i,:),Ff(i,:),'b');endholdongridonxlabel('车速(km/h)');ylabel('驱动力、行驶阻力(N)');legend('驱动力Ft','行驶阻力Ff+Fw','滚动阻力Ff');title('驱动力-行驶阻力平衡图');axis([027005000]);%%汽车功率平衡图%计算各档位功率fori=1:length(ig);P(i,:)=Ft(i,:).*ua(i,:)/(3600*eta);end%计算风阻阻力功率fori=1:length(ig);Pw(i,:)=CD*A*ua(i,:).^3/(76140*eta);end%计算滚动阻力功率fori=1:length(ig);Pf(i,:)=M*g*f(i,:).*ua(i,:)/(3600*eta);end%计算总阻力功率fori=1:length(ig);Pz(i,:)=Pw(i,:)+Pf(i,:);endfigure(5)holdonfori=1:length(ig);plot(ua(i,:),P(i,:),'k');plot(ua(i,:),Pz(i,:),'r');endholdongridonxlabel('车速(km/h)');ylabel('发动机功率、阻力功率(kW)');legend('发动机功率P','阻力功率Pz','Location','NorthWest');title('功率平衡图');axis([02700300]);%%动力特性图(动力因数图)fori=1:length(ig);D(i,:)=(Ft(i,:)-Fw(i,:))/M/g;endfigure(6)holdonfori=1:length(ig);plot(ua(i,:),D(i,:),'k');plot(ua(i,:),f(i,:),'r');endholdongridonxlabel('车速(km/h)');ylabel('动力因数D');legend('动力因数D','滚动阻力系数f');title('动力特性图');axis([027000.6]);%%爬坡度曲线图fori=1:length(ig);I(i,:)=(tan(asin((Ft(i,:)-(Ff(i,:)+Fw(i,:)))/(M*g))))*100;endfigure(7)holdonfori=1:length(ig);ifi==1plot(ua(i,:),I(i,:),'r');elseplot(ua(i,:),I(i,:),'k');endendholdongridonxlabel('车速(km/h)');ylabel('最大爬坡度(%)');legend('Ⅰ挡','高速档');title('爬坡度曲线图');axis([0270050]);%%加速度曲线图deta=1+1/M*4*Iw/r^2+1/M*If*ig.^2*i0^2*eta/r^2;fori=1:length(ig);a(i,:)=(Ft(i,:)-Ff(i,:)-Fw(i,:))./deta(i)/M;ifi==5forj=1:length(n)ifa(i,j)0a(i,j)=0;elseendendendendfigure(8)holdonfori=1:length(ig);ifi==1plot(ua(i,:),a(i,:),'r');elseplot(ua(i,:),a(i,:),'k');endendholdongridonxlabel('车速(km/h)');ylabel('加速度a(m/s^2)');legend('Ⅰ档','高速档');title('加速度曲线图');axis([027004.5])%%加速度倒数曲线fori=1:length(ig);forj=1:length(n)b(i,j)=1./a(i,j);endendfigure(9)holdonfori=1:length(ig)plot(ua(i,:),b(i,:),'k');endholdongridonxlabel('车速(km/h)');ylabel('各档加速度倒数1/a');legend('各档加速度倒数1/a曲线','Location','NorthWest');title('各档加速度倒数曲线图');axis([016006])ad1=b(1,:);ad2=ua(1,:);fori=1:(length(ig)-1);forj=1:length(n)ifua(i+1,j)=ua(i,length(n))flag(i)=j;break;endendad1=[ad1b(i+1,j:length(n))];ad2=[ad2ua(i+1,j:length(n))];endfigure(10)holdonplot(ad2,ad1,'k');holdongridonxlabel('车速(km/h)');ylabel('加速度倒数1/a');legend('加速度倒数1/a曲线','Location','NorthWest');title('加速度倒数曲线图');axis([016006])%%加速时间曲线k=length(n);fori=1:length(ig);t(i,1)=0;forj=2:kt(i,j)=abs(ua(i,j)-ua(i,j-1))*(b(i,j)+b(i,j-1))/2;endendfori=1:length(ig);forj=1:kat(i,j)=sum(t(i,1:j))/3.6;endendtotalat=at(1,:);fori=1:(length(ig)-1);forj=flag(i):ktotalat=[totalattotalat(length(totalat))+t(i+1,j)/3.6];endendfigure(11)holdonplot(totalat,ad2,'k');holdongridonxlabel('时间(s)');ylabel('车速(km/h)');legend('加速时间','Location','NorthWest');title('加速时间曲线图');axis([0500150])

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功