Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

ltr0.m
function ltr0(n)
%LTR0 : 1 finestra di sintesi LQG\LTR
%
%                     ltr0(n)
%
% n  = blocchi di integratori da aggiungere al sistema
%
% Finestra relativa alla definizione delle barriere e della
% incertezza non strutturata
%
% Massimo Davini 12/10/99
   
global stack;

A=stack.general.A;
B=stack.general.B;
C=stack.general.C;
D=stack.general.D;
[no,ni]=size(D);

set(findobj('tag','integratori'),'visible','off');
set(findobj('tag','EditIntegr'),'visible','off');
drawnow;

stack.temp.integratori=n;
stack.temp.plant=pck(A,B,C,D);
stack.temp.sys=pck(A,B,C,D);

% enlarge text if java machine is running
jsz=stack.general.javasize;

sizetext1=jsz/2+.7;sz2=jsz/2+.6;

ltr_0(1)=uicontrol('style','frame','units','normalized','position',[0.05 0.59 0.9 0.36],...
    'backgroundcolor',[1 1 1],'visible','off','tag','ltr_0');
 
ltr_0(2)=uicontrol('style','text','units','normalized','position',[0.08 0.87 0.84 0.06],...
   'fontunits','normalized','fontsize',sz2,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'foregroundcolor','red','HorizontalAlignment','left',...
   'visible','off','string','PERFORMANCE ( low frequency limit )','tag','ltr_0');

