home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 7.ddi / ROBUST.DI$ / IOFR.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.9 KB  |  75 lines

  1. function [ain,bin,cin,din,ainp,binp,cinp,dinp,aout,bout,cout,dout] = iofc(Z1,Z2,Z3,Z4)
  2. % [SS_IN,SS_INP,SS_OUT] = IOFC(SS_) or
  3. % [AIN,BIN,CIN,DIN,AINP,BINP,CINP,DINP,AOUT,BOUT,COUT,DOUT] = IOFC(A,B,C,D) 
  4. %     produces an inner-outer factorization of a m x n transfer function 
  5. %     G: SS_ = MKSYS(A,B,C,D) (m>=n)
  6. %     such that
  7. %                      G = |Th Thp| |M|
  8. %                                   |0|
  9. %     where
  10. %                      [Th Thp] : square and inner.
  11. %                      M : outer factor.
  12. %
  13. %     The resulting state-space quadruples are accumulated in
  14. %     (ain,bin,...) or
  15. %
  16. %            ss_in  = mksys(ain,bin,cin,din); 
  17. %            ss_inp = mksys(ainp,binp,cinp,dinp);
  18. %            ss_out = mksys(aout,bout,cout,dout); 
  19. %
  20. %     The standard state-space can be recovered by "branch".
  21.  
  22. % R. Y. Chiang & M. G. Safonov 8/85
  23. % Copyright (c) 1988 by the MathWorks, Inc.
  24. % All Rights Reserved.
  25. % ---------------------------------------------------------------
  26. %
  27.  
  28. inargs = '(a,b,c,d)';
  29. eval(mkargs(inargs,nargin,'ss'))
  30.  
  31. [dp] = ortc(d);
  32. deln1 = inv(d'*d);
  33. aric = a - b * deln1 * d' * c;
  34. qric = c' * dp * dp' * c;
  35. rric = d' * d;
  36. qrn = diagmx(qric,rric);
  37. [kx,x] = lqrc(aric,b,qrn);
  38. f = -deln1 * (b' * x + d' * c);
  39. %
  40. % --------- Inner factor:
  41. %
  42. Ri12 = (d'*d)^(-0.5);
  43. ain = a + b * f; bin = b * Ri12;
  44. cin = c + d * f; din = d * Ri12;
  45. %
  46. % --------- Complementary inner factor:
  47. %
  48. xp = pinv(x);
  49. binp = -xp * c' * dp;
  50. dinp = dp;
  51. ainp = ain;
  52. cinp = cin;
  53. %
  54. % --------- Inverse of the outer factor:
  55. %
  56. aouti = ain;
  57. bouti = bin;
  58. couti = f;
  59. douti = Ri12;
  60. %
  61. % --------- Outer factor:
  62. %
  63. dout = inv(douti);
  64. aout = ain-bouti*dout*couti;
  65. bout = bouti*dout;
  66. cout = -dout*couti;
  67. %
  68. if xsflag
  69.   ain = mksys(ain,bin,cin,din);
  70.   bin = mksys(ainp,binp,cinp,dinp);
  71.   cin = mksys(aout,bout,cout,dout);
  72. end
  73. %
  74. % ------ End of IOFR.M ---- RYC/MGS 8/85 %
  75.