⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hu.m

📁 电力能源预测
💻 M
字号:
clf reset
set(gcf,'unit','normalized','position',[0.05,0.1,0.8,0.7]);
set(gcf,'defaultuicontrolunits','normalized');
set(gcf,'defaultuicontrolfontsize',12);
set(gcf,'defaultuicontrolfontname','隶书');
set(gcf,'defaultuicontrolhorizontal','left');
str='归一化二阶系统阶跃响应曲线';
set(gcf,'name',str,'numbertitle','off');		

%set(h1_axes,'XTick','Xscal');
%数据计算
global g_num;
global k_num;
global n_num;
global o_num;
g_num=0;k_num=0;n_num=0;o_num=0;
K=[1.09898675 1.065957447 1.028942116 1.059489169 1.072322246 1.072851451 1.08938992 ...
1.094716338 ... 
1.106094306 ...
1.096119043 ...
1.072647221 ...
1.062596203 ...
1.090616449 ...
1.112603306 ...
1.11354291 ...
1.105539011 ...
1.085012391 ...
1.073783515 ...
1.048922593 ...
1.020631282 ...
1.065221147 ...
1.09999189 ...
1.093966382  ....
1.114800897 ...
1.15177 1.14 1.137 1.08 1.06 1.05 1.055 1.065 1.067 1.07 1.05 1.04 1.03 1.02 1.03 1.04 1.05 1.053];
I=[2820 3006 3093 3277 3514 3770 4107 4496 4973 5451 5847 ... 
    6213 6776 7539 8395 9281 10070 10813 11342 11576 12331 ...
    13564 14838.56 16542.04 19052.62];
for i=26:42
    I(i)=I(i-1)*K(i);
end
Gc=1:1:17;
G=[63 66 69 72 76 80 87 94 103 115 127 138 151 167 183 200 ...
217 237 254.238 277 299 319 334 357 391];
for i=26:42
    G(i)=G(i-1)+Gc(i-25);
end
 N=zeros(1,42);
 O=zeros(1,42);
 for i=1:42
     L(i)=G(i)-I(i)/(87.6*(1-0.479195-0.005*N(i)+0.005*O(i)));
 end
 for i=1:42
     J(i)=(I(i)/(G(i)*87.6)+0.479195-0.005*N(i)+0.005*O(i))/(I(i)/((G(i)-L(i))*87.6)+0.479195-0.005*N(i)+0.005*O(i));
 end
str1='当前值=';
h1_axes=axes('position',[0.05,0.1,0.6,0.35]);
%Xsc=[1980:1:2020];
%set(h1_axes,'xlim',[1980 2020],'XTick',[1980:1:2020]);	

t=1979:1:2020;
hbar=bar(t,L);
axis([1980 2002 -40 40]);
h2_axes=axes('position',[0.05,0.55,0.6,0.35]);
t=1979:1:2020;
hline=plot(t,J);
axis([1980 2002 0.9  1.1]);


g=0;k=1;n=1;o=1;
G_h1text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.67,0.8,0.13,0.1],...
   'string',['G']);
G_hpop=uicontrol(gcf,'style','popup',...				%	<17>
   'position',[0.67,0.75,0.13,0.1],...
   'string','2004|2005|2006|2007|2008|2009|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|2020');
G_h2text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.81,0.8,0.23,0.1],...
   'string',[str1,sprintf('%1.4g\',g)]);
G_hslider=uicontrol(gcf,'style','slider',...	%	<17>
   'position',[0.81,0.8,0.17,0.05],...
   'max',60,'min',0,...					%	<19>
   'sliderstep',[0.1,0.5],...				%	<20>
   'Value',0);                              %	<21>


K_h1text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.67,0.55,0.13,0.1],...
   'string',['K']);
K_hpop=uicontrol(gcf,'style','popup',...				%	<17>
   'position',[0.67,0.5,0.13,0.1],...
   'string','2004|2005|2006|2007|2008|2009|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|2020');
K_h2text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.81,0.55,0.23,0.1],...
   'string',[str1,sprintf('%1.4g\',k)]);
K_hslider=uicontrol(gcf,'style','slider',...	%	<17>
   'position',[0.81,0.55,0.17,0.05],...
   'max',3,'min',0,...					%	<19>
   'sliderstep',[0.02,0.1],...				%	<20>
   'Value',1);                                  %	<21>


N_h1text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.67,0.35,0.13,0.1],...
   'string',['N']);
N_hpop=uicontrol(gcf,'style','popup',...				%	<17>
   'position',[0.67,0.3,0.13,0.1],...
   'string','2004|2005|2006|2007|2008|2009|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|2020');
N_h2text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.81,0.35,0.23,0.1],...
   'string',[str1,sprintf('%1.4g\',n)]);
N_hslider=uicontrol(gcf,'style','slider',...	%	<17>
   'position',[0.81,0.35,0.17,0.05],...
   'max',3,'min',-3,...					%	<19>
   'sliderstep',[0.1,0.5],...				%	<20>
   'Value',1);%	<21>


O_h1text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.67,0.15,0.13,0.1],...
   'string',['O']);
O_hpop=uicontrol(gcf,'style','popup',...				%	<17>
   'position',[0.67,0.1,0.13,0.1],...
   'string','2004|2005|2006|2007|2008|2009|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|2020');
O_h2text=uicontrol(gcf,'style','text',...		%	<14>
   'position',[0.81,0.15,0.23,0.1],...
   'string',[str1,sprintf('%1.4g\',o)]);
O_hslider=uicontrol(gcf,'style','slider',...	%	<17>
   'position',[0.81,0.15,0.17,0.05],...
   'max',3,'min',-3,...					%	<19>
   'sliderstep',[0.1,0.5],...				%	<20>
   'Value',1);%	<21>

set(G_hslider,'callback',[...						%	<30>
   'g=get(gcbo,''value'');',...				%	<31>
   'xu_callcheck(G_h2text,K_h2text,N_h2text,O_h2text,str1,g,k,n,o)']);	%	<32>

set(K_hslider,'callback',[...						%	<30>
   'k=get(gcbo,''value'');',...				%	<31>
   'xu_callcheck(G_h2text,K_h2text,N_h2text,O_h2text,str1,g,k,n,o)']);	%	<32>

set(N_hslider,'callback',[...						%	<30>
   'n=get(gcbo,''value'');',...				%	<31>
   'xu_callcheck(G_h2text,K_h2text,N_h2text,O_h2text,str1,g,k,n,o)']);	%	<32>

set(O_hslider,'callback',[...						%	<30>
   'o=get(gcbo,''value'');',...				%	<31>
   'xu_callcheck(G_h2text,K_h2text,N_h2text,O_h2text,str1,g,k,n,o)']);	%	<32>
%显示G、K、N、O的当前值;设定需要G、K、N、O的年份
set(G_hpop,'callback',[...						%	<30>
   'Gpopup_callcheck(G_hpop,G_h2text,str1,G)']);	%	<32>

set(K_hpop,'callback',[...						%	<30>
   'Kpopup_callcheck(K_hpop,K_h2text,str1,K)']);	%	<32>

set(N_hpop,'callback',[...						%	<30>
   'Npopup_callcheck(N_hpop,N_h2text,str1,N)']);	%	<32>

set(O_hpop,'callback',[...						%	<30>
   'Opopup_callcheck(O_hpop,O_h2text,str1,O)']);	%	<32>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -