home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / SFRWTBLD.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.1 KB  |  44 lines

  1. % function syshat = sfrwtbld(sys,wt1,wt2)
  2. %
  3. %   Calculate the stable part of (WT1~)*SYS*(WT2~)
  4. %   The routine is used with SFRWTBAL to obtain a possible
  5. %   SYSHAT as follows:
  6. %
  7. %    >>[sys1,sig1] = sfrwtbal(sys,wt1,wt2);
  8. %    >>sys1hat = strunc(sys1,k)
  9. %   or 
  10. %    >>sys1hat = hankmr(sys1,sig1,k)
  11. %    >>syshat = sfrwtbld(sys1hat,wt1,wt2);
  12. %
  13. %   The resulting error can be assessed with a direct frequency
  14. %   response calculation.
  15. %
  16. %   See also: HANKMR, SDECOMP, SFRWTBAL, SNCFBAL, SRELBAL, SYSBAL,
  17. %             SRESID, and TRUNC.
  18.  
  19.  
  20. function syshat=sfrwtbld(sys1hat,wt1,wt2);
  21.  
  22. % initial consistency checks.
  23. if nargin <2
  24.   disp('usage: syshat = sfrwtbld(sys,wt1,wt2);')
  25.    return
  26. end
  27.  
  28. [systype,p,m,n]= minfo(sys1hat);
  29. if nargin==2, wt2=eye(m); end
  30. [wt1type,p1,m1,n1]= minfo(wt1);
  31. [wt2type,p2,m2,n2]= minfo(wt2);
  32. if m1~=p1 | m1~=p
  33.   error('WT1 should be square compatible with SYS')
  34.   return
  35. end
  36. if m2~=p2 | m2~=m
  37.   error('WT2 should be square compatible with SYS')
  38.   return
  39. end
  40.  
  41. syshat = sdecomp(mmult(cjt(wt1),mmult(sys1hat,cjt(wt2))));
  42. %
  43. % Copyright MUSYN INC 1991,  All Rights Reserved
  44.