www.pudn.com > Closid30.rar > Clsigcon.m, change:1999-02-08,size:2122b


function clsigcon(option) 
 
% function clsigcon(option) 
% 
% Constructs the identification signals for the second step in  
% closed-loop identification methods that have a nontrivial first step. 
% Two-step method:           option=1    
% Coprime factor method:     option=2	 
% Dual-Youla identification: option=3    
 
% Functions called: clobjget,clsplit,cldn2sys,dlsim,clobjins,cllight 
 
% 03-06-1997 (partly based on clyucon) 
% (c) Paul Van den Hof  
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last update: 12-06-1997. 
%              11-09-1998. Adapted to deal with working data. 
%              15-09-1998. 
%              16-09-1998 Adapted to handle also validation data. 
 
% Read the original data 
[data,title,info,p]=clobjget('datw'); 
[datav,titlev,infov,pv]=clobjget('datv');  %% Added 16-09-1998 
 
if option==1 
  S=clobjget('X'); 
  [a,b,c,d]=clsplit(S); 
% Take the excitation signal that is stored in 'datre' as a basis for the 
% input simulation: 
  r_c=clobjget('datre'); 
  x=dlsim(a,b,c,d,r_c); 
  clobjins([data(:,1) x],'datfe',' ',' ',p); 
% 
% and do the same thing for validation data	%% Added 16-09-1998 
  r_cv=clobjget('datrv'); 
  xv=dlsim(a,b,c,d,r_cv); 
  clobjins([datav(:,1) xv],'datfv',' ',' ',pv); 
 
else 
% 
  C=clobjget('C'); 
  Gxf=clobjget('Xnd'); 
%   
  ngxf=size(Gxf,1)-2; 
  [sfx,nsfx]=clmkfx(Gxf,C,ngxf,length(C)-1,'R'); 
  [afx,bfx,cfx,dfx]=clsplit(sfx,nsfx); 
  x=dlsim(afx,bfx,cfx,dfx,data(:,[1 2])); 
  xv=dlsim(afx,bfx,cfx,dfx,datav(:,[1 2]));	  %% Added 16-09-1998 
  if option==2 
    clobjins([data(:,1:2) x],'datfe',' ',' ',p); 
	clobjins([datav(:,1:2) xv],'datfv',' ',' ',pv);	%% Added 16-09-1998 
  elseif option==3 
	Cf=clobjget('Cnd'); 
	ncf=size(Cf,1)-2; 
	[sgx,nsgx]=cldn2sys(Gxf,ngxf,'R'); 
	[sfz,nsfz]=clmkfz(sgx,Cf,nsgx,ncf,'R'); 
	[afz,bfz,cfz,dfz]=clsplit(sfz,nsfz); 
    z=dlsim(afz,bfz,cfz,dfz,data(:,[1 2])); 
	zv=dlsim(afz,bfz,cfz,dfz,datav(:,[1 2])); %% Added 16-09-1998  
	clobjins([z x],'datfe',' ',' ',p); 
	clobjins([zv xv],'datfv',' ',' ',pv);	  %% Added 16-09-1998 
  end 
end 
cllight(1)