From: <par...@us...> - 2011-11-09 20:27:57
|
Revision: 9041 http://octave.svn.sourceforge.net/octave/?rev=9041&view=rev Author: paramaniac Date: 2011-11-09 20:27:50 +0000 (Wed, 09 Nov 2011) Log Message: ----------- control-devel: work on argument checking of model reduction commands (3) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m trunk/octave-forge/extra/control-devel/inst/bstmodred.m trunk/octave-forge/extra/control-devel/inst/hnamodred.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m Modified: trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m 2011-11-09 20:18:40 UTC (rev 9040) +++ trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m 2011-11-09 20:27:50 UTC (rev 9041) @@ -50,6 +50,7 @@ dt = isdt (sys); ## default arguments + alpha = __default_alpha__ (dt); av = bv = cv = dv = []; jobv = 0; aw = bw = cw = dw = []; @@ -64,12 +65,6 @@ equil = 0; ordsel = 1; nr = 0; - - if (dt) # discrete-time - alpha = 1; # ALPHA <= 0 - else # continuous-time - alpha = 0; # 0 <= ALPHA <= 1 - endif ## handle properties and values for k = 1 : 2 : npv Added: trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m 2011-11-09 20:27:50 UTC (rev 9041) @@ -0,0 +1,33 @@ +## Copyright (C) 2011 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## default alpha for model reduction commands + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function alpha = __default_alpha__ (dt) + + if (dt) # discrete-time + alpha = 1; # ALPHA <= 0 + else # continuous-time + alpha = 0; # 0 <= ALPHA <= 1 + endif + +endfunction Modified: trunk/octave-forge/extra/control-devel/inst/bstmodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/bstmodred.m 2011-11-09 20:18:40 UTC (rev 9040) +++ trunk/octave-forge/extra/control-devel/inst/bstmodred.m 2011-11-09 20:27:50 UTC (rev 9041) @@ -63,6 +63,7 @@ dt = isdt (sys); ## default arguments + alpha = __default_alpha__ (dt); beta = 1; # ? tol1 = 0; tol2 = 0; @@ -70,13 +71,8 @@ nr = 0; job = 1; ## ? - - if (dt) # discrete-time - alpha = 1; # ALPHA <= 0 - else # continuous-time - alpha = 0; # 0 <= ALPHA <= 1 - endif + ## handle properties and values for k = 1 : 2 : (nargin-1) prop = lower (varargin{k}); val = varargin{k+1}; Modified: trunk/octave-forge/extra/control-devel/inst/hnamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-09 20:18:40 UTC (rev 9040) +++ trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-09 20:27:50 UTC (rev 9041) @@ -63,6 +63,7 @@ dt = isdt (sys); ## default arguments + alpha = __default_alpha__ (dt); av = bv = cv = dv = []; jobv = 0; aw = bw = cw = dw = []; @@ -72,13 +73,8 @@ tol2 = 0; ordsel = 1; nr = 0; - - if (dt) # discrete-time - alpha = 1; # ALPHA <= 0 - else # continuous-time - alpha = 0; # 0 <= ALPHA <= 1 - endif + ## handle properties and values for k = 1 : 2 : (nargin-1) prop = lower (varargin{k}); val = varargin{k+1}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |