function [af,bf,cf,df,svl] = ltru(Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10)
% [ss_f,svl] = ltru(ss_,Kc,Xi,Th,r,w,svk) or
% [af,bf,cf,df,svl] = ltru(A,B,C,D,Kc,Xi,Th,r,w,svk) produces 
%    LQG/LTR at inputs of the plant, such that the LQG loop TF
%    will converge to LQSF's loop TF as the plant noise goes to INF:
%                        -1                  -1
%     GKc(Is-A+B*Kc+Kf*C) Kf -------> Kc(Is-A) B   (as r --> INF)
%                                 
%  Inputs: sys -- system matrix, dim -- no.of states
%          Kc -- LQSF gain
%  (optional) svk(MIMO) -- SV of (Kc inv(Is-A)B)
%  (optional) svk(SISO) -- [re im;re(reverse order) -im(reverse order)] 
%                          of complete Nyquist plot
%          w -- frequency points
%          Xi -- plant noise intensity, Th -- sensor noise intensity
%          r -- a row vector containing a set of recovery gains
%               (nr: length of r)   
%  Outputs: svl -- singular value plots of all the recovery points
%           svl(SISO) -- Nyquist loci svl = [re(1:nr) im(1:nr)]
%           final state-space controller (af,bf,cf,df).

% R. Y. Chiang & M. G. Safonov 6/86
% Copyright (c) 1988 by the MathWorks, Inc.
% All Rights Reserved.
% ------------------------------------------------------------------
%

nag1 = nargin;
inargs = '(A,B,C,D,Kc,Xi,Th,r,w,svk)';
eval(mkargs(inargs,nag1,'ss'))
nag1 = nargin;
if nag1 == 10
   [af,bf,cf,df,svl] = ltry(A',C',B',D',Kc',Xi,Th,r,w,svk);
else
   [af,bf,cf,df,svl] = ltry(A',C',B',D',Kc',Xi,Th,r,w);
end
if xsflag
   af = mksys(af,bf,cf,df);
   bf = svl;
end
%
% ------- End of LTRU.M -- RYC %
