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

  1. function [a,b,c,d] = ord2(wn, z)
  2. %ORD2   Generate continuous second order system.
  3. %    [A,B,C,D] = ORD2(Wn, Z) returns the A,B,C,D representation of the
  4. %    continuous second order system with natural frequency Wn and 
  5. %    damping factor Z.
  6. %
  7. %    [NUM,DEN] = ORD2(Wn,Z) returns the polynomial transfer function of
  8. %    the second order system.
  9. %
  10. %    See also: RMODEL and TF2SS.
  11.  
  12. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  13.  
  14. error(nargchk(2,2,nargin));
  15.  
  16. if nargout==4,        % Generate state space system
  17.   a = [0 1;-wn*wn, -2*z*wn];
  18.   b = [0;1];
  19.   c = [1 0];
  20.   d = 0;
  21. else
  22.   a = 1;
  23.   b = [1 2*z*wn wn*wn];
  24. end
  25.