From: <par...@us...> - 2010-09-05 06:42:29
|
Revision: 7659 http://octave.svn.sourceforge.net/octave/?rev=7659&view=rev Author: paramaniac Date: 2010-09-05 06:42:21 +0000 (Sun, 05 Sep 2010) Log Message: ----------- control: change texinfo, variable names and author Modified Paths: -------------- trunk/octave-forge/main/control/inst/isctrb.m trunk/octave-forge/main/control/inst/isdetectable.m trunk/octave-forge/main/control/inst/isobsv.m trunk/octave-forge/main/control/inst/isstabilizable.m Modified: trunk/octave-forge/main/control/inst/isctrb.m =================================================================== --- trunk/octave-forge/main/control/inst/isctrb.m 2010-09-05 05:54:14 UTC (rev 7658) +++ trunk/octave-forge/main/control/inst/isctrb.m 2010-09-05 06:42:21 UTC (rev 7659) @@ -1,26 +1,25 @@ -## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2004, 2005, 2006, 2007 -## Auburn University. All rights reserved. +## Copyright (C) 2009 - 2010 Lukas F. Reichlin ## +## This file is part of LTI Syncope. ## -## This program 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 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. ## -## This program 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. +## 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; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. +## along with this program. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{retval}, @var{u}] =} isctrb (@var{sys}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isctrb (@var{sys}, @var{tol}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isctrb (@var{a}, @var{b}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isctrb (@var{a}, @var{b}, @var{tol}) +## @deftypefn {Function File} {[@var{bool}, @var{u}] =} isctrb (@var{sys}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isctrb (@var{sys}, @var{tol}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isctrb (@var{a}, @var{b}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isctrb (@var{a}, @var{b}, @var{tol}) ## Logical check for system controllability. ## Uses SLICOT AB01OD by courtesy of NICONET e.V. ## <http://www.slicot.org> @@ -39,8 +38,10 @@ ## ## @strong{Outputs} ## @table @var -## @item retval -## Logical flag; true (1) if the system is controllable. +## @item bool = 0 +## System is not controllable. +## @item bool = 1 +## System is controllable. ## @item u ## An orthogonal basis of the controllable subspace. ## @end table @@ -48,30 +49,25 @@ ## @seealso{isobsv} ## @end deftypefn -## Author: A. S. Hodel <a.s...@en...> -## Created: August 1993 -## Updated by A. S. Hodel (sc...@en...) Aubust, 1995 to use krylovb -## Updated by John Ingram (in...@en...) July, 1996 for packed systems - -## Adapted-By: Lukas Reichlin <luk...@gm...> -## Date: October 2009 +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 ## Version: 0.2 -function [retval, U] = isctrb (A, B = 0, tol = 0) +function [bool, u] = isctrb (a, b = 0, tol = 0) if (nargin < 1 || nargin > 3) print_usage (); - elseif (isa (A, "lti")) # isctrb (sys), isctrb (sys, tol) + elseif (isa (a, "lti")) # isctrb (sys), isctrb (sys, tol) if (nargin > 2) print_usage (); endif - tol = B; - [A, B] = ssdata (A); - elseif (nargin < 2) # isctrb (A, B), isctrb (A, B, tol) + tol = b; + [a, b] = ssdata (a); + elseif (nargin < 2) # isctrb (a, b), isctrb (a, b, tol) print_usage (); - elseif (isempty (A) || isempty (B) || rows (A) != rows (B) || ! issquare (A)) - error ("isctrb: A(%dx%d), B(%dx%d)", - rows (A), columns (A), rows (B), columns (B)); + elseif (isempty (a) || isempty (b) || rows (a) != rows (b) || ! issquare (a)) + error ("isctrb: a(%dx%d), b(%dx%d) not conformal", + rows (a), columns (a), rows (b), columns (b)); endif ## check tol dimensions @@ -80,10 +76,10 @@ rows (tol), columns (tol)); endif - [Ac, Bc, U, ncont] = slab01od (A, B, tol); + [ac, bc, u, ncont] = slab01od (a, b, tol); - U = U(:, 1:ncont); + u = u(:, 1:ncont); - retval = (ncont == rows (A)); + bool = (ncont == rows (a)); endfunction Modified: trunk/octave-forge/main/control/inst/isdetectable.m =================================================================== --- trunk/octave-forge/main/control/inst/isdetectable.m 2010-09-05 05:54:14 UTC (rev 7658) +++ trunk/octave-forge/main/control/inst/isdetectable.m 2010-09-05 06:42:21 UTC (rev 7659) @@ -1,29 +1,30 @@ -## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2003, 2004, 2005, 2006, -## 2007 Auburn University. All rights reserved. +## Copyright (C) 2009 - 2010 Lukas F. Reichlin ## +## This file is part of LTI Syncope. ## -## This program 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 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. ## -## This program 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. +## 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; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. +## along with this program. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{retval} =} isdetectable (@var{sys}) -## @deftypefnx {Function File} {@var{retval} =} isdetectable (@var{sys}, @var{tol}) -## @deftypefnx {Function File} {@var{retval} =} isdetectable (@var{a}, @var{c}) -## @deftypefnx {Function File} {@var{retval} =} isdetectable (@var{a}, @var{c}, @var{tol}) -## @deftypefnx {Function File} {@var{retval} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{dflg}) -## @deftypefnx {Function File} {@var{retval} =} isdetectable (@var{a}, @var{c}, @var{tol}, @var{dflg}) -## Logical test for system detectability (observability of unstable modes). +## @deftypefn {Function File} {@var{bool} =} isdetectable (@var{sys}) +## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{sys}, @var{tol}) +## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}) +## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{tol}) +## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{dflg}) +## @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{tol}, @var{dflg}) +## Logical test for system detectability. All unstable modes must be observable or +## all unobservable states must be stable. Uses SLICOT AB01OD by courtesy of NICONET e.V. +## <http://www.slicot.org> ## ## @strong{Inputs} ## @table @var @@ -36,48 +37,43 @@ ## @item tol ## Optional tolerance for stability. Default value is 0. ## @item dflg = 0 -## Matrices (a, c) are part of a continuous-time system. Default Value. +## Matrices (@var{a}, @var{c}) are part of a continuous-time system. Default Value. ## @item dflg = 1 -## Matrices (a, c) are part of a discrete-time system. +## Matrices (@var{a}, @var{c}) are part of a discrete-time system. ## @end table ## ## @strong{Outputs} ## @table @var -## @item retval = 0 +## @item bool = 0 ## System is not detectable. -## @item retval = 1 +## @item bool = 1 ## System is detectable. ## @end table ## -## See @command{isstabilizable} for detailed description of -## arguments and computational method. +## See @command{isstabilizable} for description of computational method. ## @seealso{isstabilizable, isstable, isctrb, isobsv} ## @end deftypefn -## Author: A. S. Hodel <a.s...@en...> -## Created: August 1993 -## Updated by John Ingram (in...@en...) July 1996. - -## Adapted-By: Lukas Reichlin <luk...@gm...> -## Date: October 2009 +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 ## Version: 0.2 -function retval = isdetectable (a, c = [], tol = [], dflg = 0) +function bool = isdetectable (a, c = [], tol = [], dflg = 0) if (nargin < 1 || nargin > 4) print_usage (); - elseif (isa (a, "lti")) # system passed + elseif (isa (a, "lti")) # isdetectable (sys), isdetectable (sys, tol) if (nargin > 2) print_usage (); endif tol = c; dflg = isdt (a); [a, b, c] = ssdata (a); - elseif (nargin == 1) # a,c arguments sent directly - print_usage (); # a,c dimension checked inside isstabilizable + elseif (nargin == 1) # isdetectable (a, c, ...) + print_usage (); endif - retval = isstabilizable (a.', c.', tol, dflg); + bool = isstabilizable (a.', c.', tol, dflg); # arguments checked inside endfunction Modified: trunk/octave-forge/main/control/inst/isobsv.m =================================================================== --- trunk/octave-forge/main/control/inst/isobsv.m 2010-09-05 05:54:14 UTC (rev 7658) +++ trunk/octave-forge/main/control/inst/isobsv.m 2010-09-05 06:42:21 UTC (rev 7659) @@ -1,26 +1,25 @@ -## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2004, 2005, 2006, 2007 -## Auburn University. All rights reserved. +## Copyright (C) 2009 - 2010 Lukas F. Reichlin ## +## This file is part of LTI Syncope. ## -## This program 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 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. ## -## This program 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. +## 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; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. +## along with this program. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{retval}, @var{u}] =} isobsv (@var{sys}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isobsv (@var{sys}, @var{tol}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isobsv (@var{a}, @var{c}) -## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} isobsv (@var{a}, @var{c}, @var{tol}) +## @deftypefn {Function File} {[@var{bool}, @var{u}] =} isobsv (@var{sys}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isobsv (@var{sys}, @var{tol}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isobsv (@var{a}, @var{c}) +## @deftypefnx {Function File} {[@var{bool}, @var{u}] =} isobsv (@var{a}, @var{c}, @var{tol}) ## Logical check for system observability. ## Uses SLICOT AB01OD by courtesy of NICONET e.V. ## <http://www.slicot.org> @@ -39,8 +38,10 @@ ## ## @strong{Outputs} ## @table @var -## @item retval -## Logical flag; true (1) if the system is observable. +## @item bool = 0 +## System is not observable. +## @item bool = 1 +## System is observable. ## @item u ## An orthogonal basis of the observable subspace. ## @end table @@ -48,32 +49,28 @@ ## @seealso{isctrb} ## @end deftypefn -## Author: A. S. Hodel <a.s...@en...> -## Created: August 1993 -## Updated by John Ingram (in...@en...) July 1996. - -## Adapted-By: Lukas Reichlin <luk...@gm...> -## Date: October 2009 +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 ## Version: 0.2 -function [retval, U] = isobsv (A, C = [], tol = []) +function [bool, u] = isobsv (a, c = [], tol = []) if (nargin < 1 || nargin > 3) print_usage (); - elseif (isa (A, "lti")) # isobsv (sys), isobsv (sys, tol) + elseif (isa (a, "lti")) # isobsv (sys), isobsv (sys, tol) if (nargin > 2) print_usage (); endif - tol = C; - [A, B, C] = ssdata (A); - elseif (nargin < 2) # isobsv (A, C), isobsv (A, C, tol) + tol = c; + [a, b, c] = ssdata (a); + elseif (nargin < 2) # isobsv (a, c), isobsv (a, c, tol) print_usage (); endif if (isempty (tol)) - [retval, U] = isctrb (A.', C.'); + [bool, u] = isctrb (a.', c.'); else - [retval, U] = isctrb (A.', C.', tol); + [bool, u] = isctrb (a.', c.', tol); endif endfunction Modified: trunk/octave-forge/main/control/inst/isstabilizable.m =================================================================== --- trunk/octave-forge/main/control/inst/isstabilizable.m 2010-09-05 05:54:14 UTC (rev 7658) +++ trunk/octave-forge/main/control/inst/isstabilizable.m 2010-09-05 06:42:21 UTC (rev 7659) @@ -1,29 +1,30 @@ -## Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 -## Kai P. Mueller. +## Copyright (C) 2009 - 2010 Lukas F. Reichlin ## +## This file is part of LTI Syncope. ## -## This program 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 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. ## -## This program 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. +## 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; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. +## along with this program. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{retval} =} isstabilizable (@var{sys}) -## @deftypefnx {Function File} {@var{retval} =} isstabilizable (@var{sys}, @var{tol}) -## @deftypefnx {Function File} {@var{retval} =} isstabilizable (@var{a}, @var{b}) -## @deftypefnx {Function File} {@var{retval} =} isstabilizable (@var{a}, @var{b}, @var{tol}) -## @deftypefnx {Function File} {@var{retval} =} isstabilizable (@var{a}, @var{b}, @var{[]}, @var{dflg}) -## @deftypefnx {Function File} {@var{retval} =} isstabilizable (@var{a}, @var{b}, @var{tol}, @var{dflg}) -## Logical check for system stabilizability (i.e., all unstable modes are controllable). +## @deftypefn {Function File} {@var{bool} =} isstabilizable (@var{sys}) +## @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{sys}, @var{tol}) +## @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}) +## @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{tol}) +## @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{[]}, @var{dflg}) +## @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{tol}, @var{dflg}) +## Logical check for system stabilizability. All unstable modes must be controllable or +## all uncontrollable states must be stable. Uses SLICOT AB01OD by courtesy of NICONET e.V. +## <http://www.slicot.org> ## ## @strong{Inputs} ## @table @var @@ -36,16 +37,16 @@ ## @item tol ## Optional tolerance for stability. Default value is 0. ## @item dflg = 0 -## Matrices (a, b) are part of a continuous-time system. Default Value. +## Matrices (@var{a}, @var{b}) are part of a continuous-time system. Default Value. ## @item dflg = 1 -## Matrices (a, b) are part of a discrete-time system. +## Matrices (@var{a}, @var{b}) are part of a discrete-time system. ## @end table ## ## @strong{Outputs} ## @table @var -## @item retval = 0 +## @item bool = 0 ## System is not stabilizable. -## @item retval = 1 +## @item bool = 1 ## System is stabilizable. ## @end table ## @@ -63,27 +64,22 @@ ## @seealso{isdetectable, isstable, isctrb, isobsv} ## @end deftypefn -## Author: A. S. Hodel <a.s...@en...> -## Created: August 1993 -## Updated by A. S. Hodel (sc...@en...) Aubust, 1995 to use krylovb -## Updated by John Ingram (in...@en...) July, 1996 to accept systems - -## Adapted-By: Lukas Reichlin <luk...@gm...> -## Date: October 2009 +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 ## Version: 0.2 -function retval = isstabilizable (a, b = [], tol = [], dflg = 0) +function bool = isstabilizable (a, b = [], tol = [], dflg = 0) if (nargin < 1 || nargin > 4) print_usage (); - elseif (isa (a, "lti")) # system passed + elseif (isa (a, "lti")) # isstabilizable (sys), isstabilizable (sys, tol) if (nargin > 2) print_usage (); endif tol = b; dflg = isdt (a); [a, b] = ssdata (a); - elseif (nargin == 1) # a,b arguments sent directly + elseif (nargin == 1) # isstabilizable (a, b, ...) print_usage (); elseif (! issquare (a) || rows (a) != rows (b)) error ("isstabilizable: a must be square and conformal to b") @@ -105,9 +101,9 @@ ## check whether uncontrollable poles are stable if (dflg) - retval = all (abs (eigw) < 1 - tol); + bool = all (abs (eigw) < 1 - tol); else - retval = all (real (eigw) < -tol*(1 + abs (eigw))); + bool = all (real (eigw) < -tol*(1 + abs (eigw))); endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |