home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 9.ddi / IDENT.DI$ / IDSIMSS.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  891 b   |  34 lines

  1. function y=idsimss(ze,eta)
  2. %IDSIMSS  simulates a given system
  3. %
  4. %    Y = idsimss(Z,ETA)
  5. %
  6. %    Auxiliary function to idsim
  7.  
  8. %    L. Ljung 10-2-90
  9. %    Copyright (c) 1990 by the MathWorks, Inc.
  10. %    All Rights Reserved.
  11.  
  12. [nr,nc]=size(eta);
  13. nd=eta(1,5);
  14. sspmod=getmfth(eta);
  15.  
  16. [etapar,P,lambda]=th2par(eta);
  17. arg=getargth(eta);
  18. T=eta(1,2);
  19. if any(eta(2,8)==[2 3]),Tmod=-1;else Tmod=abs(T);end
  20. if length(etapar)==0,etapar=0;end
  21. [a,b,c,d,k,x0]=feval(sspmod,etapar,Tmod,arg);
  22. if max(abs(eig(a)))>1, disp('WARNING: System unstable!'),end
  23. [ny,n]=size(c);[n,nu]=size(b);
  24. [Ncap,nze]=size(ze); 
  25. if ~any(nze==[nu nu+ny]),error('An incorrect number of inputs/noises have been specified!'),end
  26. if nze==ny+nu,
  27. sqrlam=sqrtm(lambda);
  28. e=ze(:,nu+1:nu+ny)*sqrlam;
  29. x=ltitr(a,[b k],[ze(:,1:nu) e],x0);y=(c*x' +[d,eye(ny)]*[ze(:,1:nu) e]')';
  30. end
  31. if nze==nu
  32. x=ltitr(a,b,ze,x0);y=(c*x'+d*ze')';
  33. end
  34.