From: <par...@us...> - 2010-09-14 23:59:27
|
Revision: 7721 http://octave.svn.sourceforge.net/octave/?rev=7721&view=rev Author: paramaniac Date: 2010-09-14 23:59:19 +0000 (Tue, 14 Sep 2010) Log Message: ----------- control: try sticking to GNU coding standards (just the beginning) Modified Paths: -------------- trunk/octave-forge/main/control/inst/@lti/get.m trunk/octave-forge/main/control/inst/@lti/set.m trunk/octave-forge/main/control/inst/@ss/__get__.m trunk/octave-forge/main/control/inst/@ss/__set__.m trunk/octave-forge/main/control/inst/@ss/__sysgroup__.m trunk/octave-forge/main/control/inst/@ss/ss.m trunk/octave-forge/main/control/inst/@tf/__get__.m trunk/octave-forge/main/control/inst/@tf/__set__.m trunk/octave-forge/main/control/inst/@tf/tf.m trunk/octave-forge/main/control/inst/bode.m trunk/octave-forge/main/control/inst/bodemag.m trunk/octave-forge/main/control/inst/impulse.m trunk/octave-forge/main/control/inst/initial.m trunk/octave-forge/main/control/inst/margin.m trunk/octave-forge/main/control/inst/nichols.m trunk/octave-forge/main/control/inst/nyquist.m trunk/octave-forge/main/control/inst/sigma.m trunk/octave-forge/main/control/inst/step.m Added Paths: ----------- trunk/octave-forge/main/control/inst/@lti/__property_names__.m trunk/octave-forge/main/control/inst/@ss/__property_names__.m trunk/octave-forge/main/control/inst/@tf/__property_names__.m trunk/octave-forge/main/control/inst/__frequency_response__.m trunk/octave-forge/main/control/inst/__ss_dim__.m trunk/octave-forge/main/control/inst/__tf_dim__.m trunk/octave-forge/main/control/inst/__time_response__.m Removed Paths: ------------- trunk/octave-forge/main/control/inst/@lti/__propnames__.m trunk/octave-forge/main/control/inst/@ss/__propnames__.m trunk/octave-forge/main/control/inst/@tf/__propnames__.m trunk/octave-forge/main/control/inst/__getfreqresp__.m trunk/octave-forge/main/control/inst/__ssmatdim__.m trunk/octave-forge/main/control/inst/__tfnddim__.m trunk/octave-forge/main/control/inst/__timeresp__.m Added: trunk/octave-forge/main/control/inst/@lti/__property_names__.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/__property_names__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/__property_names__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,37 @@ +## Copyright (C) 2009 Lukas F. Reichlin +## +## 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. +## +## 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. +## +## 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{props}, @var{vals}] =} __property_names__ (@var{sys}) +## Return the list of properties as well as the assignable values for a lti object sys. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: September 2009 +## Version: 0.1 + +function [props, vals] = __property_names__ (sys) + + ## cell vector of lti-specific properties + props = {"tsam"; + "inname"; + "outname"}; + + ## cell vector of lti-specific assignable values + vals = {"scalar (sample time in seconds)"; + "m-by-1 cell vector of strings"; + "p-by-1 cell vector of strings"}; + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/@lti/__propnames__.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/__propnames__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@lti/__propnames__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,37 +0,0 @@ -## Copyright (C) 2009 Lukas F. Reichlin -## -## 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. -## -## 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. -## -## 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{propv}, @var{asgnvalv}] =} __propnames__ (@var{sys}) -## Return the list of properties as well as the assignable values for a lti object sys. -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: September 2009 -## Version: 0.1 - -function [propv, asgnvalv] = __propnames__ (sys) - - ## cell vector of lti-specific properties - propv = {"tsam"; - "inname"; - "outname"}; - - ## cell vector of lti-specific assignable values - asgnvalv = {"scalar (sample time in seconds)"; - "m-by-1 cell vector of strings"; - "p-by-1 cell vector of strings"}; - -endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/inst/@lti/get.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/get.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@lti/get.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -28,10 +28,10 @@ function varargout = get (sys, varargin) if (nargin == 1) - [propv, valv] = __propnames__ (sys); - nrows = numel (propv); - str = strjust (strvcat (propv), "right"); - str = horzcat (repmat (" ", nrows, 1), str, repmat (": ", nrows, 1), strvcat (valv)); + [props, vals] = __property_names__ (sys); + nrows = numel (props); + str = strjust (strvcat (props), "right"); + str = horzcat (repmat (" ", nrows, 1), str, repmat (": ", nrows, 1), strvcat (vals)); disp (str); else for k = 1 : (nargin-1) Modified: trunk/octave-forge/main/control/inst/@lti/set.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/set.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@lti/set.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -29,11 +29,11 @@ if (nargin == 1) # set (sys), sys = set (sys) - [propv, valv] = __propnames__ (sys); - nrows = numel (propv); + [props, vals] = __property_names__ (sys); + nrows = numel (props); - str = strjust (strvcat (propv), "right"); - str = horzcat (repmat (" ", nrows, 1), str, repmat (": ", nrows, 1), strvcat (valv)); + str = strjust (strvcat (props), "right"); + str = horzcat (repmat (" ", nrows, 1), str, repmat (": ", nrows, 1), strvcat (vals)); disp (str); Modified: trunk/octave-forge/main/control/inst/@ss/__get__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__get__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@ss/__get__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -41,7 +41,7 @@ val = sys.stname; otherwise - error ("get: invalid property name"); + error ("ss: get: invalid property name"); endswitch Added: trunk/octave-forge/main/control/inst/@ss/__property_names__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__property_names__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@ss/__property_names__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,52 @@ +## Copyright (C) 2009 Lukas F. Reichlin +## +## 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. +## +## 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. +## +## 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{props}, @var{vals}] =} __property_names__ (@var{sys}) +## @deftypefnx {Function File} {[@var{props}, @var{vals}] =} __property_names__ (@var{sys}, @var{"specific"}) +## Return the list of properties as well as the assignable values for a ss object sys. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: September 2009 +## Version: 0.1 + +function [props, vals] = __property_names__ (sys, flg) + + ## cell vector of ss-specific properties + props = {"a"; + "b"; + "c"; + "d"; + "stname"}; + + ## cell vector of ss-specific assignable values + vals = {"n-by-n matrix (n = number of states)"; + "n-by-m matrix (m = number of inputs)"; + "p-by-n matrix (p = number of outputs)"; + "p-by-m matrix"; + "n-by-1 cell vector of strings"}; + + if (nargin == 1) + [ltiprops, ltivals] = __property_names__ (sys.lti); + + props = [props; + ltiprops]; + + vals = [vals; + ltivals]; + endif + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/@ss/__propnames__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__propnames__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@ss/__propnames__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,52 +0,0 @@ -## Copyright (C) 2009 Lukas F. Reichlin -## -## 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. -## -## 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. -## -## 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{propv}, @var{asgnvalv}] =} __propnames__ (@var{sys}) -## @deftypefnx {Function File} {[@var{propv}, @var{asgnvalv}] =} __propnames__ (@var{sys}, @var{"specific"}) -## Return the list of properties as well as the assignable values for a ss object sys. -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: September 2009 -## Version: 0.1 - -function [propv, asgnvalv] = __propnames__ (sys, flg) - - ## cell vector of ss-specific properties - propv = {"a"; - "b"; - "c"; - "d"; - "stname"}; - - ## cell vector of ss-specific assignable values - asgnvalv = {"n-by-n matrix (n = number of states)"; - "n-by-m matrix (m = number of inputs)"; - "p-by-n matrix (p = number of outputs)"; - "p-by-m matrix"; - "n-by-1 cell vector of strings"}; - - if (nargin == 1) - [ltipropv, ltiasgnvalv] = __propnames__ (sys.lti); - - propv = [propv; - ltipropv]; - - asgnvalv = [asgnvalv; - ltiasgnvalv]; - endif - -endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/inst/@ss/__set__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__set__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@ss/__set__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -26,19 +26,19 @@ switch (prop) # {<internal name>, <user name>} case "a" - [m, n, p] = __ssmatdim__ (val, sys.b, sys.c, sys.d); + [m, n, p] = __ss_dim__ (val, sys.b, sys.c, sys.d); sys.a = val; case "b" - [m, n, p] = __ssmatdim__ (sys.a, val, sys.c, sys.d); + [m, n, p] = __ss_dim__ (sys.a, val, sys.c, sys.d); sys.b = val; case "c" - [m, n, p] = __ssmatdim__ (sys.a, sys.b, val, sys.d); + [m, n, p] = __ss_dim__ (sys.a, sys.b, val, sys.d); sys.c = val; case "d" - [m, n, p] = __ssmatdim__ (sys.a, sys.b, sys.c, val); + [m, n, p] = __ss_dim__ (sys.a, sys.b, sys.c, val); sys.d = val; case {"stname", "statename"} @@ -46,7 +46,7 @@ sys.stname = __checkname__ (val, n); otherwise - error ("set: invalid property name"); + error ("ss: set: invalid property name"); endswitch Modified: trunk/octave-forge/main/control/inst/@ss/__sysgroup__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__sysgroup__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@ss/__sysgroup__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -47,8 +47,8 @@ C2 = sys2.c; D2 = sys2.d; - [m1, n1, p1] = __ssmatdim__ (A1, B1, C1, D1); - [m2, n2, p2] = __ssmatdim__ (A2, B2, C2, D2); + [m1, n1, p1] = __ss_dim__ (A1, B1, C1, D1); + [m2, n2, p2] = __ss_dim__ (A2, B2, C2, D2); A12 = zeros (n1, n2); B12 = zeros (n1, m2); Modified: trunk/octave-forge/main/control/inst/@ss/ss.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/ss.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@ss/ss.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -54,7 +54,7 @@ function sys = ss (a = [], b = [], c = [], d = [], varargin) ## model precedence: frd > ss > zpk > tf > double - %inferiorto ("frd"); + ## inferiorto ("frd"); superiorto ("zpk", "tf", "double"); argc = 0; @@ -113,7 +113,7 @@ tsam = -1; endif - [m, n, p] = __ssmatdim__ (a, b, c, d); + [m, n, p] = __ss_dim__ (a, b, c, d); stname = repmat ({""}, n, 1); Modified: trunk/octave-forge/main/control/inst/@tf/__get__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__get__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@tf/__get__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -27,12 +27,15 @@ switch (prop) # {<internal name>, <user name>} case "num" val = cellfun ("@tfpoly/get", sys.num, "uniformoutput", false); + case "den" val = cellfun ("@tfpoly/get", sys.den, "uniformoutput", false); + case {"tfvar", "variable"} val = sys.tfvar; + otherwise - error ("get: invalid property name"); + error ("tf: get: invalid property name"); endswitch endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/@tf/__property_names__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__property_names__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@tf/__property_names__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,48 @@ +## Copyright (C) 2009 Lukas F. Reichlin +## +## 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. +## +## 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. +## +## 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{props}, @var{vals}] =} __property_names__ (@var{sys}) +## @deftypefnx {Function File} {[@var{props}, @var{vals}] =} __property_names__ (@var{sys}, @var{"specific"}) +## Return the list of properties as well as the assignable values for a ss object sys. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 +## Version: 0.1 + +function [props, vals] = __property_names__ (sys, flg) + + ## cell vector of tf-specific properties + props = {"num"; + "den"; + "tfvar"}; + + ## cell vector of tf-specific assignable values + vals = {"p-by-m cell array of row vectors (m = number of inputs)"; + "p-by-m cell array of row vectors (p = number of outputs)"; + "string (usually s or z)"}; + + if (nargin == 1) + [ltiprops, ltivals] = __property_names__ (sys.lti); + + props = [props; + ltiprops]; + + vals = [vals; + ltivals]; + endif + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/@tf/__propnames__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__propnames__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@tf/__propnames__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,48 +0,0 @@ -## Copyright (C) 2009 Lukas F. Reichlin -## -## 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. -## -## 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. -## -## 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{propv}, @var{asgnvalv}] =} __propnames__ (@var{sys}) -## @deftypefnx {Function File} {[@var{propv}, @var{asgnvalv}] =} __propnames__ (@var{sys}, @var{"specific"}) -## Return the list of properties as well as the assignable values for a ss object sys. -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: October 2009 -## Version: 0.1 - -function [propv, asgnvalv] = __propnames__ (sys, flg) - - ## cell vector of tf-specific properties - propv = {"num"; - "den"; - "tfvar"}; - - ## cell vector of tf-specific assignable values - asgnvalv = {"p-by-m cell array of row vectors (m = number of inputs)"; - "p-by-m cell array of row vectors (p = number of outputs)"; - "string (usually s or z)"}; - - if (nargin == 1) - [ltipropv, ltiasgnvalv] = __propnames__ (sys.lti); - - propv = [propv; - ltipropv]; - - asgnvalv = [asgnvalv; - ltiasgnvalv]; - endif - -endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/inst/@tf/__set__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__set__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@tf/__set__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -27,12 +27,12 @@ switch (prop) # {<internal name>, <user name>} case "num" num = __conv2tfpolycell__ (val); - [p, m] = __tfnddim__ (num, sys.den); + [p, m] = __tf_dim__ (num, sys.den); sys.num = num; case "den" den = __conv2tfpolycell__ (val); - [p, m] = __tfnddim__ (sys.num, den); + [p, m] = __tf_dim__ (sys.num, den); sys.den = den; case {"tfvar", "variable"} @@ -43,7 +43,7 @@ endif otherwise - error ("set: invalid property name"); + error ("tf: set: invalid property name"); endswitch Modified: trunk/octave-forge/main/control/inst/@tf/tf.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/tf.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/@tf/tf.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -59,7 +59,7 @@ function sys = tf (num = {}, den = {}, varargin) ## model precedence: frd > ss > zpk > tf > double - %inferiorto ("frd", "ss", "zpk"); # error if de-commented. bug in octave? + ## inferiorto ("frd", "ss", "zpk"); # error if de-commented. bug in octave? superiorto ("double"); argc = 0; @@ -134,7 +134,7 @@ endswitch - [p, m] = __tfnddim__ (num, den); + [p, m] = __tf_dim__ (num, den); tfdata = struct ("num", {num}, "den", {den}, Added: trunk/octave-forge/main/control/inst/__frequency_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_response__.m (rev 0) +++ trunk/octave-forge/main/control/inst/__frequency_response__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,52 @@ +## 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 -*- +## Return frequency response H and frequency vector w. +## If w is empty, it will be calculated by __freqbounds__ + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2009 +## Version: 0.1 + +function [H, w] = __frequency_response__ (sys, w = [], mimoflag = 0, resptype = 0, wbounds = "std") + + ## check arguments + if(! isa (sys, "lti")) + error ("frequency_response: first argument sys must be a LTI system"); + endif + + if (! isempty (w) && ! (isreal (w) && isvector (w))) + error ("frequency_response: second argument w must be a vector of frequencies"); + endif + + if (! mimoflag && ! issiso (sys)) + error ("frequency_response: require SISO system"); + endif + + ## find interesting frequency range w if not specified + if (isempty (w)) + ## begin plot at 10^dec_min, end plot at 10^dec_max [rad/s] + [dec_min, dec_max] = __freqbounds__ (sys, wbounds); + + w = logspace (dec_min, dec_max, 500); # [rad/s] + endif + + ## frequency response + H = __freqresp__ (sys, w, resptype); + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/__getfreqresp__.m =================================================================== --- trunk/octave-forge/main/control/inst/__getfreqresp__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/__getfreqresp__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,52 +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 -*- -## Return frequency response H and frequency vector w. -## If w is empty, it will be calculated by __freqbounds__ - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2009 -## Version: 0.1 - -function [H, w] = __getfreqresp__ (sys, w = [], mimoflag = 0, resptype = 0, wbounds = "std") - - ## check arguments - if(! isa (sys, "lti")) - error ("getfreqresp: first argument sys must be a LTI system"); - endif - - if (! isempty (w) && ! (isreal (w) && isvector (w))) - error ("getfreqresp: second argument w must be a vector of frequencies"); - endif - - if (! mimoflag && ! issiso (sys)) - error ("getfreqresp: require SISO system"); - endif - - ## find interesting frequency range w if not specified - if (isempty (w)) - ## begin plot at 10^dec_min, end plot at 10^dec_max [rad/s] - [dec_min, dec_max] = __freqbounds__ (sys, wbounds); - - w = logspace (dec_min, dec_max, 500); # [rad/s] - endif - - ## frequency response - H = __freqresp__ (sys, w, resptype); - -endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/__ss_dim__.m =================================================================== --- trunk/octave-forge/main/control/inst/__ss_dim__.m (rev 0) +++ trunk/octave-forge/main/control/inst/__ss_dim__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,65 @@ +## 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 -*- +## Number of inputs (m), states (n) and outputs (p) of state space matrices. +## For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: September 2009 +## Version: 0.2 + +function [m, n, p] = __ss_dim__ (a, b, c, d) + + [arows, acols] = size (a); + [brows, bcols] = size (b); + [crows, ccols] = size (c); + [drows, dcols] = size (d); + + m = bcols; # = dcols + n = arows; # = acols + p = crows; # = drows + + if (! issquare (a) && ! isempty (a)) + error ("ss: system matrix a(%dx%d) is not square", arows, acols); + endif + + if (brows != arows) + error ("ss: system matrices a(%dx%d) and b(%dx%d) are incompatible", + arows, acols, brows, bcols); + endif + + if (ccols != acols) + error ("ss: system matrices a(%dx%d) and c(%dx%d) are incompatible", + arows, acols, crows, ccols); + endif + + if (bcols != dcols) + error ("ss: system matrices b(%dx%d) and d(%dx%d) are incompatible", + brows, bcols, drows, dcols); + endif + + if (crows != drows) + error ("ss: system matrices c(%dx%d) and d(%dx%d) are incompatible", + crows, ccols, drows, dcols); + endif + + if (! isreal (a) || ! isreal (b) || ! isreal (c) || ! isreal (d)) + error ("ss: system matrices are not real"); + endif + +endfunction Deleted: trunk/octave-forge/main/control/inst/__ssmatdim__.m =================================================================== --- trunk/octave-forge/main/control/inst/__ssmatdim__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/__ssmatdim__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,65 +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 -*- -## Number of inputs (m), states (n) and outputs (p) of state space matrices. -## For internal use only. - -## Author: Lukas Reichlin <luk...@gm...> -## Created: September 2009 -## Version: 0.2 - -function [m, n, p] = __ssmatdim__ (a, b, c, d) - - [arows, acols] = size (a); - [brows, bcols] = size (b); - [crows, ccols] = size (c); - [drows, dcols] = size (d); - - m = bcols; # = dcols - n = arows; # = acols - p = crows; # = drows - - if (! issquare (a) && ! isempty (a)) - error ("ss: system matrix a(%dx%d) is not square", arows, acols); - endif - - if (brows != arows) - error ("ss: system matrices a(%dx%d) and b(%dx%d) are incompatible", - arows, acols, brows, bcols); - endif - - if (ccols != acols) - error ("ss: system matrices a(%dx%d) and c(%dx%d) are incompatible", - arows, acols, crows, ccols); - endif - - if (bcols != dcols) - error ("ss: system matrices b(%dx%d) and d(%dx%d) are incompatible", - brows, bcols, drows, dcols); - endif - - if (crows != drows) - error ("ss: system matrices c(%dx%d) and d(%dx%d) are incompatible", - crows, ccols, drows, dcols); - endif - - if (! isreal (a) || ! isreal (b) || ! isreal (c) || ! isreal (d)) - error ("ss: system matrices are not real"); - endif - -endfunction Added: trunk/octave-forge/main/control/inst/__tf_dim__.m =================================================================== --- trunk/octave-forge/main/control/inst/__tf_dim__.m (rev 0) +++ trunk/octave-forge/main/control/inst/__tf_dim__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,36 @@ +## 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 -*- +## Number of outputs and inputs of transfer function numerator and +## denominator. For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 +## Version: 0.1 + +function [nrows, ncols] = __tf_dim__ (num, den) + + [nrows, ncols] = size (num); + [drows, dcols] = size (den); + + if (nrows != drows || ncols != dcols) + error ("tf: num(%dx%d) and den(%dx%d) must have equal dimensions", + nrows, ncols, drows, dcols); + endif + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/inst/__tfnddim__.m =================================================================== --- trunk/octave-forge/main/control/inst/__tfnddim__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/__tfnddim__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,36 +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 -*- -## Number of outputs and inputs of transfer function numerator and -## denominator. For internal use only. - -## Author: Lukas Reichlin <luk...@gm...> -## Created: October 2009 -## Version: 0.1 - -function [nrows, ncols] = __tfnddim__ (num, den) - - [nrows, ncols] = size (num); - [drows, dcols] = size (den); - - if (nrows != drows || ncols != dcols) - error ("tf: num(%dx%d) and den(%dx%d) must have equal dimensions", - nrows, ncols, drows, dcols); - endif - -endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/__time_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__time_response__.m (rev 0) +++ trunk/octave-forge/main/control/inst/__time_response__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -0,0 +1,309 @@ +## 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 -*- +## Common code for the time response functions step, impulse and initial. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2009 +## Version: 0.2 + +function [y, t, x_arr] = __time_response__ (sys, resptype, plotflag, tfinal, dt, x0) + + if (! isa (sys, "ss")) + sys = ss (sys); # sys must be proper + endif + + if (! isempty (tfinal) && ! isscalar (tfinal)) # time vector t passed + dt = tfinal(2) - tfinal(1); # assume that t is regularly spaced + tfinal = tfinal(end); + endif + + [A, B, C, D, tsam] = ssdata (sys); + + discrete = ! isct (sys); # static gains are treated as analog systems + + if (discrete) + if (! isempty (dt)) + warning ("time_response: argument dt has no effect on sampling time of discrete system"); + endif + + dt = tsam; + endif + + [tfinal, dt] = __sim_horizon__ (A, discrete, tfinal, dt); + + if (! discrete) + sys = c2d (sys, dt, "zoh"); + endif + + [F, G] = ssdata (sys); # matrices C and D don't change + + n = rows (F); # number of states + m = columns (G); # number of inputs + p = rows (C); # number of outputs + + ## time vector + t = reshape (0 : dt : tfinal, [], 1); + l_t = length (t); + + switch (resptype) + case "initial" + str = "Response to Initial Conditions"; + yfinal = zeros (p, 1); + + ## preallocate memory + y = zeros (l_t, p); + x_arr = zeros (l_t, n); + + ## initial conditions + x = reshape (x0, [], 1); # make sure that x is a column vector + + if (n != length (x0)) + error ("initial: x0 must be a vector with %d elements", n); + endif + + ## simulation + for k = 1 : l_t + y(k, :) = C * x; + x_arr(k, :) = x; + x = F * x; + endfor + + case "step" + str = "Step Response"; + yfinal = dcgain (sys); + + ## preallocate memory + y = zeros (l_t, p, m); + x_arr = zeros (l_t, n, m); + + for j = 1 : m # for every input channel + ## initial conditions + x = zeros (n, 1); + u = zeros (m, 1); + u(j) = 1; + + ## simulation + for k = 1 : l_t + y(k, :, j) = C * x + D * u; + x_arr(k, :, j) = x; + x = F * x + G * u; + endfor + endfor + + case "impulse" + str = "Impulse Response"; + yfinal = zeros (p, m); + + ## preallocate memory + y = zeros (l_t, p, m); + x_arr = zeros (l_t, n, m); + + for j = 1 : m # for every input channel + ## initial conditions + u = zeros (m, 1); + u(j) = 1; + + if (discrete) + x = zeros (n, 1); # zero by definition + y(1, :, j) = D * u / dt; + x_arr(1, :, j) = x; + x = G * u / dt; + else + x = B * u; # B, not G! + y(1, :, j) = C * x; + x_arr(1, :, j) = x; + x = F * x; + endif + + ## simulation + for k = 2 : l_t + y (k, :, j) = C * x; + x_arr(k, :, j) = x; + x = F * x; + endfor + endfor + + if (discrete) + y *= dt; + x_arr *= dt; + endif + + otherwise + error ("time_response: invalid response type"); + + endswitch + + + if (plotflag) # display plot + + ## TODO: Set correct titles, especially for multi-input systems + ## Limitations probably due to the Gnuplot backend + + stable = isstable (sys); + outname = get (sys, "outname"); + + if (isempty (outname) || isequal ("", outname{:})) + outname = strseq ("y_", 1 : length (outname)); + else + outname = __markemptynames__ (outname); + endif + + if (strcmp (resptype, "initial")) + cols = 1; + else + cols = m; + endif + + if (discrete) # discrete system + for k = 1 : p + for j = 1 : cols + + subplot (p, cols, (k-1)*cols+j); + + if (stable) + stairs (t, [y(:, k, j), yfinal(k, j) * ones(l_t, 1)]); + else + stairs (t, y(:, k, j)); + endif + + grid ("on"); + + if (k == 1 && j == 1) + title (str); + endif + + if (j == 1) + ylabel (sprintf ("Amplitude %s", outname{k})); + endif + + endfor + endfor + + xlabel ("Time [s]"); + + else # continuous system + for k = 1 : p + for j = 1 : cols + + subplot (p, cols, (k-1)*cols+j); + + if (stable) + plot (t, [y(:, k, j), yfinal(k, j) * ones(l_t, 1)]); + else + plot (t, y(:, k, j)); + endif + + grid ("on"); + + if (k == 1 && j == 1) + title (str); + endif + + if (j == 1) + ylabel (sprintf ("Amplitude %s", outname{k})); + endif + + endfor + endfor + + xlabel ("Time [s]"); + + endif + endif + +endfunction + + +function [tfinal, dt] = __sim_horizon__ (A, discrete, tfinal, Ts) + + ## code based on __stepimp__.m of Kai P. Mueller and A. Scottedward Hodel + + TOL = 1.0e-10; # values below TOL are assumed to be zero + N_MIN = 50; # min number of points + N_MAX = 2000; # max number of points + N_DEF = 1000; # default number of points + T_DEF = 10; # default simulation time + + n = rows (A); + eigw = eig (A); + + if (discrete) + ## perform bilinear transformation on poles in z + for k = 1 : n + pol = eigw(k); + if (abs (pol + 1) < TOL) + eigw(k) = 0; + else + eigw(k) = 2 / Ts * (pol - 1) / (pol + 1); + endif + endfor + endif + + ## remove poles near zero from eigenvalue array eigw + nk = n; + for k = 1 : n + if (abs (real (eigw(k))) < TOL) + eigw(k) = 0; + nk -= 1; + endif + endfor + + if (nk == 0) + if (isempty (tfinal)) + tfinal = T_DEF; + endif + + if (! discrete) + dt = tfinal / N_DEF; + endif + else + eigw = eigw(find (eigw)); + eigw_max = max (abs (eigw)); + + if (! discrete) + dt = 0.2 * pi / eigw_max; + endif + + if (isempty (tfinal)) + eigw_min = min (abs (real (eigw))); + tfinal = 5.0 / eigw_min; + + ## round up + yy = 10^(ceil (log10 (tfinal)) - 1); + tfinal = yy * ceil (tfinal / yy); + endif + + if (! discrete) + N = tfinal / dt; + + if (N < N_MIN) + dt = tfinal / N_MIN; + endif + + if (N > N_MAX) + dt = tfinal / N_MAX; + endif + endif + endif + + if (! isempty (Ts)) # catch case analog system with dt specified + dt = Ts; + endif + +endfunction Deleted: trunk/octave-forge/main/control/inst/__timeresp__.m =================================================================== --- trunk/octave-forge/main/control/inst/__timeresp__.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/__timeresp__.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -1,309 +0,0 @@ -## 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 -*- -## Common code for the time response functions step, impulse and initial. - -## Author: Lukas Reichlin <luk...@gm...> -## Created: October 2009 -## Version: 0.2 - -function [y, t, x_arr] = __timeresp__ (sys, resptype, plotflag, tfinal, dt, x0) - - if (! isa (sys, "ss")) - sys = ss (sys); # sys must be proper - endif - - if (! isempty (tfinal) && ! isscalar (tfinal)) # time vector t passed - dt = tfinal(2) - tfinal(1); # assume that t is regularly spaced - tfinal = tfinal(end); - endif - - [A, B, C, D, tsam] = ssdata (sys); - - discrete = ! isct (sys); # static gains are treated as analog systems - - if (discrete) - if (! isempty (dt)) - warning ("timeresp: argument dt has no effect on sampling time of discrete system"); - endif - - dt = tsam; - endif - - [tfinal, dt] = __simhorizon__ (A, discrete, tfinal, dt); - - if (! discrete) - sys = c2d (sys, dt, "zoh"); - endif - - [F, G] = ssdata (sys); # matrices C and D don't change - - n = rows (F); # number of states - m = columns (G); # number of inputs - p = rows (C); # number of outputs - - ## time vector - t = reshape (0 : dt : tfinal, [], 1); - l_t = length (t); - - switch (resptype) - case "initial" - str = "Response to Initial Conditions"; - yfinal = zeros (p, 1); - - ## preallocate memory - y = zeros (l_t, p); - x_arr = zeros (l_t, n); - - ## initial conditions - x = reshape (x0, [], 1); # make sure that x is a column vector - - if (n != length (x0)) - error ("initial: x0 must be a vector with %d elements", n); - endif - - ## simulation - for k = 1 : l_t - y(k, :) = C * x; - x_arr(k, :) = x; - x = F * x; - endfor - - case "step" - str = "Step Response"; - yfinal = dcgain (sys); - - ## preallocate memory - y = zeros (l_t, p, m); - x_arr = zeros (l_t, n, m); - - for j = 1 : m # for every input channel - ## initial conditions - x = zeros (n, 1); - u = zeros (m, 1); - u(j) = 1; - - ## simulation - for k = 1 : l_t - y(k, :, j) = C * x + D * u; - x_arr(k, :, j) = x; - x = F * x + G * u; - endfor - endfor - - case "impulse" - str = "Impulse Response"; - yfinal = zeros (p, m); - - ## preallocate memory - y = zeros (l_t, p, m); - x_arr = zeros (l_t, n, m); - - for j = 1 : m # for every input channel - ## initial conditions - u = zeros (m, 1); - u(j) = 1; - - if (discrete) - x = zeros (n, 1); # zero by definition - y(1, :, j) = D * u / dt; - x_arr(1, :, j) = x; - x = G * u / dt; - else - x = B * u; # B, not G! - y(1, :, j) = C * x; - x_arr(1, :, j) = x; - x = F * x; - endif - - ## simulation - for k = 2 : l_t - y (k, :, j) = C * x; - x_arr(k, :, j) = x; - x = F * x; - endfor - endfor - - if (discrete) - y *= dt; - x_arr *= dt; - endif - - otherwise - error ("timeresp: invalid response type"); - - endswitch - - - if (plotflag) # display plot - - ## TODO: Set correct titles, especially for multi-input systems - ## Limitations probably due to the Gnuplot backend - - stable = isstable (sys); - outname = get (sys, "outname"); - - if (isempty (outname) || isequal ("", outname{:})) - outname = strseq ("y_", 1 : length (outname)); - else - outname = __markemptynames__ (outname); - endif - - if (strcmp (resptype, "initial")) - cols = 1; - else - cols = m; - endif - - if (discrete) # discrete system - for k = 1 : p - for j = 1 : cols - - subplot (p, cols, (k-1)*cols+j); - - if (stable) - stairs (t, [y(:, k, j), yfinal(k, j) * ones(l_t, 1)]); - else - stairs (t, y(:, k, j)); - endif - - grid ("on"); - - if (k == 1 && j == 1) - title (str); - endif - - if (j == 1) - ylabel (sprintf ("Amplitude %s", outname{k})); - endif - - endfor - endfor - - xlabel ("Time [s]"); - - else # continuous system - for k = 1 : p - for j = 1 : cols - - subplot (p, cols, (k-1)*cols+j); - - if (stable) - plot (t, [y(:, k, j), yfinal(k, j) * ones(l_t, 1)]); - else - plot (t, y(:, k, j)); - endif - - grid ("on"); - - if (k == 1 && j == 1) - title (str); - endif - - if (j == 1) - ylabel (sprintf ("Amplitude %s", outname{k})); - endif - - endfor - endfor - - xlabel ("Time [s]"); - - endif - endif - -endfunction - - -function [tfinal, dt] = __simhorizon__ (A, discrete, tfinal, Ts) - - ## code based on __stepimp__.m of Kai P. Mueller and A. Scottedward Hodel - - TOL = 1.0e-10; # values below TOL are assumed to be zero - N_MIN = 50; # min number of points - N_MAX = 2000; # max number of points - N_DEF = 1000; # default number of points - T_DEF = 10; # default simulation time - - n = rows (A); - eigw = eig (A); - - if (discrete) - ## perform bilinear transformation on poles in z - for k = 1 : n - pol = eigw(k); - if (abs (pol + 1) < TOL) - eigw(k) = 0; - else - eigw(k) = 2 / Ts * (pol - 1) / (pol + 1); - endif - endfor - endif - - ## remove poles near zero from eigenvalue array eigw - nk = n; - for k = 1 : n - if (abs (real (eigw(k))) < TOL) - eigw(k) = 0; - nk -= 1; - endif - endfor - - if (nk == 0) - if (isempty (tfinal)) - tfinal = T_DEF; - endif - - if (! discrete) - dt = tfinal / N_DEF; - endif - else - eigw = eigw(find (eigw)); - eigw_max = max (abs (eigw)); - - if (! discrete) - dt = 0.2 * pi / eigw_max; - endif - - if (isempty (tfinal)) - eigw_min = min (abs (real (eigw))); - tfinal = 5.0 / eigw_min; - - ## round up - yy = 10^(ceil (log10 (tfinal)) - 1); - tfinal = yy * ceil (tfinal / yy); - endif - - if (! discrete) - N = tfinal / dt; - - if (N < N_MIN) - dt = tfinal / N_MIN; - endif - - if (N > N_MAX) - dt = tfinal / N_MAX; - endif - endif - endif - - if (! isempty (Ts)) # catch case analog system with dt specified - dt = Ts; - endif - -endfunction Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/bode.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -55,7 +55,7 @@ print_usage (); endif - [H, w] = __getfreqresp__ (sys, w, false, 0, "std"); + [H, w] = __frequency_response__ (sys, w, false, 0, "std"); H = reshape (H, [], 1); mag = abs (H); Modified: trunk/octave-forge/main/control/inst/bodemag.m =================================================================== --- trunk/octave-forge/main/control/inst/bodemag.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/bodemag.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -53,7 +53,7 @@ print_usage (); endif - [H, w] = __getfreqresp__ (sys, w, false, 0, "std"); + [H, w] = __frequency_response__ (sys, w, false, 0, "std"); H = reshape (H, [], 1); mag = abs (H); Modified: trunk/octave-forge/main/control/inst/impulse.m =================================================================== --- trunk/octave-forge/main/control/inst/impulse.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/impulse.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -64,7 +64,7 @@ print_usage (); endif - [y, t, x] = __timeresp__ (sys, "impulse", ! nargout, tfinal, dt); + [y, t, x] = __time_response__ (sys, "impulse", ! nargout, tfinal, dt); if (nargout) y_r = y; Modified: trunk/octave-forge/main/control/inst/initial.m =================================================================== --- trunk/octave-forge/main/control/inst/initial.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/initial.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -74,7 +74,7 @@ print_usage (); endif - [y, t, x] = __timeresp__ (sys, "initial", ! nargout, tfinal, dt, x0); + [y, t, x] = __time_response__ (sys, "initial", ! nargout, tfinal, dt, x0); if (nargout) y_r = y; Modified: trunk/octave-forge/main/control/inst/margin.m =================================================================== --- trunk/octave-forge/main/control/inst/margin.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/margin.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -262,7 +262,7 @@ if (nargout == 0) # show bode diagram - [H, w] = __getfreqresp__ (sys, [], false, 0, "std"); + [H, w] = __frequency_response__ (sys, [], false, 0, "std"); H = reshape (H, [], 1); mag_db = 20 * log10 (abs (H)); Modified: trunk/octave-forge/main/control/inst/nichols.m =================================================================== --- trunk/octave-forge/main/control/inst/nichols.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/nichols.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -55,7 +55,7 @@ print_usage (); endif - [H, w] = __getfreqresp__ (sys, w, false, 0, "ext"); + [H, w] = __frequency_response__ (sys, w, false, 0, "ext"); H = reshape (H, [], 1); mag = abs (H); Modified: trunk/octave-forge/main/control/inst/nyquist.m =================================================================== --- trunk/octave-forge/main/control/inst/nyquist.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/nyquist.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -55,7 +55,7 @@ print_usage (); endif - [H, w] = __getfreqresp__ (sys, w, false, 0, "ext"); + [H, w] = __frequency_response__ (sys, w, false, 0, "ext"); H = reshape (H, [], 1); re = real (H); Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/sigma.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -67,7 +67,7 @@ print_usage (); endif - [H, w] = __getfreqresp__ (sys, w, true, resptype, "std"); + [H, w] = __frequency_response__ (sys, w, true, resptype, "std"); [p, m] = size (sys); l_w = length (w); Modified: trunk/octave-forge/main/control/inst/step.m =================================================================== --- trunk/octave-forge/main/control/inst/step.m 2010-09-14 19:52:29 UTC (rev 7720) +++ trunk/octave-forge/main/control/inst/step.m 2010-09-14 23:59:19 UTC (rev 7721) @@ -64,7 +64,7 @@ print_usage (); endif - [y, t, x] = __timeresp__ (sys, "step", ! nargout, tfinal, dt); + [y, t, x] = __time_response__ (sys, "step", ! nargout, tfinal, dt); if (nargout) y_r = y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |