Mercurial > hg > octave-nkf
changeset 6919:e45e921fbee2
[project @ 2007-09-21 16:01:15 by jwe]
author | jwe |
---|---|
date | Fri, 21 Sep 2007 16:01:16 +0000 |
parents | dcd384e73cbe |
children | 17d9ce1f00f5 |
files | scripts/ChangeLog scripts/control/hinf/h2norm.m |
diffstat | 2 files changed, 18 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2007-09-21 Luther Tychonievich <lty@cs.byu.edu> + + * control/hinf/h2norm: Compute d*d', not d'*d. + 2007-09-21 Thomas Weber <thomas.weber.mail@gmail.com> * statistics/distributions/Makefile.in (SOURCES): Add unidcdf.m,
--- a/scripts/control/hinf/h2norm.m +++ b/scripts/control/hinf/h2norm.m @@ -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