您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 汽车理论 > MATLAB万有特性曲线
%不同转速下的燃油消耗率与扭矩的曲线拟合clearallbe1=[222.8,220.4,232.4,228.5,227.8,232.6,248.5,245.9,272.4,329.7];Ttq1=[399.8,354.1,318.5,278.1,236.2,203.6,185.3,157.2,117.2,80.8];T1=80:320/9:400;%转换矩阵格式Be1=interp1(Ttq1,be1,T1,'spline');%n=1400r/min时燃油消耗率与扭矩的曲线拟合be2=[222.0,221.7,235.4,226.5,230.5,236.8,249.1,276.1,407.9,487.0];Ttq2=[409.1,365.7,328.3,284.1,243.7,203.2,164.3,123.9,83.5,39.7];T2=39:371/9:410;Be2=interp1(Ttq2,be2,T2,'spline');be3=[226.0,225.3,226.4,233.9,242.1,283.3,253.9,271.4,323.5,468.6];Ttq3=[408.3,368.3,328.3,289.0,244.4,208.8,167.7,132.1,89.5,46.1];T3=46:363/9:409;Be3=interp1(Ttq3,be3,T3,'spline');be4=[206.5,231.1,231.1,233.0,242.0,244.9,265.0,299.8,398.0,596.8];Ttq4=[425.6,380.3,332.7,290.9,244.4,205.1,160.2,114.5,68.8,30.7];T4=30:396/9:426;Be4=interp1(Ttq4,be4,T4,'spline');be5=[234.7,259.8,235.5,237.6,242.8,292.3,277.9,308.7,396.2,605.9];Ttq5=[420.7,379.6,334.6,291.6,244.4,202.8,157.5,116.0,74.1,37.8];T5=37:384/9:421;Be5=interp1(Ttq5,be5,T5,'spline');be6=[174.2,242.2,252.1,287.4,253.6,263.6,290.6,316.8,378.0,518.8];Ttq6=[404.6,360.5,322.7,283.0,243.3,205.5,162.1,124.7,86.8,52.4];T6=52:353/9:405;Be6=interp1(Ttq6,be6,T6,'spline');be7=[256.9,253.7,253.5,260.0,303.8,280.7,300.6,346.6,435.6,812.9];Ttq7=[378.0,344.7,310.3,264.3,226.1,186.8,154.2,115.3,76.3,34.1];T7=34:344/9:378;Be7=interp1(Ttq7,be7,T7,'spline');be8=[257.9,295.3,282.4,288.7,301.9,329.7,357.0,475.4,580.3,1080.1];Ttq8=[315.6,275.5,242.5,210.3,178.5,145.6,118.6,72.6,52.8,22.4];T8=22:294/9:316;Be8=interp1(Ttq8,be8,T8,'spline');B=[Be1';Be2';Be3';Be4';Be5';Be6';Be7';Be8'];N=[1400*ones(10,1);1600*ones(10,1);1800*ones(10,1);2000*ones(10,1);2200*ones(10,1);2400*ones(10,1);2600*ones(10,1);2800*ones(10,1)];Ttqn=[T1';T2';T3';T4';T5';T6';T7';T8'];G=[ones(80,1),N,Ttqn,N.^2,N.*Ttqn,Ttqn.^2];A=G\B;%A为6*1矩阵[n,Ttq]=meshgrid(1400:2800,100:600);%生成n-Ttq平面上的自变量“格点”矩阵be=A(1)+n.*A(2)++Ttq*A(3)+n.^2*A(4)+n.*Ttq*A(5)+Ttq.^2*A(6);%501×1401Pe=Ttq.*n/9550;%501×1401%外特性实验数据拟合Nw=[1403,1597,1797,1986,2102,2199,2303,2400,2507,2598,2700,2802];Ttqw=[474,497,515,526,528.8,522.8,509.5,492.2,471.2,448.4,408.3,357.4];n0=1400:2800;Ttqw_N=interp1(Nw,Ttqw,n0,'spline');h=repmat(Ttqw_N,501,1);%501×1401矩阵ii=find(Ttqh);%确定超出边界的“格点”下标%155109×1be(ii)=NaN;%强制为非数Pe(ii)=NaN;%强制为非数%绘制等燃油消耗率曲线和等功率曲线三维拟合图subplot(1,2,1);mesh(n,Ttq,be);holdon;mesh(n,Ttq,Pe);axis([1000,3000,100,600,0,500]);holdon;xlabel('n(r/min)')ylabel('Ttq(N*m)')zlabel('Pe(KW)be(g/(KW*h))')title('等燃油消耗曲线和等功率曲线的三维拟合图')%绘制边界线(外特性曲线)subplot(1,2,2);plot(n0,Ttqw_N,'LineWidth',2);axis([1400,2800,100,550]);xlabel('n(r/min)');ylabel('Ttq(N*m)');title('万有特性曲线');holdon;%绘制等油耗率曲线的二维图B=contour(n,Ttq,be,11);%画等位线,并给出标识数据clabel(B);%把“等位值”沿等位线随机标识holdon;%绘制等功率曲线的二维图P=contour(n,Ttq,Pe,11);%画等位线,并给出标识数据clabel(P);%把“等位值”沿等位线随机标识legend('等油耗曲线','等功率曲线','外特性曲线')holdoff%利用mesh作原始曲面N=3500:500:8000;T=1.3:-1.2/6:0.1;B=xlsread('F:\Matlab\RanJia.xls','revise5');%mesh(N,T,B)%colormap;%colorbar;%xlabel('转速n/r*min^-^1'),ylabel('p平均有效压力/Mpa'),zlabel('燃油消耗率z/kg/(kw*h)')%hiddenoff透明网孔%colormap;表面小块着色%colorbar;%surf(,,,'FaceColor','red','EdgeColor','none');%camlightleft;增加光源%lightingphone照明方式%view(-15,65)改变视角(方位角,仰角)%利用interrp2矩阵插值函数作优化曲面N1=3500:50:8000;T1=1.3:-0.005:0.1;[N2,T2]=meshgrid(N1,T1);B1=interp2(N,T,B,N2,T2,'cubic');P1=T2.*N2/9.55;%figure;%surf(N1,T1,B1)%colormap;%colorbar;%xlabel('转速n/r*min^-^1'),ylabel('p平均有效压力/Mpa'),zlabel('燃油消耗率z/kg/(kw*h)')%外特性实验数据拟合T3=[0.90,0.95,0.99,1.06,1.12,1.18,1.24,1.30,1.22,1.11];T4=interp1(N,T3,N1,'spline');W=repmat(T4,241,1);%平铺成381×91矩阵jj=find(T2W);%确定超出边界的“格点”下标B1(jj)=NaN;%画外特性曲线plot(N1,T4,'LineWidth',2);axis([3500,8000,0.1,1.3]);holdon%画等油耗线v=[450,460,470,480,490,500,510,525,540,560];[A1,h]=contour(N2,T2,B1,v,'b:');%N2,T2限制在X,Y轴上的范围,10为等高线条数clabel(A1,h,'manual');holdon%画等功率线[A2,h]=contour(N2,T2,P1,500:100:900,'k:');%N2,T2限制在X,Y轴上的范围,10为等高线条数clabel(A2,h,'manual');plot(6000,1.114,'.','color','r');xlabel('转速—r/min');ylabel('扭矩—N·m');legend('外特性曲线','等油耗线-g/(kW·h)','等功率线-W')holdoff%title('等油耗线');%xlabel('转速n/r*min^-^1'),ylabel('p平均有效压力/Mpa')35004000450050005500600065007000750080000.20.40.60.811.2转速(r/min)扭矩(N·m)外特性曲线等油耗线-g/(kW·h)等功率线-W
本文标题:MATLAB万有特性曲线
链接地址:https://www.777doc.com/doc-5097717 .html