MATLAB及Origin绘制发动机万有特性曲线实例
1.MATLAB绘制发动机万有特性实例(含程序代码)
2.Origin绘制发动机万有特性曲线方法(操作步骤)
一、MATLAB方法
MTALB绘制发动机万有特性曲线需要建立M文件,并在M文件中将程序写入,运行即可,当然也可以通过调用excel数据来绘制万有特性曲线,下面是MATLAB绘制实例,可借鉴修改然后运行。
MATLAB程序如下:
clc
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;%转换矩阵格式
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];
matlab等高线填充颜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);
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;
Ttqw_N=interp1(Nw,Ttqw,n0,'spline');
h=repmat(Ttqw_N,501,1);
ii=find(Ttq>h);%确定超出边界的“格点”下标
be(ii)=NaN;%强制为非数
Pe(ii)=NaN;%强制为非数
%绘制等燃油消耗率曲线和等功率曲线三维拟合图
subplot(1,2,1);
mesh(n,Ttq,be);
hold on;
mesh(n,Ttq,Pe);
axis([1000,3000,100,600,0,500]);
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论