复现论文《高速公路卡车队列行驶非线性滚动优化控制》(1)

节气门位置000.040.080.120.160.20.240.280.320.360.40.440.480.520.560.60.640.680.720.760.80.840.880.920.961
转速6008.00E-050.00020.00030.000320.000340.000370.000390.000410.000430.000460.000480.00050.000520.000550.000570.000590.000610.000640.000660.000680.00070.000730.000750.000770.000790.00082
8000.000130.00020.00040.000590.000710.00080.000830.000850.000860.000870.000880.000890.00090.000910.000920.000930.000940.000960.000970.000980.000990.0010.001010.001020.001030.00104
10000.000160.00020.000390.000620.000790.000910.000990.001040.001070.001080.001090.001110.001120.001130.001140.001150.001170.001180.001190.00120.001210.001230.001240.001250.001260.00127
12000.000160.000210.000390.000640.000880.001040.001140.001230.001280.001310.001330.001340.001350.001370.001380.00140.001410.001420.001440.001450.001470.001480.001490.001510.001520.00154
14000.000170.000230.000390.000660.000910.001130.00130.00140.001480.001530.001560.001580.00160.001610.001630.001650.001670.001680.00170.001720.001740.001750.001770.001790.001810.00182
16000.00020.000260.00040.000660.000950.001190.001390.001540.001640.001730.001780.001810.001830.001840.001860.001880.00190.001920.001940.001950.001970.001990.002010.002030.002050.00207
18000.000210.000280.000390.000670.000950.001240.001470.001660.001780.001890.001950.0020.002030.002060.002090.002120.002150.002180.002220.002250.002280.002310.002340.002370.00240.00243
20000.000230.00030.000380.000650.000960.001290.001560.001780.001950.002070.002150.002210.002270.002310.002340.002380.002410.002450.002490.002520.002560.002590.002630.002670.00270.00274
22000.000250.000330.000410.000650.000980.00130.001620.001890.002120.002260.002390.002460.002520.002570.002610.002640.002680.002720.002750.002790.002820.002860.00290.002930.002970.003
24000.000270.000360.000440.000650.000950.001330.001680.001990.002230.00240.002550.002650.002720.002780.002840.00290.002960.003020.003080.003140.003190.003250.003310.003370.003430.00349
28000.000330.000390.000460.000650.000970.001340.001740.002070.002390.002650.00280.002960.003070.003130.00320.003260.003310.003360.003420.003470.003520.003570.003630.003680.003730.00379
32000.000380.000450.000530.000640.000970.001360.001750.002160.002560.002870.00310.003260.003430.003650.003880.00410.004240.004250.004270.004290.00430.004320.004340.004350.004370.00439
36000.000430.000520.000610.00070.000950.001370.001790.002210.002720.003150.003470.003840.004230.004630.004870.004950.005020.005090.005130.005140.005160.005170.005190.00520.005210.00523
40000.000470.000590.000830.001180.001620.00210.002590.003170.003670.004030.004360.004870.005370.005870.006030.006080.006140.00620.006240.006250.006260.006270.006290.00630.006310.00633
44000.000510.000640.000850.001220.001650.002180.00270.003330.003920.004430.004770.005140.005680.006210.006750.007030.007090.007150.007210.007260.007310.007320.007330.007350.007360.00738
48000.000520.000740.000950.001210.001670.002180.002720.003360.004040.004590.005380.00640.007010.007250.00750.007740.007930.007990.008050.008110.008170.008220.008280.008290.00830.00831
52000.000590.000780.000980.001170.001640.002160.002720.00340.00410.005050.006330.00690.007470.007790.008070.008350.008630.00880.008860.008910.008970.009030.009090.009140.00920.00926
56000.000650.000830.0010.001190.00160.002120.002730.003560.004620.005510.006380.007040.007620.008030.00830.008570.008850.009120.009250.009310.009370.009430.009490.009550.009610.00967
58000.000760.00090.001030.001190.001620.002110.002710.003570.00460.005480.006420.007120.007720.008160.008410.008670.008920.009180.00930.009350.00940.009450.009510.009560.009610.00966

 一.Carsim中复制出来的燃油特性曲线数据

th2=[0    0.04    0.08    0.12    0.16    0.2    0.24    0.28    0.32    0.36    0.4    0.44    0.48    0.52    0.56    0.6    0.64    0.68    0.72    0.76    0.8    0.84    0.88    0.92    0.96    1
];
n2=[600
800
1000
1200
1400
1600
1800
2000
2200
2400
2800
3200
3600
4000
4400
4800
5200
5600
5800
];
be=[8.00E-05    0.0002    0.0003    0.00032    0.00034    0.00037    0.00039    0.00041    0.00043    0.00046    0.00048    0.0005    0.00052    0.00055    0.00057    0.00059    0.00061    0.00064    0.00066    0.00068    0.0007    0.00073    0.00075    0.00077    0.00079    0.00082
0.00013    0.0002    0.0004    0.00059    0.00071    0.0008    0.00083    0.00085    0.00086    0.00087    0.00088    0.00089    0.0009    0.00091    0.00092    0.00093    0.00094    0.00096    0.00097    0.00098    0.00099    0.001    0.00101    0.00102    0.00103    0.00104
0.00016    0.0002    0.00039    0.00062    0.00079    0.00091    0.00099    0.00104    0.00107    0.00108    0.00109    0.00111    0.00112    0.00113    0.00114    0.00115    0.00117    0.00118    0.00119    0.0012    0.00121    0.00123    0.00124    0.00125    0.00126    0.00127
0.00016    0.00021    0.00039    0.00064    0.00088    0.00104    0.00114    0.00123    0.00128    0.00131    0.00133    0.00134    0.00135    0.00137    0.00138    0.0014    0.00141    0.00142    0.00144    0.00145    0.00147    0.00148    0.00149    0.00151    0.00152    0.00154
0.00017    0.00023    0.00039    0.00066    0.00091    0.00113    0.0013    0.0014    0.00148    0.00153    0.00156    0.00158    0.0016    0.00161    0.00163    0.00165    0.00167    0.00168    0.0017    0.00172    0.00174    0.00175    0.00177    0.00179    0.00181    0.00182
0.0002    0.00026    0.0004    0.00066    0.00095    0.00119    0.00139    0.00154    0.00164    0.00173    0.00178    0.00181    0.00183    0.00184    0.00186    0.00188    0.0019    0.00192    0.00194    0.00195    0.00197    0.00199    0.00201    0.00203    0.00205    0.00207
0.00021    0.00028    0.00039    0.00067    0.00095    0.00124    0.00147    0.00166    0.00178    0.00189    0.00195    0.002    0.00203    0.00206    0.00209    0.00212    0.00215    0.00218    0.00222    0.00225    0.00228    0.00231    0.00234    0.00237    0.0024    0.00243
0.00023    0.0003    0.00038    0.00065    0.00096    0.00129    0.00156    0.00178    0.00195    0.00207    0.00215    0.00221    0.00227    0.00231    0.00234    0.00238    0.00241    0.00245    0.00249    0.00252    0.00256    0.00259    0.00263    0.00267    0.0027    0.00274
0.00025    0.00033    0.00041    0.00065    0.00098    0.0013    0.00162    0.00189    0.00212    0.00226    0.00239    0.00246    0.00252    0.00257    0.00261    0.00264    0.00268    0.00272    0.00275    0.00279    0.00282    0.00286    0.0029    0.00293    0.00297    0.003
0.00027    0.00036    0.00044    0.00065    0.00095    0.00133    0.00168    0.00199    0.00223    0.0024    0.00255    0.00265    0.00272    0.00278    0.00284    0.0029    0.00296    0.00302    0.00308    0.00314    0.00319    0.00325    0.00331    0.00337    0.00343    0.00349
0.00033    0.00039    0.00046    0.00065    0.00097    0.00134    0.00174    0.00207    0.00239    0.00265    0.0028    0.00296    0.00307    0.00313    0.0032    0.00326    0.00331    0.00336    0.00342    0.00347    0.00352    0.00357    0.00363    0.00368    0.00373    0.00379
0.00038    0.00045    0.00053    0.00064    0.00097    0.00136    0.00175    0.00216    0.00256    0.00287    0.0031    0.00326    0.00343    0.00365    0.00388    0.0041    0.00424    0.00425    0.00427    0.00429    0.0043    0.00432    0.00434    0.00435    0.00437    0.00439
0.00043    0.00052    0.00061    0.0007    0.00095    0.00137    0.00179    0.00221    0.00272    0.00315    0.00347    0.00384    0.00423    0.00463    0.00487    0.00495    0.00502    0.00509    0.00513    0.00514    0.00516    0.00517    0.00519    0.0052    0.00521    0.00523
0.00047    0.00059    0.00083    0.00118    0.00162    0.0021    0.00259    0.00317    0.00367    0.00403    0.00436    0.00487    0.00537    0.00587    0.00603    0.00608    0.00614    0.0062    0.00624    0.00625    0.00626    0.00627    0.00629    0.0063    0.00631    0.00633
0.00051    0.00064    0.00085    0.00122    0.00165    0.00218    0.0027    0.00333    0.00392    0.00443    0.00477    0.00514    0.00568    0.00621    0.00675    0.00703    0.00709    0.00715    0.00721    0.00726    0.00731    0.00732    0.00733    0.00735    0.00736    0.00738
0.00052    0.00074    0.00095    0.00121    0.00167    0.00218    0.00272    0.00336    0.00404    0.00459    0.00538    0.0064    0.00701    0.00725    0.0075    0.00774    0.00793    0.00799    0.00805    0.00811    0.00817    0.00822    0.00828    0.00829    0.0083    0.00831
0.00059    0.00078    0.00098    0.00117    0.00164    0.00216    0.00272    0.0034    0.0041    0.00505    0.00633    0.0069    0.00747    0.00779    0.00807    0.00835    0.00863    0.0088    0.00886    0.00891    0.00897    0.00903    0.00909    0.00914    0.0092    0.00926
0.00065    0.00083    0.001    0.00119    0.0016    0.00212    0.00273    0.00356    0.00462    0.00551    0.00638    0.00704    0.00762    0.00803    0.0083    0.00857    0.00885    0.00912    0.00925    0.00931    0.00937    0.00943    0.00949    0.00955    0.00961    0.00967
0.00076    0.0009    0.00103    0.00119    0.00162    0.00211    0.00271    0.00357    0.0046    0.00548    0.00642    0.00712    0.00772    0.00816    0.00841    0.00867    0.00892    0.00918    0.0093    0.00935    0.0094    0.00945    0.00951    0.00956    0.00961    0.00966
];
[x1,y1]=meshgrid(th2,n2);
surf(x1,y1,be);
figure
[x1i, y1i] = meshgrid(0:0.01:1,0:50:6700);
z1i = griddata(x1,y1,be, x1i,y1i);
surf(x1i,y1i,z1i);
title('发动机燃油特性三维图','fontsize',15)
xlabel('节气门开度','fontsize',15), ylabel('发动机转速','fontsize',15), zlabel('燃油消耗率','fontsize',15)

 二.在将两个数据表结合在一起的时候不会弄了,只能用公式的方式来做,学习一下cftool工具箱的使用

