From: <par...@us...> - 2011-08-06 18:56:09
|
Revision: 8443 http://octave.svn.sourceforge.net/octave/?rev=8443&view=rev Author: paramaniac Date: 2011-08-06 18:56:03 +0000 (Sat, 06 Aug 2011) Log Message: ----------- control: improve texinfo strings Modified Paths: -------------- trunk/octave-forge/main/control/inst/@frd/frd.m trunk/octave-forge/main/control/inst/@lti/isct.m trunk/octave-forge/main/control/inst/@lti/isdt.m trunk/octave-forge/main/control/inst/@lti/size.m trunk/octave-forge/main/control/inst/@ss/ss.m trunk/octave-forge/main/control/inst/@tf/tf.m trunk/octave-forge/main/control/inst/ctrb.m trunk/octave-forge/main/control/inst/dss.m trunk/octave-forge/main/control/inst/obsv.m Modified: trunk/octave-forge/main/control/inst/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/inst/@frd/frd.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@frd/frd.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -25,7 +25,8 @@ ## @strong{Inputs} ## @table @var ## @item sys -## LTI model. If second argument @var{w} is omitted, the interesting +## LTI model to be converted to frequency response data. +## If second argument @var{w} is omitted, the interesting ## frequency range is calculated by the zeros and poles of @var{sys}. ## @item H ## Frequency response array (p-by-m-by-lw). In the SISO case, Modified: trunk/octave-forge/main/control/inst/@lti/isct.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/isct.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@lti/isct.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -18,6 +18,20 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{bool} =} isct (@var{sys}) ## Determine whether LTI model is a continuous-time system. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI system. +## @end table +## +## @strong{Outputs} +## @table @var +## @item bool = 0 +## @var{sys} is a discrete-time system. +## @item bool = 1 +## @var{sys} is a continuous-time system or a static gain. +## @end table ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> @@ -32,4 +46,4 @@ bool = (ltisys.tsam == 0 || ltisys.tsam == -2); -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/inst/@lti/isdt.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/isdt.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@lti/isdt.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -18,6 +18,20 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{bool} =} isdt (@var{sys}) ## Determine whether LTI model is a discrete-time system. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI system. +## @end table +## +## @strong{Outputs} +## @table @var +## @item bool = 0 +## @var{sys} is a continuous-time system. +## @item bool = 1 +## @var{sys} is a discrete-time system or a static gain. +## @end table ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> @@ -32,4 +46,4 @@ bool = (ltisys.tsam != 0); -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/inst/@lti/size.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/size.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@lti/size.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -1,4 +1,4 @@ -## Copyright (C) 2009 Lukas F. Reichlin +## Copyright (C) 2009, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -16,54 +16,76 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{nvec} =} size (@var{ltisys}) -## @deftypefnx {Function File} {@var{n} =} size (@var{ltisys}, @var{idx}) -## @deftypefnx {Function File} {[@var{ny}, @var{nu}] =} size (@var{ltisys}) +## @deftypefn {Function File} {@var{nvec} =} size (@var{sys}) +## @deftypefnx {Function File} {@var{n} =} size (@var{sys}, @var{dim}) +## @deftypefnx {Function File} {[@var{p}, @var{m}] =} size (@var{sys}) ## LTI model size, i.e. number of outputs and inputs. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI system. +## @item dim +## If given a second argument, @command{size} will return the size of the +## corresponding dimension. +## @end table +## +## @strong{Outputs} +## @table @var +## @item nvec +## Row vector. The first element is the number of outputs (rows) and the second +## element the number of inputs (columns). +## @item n +## Scalar value. The size of the dimension @var{dim}. +## @item p +## Number of outputs. +## @item m +## Number of inputs. +## @end table ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> ## Created: September 2009 -## Version: 0.1 +## Version: 0.2 -function [n, varargout] = size (ltisys, idx = 0) +function [n, varargout] = size (ltisys, dim = 0) if (nargin > 2) print_usage (); endif - ny = numel (ltisys.outname); # WARNING: system matrices may change without - nu = numel (ltisys.inname); # being noticed by the i/o names! + p = numel (ltisys.outname); # WARNING: system matrices may change without + m = numel (ltisys.inname); # being noticed by the i/o names! - switch (idx) + switch (dim) case 0 switch (nargout) case 0 - if (ny == 1) + if (p == 1) stry = ""; else stry = "s"; endif - if (nu == 1) + if (m == 1) stru = ""; else stru = "s"; endif disp (sprintf ("LTI model with %d output%s and %d input%s.", ny, stry, nu, stru)); case 1 - n = [ny, nu]; + n = [p, m]; case 2 - n = ny; - varargout{1} = nu; + n = p; + varargout{1} = m; otherwise print_usage (); endswitch case 1 - n = ny; + n = p; case 2 - n = nu; + n = m; otherwise print_usage (); endswitch -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/inst/@ss/ss.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/ss.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@ss/ss.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -26,6 +26,8 @@ ## ## @strong{Inputs} ## @table @var +## @item sys +## LTI model to be converted to state-space. ## @item a ## State transition matrix (n-by-n). ## @item b Modified: trunk/octave-forge/main/control/inst/@tf/tf.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/tf.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/@tf/tf.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -25,6 +25,8 @@ ## ## @strong{Inputs} ## @table @var +## @item sys +## LTI model to be converted to transfer function. ## @item num ## Numerator or cell of numerators. Each numerator must be a row vector ## containing the exponents of the polynomial in descending order. Modified: trunk/octave-forge/main/control/inst/ctrb.m =================================================================== --- trunk/octave-forge/main/control/inst/ctrb.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/ctrb.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -19,7 +19,36 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{co} =} ctrb (@var{sys}) ## @deftypefnx {Function File} {@var{co} =} ctrb (@var{a}, @var{b}) +## Return controllability matrix. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI model. +## @item a +## State transition matrix (n-by-n). +## @item b +## Input matrix (n-by-m). +## @end table +## +## @strong{Outputs} +## @table @var +## @item co ## Controllability matrix. +## @end table +## +## @strong{Equation} +## @iftex +## @tex +## $$ C_o = [ B AB A^2B \ldots A^{n-1}B ] $$ +## @end tex +## @end iftex +## @ifinfo +## @example +## 2 n-1 +## Co = [ B AB A B ... A B ] +## @end example +## @end ifinfo ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> Modified: trunk/octave-forge/main/control/inst/dss.m =================================================================== --- trunk/octave-forge/main/control/inst/dss.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/dss.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -24,6 +24,8 @@ ## ## @strong{Inputs} ## @table @var +## @item sys +## LTI model to be converted to state-space. ## @item a ## State transition matrix (n-by-n). ## @item b @@ -85,4 +87,4 @@ ## ## but this would break compatibility to a widespread ## commercial implementation of the octave language. -## There's no way to tell e and d apart if n = m = p. \ No newline at end of file +## There's no way to tell e and d apart if n = m = p. Modified: trunk/octave-forge/main/control/inst/obsv.m =================================================================== --- trunk/octave-forge/main/control/inst/obsv.m 2011-08-06 12:32:14 UTC (rev 8442) +++ trunk/octave-forge/main/control/inst/obsv.m 2011-08-06 18:56:03 UTC (rev 8443) @@ -19,7 +19,45 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{ob} =} obsv (@var{sys}) ## @deftypefnx {Function File} {@var{ob} =} obsv (@var{a}, @var{c}) +## Return observability matrix. +## +## @strong{Inputs} +## @table @var +## @item sys +## LTI model. +## @item a +## State transition matrix (n-by-n). +## @item c +## Measurement matrix (p-by-n). +## @end table +## +## @strong{Outputs} +## @table @var +## @item co ## Observability matrix. +## @end table +## +## @strong{Equation} +## @iftex +## @tex +## $$ O_b = \left[ \matrix{ C \cr +## CA \cr +## CA^2 \cr +## \vdots \cr +## CA^{n-1} } \right ] $$ +## @end tex +## @end iftex +## @ifinfo +## @example +## @group +## | C | +## | CA | +## Ob = | CA^2 | +## | ... | +## | CA^(n-1) | +## @end group +## @end example +## @end ifinfo ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |