From: <par...@us...> - 2010-09-15 11:11:02
|
Revision: 7728 http://octave.svn.sourceforge.net/octave/?rev=7728&view=rev Author: paramaniac Date: 2010-09-15 11:10:55 +0000 (Wed, 15 Sep 2010) Log Message: ----------- control: relocate functions, improve argument checks Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/@lti/dcgain.m trunk/octave-forge/main/control/inst/@lti/freqresp.m Removed Paths: ------------- trunk/octave-forge/main/control/inst/dcgain.m trunk/octave-forge/main/control/inst/freqresp.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2010-09-15 09:59:03 UTC (rev 7727) +++ trunk/octave-forge/main/control/INDEX 2010-09-15 11:10:55 UTC (rev 7728) @@ -26,7 +26,7 @@ @lti/series strseq System Gain and Dynamics - dcgain + @lti/dcgain @lti/norm @lti/pole pzmap @@ -41,7 +41,7 @@ Frequency Domain Analysis bode bodemag - freqresp + @lti/freqresp margin nichols nyquist Added: trunk/octave-forge/main/control/inst/@lti/dcgain.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/dcgain.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/dcgain.m 2010-09-15 11:10:55 UTC (rev 7728) @@ -0,0 +1,50 @@ +## Copyright (C) 2009 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{k} =} dcgain (@var{sys}) +## DC gain of LTI model. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI system. +## @end table +## +## @strong{Outputs} +## @table @var +## @item k +## DC gain matrice. For a system with m inputs and p outputs, the array @var{k} +## has dimensions [p, m]. +## @end table +## +## @seealso{freqresp} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 +## Version: 0.1 + +function gain = dcgain (sys) + + if (nargin != 1) # sys is always an LTI model + print_usage (); + endif + + gain = __freqresp__ (sys, 0); + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/@lti/freqresp.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/freqresp.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/freqresp.m 2010-09-15 11:10:55 UTC (rev 7728) @@ -0,0 +1,57 @@ +## Copyright (C) 2009 - 2010 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {@var{H} =} freqresp (@var{sys}, @var{w}) +## Evaluate frequency response at given frequencies. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI system. +## @item w +## Vector of frequency values. +## @end table +## +## @strong{Outputs} +## @table @var +## @item H +## Array of frequency response. For a system with m inputs and p outputs, the array @var{H} +## has dimensions [p, m, length (w)]. +## The frequency response at the frequency w(k) is given by H(:,:,k). +## @end table +## +## @seealso{dcgain} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 +## Version: 0.2 + +function H = freqresp (sys, w) + + if (nargin != 2) # case freqresp () not possible + print_usage (); + endif + + if (! isreal (w) || ! isvector (w)) # catches freqresp (sys, sys) and freqresp (w, sys) as well + error ("freqresp: second argument must be a real vector"); + endif + + H = __freqresp__ (sys, w); + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/dcgain.m =================================================================== --- trunk/octave-forge/main/control/inst/dcgain.m 2010-09-15 09:59:03 UTC (rev 7727) +++ trunk/octave-forge/main/control/inst/dcgain.m 2010-09-15 11:10:55 UTC (rev 7728) @@ -1,50 +0,0 @@ -## Copyright (C) 2009 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {@var{k} =} dcgain (@var{sys}) -## DC gain of LTI model. -## -## @strong{Inputs} -## @table @var -## @item sys -## LTI system. -## @end table -## -## @strong{Outputs} -## @table @var -## @item k -## DC gain matrice. For a system with m inputs and p outputs, the array @var{k} -## has dimensions [p, m]. -## @end table -## -## @seealso{freqresp} -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: October 2009 -## Version: 0.1 - -function gain = dcgain (sys) - - if (nargin != 1) - print_usage (); - endif - - gain = __freqresp__ (sys, 0); - -endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/freqresp.m =================================================================== --- trunk/octave-forge/main/control/inst/freqresp.m 2010-09-15 09:59:03 UTC (rev 7727) +++ trunk/octave-forge/main/control/inst/freqresp.m 2010-09-15 11:10:55 UTC (rev 7728) @@ -1,53 +0,0 @@ -## Copyright (C) 2009 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {@var{H} =} freqresp (@var{sys}, @var{w}) -## Evaluate frequency response at given frequencies. -## -## @strong{Inputs} -## @table @var -## @item sys -## LTI system. -## @item w -## Vector of frequency values. -## @end table -## -## @strong{Outputs} -## @table @var -## @item H -## Array of frequency response. For a system with m inputs and p outputs, the array @var{H} -## has dimensions [p, m, length (w)]. -## The frequency response at the frequency w(k) is given by H(:,:,k). -## @end table -## -## @seealso{dcgain} -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: October 2009 -## Version: 0.1 - -function H = freqresp (sys, w) - - if (nargin != 2) - print_usage (); - endif - - H = __freqresp__ (sys, w); - -endfunction \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |