clear all;
t=0:0.0004:(2500-1)/2500; % important
%64g/s 流量输入,经过非线性静态环节
t1=1083;
for i=1:t1
x1(i)=0;
end
for i=(t1+1):2500
x1(i)=1;
end
x1=x1';
flux=64.12;
p=[0.00000000158458,-0.00000044392527,0.00004927931552,-0.00288655624523,0.10954571440471,0.94145172599242];
flux=polyval(p,flux)-0.94145172599242;
u=flux*x1;%u中间变量,非线性环节输出,阶跃信号
%非线性环节输出而后经过线性环节,得到传感器块联模型输出
num=[1];
den=conv([0.025169,1],[ 192.460129000000e-006, 0.01133812544,1]);
[num_yls,den_yls] = c2dm(num,den,1/2500,'method');%连续转换为离散系统
u_sc=filter(num_yls,den_yls,u);
%得到64g/s 流量线性补偿环节的输出
num_bcls=[0,261.341216363692,-773.854264573488,763.985231284803,-251.469094001635];
den_bcls=[1,-1.90816006974182,911.254706444840e-003,0,0];
u_bc=filter(num_bcls,den_bcls,u_sc);
figure(1)
plot(t,u_sc,'k',t,u_bc,'k')
h3=xlabel('Time (s)');
h4=ylabel('Voltage (V)');
set(h4,'Fontsize',10);
set(h3,'Fontsize',10);
set(gcf,'color',[1,1,1]);
set(gca,'xcolor',[0,0,0],'ycolor',[0,0,0]);
set(gcf,'units','centimeters','position',[3,3,7,5]);
set(gca,'box','on','fontname','Times New Roman','fontsize',10,'LineWidth',1.4);
annotation1 = annotation(figure(1),'line',[0.5887 0.6151],[0.7034 0.6364]);
annotation1 = annotation(figure(1),'line',[0.4851 0.4436],[0.7033 0.6651]);
annotation1 = annotation(...
figure(1),'textbox',...
'Position',[0.6038 0.5153 0.3396 0.1404],...
'LineStyle','none',...
'FontSize',8,...
'String',{'1'},...
'FitHeightToText','on');
annotation1 = annotation(...
figure(1),'textbox',...
'Position',[0.3635 0.5343 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'2'},...
'FitHeightToText','on');
title('flux=64g/s')
% 输入值为17流量的阶跃信号
t1=1230;
for i=1:t1
x17(i)=0;
end
for i=(t1+1):2500
x17(i)=1;
end
x17=x17';
flux17=17.34655297889845;
%经过非线性静态环节
flux17=polyval(p,flux17)-0.94145172599242;
u_17=flux17*x17;%u中间变量,非线性环节输出,阶跃信号
%非线性环节输出而后经过线性环节,得到传感器块联模型输出
u_sc17=filter(num_yls,den_yls,u_17);
%得到17g/s 流量线性补偿环节的输出
u_bc17=filter(num_bcls,den_bcls,u_sc17);
figure(2)
plot(t,u_sc17,'k',t,u_bc17,'k')
h3=xlabel('Time (s)');
h4=ylabel('Voltage (V)');
set(h4,'Fontsize',10);
set(h3,'Fontsize',10);
set(gcf,'color',[1,1,1]);
set(gca,'xcolor',[0,0,0],'ycolor',[0,0,0]);
set(gcf,'units','centimeters','position',[3,3,7,5]);
set(gca,'box','on','fontname','Times New Roman','fontsize',10,'LineWidth',1.4);
annotation1 = annotation(figure(2),'line',[0.5115 0.47],[0.7559 0.7177]);
annotation1 = annotation(figure(2),'line',[0.6075 0.6453],[0.7 0.6316]);
annotation1 = annotation(...
figure(2),'textbox',...
'Position',[0.6302 0.4908 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'1'},...
'FitHeightToText','on');
annotation1 = annotation(...
figure(2),'textbox',...
'Position',[0.4126 0.5764 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'2'},...
'FitHeightToText','on');
title('flux=17g/s')
% 输入值为77流量的阶跃信号
t1=1081;%gaidong yao
for i=1:t1
x77(i)=0;
end
for i=(t1+1):2500
x77(i)=1;
end
x77=x77';
flux77=77.3039;
%经过非线性静态环节
flux77=polyval(p,flux77)-0.94145172599242;
u_77=flux77*x77;%u中间变量,非线性环节输出,阶跃信号
%非线性环节输出而后经过线性环节,得到传感器块联模型输出
u_sc77=filter(num_yls,den_yls,u_77);
%得到77g/s 流量线性补偿环节的输出
u_bc77=filter(num_bcls,den_bcls,u_sc77);
figure(3)
plot(t,u_sc77,'k',t,u_bc77,'k')
h3=xlabel('Time (s)');
h4=ylabel('Voltage (V)');
set(h4,'Fontsize',10);
set(h3,'Fontsize',10);
set(gcf,'color',[1,1,1]);
set(gca,'xcolor',[0,0,0],'ycolor',[0,0,0]);
set(gcf,'units','centimeters','position',[3,3,6.8,5]);
set(gca,'box','on','fontname','Times New Roman','fontsize',10,'LineWidth',1.4);
annotation1 = annotation(figure(3),'line',[0.5509 0.5811],[0.7105 0.6579]);
annotation1 = annotation(figure(3),'line',[0.47 0.4285],[0.7665 0.7283]);
annotation1 = annotation(...
figure(3),'textbox',...
'Position',[0.5623 0.5066 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'1'},...
'FitHeightToText','on');
annotation1 = annotation(...
figure(3),'textbox',...
'Position',[0.3749 0.608 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'2'},...
'FitHeightToText','on');
title('flux=77g/s')
% 输入值为32流量的阶跃信号
t32=1250;
for i=1:t32
x32(i)=0;
end
for i=(t32+1):2500
x32(i)=1;
end
x32=x32';
flux32=32.60;
%经过非线性静态环节
flux32=polyval(p,flux32)-0.94145172599242;
u_32=flux32*x32;%u中间变量,非线性环节输出,阶跃信号
%非线性环节输出而后经过线性环节,得到传感器块联模型输出
u_sc32=filter(num_yls,den_yls,u_32);
%得到17g/s 流量线性补偿环节的输出
u_bc32=filter(num_bcls,den_bcls,u_sc32);
figure(4)
plot(t,u_sc32,'k',t,u_bc32,'k')
h3=xlabel('Time (s)');
h4=ylabel('Voltage (V)');
set(h4,'Fontsize',10);
set(h3,'Fontsize',10);
set(gcf,'color',[1,1,1]);
set(gca,'xcolor',[0,0,0],'ycolor',[0,0,0]);
set(gcf,'units','centimeters','position',[3,3,7,5]);
set(gca,'box','on','fontname','Times New Roman','fontsize',10,'LineWidth',1.4);
annotation1 = annotation(figure(4),'line',[0.5585 0.6058],[0.7526 0.6756]);
annotation1 = annotation(figure(4),'line',[0.4679 0.4361],[0.7895 0.7388]);
annotation1 = annotation(...
figure(4),'textbox',...
'Position',[0.6 0.5276 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'1'},...
'FitHeightToText','on');
annotation1 = annotation(...
figure(4),'textbox',...
'Position',[0.3635 0.6133 0.3396 0.1544],...
'LineStyle','none',...
'FontSize',8,...
'String',{'2'},...
'FitHeightToText','on');
title('flux=32g/s')