From: <par...@us...> - 2011-11-10 17:48:11
|
Revision: 9047 http://octave.svn.sourceforge.net/octave/?rev=9047&view=rev Author: paramaniac Date: 2011-11-10 17:48:04 +0000 (Thu, 10 Nov 2011) Log Message: ----------- control-devel: rename functions Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/bstmodred.m trunk/octave-forge/extra/control-devel/inst/btamodred.m trunk/octave-forge/extra/control-devel/inst/hnamodred.m trunk/octave-forge/extra/control-devel/inst/spamodred.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/inst/__modred_ab09id__.m trunk/octave-forge/extra/control-devel/inst/__modred_check_alpha__.m trunk/octave-forge/extra/control-devel/inst/__modred_check_order__.m trunk/octave-forge/extra/control-devel/inst/__modred_check_tol__.m trunk/octave-forge/extra/control-devel/inst/__modred_check_weight__.m trunk/octave-forge/extra/control-devel/inst/__modred_default_alpha__.m Removed Paths: ------------- trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m trunk/octave-forge/extra/control-devel/inst/__check_alpha__.m trunk/octave-forge/extra/control-devel/inst/__check_order__.m trunk/octave-forge/extra/control-devel/inst/__check_tol__.m trunk/octave-forge/extra/control-devel/inst/__check_weight__.m trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m Deleted: trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,125 +0,0 @@ -## 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 -*- -## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} __ab09id_modred__ (@var{method}, @dots{}) -## Backend for btamodred and spamodred. -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2011 -## Version: 0.1 - -function [sysr, nr] = __ab09id_modred__ (method, varargin) - - if (nargin < 2) - print_usage (); - endif - - if (method != "bta" && method != "spa") - error ("modred: invalid method"); - endif - - sys = varargin{1}; - varargin = varargin(2:end); - npv = nargin - 2; # number of properties and values - - if (! isa (sys, "lti")) - error ("%smodred: first argument must be an LTI system", method); - endif - - if (rem (npv, 2)) - error ("%smodred: properties and values must come in pairs", method); - endif - - [a, b, c, d, tsam, scaled] = ssdata (sys); - dt = isdt (sys); - - ## default arguments - alpha = __default_alpha__ (dt); - av = bv = cv = dv = []; - jobv = 0; - aw = bw = cw = dw = []; - jobw = 0; - alphac = alphao = 0.0; - tol1 = 0.0; - tol2 = 0.0; - dico = 0; - jobc = jobo = 0; - job = 1; # 'F': balancing-free square-root Balance & Truncate method - weight = 1; - equil = 0; - ordsel = 1; - nr = 0; - - ## handle properties and values - for k = 1 : 2 : npv - prop = lower (varargin{k}); - val = varargin{k+1}; - switch (prop) - case {"left", "v"} - [av, bv, cv, dv, jobv] = __check_weight__ (val, dt); - - case {"right", "w"} - [aw, bw, cw, dw, jobw] = __check_weight__ (val, dt); - - case {"order", "n", "nr"} - [nr, ordsel] = __check_order__ (val); - - case "tol1" - tol1 = __check_tol__ (val, "tol1"); - - case "tol2" - tol2 = __check_tol__ (val, "tol2"); - - case "alpha" - alpha = __check_alpha__ (val, dt); - - ## TODO: alphac, alphao, jobc, jobo - - otherwise - error ("hnamodred: invalid property name"); - endswitch - endfor - - if (jobv && jobw) - weight = 3; # 'B': both left and right weightings V and W are used - elseif (jobv) - weight = 1; # 'L': only left weighting V is used (W = I) - elseif (jobw) - weight = 2; # 'R': only right weighting W is used (V = I) - else - weight = 0; # 'N': no weightings are used (V = I, W = I) - endif - - ## TODO: handle job - - ## perform model order reduction - [ar, br, cr, dr] = slab09id (a, b, c, d, dico, equil, nr, ordsel, alpha, job, \ - av, bv, cv, dv, \ - aw, bw, cw, dw, \ - weight, jobc, jobo, alphac, alphao, \ - tol1, tol2); - - ## assemble reduced order model - sysr = ss (ar, br, cr, dr, tsam); - -endfunction - - - - Deleted: trunk/octave-forge/extra/control-devel/inst/__check_alpha__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__check_alpha__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__check_alpha__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,40 +0,0 @@ -## 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 -*- -## check alpha for model reduction commands - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2011 -## Version: 0.1 - -function alpha = __check_alpha__ (alpha, dt) - - if (! is_real_scalar (alpha)) - error ("modred: argument alpha must be a real scalar"); - endif - if (dt) # discrete-time - if (alpha < 0 || alpha > 1) - error ("modred: require 0 <= ALPHA <= 1"); - endif - else # continuous-time - if (alpha > 0) - error ("modred: require ALPHA <= 0"); - endif - endif - -endfunction Deleted: trunk/octave-forge/extra/control-devel/inst/__check_order__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__check_order__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__check_order__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,33 +0,0 @@ -## 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 -*- -## check order for model reduction commands - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2011 -## Version: 0.1 - -function [nr, ordsel] = __check_order__ (nr) - - if (! issample (nr, 0) || nr != round (nr)) - error ("modred: order of reduced model must be an integer >= 0"); - endif - - ordsel = 0; - -endfunction \ No newline at end of file Deleted: trunk/octave-forge/extra/control-devel/inst/__check_tol__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__check_tol__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__check_tol__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,31 +0,0 @@ -## 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 -*- -## check tolerance for model reduction commands - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2011 -## Version: 0.1 - -function tol = __check_tol__ (tol, str = "") - - if (! is_real_scalar (tol)) - error ("modred: argument %s must be a real scalar", str); - endif - -endfunction \ No newline at end of file Deleted: trunk/octave-forge/extra/control-devel/inst/__check_weight__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__check_weight__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__check_weight__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,39 +0,0 @@ -## 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 -*- -## check weightings for model reduction commands - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2011 -## Version: 0.1 - -function [a, b, c, d, job] = __check_weight__ (sys, dt) - - sys = ss (sys); # could be non-lti, therefore ssdata would fail - - if (dt != isdt (sys)) - error ("modred: ct/dt"); # TODO: error message - endif - - [a, b, c, d] = ssdata (sys); - - job = 1; - - ## TODO: check system size - -endfunction Deleted: trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -1,33 +0,0 @@ -## 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 Copied: trunk/octave-forge/extra/control-devel/inst/__modred_ab09id__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__ab09id_modred__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_ab09id__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_ab09id__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -0,0 +1,125 @@ +## 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 -*- +## @deftypefn{Function File} {[@var{sysr}, @var{nr}] =} __modred_ab09id__ (@var{method}, @dots{}) +## Backend for btamodred and spamodred. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function [sysr, nr] = __modred_ab09id__ (method, varargin) + + if (nargin < 2) + print_usage (); + endif + + if (method != "bta" && method != "spa") + error ("modred: invalid method"); + endif + + sys = varargin{1}; + varargin = varargin(2:end); + npv = nargin - 2; # number of properties and values + + if (! isa (sys, "lti")) + error ("%smodred: first argument must be an LTI system", method); + endif + + if (rem (npv, 2)) + error ("%smodred: properties and values must come in pairs", method); + endif + + [a, b, c, d, tsam, scaled] = ssdata (sys); + dt = isdt (sys); + + ## default arguments + alpha = __modred_default_alpha__ (dt); + av = bv = cv = dv = []; + jobv = 0; + aw = bw = cw = dw = []; + jobw = 0; + alphac = alphao = 0.0; + tol1 = 0.0; + tol2 = 0.0; + dico = 0; + jobc = jobo = 0; + job = 1; # 'F': balancing-free square-root Balance & Truncate method + weight = 1; + equil = 0; + ordsel = 1; + nr = 0; + + ## handle properties and values + for k = 1 : 2 : npv + prop = lower (varargin{k}); + val = varargin{k+1}; + switch (prop) + case {"left", "v"} + [av, bv, cv, dv, jobv] = __modred_check_weight__ (val, dt); + + case {"right", "w"} + [aw, bw, cw, dw, jobw] = __modred_check_weight__ (val, dt); + + case {"order", "n", "nr"} + [nr, ordsel] = __modred_check_order__ (val); + + case "tol1" + tol1 = __modred_check_tol__ (val, "tol1"); + + case "tol2" + tol2 = __modred_check_tol__ (val, "tol2"); + + case "alpha" + alpha = __modred_check_alpha__ (val, dt); + + ## TODO: alphac, alphao, jobc, jobo + + otherwise + error ("hnamodred: invalid property name"); + endswitch + endfor + + if (jobv && jobw) + weight = 3; # 'B': both left and right weightings V and W are used + elseif (jobv) + weight = 1; # 'L': only left weighting V is used (W = I) + elseif (jobw) + weight = 2; # 'R': only right weighting W is used (V = I) + else + weight = 0; # 'N': no weightings are used (V = I, W = I) + endif + + ## TODO: handle job + + ## perform model order reduction + [ar, br, cr, dr] = slab09id (a, b, c, d, dico, equil, nr, ordsel, alpha, job, \ + av, bv, cv, dv, \ + aw, bw, cw, dw, \ + weight, jobc, jobo, alphac, alphao, \ + tol1, tol2); + + ## assemble reduced order model + sysr = ss (ar, br, cr, dr, tsam); + +endfunction + + + + Copied: trunk/octave-forge/extra/control-devel/inst/__modred_check_alpha__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__check_alpha__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_check_alpha__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_check_alpha__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -0,0 +1,40 @@ +## 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 -*- +## check alpha for model reduction commands + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function alpha = __modred_check_alpha__ (alpha, dt) + + if (! is_real_scalar (alpha)) + error ("modred: argument alpha must be a real scalar"); + endif + if (dt) # discrete-time + if (alpha < 0 || alpha > 1) + error ("modred: require 0 <= ALPHA <= 1"); + endif + else # continuous-time + if (alpha > 0) + error ("modred: require ALPHA <= 0"); + endif + endif + +endfunction Copied: trunk/octave-forge/extra/control-devel/inst/__modred_check_order__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__check_order__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_check_order__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_check_order__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -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 -*- +## check order for model reduction commands + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function [nr, ordsel] = __modred_check_order__ (nr) + + if (! issample (nr, 0) || nr != round (nr)) + error ("modred: order of reduced model must be an integer >= 0"); + endif + + ordsel = 0; + +endfunction \ No newline at end of file Copied: trunk/octave-forge/extra/control-devel/inst/__modred_check_tol__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__check_tol__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_check_tol__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_check_tol__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -0,0 +1,31 @@ +## 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 -*- +## check tolerance for model reduction commands + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function tol = __modred_check_tol__ (tol, str = "") + + if (! is_real_scalar (tol)) + error ("modred: argument %s must be a real scalar", str); + endif + +endfunction \ No newline at end of file Copied: trunk/octave-forge/extra/control-devel/inst/__modred_check_weight__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__check_weight__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_check_weight__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_check_weight__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -0,0 +1,39 @@ +## 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 -*- +## check weightings for model reduction commands + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2011 +## Version: 0.1 + +function [a, b, c, d, job] = __modred_check_weight__ (sys, dt) + + sys = ss (sys); # could be non-lti, therefore ssdata would fail + + if (dt != isdt (sys)) + error ("modred: ct/dt"); # TODO: error message + endif + + [a, b, c, d] = ssdata (sys); + + job = 1; + + ## TODO: check system size + +endfunction Copied: trunk/octave-forge/extra/control-devel/inst/__modred_default_alpha__.m (from rev 9046, trunk/octave-forge/extra/control-devel/inst/__default_alpha__.m) =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__modred_default_alpha__.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/__modred_default_alpha__.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -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 = __modred_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-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/bstmodred.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -63,7 +63,7 @@ dt = isdt (sys); ## default arguments - alpha = __default_alpha__ (dt); + alpha = __modred_default_alpha__ (dt); beta = 1; # ? tol1 = 0; tol2 = 0; @@ -78,16 +78,16 @@ val = varargin{k+1}; switch (prop) case {"order", "n", "nr"} - [nr, ordsel] = __check_order__ (val); + [nr, ordsel] = __modred_check_order__ (val); case "tol1" - tol1 = __check_tol__ (val, "tol1"); + tol1 = __modred_check_tol__ (val, "tol1"); case "tol2" - tol2 = __check_tol__ (val, "tol2"); + tol2 = __modred_check_tol__ (val, "tol2"); case "alpha" - alpha = __check_alpha__ (val, dt); + alpha = __modred_check_alpha__ (val, dt); case "beta" if (! issample (val, 0)) Modified: trunk/octave-forge/extra/control-devel/inst/btamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/btamodred.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/btamodred.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -47,7 +47,7 @@ function [sysr, nr] = btamodred (varargin) - [sysr, nr] = __ab09id_modred__ ("bta", varargin{:}); + [sysr, nr] = __modred_ab09id__ ("bta", varargin{:}); endfunction Modified: trunk/octave-forge/extra/control-devel/inst/hnamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/hnamodred.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -63,7 +63,7 @@ dt = isdt (sys); ## default arguments - alpha = __default_alpha__ (dt); + alpha = __modred_default_alpha__ (dt); av = bv = cv = dv = []; jobv = 0; aw = bw = cw = dw = []; @@ -80,22 +80,22 @@ val = varargin{k+1}; switch (prop) case {"left", "v"} - [av, bv, cv, dv, jobv] = __check_weight__ (val, dt); + [av, bv, cv, dv, jobv] = __modred_check_weight__ (val, dt); case {"right", "w"} - [aw, bw, cw, dw, jobw] = __check_weight__ (val, dt); + [aw, bw, cw, dw, jobw] = __modred_check_weight__ (val, dt); case {"order", "n", "nr"} - [nr, ordsel] = __check_order__ (val); + [nr, ordsel] = __modred_check_order__ (val); case "tol1" - tol1 = __check_tol__ (val, "tol1"); + tol1 = __modred_check_tol__ (val, "tol1"); case "tol2" - tol2 = __check_tol__ (val, "tol2"); + tol2 = __modred_check_tol__ (val, "tol2"); case "alpha" - alpha = __check_alpha__ (val, dt); + alpha = __modred_check_alpha__ (val, dt); otherwise error ("hnamodred: invalid property name"); Modified: trunk/octave-forge/extra/control-devel/inst/spamodred.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/spamodred.m 2011-11-10 17:30:57 UTC (rev 9046) +++ trunk/octave-forge/extra/control-devel/inst/spamodred.m 2011-11-10 17:48:04 UTC (rev 9047) @@ -47,7 +47,7 @@ function [sysr, nr] = spamodred (varargin) - [sysr, nr] = __ab09id_modred__ ("spa", varargin{:}); + [sysr, nr] = __modred_ab09id__ ("spa", varargin{:}); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |