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

  1. function [Ap,Bp,Cp,Dp] = sectf(Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8)
  2. % [SS_P] = SECTF(SS_,d11,a,b,Type) or
  3. % [Ap,Bp,Cp,Dp] = SECTF(A,B,C,D,d11,a,b,Type) performs multivariable
  4. %   sector bilinear transformation on input-output channel 1 of a plant
  5. %   P(s) such that the original input-output pairs (U1,Y1) in sector[a,b]
  6. %   is mapped to another sector[x,y], or vice versa. 
  7. %
  8. %                           |A  B1  B2 |
  9. %           P(s) := |A B| = |C1 D11 D12| 
  10. %                   |C D|   |C2 D21 D22|
  11. %
  12. %           d11 = any matrix of same size as D11
  13. %
  14. %   Four options are provided: (must have 0 < b <= inf, a < b)
  15. %
  16. %       Type = 1, sector(a,b) -----> sector(0,inf) = positive real problem
  17. %       Type = 2, sector(a,b) -----> sector(-1,1)  = small gain problem
  18. %       Type = 3, sector(0,inf) ---> sector(a,b) (inverse map of type 1)
  19. %       Type = 4, sector(-1,1) ----> sector(a,b) (inverse map of type 2)
  20. %
  21.  
  22. % R. Y. Chiang & M. G. Safonov 2/1/88
  23. % Copyright (c) 1988 by the MathWorks, Inc.
  24. % All Rights Reserved.
  25. % --------------------------------------------------------------------------
  26.  
  27. inargs = '(A,B,C,D,d11,a,b,Type)';
  28. eval(mkargs(inargs,nargin,'ss'))
  29.  
  30. [rd11,cd11] = size(d11);
  31. [ra,ca] = size(A);
  32. [rb,cb] = size(B);
  33. [rc,cc] = size(C);
  34. m = rd11; cb2 = cb-m; rc2 = rc-m;
  35. %
  36. if rd11 ~= cd11
  37.    disp('    D11 NONSQUARE !! NO SECTOR TRANSFORMATION EXISTS !!')
  38.    return
  39. end
  40. % ---------------------------------------------
  41. if Type == 1
  42.    q = a; r = 1/b;
  43. end
  44. %
  45. if Type== 2
  46.    q1 = a; r1 = 1/b;
  47.    q2 = 1; r2 = -1;
  48. end
  49. %
  50. if Type== 3
  51.    q = -a; r = -1/b;
  52. end
  53. %
  54. if Type== 4
  55.    q1 = -1; r1 = 1;
  56.    q2 = -a; r2 = -1/b;
  57. end
  58. % ---------------------------------------------
  59. B = [B zeros(rb,2)];
  60. C = [C;zeros(2,cc)];
  61. M = zeros(m+cb2+m+m,m+cb2);
  62. N = zeros(m+rc2,m+rc2+m+m);
  63. F = zeros(m+cb2+m+m,m+rc2+m+m);
  64. F(1:m,m+rc2+m+1:m+rc2+m+m) = eye(m);
  65. F(m+cb2+m+1:m+cb2+m+m) = eye(m);
  66. % ---------------------------------------------
  67. if cb2 ~= 0 & rc2 ~= 0
  68.    M(m+1:m+cb2,m+1:m+cb2) = eye(cb2);
  69.    M(m+cb2+1:m+cb2+m,1:m) = eye(m);
  70.    N(1:m,m+rc2+1:m+rc2+m) = eye(m);
  71.    N(m+1:m+rc2,m+1:m+rc2) = eye(rc2);
  72. else
  73.    M(m+cb2+1:m+cb2+m,1:m) = eye(m);
  74.    N(1:m,m+rc2+1:m+rc2+m) = eye(m);
  75. end
  76. % ----------------------------------------------
  77. if Type == 1 | Type == 3
  78.    K = [-q 1-q*r;1 r];
  79.    D = [D zeros(rc,2);zeros(2,cb) K];
  80.    [Ap,Bp,Cp,Dp] = interc(A,B,C,D,M,N,F);
  81. end
  82. %
  83. if Type == 2 | Type == 4
  84.    K1 = [-q1 1-q1*r1;1 r1];
  85.    D = [D zeros(rc,2);zeros(2,cb) K1];
  86.    [A,B,C,D] = interc(A,B,C,D,M,N,F);
  87.    K2 = [-q2 1-q2*r2;1 r2];
  88.    D = [D zeros(rc,2);zeros(2,cb) K2];
  89.    [Ap,Bp,Cp,Dp] = interc(A,B,C,D,M,N,F);
  90. end
  91. %
  92. if xsflag
  93.    ss_p = mksys(Ap,Bp,Cp,Dp);
  94.    Ap = ss_p;
  95. end
  96. %
  97.  
  98. % ---------- End of SECTF88.M --- RYC/MGS 1988 (Rev. 03/06/92)
  99.