ltr_0(3)=uicontrol('style','checkbox','units','normalized','position',[0.08 0.8 0.7 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',1,'tag','ltr_0',...
   'visible','off','string','Blocks of integrators added in the previous window');

ltr_0(4)=uicontrol('style','edit','units','normalized','position',[0.82 0.797 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(n),'tag','ltr_0','enable','off');

if n==0 set(ltr_0(3),'enable','off');
else set(ltr_0(3),'enable','inactive');
end;

ltr_0(5)=uicontrol('style','checkbox','units','normalized','position',[0.08 0.74 0.7 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',1,...
   'visible','off','string','Bandwidth upper limit in rad/s ','tag','ltr_0',...
   'callback','set(gcbo,''value'',1);');

ltr_0(6)=uicontrol('style','edit','units','normalized','position',[0.82 0.737 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(10),'tag','ltr_0');

cb1=['set(gcbo,''value'',1);',...
     'set(findobj(''tag'',''ib_text''),''visible'',''off'');',...
     'set(findobj(''tag'',''ibg''),''visible'',''off'');',...
     'set(findobj(''tag'',''ibf''),''visible'',''off'');',...
     'set(findobj(''tag'',''ck_ib''),''value'',0);',...
     'set(findobj(''tag'',''sg''),''visible'',''on'');'];

ltr_0(7)=uicontrol('style','checkbox','units','normalized','position',[0.08 0.68 0.7 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',1,...
   'visible','off','string','Static gain in dB','tag','ck_sg','callback',cb1);

ltr_0(8)=uicontrol('style','edit','units','normalized','position',[0.82 0.677 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(60),'tag','sg');

cb2=['set(gcbo,''value'',1);',...
     'set(findobj(''tag'',''ib_text''),''visible'',''on'');',...
     'set(findobj(''tag'',''ibg''),''visible'',''on'');',...
     'set(findobj(''tag'',''ibf''),''visible'',''on'');',...
     'set(findobj(''tag'',''ck_sg''),''value'',0);',...
     'set(findobj(''tag'',''sg''),''visible'',''off'');'];

ltr_0(9)=uicontrol('style','checkbox','units','normalized','position',[0.08 0.62 0.3 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',0,...
   'visible','off','string','Integral behaviour','tag','ck_ib','callback',cb2);

ltr_0(10)=uicontrol('style','text','units','normalized','position',[0.43 0.62 0.15 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','center',...
   'visible','off','string','Gain in dB','tag','ib_text');

ltr_0(11)=uicontrol('style','edit','units','normalized','position',[0.58 0.617 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(60),'tag','ibg');

ltr_0(12)=uicontrol('style','text','units','normalized','position',[0.68 0.62 0.13 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','right',...
   'visible','off','string','at rad/s','tag','ib_text');

ltr_0(13)=uicontrol('style','edit','units','normalized','position',[0.82 0.617 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(0.01),'tag','ibf');
%------
ltr_0(14)=uicontrol('style','frame','units','normalized','position',[0.05 0.22 0.9 0.36],...
    'backgroundcolor',[1 1 1],'visible','off','tag','ltr_0');

ltr_0(15)=uicontrol('style','text','units','normalized','position',[0.08 0.50 0.84 0.06],...
   'fontunits','normalized','fontsize',sz2,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'foregroundcolor','red','HorizontalAlignment','left',...
   'visible','off','string','MULTIPLICATIVE UNCERTAINTY  ( high frequency limit )','tag','ltr_0');

ltr_0(16)=uicontrol('style','frame','units','normalized','position',[0.08 0.25 0.16 0.22],...
   'backgroundcolor',[1 1 1],'visible','off','tag','ltr_0');
 
cbi1=['if strcmp(get(findobj(''tag'',''opt_o''),''enable''),''on''),',...
      'set(findobj(''tag'',''opt_o''),''value'',0);end;'];
cbo1=['if strcmp(get(findobj(''tag'',''opt_i''),''enable''),''on''),',...
      'set(findobj(''tag'',''opt_i''),''value'',0);end;'];
cbio0=['set(gco,''value'',1);'];   

ltr_0(17)=uicontrol('style','radiobutton','units','normalized','position',[0.09 0.38 0.14 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',0,...
   'visible','off','string','Input','tag','opt_i','enable','off','callback',[cbio0,cbi1]);

ltr_0(18)=uicontrol('style','radiobutton','units','normalized','position',[0.09 0.29 0.14 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',0,...
   'visible','off','string','Output','tag','opt_o','enable','off','callback',[cbio0,cbo1]);

% ni=#ingressi,no=#uscite
if ni<no      set(ltr_0(17),'value',1,'enable','on');
elseif ni>no  set(ltr_0(18),'value',1,'enable','on');
elseif ni==no set(ltr_0(17),'value',1);set(ltr_0(17:18),'enable','on');
end;

ltr_0(19)=uicontrol('style','text','units','normalized','position',[0.27 0.40 0.66 0.1],...
   'fontunits','normalized','fontsize',jsz/2+.3,'fontweight','bold','ForegroundColor','b',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','tag','ltr_0',...
   'visible','off','string','The upper bound of the uncertainty norm will be approximated to a LOWPASS transfer function with :');

ltr_0(20)=uicontrol('style','checkbox','units','normalized','position',[0.28 0.31 0.53 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',1,...
   'visible','off','string','Crossover frequency in rad/s','tag','ltr_0',...
   'callback','set(gcbo,''value'',1);');

ltr_0(21)=uicontrol('style','checkbox','units','normalized','position',[0.28 0.25 0.53 0.05],...
   'fontunits','normalized','fontsize',sizetext1,'fontweight','bold',...
   'backgroundcolor',[1 1 1],'HorizontalAlignment','left','value',1,...
   'visible','off','string','Roll-off at crossover in dB/dec','tag','ltr_0',...
   'callback','set(gcbo,''value'',1);');

ltr_0(22)=uicontrol('style','edit','units','normalized','position',[0.82 0.307 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(20),'tag','cf');

ltr_0(23)=uicontrol('style','edit','units','normalized','position',[0.82 0.247 0.1 0.06],...
   'fontunits','normalized','fontsize',jsz/2+.6,'fontweight','bold',...
   'backgroundcolor','yellow','HorizontalAlignment','center',...
   'visible','off','string',num2str(40),'tag','ro');

ltr_00(1)=uicontrol('style','push','unit','normalized','position',[0.05 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'string','BACK','Horizontalalignment','center','tag','ltr_0',...
   'TooltipString','Back to the previous window',...
   'callback',sprintf('back_syn(''integratori'',%u,''integratori'',''plant'',''sys'',''edit'');',length(stack.temp.handles))); 

ltr_00(2)=uicontrol('style','push','unit','normalized','position',[0.2 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'string','CLOSE','Horizontalalignment','center','tag','ltr_0',...
   'TooltipString','Back to the main SYNTHESIS window',...
   'callback','back_syn(''syn0'',0,''integratori'',''plant'',''sys'',''edit'');');

ltr_00(3)=uicontrol('style','push','unit','normalized','position',[0.81 0.05 0.14 0.12],...
   'fontunits','normalized','fontsize',.35,'fontweight','bold',...
   'Horizontalalignment','center','string','NEXT','tag','ltr_0',...
   'TooltipString','Go to the next window','callback','ltr1;');

set(ltr_00,'visible','on');
drawnow;
set(ltr_0(1:9),'visible','on');
set(ltr_0(14:length(ltr_0)),'visible','on');
drawnow;

stack.temp.handles=[stack.temp.handles,ltr_00,ltr_0];

%handles degli edit
stack.temp.edit=[ltr_0(6) ltr_0(8) ltr_0(11) ltr_0(13) ltr_0(22) ltr_0(23)];

Contact us