www.pudn.com > Closid30.rar > CLR2P.M, change:1997-06-20,size:1496b


function [P,nP]=clr2p(R,nR,Xnd,nXnd,Cnd,nCnd) 
 
% function [P,nP]=clr2p(R,nR,Xnd,nXnd,Cnd,nCnd) 
% 
% Purpose: Constructs a plant model (P,nP) from 
%          a dual-Youla parameter (R,nR), an 
%          auxiliary model factorization (Xnd,nXnd) 
%          and a controller factorization (Cnd,nCnd). 
 
% Functions called: clsplit, minreal, cldn2sys 
 
% 29-10-1996 
% (c) Edwin van Donkelaar, Paul Van den Hof 
% Mechanical Engineering Systems and Control Group 
% Delft University of Technology 
% Last updated: 07-06-1997 
 
 
% Get the ss-description of the estimated R 
[ar,br,cr,dr]=clsplit(R,nR); 
 
% Get the ss-description of the applied controller factorization 
%[sc,nsc]=cldn2sys(Cnd,nCnd,'r'); 
%[ac,bc,cc,dc]=clsplit(sc,nsc); 
[ac,bc,cc,dc]=clsplit(Cnd,nCnd); 
cDc=cc(1,:);dDc=dc(1,:); 
cNc=cc(2,:);dNc=dc(2,:); 
 
 
% Get the ss-description of the applied auxiliary model factorization 
%[sx,nsx]=cldn2sys(Xnd,nXnd,'r'); 
%[ax,bx,cx,dx]=clsplit(sx,nsx); 
[ax,bx,cx,dx]=clsplit(Xnd,nXnd); 
cDx=cx(1,:);dDx=dx(1,:); 
cNx=cx(2,:);dNx=dx(2,:); 
 
% Construct model 
nr=length(ar); 
nc=length(ac); 
nx=length(ax); 
 
aPnd=[ar zeros(nr,nc+nx);... 
      bc*cr ac zeros(nc,nx) ; ... 
      zeros(nx,nr+nc)  ax]; 
bPnd=[br;bc*dr;bx]; 
cPnd=[-dNc*cr -cNc cDx;... 
      dDc*cr cDc cNx]; 
dPnd=[dDx-dNc*dr;... 
      dNx+dDc*dr]; 
[P,nP]=cldn2sys([aPnd bPnd;cPnd dPnd],length(aPnd),'r'); 
[ap,bp,cp,dp]=clsplit(P,nP); 
[ap,bp,cp,dp]=minreal(ap,bp,cp,dp); 
P=[ap bp;cp dp];nP=length(ap);