matlab拟合工具箱cftool_哔哩哔哩_bilibili

三.数据多项式拟合学习

https://blog.csdn.net/qq_45625115/article/details/115874761

四.学习的别人代码

clear all
be1=[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;%转换矩阵格式,从90开始,400结束,以320/9为间隔
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');%n=1600

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');%n=1800

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');%n=2000

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');%n=2200

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');%n=2400

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');%n=2600

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;%共10个数
Be8=interp1(Ttq8,be8,T8,'spline');%n=2800

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)];%产生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);
Pe=Ttq.*n/9550;

%外特性实验数据拟合
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;%共1401个数
Ttqw_N=interp1(Nw,Ttqw,n0,'spline');%共1401个数
h=repmat(Ttqw_N,501,1);%。共1401列,501行;repmat:重复1*1401列;501,1
ii=find(Ttq>h);%确定超出边界的“格点”下标,即行和列数
be(ii)=NaN;%强制为非数,绘图时挖掉超出范围的数
Pe(ii)=NaN;%强制为非数

%绘制等燃油消耗率曲线和等功率曲线三维拟合图
subplot(1,2,1);
mesh(n,Ttq,be);%生成由n,Ttq和be指定的网线面的三维网格图
hold on;
mesh(n,Ttq,Pe);
axis([1000,3000,100,600,0,500]);
hold on;
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('万有特性曲线');
hold on;

%绘制等油耗率曲线的二维图
B=contour(n,Ttq,be,11);%画等位线,并给出标识数据
clabel(B);%把“等位值”沿等位线随机标识
hold on;

%绘制等功率曲线的二维图
P=contour(n,Ttq,Pe,11);%画等位线,并给出标识数据
clabel(P);%把“等位值”沿等位线随机标识
legend('等油耗曲线','等功率曲线','外特性曲线')
hold off

五.重新走拟合这条路

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值