📄 imcmenum.m
字号:
'Position',[335 190 60 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(Epsilon{row,col}(2)),...
'UserData',[16],...
'Callback','TF_index=1;cbackM');
uicontrol(f,...
'Style','text',...
'Position',[20 160 50 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','qd-part:');
uicontrol(f,...
'Style','Popup',...
'String','Zero-pole cancelation from (1-mqqd)pd|Set to be 1|User defined in qd_mat.m',...
'Position',[100 160 210 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'UserData',[14],...
'Callback','TF_index=1;cbackM');
uicontrol(f,...
'Style','text',...
'Position',[45 130 50 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','qd = ');
if degree_freedom==1
qd='1';
else
if cascade
if n_of_TF>1
[mq]=mq_gen(Xmnummt(1,1,:,2),Xmdenmt(1,1,:,2),Xmdeadmt(1,1,:,2),...
qfnummt{1},qfdenmt{1},F_order{1},y);
else
[mq]=mq_gen(Xmnummt{1,1,1,2},Xmdenmt{1,1,1,2},Xmdeadmt{1,1,1,2},...
qfnummt{1},qfdenmt{1},F_order{1},y);
end
[qd{row,col},qdnum{row,col},qdden{row,col}]=qd_mat(Tcanc(2,:),...
mq,Epsilon{row,col}(2),F_order{1},y);
else
if n_of_TF>1
[mq]=mq_gen(Xmnummt,Xmdenmt,Xmdeadmt,qfnummt{1},...
qfdenmt{1},F_order{1},y);
else
[mq]=mq_gen(Xmnummt{1,1},Xmdenmt{1,1},Xmdeadmt{1,1},qfnummt{1},...
qfdenmt{1},F_order{1},y);
end
[qd{row,col},qdnum{row,col},qdden{row,col}]=qd_mat(Tcanc(2,:),...
mq,Epsilon{row,col}(2),F_order{1},y);
end
end
temp=strrep(qd{row,col},'e',num2str(Epsilon{row,col}(2)));
%[12]
uicontrol(f,'Style','edit',...
'Position',[100 133 296 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp);
%[11]
uicontrol(f,'Style','edit',...
'Position',[100 100 296 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',qfden{row,col});
temp=strrep(qfdenc{row,col},'e',num2str(Epsilon{row,col}(2)));
%[10]
uicontrol(f,'Style','edit',...
'Position',[100 70 296 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp);
uicontrol(f,...
'Style','frame',...
'Position',[100 270 296 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[105 273 286 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',qfnums{row,col},...
'UserData',[8],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','frame',...
'Position',[100 225 296 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[105 228 286 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',qfdens{row,col},...
'UserData',[6],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','frame',...
'Position',[155 187 35 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[160 190 25 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(F_order{row,col}),...
'UserData',[4],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','push',...
'Position',[100 20 80 25],...
'String','OK',...
'UserData',[3],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','push',...
'Position',[220 20 80 25],...
'String',' Cancel',...
'Callback','close');
uicontrol(f,...
'Style','push',...
'Position',[340 20 80 25],...
'String','Help',...
'Callback','sayhelp(2300)');
else % MIMO Feedback part Controller
if any(iscellempty(diag(Xpddenmt)))
errordlg('Give at least all diagonal elements of the Pd lag');
return
elseif any(iscellempty(q))
errordlg('Forward part controller must be input first !');
return
else
if any(iscellempty(diag(pd_prime)))
if d_through_p
[pd_prime,pd_prime_str,pdxs]=pdmodel(Xpnummt,Xpdenmt,vlb);
else
[pd_prime,pd_prime_str,pdxs]=pdmodel(Xpdnummt,Xpddenmt,vlb);
end
qfnummt=qnummt; qfdenmt=qdenmt; qfdeadmt=qdeadmt;qf=q;
else
temp=questdlg('The model of Pd was assigned, would you like to re-compute it?',...
'Whoops!!');
switch temp
case 'Yes'
if d_through_p
[pd_prime,pd_prime_str,pdxs]=pdmodel(Xpnummt,Xpdenmt,vlb);
else
[pd_prime,pd_prime_str,pdxs]=pdmodel(Xpdnummt,Xpddenmt,vlb);
end
qfnummt=qnummt; qfdenmt=qdenmt; qfdeadmt=qdeadmt;qf=q;
case 'Cancel'
return
end
end
[f]=crfig(50,50,450,340,'Feedback Path Controller',192/255*[1 1 1],'none','off');
set(f,'UserData',{[row col p_index],current_obj});
set(f,'DeleteFcn','clear QD_handle PD_handle;');
uicontrol(f,...
'Style','text',...
'Position',[20 240 400 80],...
'Backgroundcolor',192/255*[1 1 1],...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String',['The current version of IMCTUNE assumes that the feedback part controller ',...
'inverts the same part of the model as the forward part controller. However, ',...
'it would have different set of filter time constants. In addition, the user ',...
'can provide the model of the disturbance lag, Pd*, as a diagonal matrix. ',...
'The default diagonal elements of the Pd* are the fastest element ',...
'(smallest time constant) in each row of Pd.']);
uicontrol(f,...
'Style','text',...
'Position',[20 200 190 25],...
'Backgroundcolor',192/255*[1 1 1],...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','The model of the disturbance lag, Pd* :');
PD_handle=Xuiarray([220 190 140 50],maxrow,maxcol,0,0,...
'push','p_index=1;imcmenuM;','',pd_prime_str,3210,f);
uicontrol(f,...
'Style','text',...
'Position',[20 75 190 25],...
'Backgroundcolor',192/255*[1 1 1],...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','The qd part of the feedback controller :');
% Calculate qd
if length(Epsilon)==1
Epsilon(2)=Epsilon(1);
end
if length(Epsilon{2}) < maxcol
Epsilon{2}(2:maxcol)=Epsilon{2}(1);
end
qdtemp=cell(maxrow,maxcol);
for i=1:maxcol
temp=mq_gen(1,1,dec_M(i),1,1,order(i),y);
[qd{i,i},qdnum{i,i},qdden{i,i}]=qd_mat(pd_prime{i,i},temp,Epsilon{2}(i),order(i),y);
qdtemp{i,i}=strrep(qd{i,i},'e',num2str(Epsilon{2}(i)));
qd{i,i}=strrep(qd{i,i},'e',['e(' num2str(i) ')']);
end
QD_handle=Xuiarray([220 65 140 50],maxrow,maxcol,0,0,...
'push','p_index=1;imcmenuM;','',qdtemp,3220,f);
clear qdtemp
uicontrol(f,...
'Style','text',...
'Position',[20 155 170 23],...
'Backgroundcolor',192/255*[1 1 1],...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Order of the diagonal filter :');
uicontrol(f,...
'Style','frame',...
'Position',[190 157 200 24],...
'Foregroundcolor','k');
order_handle=uicontrol(f,...
'Style','edit',...
'Position',[195 160 190 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(order),...
'UserData',[12],...
'Callback','');
uicontrol(f,...
'Style','text',...
'Position',[20 125 170 23],...
'Backgroundcolor',192/255*[1 1 1],...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Diagonal filter time constants :');
uicontrol(f,...
'Style','frame',...
'Position',[190 127 200 24],...
'Foregroundcolor','k');
E_handle=uicontrol(f,...
'Style','edit',...
'Position',[195 130 190 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(Epsilon{2}),...
'UserData',[12],...
'Callback','Epsilon{2}=str2num(get(gco,''String''));');
uicontrol(f,...
'Style','push',...
'Position',[150 20 80 25],...
'Backgroundcolor',192/255*[1 1 1],...
'String','Done',...
'UserData',[3],...
'Callback','cbackM;');
uicontrol(f,...
'Style','push',...
'Position',[270 20 80 25],...
'Backgroundcolor',192/255*[1 1 1],...
'String',' Cancel',...
'Callback','close');
end
end
case 2400 % Pd
% not_save_yet=1;
[f]=crfig(50,50,500,370,['Pd : (' num2str(row) ',' num2str(col) ')'],'w','none','off');
set(f,'UserData',{[row col p_index],current_obj});
uicontrol(f,...
'Style','text',...
'Position',[20 300 400 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Pd (edit) = --------------------------------------------------------------------------------');
uicontrol(f,...
'Style','text',...
'Position',[20 190 200 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Current Pd:');
uicontrol(f,...
'Style','text',...
'Position',[100 180 400 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','--------------------------------------------------------------------------------------------');
pduindex=get_uindex(Xpdnummt,Xpddenmt);
uicontrol(f,...
'Style','text',...
'Position',[125 125 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Center',...
'String',['Only x [ ' num2str(pduindex{row,col}) ' ] required']);
uicontrol(f,'Style','edit',...
'Position',[100 195 296 20],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',Xpdnum{row,col});
uicontrol(f,'Style','edit',...
'Position',[100 165 296 20],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',Xpdden{row,col});
uicontrol(f,...
'Style','frame',...
'Position',[100 320 296 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[105 323 286 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',Xpdnums{row,col},...
'UserData',[12],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','frame',...
'Position',[100 275 296 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[105 278 286 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',Xpddens{row,col},...
'UserData',[10],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','push',...
'Position',[100 20 80 25],...
'String','OK',...
'UserData',[9],...
'Callback',['TF_index=1;cbackM']);
uicontrol(f,...
'Style','push',...
'Position',[220 20 80 25],...
'String',' Cancel',...
'Callback','close');
uicontrol(f,...
'Style','push',...
'Position',[340 20 80 25],...
'String','Help',...
'Callback','sayhelp(2100)');
uicontrol(f,...
'Style','text',...
'Position',[20 105 90 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Upper limits of x:');
uicontrol(f,...
'Style','text',...
'Position',[20 67 90 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Lower limits of x:');
uicontrol(f,...
'Style','frame',...
'Position',[125 102 270 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
if all(length(vub)>=pduindex{row,col})
temp=num2str(vub(pduindex{row,col}));
else
temp='';
end
uicontrol(f,...
'Style','edit',...
'Position',[130 105 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp,...
'UserData',[3],...
'Callback','TF_index=1;cbackM');
uicontrol(f,...
'Style','frame',...
'Position',[125 64 270 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
if all(length(vlb)>=pduindex{row,col})
temp=num2str(vlb(pduindex{row,col}));
else
temp='';
end
uicontrol(f,...
'Style','edit',...
'Position',[130 67 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp,...
'UserData',[1],...
'Callback','TF_index=1;cbackM');
case 4700
temp=round(64/maxrow/maxcol)-1;
temp1=(maxcol*(row-1)+col)*temp;
temp=get(current_obj,'Backgroundcolor');
if all(temp==[1 1 1])
set(current_obj,'Backgroundcolor',COLOR_MAP(temp1,:));
else
set(current_obj,'Backgroundcolor',[1 1 1]);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -