changeset 9172:7db1aacbb3e6 octave-forge

control-devel: doc update (3)
author paramaniac
date Sat, 10 Dec 2011 20:33:15 +0000
parents 05f631eaefe6
children 3bd4b2482cef
files extra/control-devel/inst/__modred_ab09id__.m extra/control-devel/inst/btamodred.m extra/control-devel/inst/spamodred.m
diffstat 3 files changed, 67 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/extra/control-devel/inst/__modred_ab09id__.m	Sat Dec 10 20:16:37 2011 +0000
+++ b/extra/control-devel/inst/__modred_ab09id__.m	Sat Dec 10 20:33:15 2011 +0000
@@ -16,7 +16,7 @@
 ## along with LTI Syncope.  If not, see <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn{Function File} {[@var{sysr}, @var{info}] =} __modred_ab09id__ (@var{method}, @dots{})
+## @deftypefn{Function File} {[@var{Gr}, @var{info}] =} __modred_ab09id__ (@var{method}, @dots{})
 ## Backend for btamodred and spamodred.
 ## @end deftypefn
 
@@ -24,7 +24,7 @@
 ## Created: November 2011
 ## Version: 0.1
 
-function [sysr, info] = __modred_ab09id__ (method, varargin)
+function [Gr, info] = __modred_ab09id__ (method, varargin)
 
   if (nargin < 2)
     print_usage ();
@@ -34,10 +34,10 @@
     error ("modred: invalid method");
   endif
 
-  sys = varargin{1};
+  G = varargin{1};
   varargin = varargin(2:end);
   
-  if (! isa (sys, "lti"))
+  if (! isa (G, "lti"))
     error ("%smodred: first argument must be an LTI system", method);
   endif
 
@@ -60,9 +60,9 @@
     error ("%smodred: keys and values must come in pairs", method);
   endif
 
-  [a, b, c, d, tsam, scaled] = ssdata (sys);
-  [p, m] = size (sys);
-  dt = isdt (sys);
+  [a, b, c, d, tsam, scaled] = ssdata (G);
+  [p, m] = size (G);
+  dt = isdt (G);
 
   ## default arguments
   alpha = __modred_default_alpha__ (dt);
@@ -156,7 +156,7 @@
                                             tol1, tol2);
 
   ## assemble reduced order model
-  sysr = ss (ar, br, cr, dr, tsam);
+  Gr = ss (ar, br, cr, dr, tsam);
 
   ## assemble info struct  
   info = struct ("nr", nr, "ns", ns, "hsv", hsv);
--- a/extra/control-devel/inst/btamodred.m	Sat Dec 10 20:16:37 2011 +0000
+++ b/extra/control-devel/inst/btamodred.m	Sat Dec 10 20:33:15 2011 +0000
@@ -65,19 +65,40 @@
 ##
 ## @strong{Inputs}
 ## @table @var
-## @item sys
+## @item G
 ## LTI model to be reduced.
+## @item nr
+## The desired order of the resulting reduced order system @var{Gr}.
+## If not specified, @var{nr} is chosen automatically according
+## to the description of key @var{"order"}.
 ## @item @dots{}
-## Pairs of properties and values.
-## TODO: describe options.
+## Optional pairs of keys and values.  @code{"key1", value1, "key2", value2}.
+## @item opt
+## Optional struct with keys as field names.
+## Struct @var{opt} can be created directly or
+## by command @command{options}.  @code{opt.key1 = value1, opt.key2 = value2}.
 ## @end table
 ##
 ## @strong{Outputs}
 ## @table @var
-## @item sysr
+## @item Gr
 ## Reduced order state-space model.
-## @item nr
-## The order of the obtained system @var{sysr}.
+## @item info
+## Struct containing additional information.
+## @table @var
+## @item info.n
+## The order of the original system @var{G}.
+## @item info.ns
+## The order of the @var{alpha}-stable subsystem of the original system @var{G}.
+## @item info.hsv
+## The Hankel singular values of the @var{alpha}-stable part of
+## the original system @var{G}, ordered decreasingly.
+## @item info.nu
+## The order of the @var{alpha}-unstable subsystem of both the original
+## system @var{G} and the reduced-order system @var{Gr}.
+## @item info.nr
+## The order of the obtained reduced order system @var{Gr}.
+## @end table
 ## @end table
 ##
 ## @strong{Algorithm}@*
@@ -89,9 +110,9 @@
 ## Created: November 2011
 ## Version: 0.1
 
-function [sysr, info] = btamodred (varargin)
+function [Gr, info] = btamodred (varargin)
 
-  [sysr, info] = __modred_ab09id__ ("bta", varargin{:});
+  [Gr, info] = __modred_ab09id__ ("bta", varargin{:});
 
 endfunction
 
--- a/extra/control-devel/inst/spamodred.m	Sat Dec 10 20:16:37 2011 +0000
+++ b/extra/control-devel/inst/spamodred.m	Sat Dec 10 20:33:15 2011 +0000
@@ -21,23 +21,44 @@
 ## @deftypefnx{Function File} {[@var{Gr}, @var{info}] =} spamodred (@var{G}, @var{opt}, @dots{})
 ## @deftypefnx{Function File} {[@var{Gr}, @var{info}] =} spamodred (@var{G}, @var{nr}, @var{opt}, @dots{})
 ##
-## Model order reduction by frequency weighted optimal Hankel-norm approximation method.
+## Model order reduction by frequency weighted Singular Perturbation Approximation (SPA).
 ##
 ## @strong{Inputs}
 ## @table @var
-## @item sys
+## @item G
 ## LTI model to be reduced.
+## @item nr
+## The desired order of the resulting reduced order system @var{Gr}.
+## If not specified, @var{nr} is chosen automatically according
+## to the description of key @var{"order"}.
 ## @item @dots{}
-## Pairs of properties and values.
-## TODO: describe options.
+## Optional pairs of keys and values.  @code{"key1", value1, "key2", value2}.
+## @item opt
+## Optional struct with keys as field names.
+## Struct @var{opt} can be created directly or
+## by command @command{options}.  @code{opt.key1 = value1, opt.key2 = value2}.
 ## @end table
 ##
 ## @strong{Outputs}
 ## @table @var
-## @item sysr
+## @item Gr
 ## Reduced order state-space model.
-## @item nr
-## The order of the obtained system @var{sysr}.
+## @item info
+## Struct containing additional information.
+## @table @var
+## @item info.n
+## The order of the original system @var{G}.
+## @item info.ns
+## The order of the @var{alpha}-stable subsystem of the original system @var{G}.
+## @item info.hsv
+## The Hankel singular values of the @var{alpha}-stable part of
+## the original system @var{G}, ordered decreasingly.
+## @item info.nu
+## The order of the @var{alpha}-unstable subsystem of both the original
+## system @var{G} and the reduced-order system @var{Gr}.
+## @item info.nr
+## The order of the obtained reduced order system @var{Gr}.
+## @end table
 ## @end table
 ##
 ## @strong{Algorithm}@*
@@ -49,9 +70,9 @@
 ## Created: November 2011
 ## Version: 0.1
 
-function [sysr, info] = spamodred (varargin)
+function [Gr, info] = spamodred (varargin)
 
-  [sysr, info] = __modred_ab09id__ ("spa", varargin{:});
+  [Gr, info] = __modred_ab09id__ ("spa", varargin{:});
 
 endfunction