From: <par...@us...> - 2011-07-27 13:12:33
|
Revision: 8416 http://octave.svn.sourceforge.net/octave/?rev=8416&view=rev Author: paramaniac Date: 2011-07-27 13:12:27 +0000 (Wed, 27 Jul 2011) Log Message: ----------- control: use scaling before computation of L-infinity norm and Hankel singular values Modified Paths: -------------- trunk/octave-forge/main/control/doc/NEWS trunk/octave-forge/main/control/inst/@lti/dssdata.m trunk/octave-forge/main/control/inst/@lti/norm.m trunk/octave-forge/main/control/inst/@lti/ssdata.m trunk/octave-forge/main/control/inst/@ss/__sys_data__.m trunk/octave-forge/main/control/inst/hsvd.m trunk/octave-forge/main/control/src/slab13ad.cc trunk/octave-forge/main/control/src/slab13dd.cc Modified: trunk/octave-forge/main/control/doc/NEWS =================================================================== --- trunk/octave-forge/main/control/doc/NEWS 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/doc/NEWS 2011-07-27 13:12:27 UTC (rev 8416) @@ -4,6 +4,13 @@ control-2.x.yy Release Date: 2011-xx-yy Release Manager: Lukas Reichlin =============================================================================== +** hsvd.m + -- Use scaling unless state-space model property "scaled" is set to true. + +** @lti/norm.m + -- Use scaling for computation of L-infinity norm unless state-space model + property "scaled" is set to true. + ** @lti/minreal.m -- Use scaling for state-space and descriptor state-space models unless property "scaled" is set to true. Modified: trunk/octave-forge/main/control/inst/@lti/dssdata.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/dssdata.m 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/inst/@lti/dssdata.m 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,4 +1,4 @@ -## Copyright (C) 2010 Lukas F. Reichlin +## Copyright (C) 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -52,9 +52,9 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: September 2010 -## Version: 0.1 +## Version: 0.2 -function [a, b, c, d, e, tsam] = dssdata (sys, flg = 0) +function [a, b, c, d, e, tsam, scaled] = dssdata (sys, flg = 0) ## NOTE: In case sys is not a dss model (matrice e empty), ## dssdata (sys, []) returns e = [] whereas @@ -68,7 +68,7 @@ sys = ss (sys); endif - [a, b, c, d, e] = __sys_data__ (sys); + [a, b, c, d, e, ~, scaled] = __sys_data__ (sys); if (isempty (e) && ! isempty (flg)) e = eye (size (a)); # return eye for ss models Modified: trunk/octave-forge/main/control/inst/@lti/norm.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/norm.m 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/inst/@lti/norm.m 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -26,7 +26,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.3 +## Version: 0.4 function [gain, varargout] = norm (sys, ntype = "2", tol = 0.01) @@ -86,19 +86,19 @@ function [gain, wpeak] = linfnorm (sys, tol = 0.01) - [a, b, c, d, e, tsam] = dssdata (sys, []); + [a, b, c, d, e, tsam, scaled] = dssdata (sys, []); discrete = ! isct (sys); tol = max (tol, 100*eps); if (isempty (e)) - [fpeak, gpeak] = slab13dd (a, a, b, c, d, discrete, false, tol); # TODO: avoid dummy argument + [fpeak, gpeak] = slab13dd (a, a, b, c, d, discrete, false, tol, scaled); # TODO: avoid dummy argument else if (rcond (e) < eps) gain = inf; wpeak = inf; return; else - [fpeak, gpeak] = slab13dd (a, e, b, c, d, discrete, true, tol); + [fpeak, gpeak] = slab13dd (a, e, b, c, d, discrete, true, tol, scaled); endif endif Modified: trunk/octave-forge/main/control/inst/@lti/ssdata.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/ssdata.m 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/inst/@lti/ssdata.m 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -45,15 +45,15 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: September 2009 -## Version: 0.2 +## Version: 0.3 -function [a, b, c, d, tsam] = ssdata (sys) +function [a, b, c, d, tsam, scaled] = ssdata (sys) if (! isa (sys, "ss")) sys = ss (sys); endif - [a, b, c, d, e] = __sys_data__ (sys); + [a, b, c, d, e, ~, scaled] = __sys_data__ (sys); if (! isempty (e)) if (rcond (e) < eps) # check for singularity Modified: trunk/octave-forge/main/control/inst/@ss/__sys_data__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__sys_data__.m 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/inst/@ss/__sys_data__.m 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -20,9 +20,9 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: September 2009 -## Version: 0.2 +## Version: 0.3 -function [a, b, c, d, e, stname] = __sys_data__ (sys) +function [a, b, c, d, e, stname, scaled] = __sys_data__ (sys) a = sys.a; b = sys.b; @@ -30,5 +30,6 @@ d = sys.d; e = sys.e; stname = sys.stname; + scaled = sys.scaled; endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/inst/hsvd.m =================================================================== --- trunk/octave-forge/main/control/inst/hsvd.m 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/inst/hsvd.m 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,4 +1,4 @@ -## Copyright (C) 2010 Lukas F. Reichlin +## Copyright (C) 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -26,7 +26,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: January 2010 -## Version: 0.2 +## Version: 0.3 function hsv_r = hsvd (sys, prop = "offset", val = 1e-8) @@ -42,7 +42,7 @@ error ("hsvd: second argument invalid"); endif - [a, b, c] = ssdata (sys); + [a, b, c, ~, ~, scaled] = ssdata (sys); discrete = ! isct (sys); @@ -52,7 +52,7 @@ alpha = - val; endif - [hsv, ns] = slab13ad (a, b, c, discrete, alpha); + [hsv, ns] = slab13ad (a, b, c, discrete, alpha, scaled); if (nargout) hsv_r = hsv; @@ -88,7 +88,7 @@ %! 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 %! 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000]; %! -%! sys = ss (a, b, c); +%! sys = ss (a, b, c, [], "scaled", true); %! hsv = hsvd (sys); %! %! hsv_exp = [2.5139; 2.0846; 1.9178; 0.7666; 0.5473; 0.0253; 0.0246]; Modified: trunk/octave-forge/main/control/src/slab13ad.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13ad.cc 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/src/slab13ad.cc 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,6 +1,6 @@ /* -Copyright (C) 2010 Lukas F. Reichlin +Copyright (C) 2010, 2011 Lukas F. Reichlin This file is part of LTI Syncope. @@ -23,7 +23,7 @@ Author: Lukas Reichlin <luk...@gm...> Created: January 2010 -Version: 0.2 +Version: 0.3 */ @@ -55,7 +55,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 5) + if (nargin != 6) { print_usage (); } @@ -63,18 +63,25 @@ { // arguments in char dico; - char equil = 'N'; + char equil; Matrix a = args(0).matrix_value (); Matrix b = args(1).matrix_value (); Matrix c = args(2).matrix_value (); int discrete = args(3).int_value (); double alpha = args(4).double_value (); + const int scaled = args(5).int_value (); if (discrete == 0) dico = 'C'; else dico = 'D'; + + if (scaled == 0) + equil = 'S'; + else + equil = 'N'; + int n = a.rows (); // n: number of states int m = b.columns (); // m: number of inputs Modified: trunk/octave-forge/main/control/src/slab13dd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13dd.cc 2011-07-27 10:50:56 UTC (rev 8415) +++ trunk/octave-forge/main/control/src/slab13dd.cc 2011-07-27 13:12:27 UTC (rev 8416) @@ -1,6 +1,6 @@ /* -Copyright (C) 2009, 2010 Lukas F. Reichlin +Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin This file is part of LTI Syncope. @@ -23,7 +23,7 @@ Author: Lukas Reichlin <luk...@gm...> Created: November 2009 -Version: 0.3 +Version: 0.4 */ @@ -60,7 +60,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 8) + if (nargin != 9) { print_usage (); } @@ -69,7 +69,7 @@ // arguments in char dico; char jobe; - char equil = 'N'; + char equil; char jobd = 'D'; Matrix a = args(0).matrix_value (); @@ -80,6 +80,7 @@ int discrete = args(5).int_value (); int descriptor = args(6).int_value (); double tol = args(7).double_value (); + const int scaled = args(8).int_value (); if (discrete == 0) dico = 'C'; @@ -90,7 +91,12 @@ jobe = 'I'; else jobe = 'G'; - + + if (scaled == 0) + equil = 'S'; + else + equil = 'N'; + int n = a.rows (); // n: number of states int m = b.columns (); // m: number of inputs int p = c.rows (); // p: number of outputs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |