home *** CD-ROM | disk | FTP | other *** search
- function [sv] = sigma2(Z1,Z2,Z3,Z4,Z5,Z6)
- %
- % Singular Value Frequency Response.
- %
- % SV = SIGMA2(A,B,C,D,TYPE,W) or
- % SV = SIGMA2(SS_,TYPE,W) returns a matrix SV containing singular
- % value frequency response associated with a state space system
- % SS_ (created by SYSTEM)
- % .
- % x = Ax + Bu
- % y = Cx + Du
- % -1
- % with frequency response G(jw) = C(jwI - A) B + D .
- %
- % SIGMA calculates the SVD of one of the following types:
- %
- % Type = 1 ---- G(jw)
- % Type = 2 ---- inv(G(jw))
- % Type = 3 ---- I + G(jw)
- % Type = 4 ---- I + inv(G(jw))
- %
- % Vector W contains the frequencies at which the frequency response
- % is to be evaluated and the rows of sigma contain the singular value
- % frequency responses in descending order.
- %
-
- % R. Y. Chiang & M. G. Safonov 5/16/85 & 10/25/90
- % Copyright (c) 1988 by the MathWorks, Inc.
- % All Rights Reserved.
- % -------------------------------------------------------------------
- %
-
- if exist('mkargs') == 2, %If RCT installed
- inargs='(a,b,c,d,Type,w)';
- eval(mkargs(inargs,nargin,'ss'))
- else
- if nargin<4,
- error('Too few input arguments')
- else
- a=Z1; b=Z2; c=Z3; d=Z4;
- if nargin > 5
- w = Z6;
- elseif nargin > 4,
- type=Z5;
- end;
- end;
- end;
-
- [mg] = freqrc(a,b,c,d,w);
- [rmg,cmg] = size(mg);
- [rb,cb] = size(b);
- [rc,cc] = size(c);
- gg = ones(rc,cb);
- for is = 1 : cmg
- gg(:) = mg(:,is);
- if (Type == 1)
- sv(:,is) = svd(gg);
- end
- if (Type == 2)
- sv(:,is) = svd(inv(gg));
- end
- if (Type == 3)
- sv(:,is) = svd(eye(cb) + gg);
- end
- if (Type == 4)
- sv(:,is) = svd(eye(cb) + inv(gg));
- end
- end
- %
- % ----- End of SIGMA2.M ---- RYC/MGS 5/16/85 %
-