汽车性能仿真实验
登录后复制
global M1 M2 M g r nt f CDA io If Iw1 Iw2 ig i1 i2 i3 i4 L a hg nmax nmin tmax imax;g=9.81;uamin=10;uamax1=70;n=nmin:(nmax-nmin)/9:nmax;n0=n/1000;tq=-19.313+295.27.*(n0)-165.44.*(n0.^2)+40.874.*(n0.^3)-3.8445.*(n0.^4);ft0=tq.*io.*nt./r;ft1=ft0.*i1;ft2=ft0.*i2;ft3=ft0.*i3;ft4=ft0.*i4;ua1=0.377.*r.*n./(i1.*io);ua2=0.377.*r.*n./(i2.*io);ua3=0.377.*r.*n./(i3.*io);ua4=0.377.*r.*n./(i4.*io);fw1=CDA.*(ua1.^2)./21.15;fw2=CDA.*(ua2.^2)./21.15;fw3=CDA.*(ua3.^2)./21.15;fw4=CDA.*(ua4.^2)./21.15;Iw=Iw1+Iw2;da0=1+Iw./(M.*(r.^2)); da01=(io.^2).*nt.*If./(M.*(r.^2));da1=da0+da01.*(i1.^2);da2=da0+da01.*(i2.^2);da3=da0+da01.*(i3.^2);da4=da0+da01.*(i4.^2);ff=M.*g.*f;a1=(ft1-ff-fw1)./(da1.*M);a2=(ft2-ff-fw2)./(da2.*M);a3=(ft3-ff-fw3)./(da3.*M);a4=(ft4-ff-fw4)./(da4.*M);js1=1./a1;js2=1./a2;js3=1./a3;js4=1./a4;t1=js1(1:end-1).*(ua1(2:end)-ua1(1:end-1));ii=1;while ua2(ii)<=ua1(end) ii=ii+1; ua2(ii)=ua2(ii+1); endt2=js2(ii:end-1).*(ua2(ii+1:end)-ua2(ii:end-1));t12=js2(ii).*(ua2(ii)-ua1(end));jj=1;while ua3(jj)<=ua2(end) jj=jj+1; ua3(jj)=ua3(jj+1); endt3=js3(jj:end-1).*(ua3(jj+1:end)-ua3(jj:end-1));t23=js3(jj).*(ua3(jj)-ua2(end));kk=1;while ua4(kk)<=ua3(end) kk=kk+1; ua4(kk)=ua4(kk+1); endt4=js4(kk:end-1).*(ua4(kk+1:end)-ua4(kk:end-1));t34=js4(kk).*(ua4(kk)-ua3(end));T1=[t1 t2 t3 t4];T=sum((T1)+t12+t23+t34); %总时间Ua=[ua1(1:end-1) ua2(ii:end-1) ua3(jj:end-1) ua4(kk:end-1)];x=T1;y=Ua;p3=polyfit(x,y,2);ppp=[ p3(1) p3(2) p3(3)-uamax1]; % 求70km/h时的时间TT=roots(ppp);tmax=min(TT);xc=0:1:60;p3c=polyval(p3,xc);plot(T1,Ua,'*',xc,p3c);xlabel('时间t/s','FontSize',8)ylabel('速度ua/(km/h)','FontSize',8)title('汽车加速时间曲线','FontSize',12)grid on;legend('各阶段加速度','拟合曲线',4);1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删