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

  1. function [A,B,C,D,K,X0] = motor(par,ts,aux)
  2. % This m-file describes the dc-motor with time-constant t (= par)
  3. % and known static gain G. The sampling interval is ts. The conversion
  4. % to a sampled model is inhibited if ts is entered as a negative number.
  5. % This is to allow for desirable features in the 'present'and 'eta2ss'
  6. % commands.
  7.  
  8. t = par;
  9. G=aux(1); 
  10.  
  11. A=[0 1;0 -1/t];
  12. B=[0;G/t];
  13. C=eye(2);
  14. D=[0;0];
  15. K=zeros(2,2);
  16. X0=[0;0];
  17. if ts>0 % Sample the model with sampling interval ts
  18. s = expm([[A B]*ts; zeros(1,3)]);
  19. A = s(1:2,1:2);
  20. B = s(1:2,3);
  21. end
  22.