# HG changeset patch # User jwe # Date 1190390476 0 # Node ID e45e921fbee255e6ca51e3292c32ddf7856251b4 # Parent dcd384e73cbe96026638d699fc933d3fc8ccdc82 [project @ 2007-09-21 16:01:15 by jwe] diff -r dcd384e73cbe -r e45e921fbee2 scripts/ChangeLog --- a/scripts/ChangeLog Fri Sep 21 12:30:34 2007 +0000 +++ b/scripts/ChangeLog Fri Sep 21 16:01:16 2007 +0000 @@ -1,3 +1,7 @@ +2007-09-21 Luther Tychonievich + + * control/hinf/h2norm: Compute d*d', not d'*d. + 2007-09-21 Thomas Weber * statistics/distributions/Makefile.in (SOURCES): Add unidcdf.m, diff -r dcd384e73cbe -r e45e921fbee2 scripts/control/hinf/h2norm.m --- a/scripts/control/hinf/h2norm.m Fri Sep 21 12:30:34 2007 +0000 +++ b/scripts/control/hinf/h2norm.m Fri Sep 21 16:01:16 2007 +0000 @@ -49,28 +49,29 @@ function h2gain = h2norm (sys) - if((nargin != 1)) + if (nargin != 1) print_usage (); - elseif(!isstruct(sys)) - error("Sys must be in system data structure"); + elseif (! isstruct (sys)) + error ("Sys must be in system data structure"); end - dflg = is_digital(sys); + dflg = is_digital (sys); - if(!is_stable(sys)) - warning("h2norm: unstable input system; returning Inf"); + if (! is_stable (sys)) + warning ("h2norm: unstable input system; returning Inf"); h2gain = Inf; else ## compute gain - [a,b,c,d] = sys2ss(sys); - if(dflg) - M = dlyap(a,b*b'); + [a, b, c, d] = sys2ss (sys); + if (dflg) + M = dlyap (a, b*b'); else - M = lyap (a,b*b'); + M = lyap (a, b*b'); endif - if( min(real(eig(M))) < 0) - error("h2norm: gramian not >= 0 (lightly damped modes?)") + if (min (real (eig (M))) < 0) + error ("h2norm: gramian not >= 0 (lightly damped modes?)") endif - h2gain = sqrt(trace(d'*d + c*M*c')); + h2gain = sqrt (trace (d*d' + c*M*c')); endif + endfunction