home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fb.zip / octave / SCRIPTS.ZIP / scripts / control / wgt1o.m < prev    next >
Encoding:
Text File  |  1999-12-15  |  1.6 KB  |  58 lines

  1. ## Copyright (C) 1998 Kai P. Mueller
  2. ##
  3. ## This file is part of Octave. 
  4. ##
  5. ## Octave is free software; you can redistribute it and/or modify it 
  6. ## under the terms of the GNU General Public License as published by the 
  7. ## Free Software Foundation; either version 2, or (at your option) any 
  8. ## later version. 
  9. ## 
  10. ## Octave is distributed in the hope that it will be useful, but WITHOUT 
  11. ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  12. ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
  13. ## for more details.
  14. ## 
  15. ## You should have received a copy of the GNU General Public License 
  16. ## along with Octave; see the file COPYING.  If not, write to the Free 
  17. ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. 
  18.  
  19. ## -*- texinfo -*-
  20. ## @deftypefn {Function File } { @var{wsys} =} wgt1o (@var{vl}, @var{vh}, @var{fc})
  21. ## State space description of a first order weighting function.
  22. ## 
  23. ##  Weighting function are needed by the H2/H_infinity design procedure.
  24. ##  These function are part of thye augmented plant P (see hinfdemo
  25. ##  for an applicattion example).
  26. ## 
  27. ##  vl = Gain @@ low frequencies
  28. ## 
  29. ##  vh = Gain @@ high frequencies
  30. ## 
  31. ##  fc = Corner frequency (in Hz, *not* in rad/sec)
  32. ## @end deftypefn
  33.  
  34. function wsys = wgt1o (vl, vh, fc)
  35. ## Written by Kai P. Mueller September 30, 1997
  36.  
  37.   if (nargin != 3)
  38.     usage("wsys = wgt1o(vl, vh, fc)");
  39.   endif
  40.  
  41.   if(nargout > 1)
  42.     usage("wsys = wgt1o(vl, vh, fc)");
  43.   endif
  44.  
  45.   if (vl == vh)
  46.       a = [];
  47.       b = [];
  48.       c = [];
  49.   else
  50.       a = [-2*pi*fc];
  51.       b = [-2*pi*fc];
  52.       c = [vh-vl];
  53.   endif
  54.   d=[vh];
  55.  
  56.   wsys = ss2sys(a,b,c,d);
  57. endfunction
  58.