From: <par...@us...> - 2011-12-04 19:21:18
|
Revision: 9260 http://octave.svn.sourceforge.net/octave/?rev=9260&view=rev Author: paramaniac Date: 2011-12-04 19:21:09 +0000 (Sun, 04 Dec 2011) Log Message: ----------- control: prepare release of control-2.2.2 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/devel/pdfdoc/functions.texi trunk/octave-forge/main/control/doc/control.pdf Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/DESCRIPTION 2011-12-04 19:21:09 UTC (rev 9260) @@ -1,6 +1,6 @@ Name: Control -Version: 2.2.1 -Date: 2011-10-24 +Version: 2.2.2 +Date: 2011-12-04 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/NEWS 2011-12-04 19:21:09 UTC (rev 9260) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.2.2 Release Date: 2011-xx-yy Release Manager: Lukas Reichlin +control-2.2.2 Release Date: 2011-12-04 Release Manager: Lukas Reichlin =============================================================================== ** Improved error messages for place, ARE solvers and robust control commands. Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2011-12-04 19:21:09 UTC (rev 9260) @@ -4,7 +4,7 @@ USAGE: * adapt all paths to your machine * update version number in the commands below * adapt version number and release date in DESCRIPTION - * update doc/NEWS + * update NEWS * adapt version number in control.tex * update doc/control.pdf * copy-paste entire block at once to the terminal @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.2.1.tar.gz control/ -md5 control-2.2.1.tar.gz -md5 control-2.2.1.tar.gz > md5_control_pkg.txt -uuencode control-2.2.1.tar.gz < control-2.2.1.tar.gz > control-2.2.1.tar.gz.uue +tar czf control-2.2.2.tar.gz control/ +md5 control-2.2.2.tar.gz +md5 control-2.2.2.tar.gz > md5_control_pkg.txt +uuencode control-2.2.2.tar.gz < control-2.2.2.tar.gz > control-2.2.2.tar.gz.uue octave -q --eval \ -"pkg install control-2.2.1.tar.gz" +"pkg install control-2.2.2.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.2.1 +rm -R ~/octave/control-2.2.2 ===================================================================================== Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2011-12-04 19:21:09 UTC (rev 9260) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.2.1 +@set VERSION 2.2.2 @finalout @c @afourwide @c %**end of header Modified: trunk/octave-forge/main/control/devel/pdfdoc/functions.texi =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2011-12-04 19:21:09 UTC (rev 9260) @@ -875,12 +875,12 @@ $$ C_o = [ B \ \ AB \ \ A^2B \ \ldots \ A^{n-1}B ] $$ @end tex @end iftex - @ifinfo + @ifnottex @example 2 n-1 Co = [ B AB A B ... A B ] @end example - @end ifinfo + @end ifnottex @end deftypefn @section @@lti/dcgain @@ -1216,7 +1216,7 @@ CA^{n-1} } \right ] $$ @end tex @end iftex - @ifinfo + @ifnottex @example @group | C | @@ -1226,7 +1226,7 @@ | CA^(n-1) | @end group @end example - @end ifinfo + @end ifnottex @end deftypefn @section @@lti/pole @@ -1906,6 +1906,10 @@ @item info.nup The number of uncontrollable eigenvalues detected by the eigenvalue assignment algorithm. + @item info.z + The orthogonal matrix @var{z} reduces the closed-loop + system state matrix @code{A + B*F} to upper real Schur form. + Note the positive sign in @code{A + B*F}. @end table @strong{Note} @@ -2904,12 +2908,12 @@ at @var{v}=80 m/s @iftex @tex - ($M = 0.26$, $G_{a0} = -3^{circ}$, ${lpha}_0 = 4^{circ}$, ${kappa}= 50^{circ}$). + ($M = 0.26$, $G_{a0} = -3^{\circ}$, ${\alpha}_0 = 4^{\circ}$, ${\kappa}= 50^{\circ}$). @end tex @end iftex - @ifinfo + @ifnottex (@var{M} = 0.26, @var{Ga0} = -3 deg, @var{alpha0} = 4 deg, @var{kappa} = 50 deg). - @end ifinfo + @end ifnottex System inputs: (1) thrust and (2) elevator angle. Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2011-12-04 15:01:22 UTC (rev 9259) +++ trunk/octave-forge/main/control/doc/control.pdf 2011-12-04 19:21:09 UTC (rev 9260) @@ -37,13 +37,13 @@ endstream endobj 6 0 obj << -/Length 292 +/Length 291 /Filter /FlateDecode >> stream -xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<KP=5W\xD5eS\xBD~oN\xEF82x -#\xC1\x96\xB0\xD2\xEA\xA1\x8B\xEA\xBE824M\xC4\xECH\x96\xA0\xC6(88@\xEF\x8B\xEDE\xB2\xB5a\xB4%\x92\x87c\xBFU\xE5\xA14\xEE\xF2\xBC\xED\xF2\xBDV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=_}f?\xFD\x90\xABmfЖ\xF1\xA1]m\x81\xB8~[\xAB\xDA\xCA6;z''P\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFD\x86\x8F`D\x81#\x8DQ|'\xF1sW +xڅ\x90MO\xC30\x86\xEF\xFD9&\x87\x988\x8E\x9B\xE4 +b\x93\xE2ct'ġ*ݘ\xF6%\xBA\x81Ŀ'Y(Ȓe\xD9o\xFC>1 +\x93\x85\xB7\xC2\x82@^t\xDBʜ\xBA\xC3R\x94b6\xAD\xF0K瘀\xA5\xFAO\x99u \xA2\xFBg\xA9N\xEE\xDA\xD7B\xCC\xC2\xF3\xA6:\x9Bx\xD6@́E\xB3\xC8x\xB5!\xF0&\x88\xE6Y<\xCAn\xBFS\x84\xF28\xEC7J\x93gi!\x85zj\xAE\xAA˦z\xFDޜ\xDEqd\xF0F\x82,a\xA5\xD5C/\xD5}qdh \x9A\x88ّ,A\x8DQpp\x80\xDEۋdk\xC3hK$>\xC7~\xAB4\xCACi\xDC\xE5y\xDB\xE5\xBCV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=\xA7>\xB3\x9F~\x8D\xC8\xD563h\xCBx\x82\xD0.\x88\xB6@\\xBF\xADUme\x9B\xBD\x93(\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFDz\xC1\xFE8B\x8C4\x9E\xE2)6sX endstream endobj 14 0 obj << @@ -103,7 +103,7 @@ endstream endobj 136 0 obj << -/Length 2327 +/Length 2328 /Filter /FlateDecode >> stream @@ -126,17 +126,14 @@ p\xF4\xDF \xC9\xE3\x86)\xDDu\xB3\xBBo7\x91s\xA5D9W\xAA($u.\xE0\xAE|~B |
From: <par...@us...> - 2011-12-06 18:10:10
|
Revision: 9289 http://octave.svn.sourceforge.net/octave/?rev=9289&view=rev Author: paramaniac Date: 2011-12-06 18:10:00 +0000 (Tue, 06 Dec 2011) Log Message: ----------- control: huge performance gain when computing the frequency response of transfer functions Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/@tf/__freqresp__.m Added Paths: ----------- trunk/octave-forge/main/control/devel/test_tf_freqresp.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2011-12-06 11:01:20 UTC (rev 9288) +++ trunk/octave-forge/main/control/NEWS 2011-12-06 18:10:00 UTC (rev 9289) @@ -1,6 +1,14 @@ Summary of important user-visible changes for releases of the control package =============================================================================== +control-2.x.y Release Date: 201x-yy-zz Release Manager: Lukas Reichlin +=============================================================================== + +** Improved performance when computing the frequency response of transfer + function models by orders of magnitude. + + +=============================================================================== control-2.2.2 Release Date: 2011-12-04 Release Manager: Lukas Reichlin =============================================================================== Added: trunk/octave-forge/main/control/devel/test_tf_freqresp.m =================================================================== --- trunk/octave-forge/main/control/devel/test_tf_freqresp.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_tf_freqresp.m 2011-12-06 18:10:00 UTC (rev 9289) @@ -0,0 +1,12 @@ +sys = tf (WestlandLynx); + +w = logspace (-3,4,1e4); + +tic +H = freqresp (sys(1,1), w); +toc + +%sigma (sys, logspace (-2,2, 20)) +tic +sigma (sys, w) +toc \ No newline at end of file Modified: trunk/octave-forge/main/control/inst/@tf/__freqresp__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__freqresp__.m 2011-12-06 11:01:20 UTC (rev 9288) +++ trunk/octave-forge/main/control/inst/@tf/__freqresp__.m 2011-12-06 18:10:00 UTC (rev 9289) @@ -20,51 +20,52 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: October 2009 -## Version: 0.3 +## Version: 0.4 function H = __freqresp__ (sys, w, resptype = 0, cellflag = false) [num, den, tsam] = tfdata (sys, "vector"); if (isct (sys)) # continuous system - s = num2cell (i * w); + s = i * w; else # discrete system - s = num2cell (exp (i * w * abs (tsam))); + s = exp (i * w * abs (tsam)); endif + + s = reshape (s, 1, 1, []); if (issiso (sys)) - H = cellfun (@(z) polyval (num, z) / polyval (den, z), s, "uniformoutput", false); + H = polyval (num, s) ./ polyval (den, s); else - f = @(z) cellfun (@(x, y) polyval (x, z) / polyval (y, z), num, den); - H = cellfun (f, s, "uniformoutput", false); + H = cellfun (@(x, y) polyval (x, s) ./ polyval (y, s), num, den, "uniformoutput", false); + H = cell2mat (H); endif if (resptype) [p, m] = size (sys); - + l = length (s); if (m != p) error ("tf: freqresp: system must be square for response type %d", resptype); - endif - + endif + H = mat2cell (H, p, m, ones (1, l))(:); j = eye (p); - switch (resptype) case 1 # inversed system H = cellfun (@inv, H, "uniformoutput", false); - case 2 # inversed sensitivity H = cellfun (@(x) j + x, H, "uniformoutput", false); - case 3 # inversed complementary sensitivity H = cellfun (@(x) j + inv (x), H, "uniformoutput", false); - otherwise error ("tf: freqresp: invalid response type"); endswitch + if (! cellflag) + H = cat (3, H{:}); + endif + elseif (cellflag) + [p, m] = size (sys); + l = length (s); + H = mat2cell (H, p, m, ones (1, l))(:); endif - if (! cellflag) - H = cat (3, H{:}); - endif - endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-12-07 16:02:27
|
Revision: 9302 http://octave.svn.sourceforge.net/octave/?rev=9302&view=rev Author: paramaniac Date: 2011-12-07 16:02:18 +0000 (Wed, 07 Dec 2011) Log Message: ----------- control: prepare release of control-2.2.3 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/doc/control.pdf Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2011-12-07 15:42:40 UTC (rev 9301) +++ trunk/octave-forge/main/control/DESCRIPTION 2011-12-07 16:02:18 UTC (rev 9302) @@ -1,6 +1,6 @@ Name: Control -Version: 2.2.2 -Date: 2011-12-04 +Version: 2.2.3 +Date: 2011-12-07 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2011-12-07 15:42:40 UTC (rev 9301) +++ trunk/octave-forge/main/control/NEWS 2011-12-07 16:02:18 UTC (rev 9302) @@ -1,13 +1,22 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.x.y Release Date: 201x-yy-zz Release Manager: Lukas Reichlin +control-2.2.3 Release Date: 2011-12-07 Release Manager: Lukas Reichlin =============================================================================== ** Improved performance when computing the frequency response of transfer - function models by orders of magnitude. - + function models by orders of magnitude. (I realized that "polyval" can + evaluate a polynomial at several values at once in a vectorized manner.) +** bode, bodemag, nichols, sigma + -- Fixed a hang when plotting pairs of purely imaginary pairs of poles or + zeros. The hang was caused by nonsensical (Inf, NaN) axis values. + (Reported by Laurent Tissier) + +** Use single instead of double quotes when displaying names of TF and FRD + models. + + =============================================================================== control-2.2.2 Release Date: 2011-12-04 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2011-12-07 15:42:40 UTC (rev 9301) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2011-12-07 16:02:18 UTC (rev 9302) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.2.2.tar.gz control/ -md5 control-2.2.2.tar.gz -md5 control-2.2.2.tar.gz > md5_control_pkg.txt -uuencode control-2.2.2.tar.gz < control-2.2.2.tar.gz > control-2.2.2.tar.gz.uue +tar czf control-2.2.3.tar.gz control/ +md5 control-2.2.3.tar.gz +md5 control-2.2.3.tar.gz > md5_control_pkg.txt +uuencode control-2.2.3.tar.gz < control-2.2.3.tar.gz > control-2.2.3.tar.gz.uue octave -q --eval \ -"pkg install control-2.2.2.tar.gz" +"pkg install control-2.2.3.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.2.2 +rm -R ~/octave/control-2.2.3 ===================================================================================== Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2011-12-07 15:42:40 UTC (rev 9301) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2011-12-07 16:02:18 UTC (rev 9302) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.2.2 +@set VERSION 2.2.3 @finalout @c @afourwide @c %**end of header Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2011-12-07 15:42:40 UTC (rev 9301) +++ trunk/octave-forge/main/control/doc/control.pdf 2011-12-07 16:02:18 UTC (rev 9302) @@ -37,13 +37,13 @@ endstream endobj 6 0 obj << -/Length 291 +/Length 292 /Filter /FlateDecode >> stream -xڅ\x90MO\xC30\x86\xEF\xFD9&\x87\x988\x8E\x9B\xE4 -b\x93\xE2ct'ġ*ݘ\xF6%\xBA\x81Ŀ'Y(Ȓe\xD9o\xFC>1 -\x93\x85\xB7\xC2\x82@^t\xDBʜ\xBA\xC3R\x94b6\xAD\xF0K瘀\xA5\xFAO\x99u \xA2\xFBg\xA9N\xEE\xDA\xD7B\xCC\xC2\xF3\xA6:\x9Bx\xD6@́E\xB3\xC8x\xB5!\xF0&\x88\xE6Y<\xCAn\xBFS\x84\xF28\xEC7J\x93gi!\x85zj\xAE\xAA˦z\xFDޜ\xDEqd\xF0F\x82,a\xA5\xD5C/\xD5}qdh \x9A\x88ّ,A\x8DQpp\x80\xDEۋdk\xC3hK$>\xC7~\xAB4\xCACi\xDC\xE5y\xDB\xE5\xBCV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=\xA7>\xB3\x9F~\x8D\xC8\xD563h\xCBx\x82\xD0.\x88\xB6@\\xBF\xADUme\x9B\xBD\x93(\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFDz\xC1\xFE8B\x8C4\x9E\xE2)6sX +xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<KH=5W\xD5eS\xBD~oN\xEF82x +#\xC1\x96\xB0\xD2\xEA\xA1\x8B\xEA\xBE824M\xC4\xECH\x96\xA0\xC6(88@\xEF\x8B\xEDE\xB2\xB5a\xB4%\x92\x87c\xBFU\xE5\xA14\xEE\xF2\xBC\xED\xF2\xBDV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=_}f?\xFD\x90\xABmfЖ\xF1\xA1]m\x81\xB8~[\xAB\xDA\xCA6;z''P\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFD\x86\x8F`D\x81#\x8DQ|*{sY endstream endobj 14 0 obj << @@ -2734,8 +2734,8 @@ 793 0 obj << /Producer (pdfTeX-1.40.12) /Creator (TeX) -/CreationDate (D:20111204201801+01'00') -/ModDate (D:20111204201801+01'00') +/CreationDate (D:20111207165944+01'00') +/ModDate (D:20111207165944+01'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) kpathsea version 6.0.1) >> endobj @@ -2760,23 +2760,25 @@ /W [1 3 1] /Root 792 0 R /Info 793 0 R -/ID [<C60EE3AE167323D492ABF44D595F061A> <C60EE3AE167323D492ABF44D595F061A>] -/Length 1832 +/ID [<AE7E1D36BA8A72C7A6D409CC2865E5B6> <AE7E1D36BA8A72C7A6D409CC2865E5B6>] +/Length 1831 /Filter /FlateDecode >> stream -x\xDA%\x97MlU\x86\xCFwoK\xFF)\xB4(--\x94\x96Җ\xFE]h-\xA5\x94\x96\xBFB[:m\x81\xD2Jk\x94\xA8\x897&\x92Cb\h\x8C\xC6Dc"&\xFF\xAE\x88\xF9tL\\x88'Qwj\x8CQ7\xB20q\x83.Tb\xC4\xFB\xBCn\x9E|\xEF\xCCܙ9\xE7<gι!\x84p\xDFB\xA82\xEF\xE4Q82!\x94\xC8Ǣw\xF31\x93\xF6\x83!]}\x8A\xE3\x9C͂\x90\xB1PR\xAF\xC7\xC0q\x8E\x81B\xE5O\xE9~8q\xA3\xA0\x8F%\xA0\x94\x81rP6\x82J\xB0 lU\xA0l5`+\xD8\xB6\x83Z\xB0ԁz\xB04\x80F\xB0\xECM`h-`/h\xFB@h`?\xE8]\xA0\xF4\x80^\xA0\xF5\x83p |
From: <par...@us...> - 2011-12-30 13:51:14
|
Revision: 9488 http://octave.svn.sourceforge.net/octave/?rev=9488&view=rev Author: paramaniac Date: 2011-12-30 13:51:08 +0000 (Fri, 30 Dec 2011) Log Message: ----------- control: move files into place Modified Paths: -------------- trunk/octave-forge/main/control/src/Makefile Added Paths: ----------- trunk/octave-forge/main/control/devel/test_ctrbf.m trunk/octave-forge/main/control/src/sltb01ud.cc Removed Paths: ------------- trunk/octave-forge/main/control/devel/ctrbf/sltb01ud.cc trunk/octave-forge/main/control/devel/ctrbf/test_ctrbf.m Deleted: trunk/octave-forge/main/control/devel/ctrbf/sltb01ud.cc =================================================================== --- trunk/octave-forge/main/control/devel/ctrbf/sltb01ud.cc 2011-12-30 13:42:29 UTC (rev 9487) +++ trunk/octave-forge/main/control/devel/ctrbf/sltb01ud.cc 2011-12-30 13:51:08 UTC (rev 9488) @@ -1,140 +0,0 @@ -/* - -Copyright (C) 2011 Lukas F. Reichlin - -This file is part of LTI Syncope. - -LTI Syncope is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -LTI Syncope is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -Orthogonal canonical form. -Uses SLICOT TB01UD by courtesy of NICONET e.V. -<http://www.slicot.org> - -Author: Lukas Reichlin <luk...@gm...> -Created: October 2011 -Version: 0.1 - -*/ - -#include <octave/oct.h> -#include <f77-fcn.h> -#include "common.cc" - -extern "C" -{ - int F77_FUNC (tb01ud, TB01UD) - (char& JOBZ, - int& N, int& M, int& P, - double* A, int& LDA, - double* B, int& LDB, - double* C, int& LDC, - int& NCONT, int& INDCON, - int* NBLK, - double* Z, int& LDZ, - double* TAU, - double& TOL, - int* IWORK, - double* DWORK, int& LDWORK, - int& INFO); -} - -DEFUN_DLD (sltb01ud, args, nargout, - "-*- texinfo -*-\n\ -Slicot TB01UD Release 5.0\n\ -No argument checking.\n\ -For internal use only.") -{ - int nargin = args.length (); - octave_value_list retval; - - if (nargin != 4) - { - print_usage (); - } - else - { - // arguments in - char jobz = 'I'; - - Matrix a = args(0).matrix_value (); - Matrix b = args(1).matrix_value (); - Matrix c = args(2).matrix_value (); - double tol = args(3).double_value (); - - int n = a.rows (); // n: number of states - int m = b.columns (); // m: number of inputs - int p = c.rows (); // p: number of outputs - - int lda = max (1, n); - int ldb = max (1, n); - int ldc = max (1, p); - int ldz = max (1, n); - - // arguments out - Matrix z (ldz, n); - - int ncont; - int indcon; - - OCTAVE_LOCAL_BUFFER (int, nblk, n); - OCTAVE_LOCAL_BUFFER (double, tau, n); - - // workspace - int ldwork = max (1, n, 3*m, p); - - OCTAVE_LOCAL_BUFFER (int, iwork, m); - OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); - - // error indicators - int info; - - - // SLICOT routine TB01UD - F77_XFCN (tb01ud, TB01UD, - (jobz, - n, m, p, - a.fortran_vec (), lda, - b.fortran_vec (), ldb, - c.fortran_vec (), ldc, - ncont, indcon, - nblk, - z.fortran_vec (), ldz, - tau, - tol, - iwork, - dwork, ldwork, - info)); - - if (f77_exception_encountered) - error ("sltb01ud: exception in SLICOT subroutine TB01UD"); - - if (info != 0) - error ("sltb01ud: TB01UD returned info = %d", info); - - // resize - a.resize (n, n); - b.resize (n, m); - c.resize (p, n); - z.resize (n, n); - - // return values - retval(0) = a; - retval(1) = b; - retval(2) = c; - retval(3) = z; - retval(4) = octave_value (ncont); - } - - return retval; -} Deleted: trunk/octave-forge/main/control/devel/ctrbf/test_ctrbf.m =================================================================== --- trunk/octave-forge/main/control/devel/ctrbf/test_ctrbf.m 2011-12-30 13:42:29 UTC (rev 9487) +++ trunk/octave-forge/main/control/devel/ctrbf/test_ctrbf.m 2011-12-30 13:51:08 UTC (rev 9488) @@ -1,84 +0,0 @@ -a = [ -1.0 0.0 0.0 - -2.0 -2.0 -2.0 - -1.0 0.0 -3.0 ]; - -b = [ 1.0 0.0 0.0 - 0.0 2.0 1.0 ].'; - - -c = [ 0.0 2.0 1.0 - 1.0 0.0 0.0 ]; - - -[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) - -z\a*z - -a = [ 1 1 - 4 -2 ]; - -b = [ 1 -1 - 1 -1 ]; - -c = [ 1 0 - 0 1 ]; - -[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) - -%{ - The transformed state dynamics matrix of a controllable realization is - -3.0000 2.2361 - 0.0000 -1.0000 - - and the dimensions of its diagonal blocks are - 2 - - The transformed input/state matrix B of a controllable realization is - 0.0000 -2.2361 - 1.0000 0.0000 - - The transformed output/state matrix C of a controllable realization is - -2.2361 0.0000 - 0.0000 1.0000 - - The controllability index of the transformed system representation = 1 - - The similarity transformation matrix Z is - 0.0000 1.0000 0.0000 - -0.8944 0.0000 -0.4472 - -0.4472 0.0000 0.8944 -%} -%{ -A = - 1 1 - 4 -2 - -B = - 1 -1 - 1 -1 - -C = - 1 0 - 0 1 -and locate the uncontrollable mode. - -[Abar,Bbar,Cbar,T,k]=ctrbf(A,B,C) - -Abar = - -3.0000 0 - -3.0000 2.0000 - -Bbar = - 0.0000 0.0000 - 1.4142 -1.4142 - -Cbar = - -0.7071 0.7071 - 0.7071 0.7071 - -T = - -0.7071 0.7071 - 0.7071 0.7071 -k = - 1 0 -%} \ No newline at end of file Copied: trunk/octave-forge/main/control/devel/test_ctrbf.m (from rev 9487, trunk/octave-forge/main/control/devel/ctrbf/test_ctrbf.m) =================================================================== --- trunk/octave-forge/main/control/devel/test_ctrbf.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_ctrbf.m 2011-12-30 13:51:08 UTC (rev 9488) @@ -0,0 +1,84 @@ +a = [ -1.0 0.0 0.0 + -2.0 -2.0 -2.0 + -1.0 0.0 -3.0 ]; + +b = [ 1.0 0.0 0.0 + 0.0 2.0 1.0 ].'; + + +c = [ 0.0 2.0 1.0 + 1.0 0.0 0.0 ]; + + +[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) + +z\a*z + +a = [ 1 1 + 4 -2 ]; + +b = [ 1 -1 + 1 -1 ]; + +c = [ 1 0 + 0 1 ]; + +[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) + +%{ + The transformed state dynamics matrix of a controllable realization is + -3.0000 2.2361 + 0.0000 -1.0000 + + and the dimensions of its diagonal blocks are + 2 + + The transformed input/state matrix B of a controllable realization is + 0.0000 -2.2361 + 1.0000 0.0000 + + The transformed output/state matrix C of a controllable realization is + -2.2361 0.0000 + 0.0000 1.0000 + + The controllability index of the transformed system representation = 1 + + The similarity transformation matrix Z is + 0.0000 1.0000 0.0000 + -0.8944 0.0000 -0.4472 + -0.4472 0.0000 0.8944 +%} +%{ +A = + 1 1 + 4 -2 + +B = + 1 -1 + 1 -1 + +C = + 1 0 + 0 1 +and locate the uncontrollable mode. + +[Abar,Bbar,Cbar,T,k]=ctrbf(A,B,C) + +Abar = + -3.0000 0 + -3.0000 2.0000 + +Bbar = + 0.0000 0.0000 + 1.4142 -1.4142 + +Cbar = + -0.7071 0.7071 + 0.7071 0.7071 + +T = + -0.7071 0.7071 + 0.7071 0.7071 +k = + 1 0 +%} \ No newline at end of file Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2011-12-30 13:42:29 UTC (rev 9487) +++ trunk/octave-forge/main/control/src/Makefile 2011-12-30 13:51:08 UTC (rev 9488) @@ -10,7 +10,7 @@ sltb01pd.oct slsb03od.oct slsg03bd.oct slag08bd.oct sltg01jd.oct \ sltg01hd.oct sltg01id.oct slsg02ad.oct sltg04bx.oct sltb01id.oct \ sltg01ad.oct slsb10id.oct slsb10kd.oct slsb10zd.oct sltb04bd.oct \ - slab04md.oct slsb10jd.oct sltd04ad.oct \ + slab04md.oct slsb10jd.oct sltd04ad.oct sltb01ud.oct \ is_real_scalar.oct is_real_vector.oct is_real_matrix.oct \ is_real_square_matrix.oct \ copy_NEWS @@ -272,6 +272,12 @@ TB01UD.f TB01ID.f MB01PD.f MB03OY.f MB01QD.f \ ${LAPACK_LIBS} ${BLAS_LIBS} +# controllable block Hessenberg realization +sltb01ud.oct: sltb01ud.cc + mkoctfile sltb01ud.cc \ + TB01UD.f MB01PD.f MB03OY.f MB01QD.f \ + ${LAPACK_LIBS} ${BLAS_LIBS} + # helpers is_real_scalar.oct: is_real_scalar.cc mkoctfile is_real_scalar.cc Copied: trunk/octave-forge/main/control/src/sltb01ud.cc (from rev 9487, trunk/octave-forge/main/control/devel/ctrbf/sltb01ud.cc) =================================================================== --- trunk/octave-forge/main/control/src/sltb01ud.cc (rev 0) +++ trunk/octave-forge/main/control/src/sltb01ud.cc 2011-12-30 13:51:08 UTC (rev 9488) @@ -0,0 +1,140 @@ +/* + +Copyright (C) 2011 Lukas F. Reichlin + +This file is part of LTI Syncope. + +LTI Syncope is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +LTI Syncope is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +Orthogonal canonical form. +Uses SLICOT TB01UD by courtesy of NICONET e.V. +<http://www.slicot.org> + +Author: Lukas Reichlin <luk...@gm...> +Created: October 2011 +Version: 0.1 + +*/ + +#include <octave/oct.h> +#include <f77-fcn.h> +#include "common.cc" + +extern "C" +{ + int F77_FUNC (tb01ud, TB01UD) + (char& JOBZ, + int& N, int& M, int& P, + double* A, int& LDA, + double* B, int& LDB, + double* C, int& LDC, + int& NCONT, int& INDCON, + int* NBLK, + double* Z, int& LDZ, + double* TAU, + double& TOL, + int* IWORK, + double* DWORK, int& LDWORK, + int& INFO); +} + +DEFUN_DLD (sltb01ud, args, nargout, + "-*- texinfo -*-\n\ +Slicot TB01UD Release 5.0\n\ +No argument checking.\n\ +For internal use only.") +{ + int nargin = args.length (); + octave_value_list retval; + + if (nargin != 4) + { + print_usage (); + } + else + { + // arguments in + char jobz = 'I'; + + Matrix a = args(0).matrix_value (); + Matrix b = args(1).matrix_value (); + Matrix c = args(2).matrix_value (); + double tol = args(3).double_value (); + + int n = a.rows (); // n: number of states + int m = b.columns (); // m: number of inputs + int p = c.rows (); // p: number of outputs + + int lda = max (1, n); + int ldb = max (1, n); + int ldc = max (1, p); + int ldz = max (1, n); + + // arguments out + Matrix z (ldz, n); + + int ncont; + int indcon; + + OCTAVE_LOCAL_BUFFER (int, nblk, n); + OCTAVE_LOCAL_BUFFER (double, tau, n); + + // workspace + int ldwork = max (1, n, 3*m, p); + + OCTAVE_LOCAL_BUFFER (int, iwork, m); + OCTAVE_LOCAL_BUFFER (double, dwork, ldwork); + + // error indicators + int info; + + + // SLICOT routine TB01UD + F77_XFCN (tb01ud, TB01UD, + (jobz, + n, m, p, + a.fortran_vec (), lda, + b.fortran_vec (), ldb, + c.fortran_vec (), ldc, + ncont, indcon, + nblk, + z.fortran_vec (), ldz, + tau, + tol, + iwork, + dwork, ldwork, + info)); + + if (f77_exception_encountered) + error ("sltb01ud: exception in SLICOT subroutine TB01UD"); + + if (info != 0) + error ("sltb01ud: TB01UD returned info = %d", info); + + // resize + a.resize (n, n); + b.resize (n, m); + c.resize (p, n); + z.resize (n, n); + + // return values + retval(0) = a; + retval(1) = b; + retval(2) = c; + retval(3) = z; + retval(4) = octave_value (ncont); + } + + return retval; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-12-30 14:06:15
|
Revision: 9490 http://octave.svn.sourceforge.net/octave/?rev=9490&view=rev Author: paramaniac Date: 2011-12-30 14:06:08 +0000 (Fri, 30 Dec 2011) Log Message: ----------- control: remaining work on obsvf, ctrbf Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/test_control.m Added Paths: ----------- trunk/octave-forge/main/control/inst/ctrbf.m trunk/octave-forge/main/control/inst/obsvf.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/ctrbf.m trunk/octave-forge/main/control/devel/obsvf.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2011-12-30 13:54:32 UTC (rev 9489) +++ trunk/octave-forge/main/control/NEWS 2011-12-30 14:06:08 UTC (rev 9490) @@ -1,6 +1,19 @@ Summary of important user-visible changes for releases of the control package =============================================================================== +control-2.2.4 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +=============================================================================== + +** Compatibility with Octave 3.6.0. One must specify the libraries that + mkoctfile needs to link. (Thanks to Marco Atzeri and Carlo De Falco) + +** ctrbf, obsvf + -- Added new functions to compute controllable and obsvervable block + Hessenberg realizations based on SLICOT TB01UD. + (Thanks to Benjamin Fernandez and Alexandre Felipe) + + +=============================================================================== control-2.2.3 Release Date: 2011-12-07 Release Manager: Lukas Reichlin =============================================================================== Deleted: trunk/octave-forge/main/control/devel/ctrbf.m =================================================================== --- trunk/octave-forge/main/control/devel/ctrbf.m 2011-12-30 13:54:32 UTC (rev 9489) +++ trunk/octave-forge/main/control/devel/ctrbf.m 2011-12-30 14:06:08 UTC (rev 9490) @@ -1,122 +0,0 @@ -## Copyright (C) 2010 Benjamin Fernandez -## Copyright (C) 2011 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}) -## @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}, @var{tol}) -## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}) -## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}, @var{TOL}) -## If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a -## similarity transformation Tc such that Tc = [t1 t2] where t1 -## is the controllable subspace and t2 is orthogonal to t1 -## -## @example -## @group -## Abar = Tc \ A * Tc , Bbar = Tc \ B , Cbar = C * Tc -## @end group -## @end example -## -## and the transformed system has the form -## -## @example -## @group -## | Ac A12| | Bc | -## Abar = |----------|, Bbar = | ---|, Cbar = [Cc | Cnc]. -## | 0 Anc| | 0 | -## @end group -## @end example -## -## where (Ac,Bc) is controllable, and Cc(sI-Ac)^(-1)Bc = C(sI-A)^(-1)B. -## and the system is stabilizable if Anc has no eigenvalues in -## the right half plane. The last output K is a vector of length n -## containing the number of controllable states. -## @end deftypefn - -## Author: Benjamin Fernandez <ma...@be...> -## Created: 2010-04-30 -## Version: 0.1 - -function [ac, bc, cc, z, ncont] = ctrbf (a, b = [], c, tol = []) - - if (nargin < 1 || nargin > 4) - print_usage (); - endif - - islti = isa (a, "lti"); - - if (islti) - if (nargin > 2) - print_usage (); - endif - sys = a; - tol = b; - [a, b, c] = ssdata (sys); - else - if (nargin < 3) - print_usage (); - endif - sys = ss (a, b, c); - [a, b, c] = ssdata (sys); - endif - - if (isempty (tol)) - tol = 0; # default tolerance - elseif (! is_real_scalar (tol)) - error ("ctrbf: tol must be a real scalar"); - endif - - [ac, bc, cc, z, ncont] = sltb01ud (a, b, c, tol); - - if (islti) - ac = set (sys, "a", ac, "b", bc, "c", cc, "scaled", false); - bc = z; - cc = ncont; - endif - -endfunction - -%!shared Ao, Bo, Co, Zo, Ae, Be, Ce, Ze, NCONT -%! A = [ -1.0 0.0 0.0 -%! -2.0 -2.0 -2.0 -%! -1.0 0.0 -3.0 ]; -%! -%! B = [ 1.0 0.0 0.0 -%! 0.0 2.0 1.0 ].'; -%! -%! C = [ 0.0 2.0 1.0 -%! 1.0 0.0 0.0 ]; -%! -%! [Ao, Bo, Co, Zo, NCONT] = ctrbf (A, B, C); -%! -%! Ae = [ -3.0000 2.2361 -%! 0.0000 -1.0000 ]; -%! -%! Be = [ 0.0000 -2.2361 -%! 1.0000 0.0000 ]; -%! -%! Ce = [ -2.2361 0.0000 -%! 0.0000 1.0000 ]; -%! -%! Ze = [ 0.0000 1.0000 0.0000 -%! -0.8944 0.0000 -0.4472 -%! -0.4472 0.0000 0.8944 ]; -%! -%!assert (Ao(1:NCONT, 1:NCONT), Ae, 1e-4); -%!assert (Bo(1:NCONT, :), Be, 1e-4); -%!assert (Co(:, 1:NCONT), Ce, 1e-4); -%!assert (Zo, Ze, 1e-4); Deleted: trunk/octave-forge/main/control/devel/obsvf.m =================================================================== --- trunk/octave-forge/main/control/devel/obsvf.m 2011-12-30 13:54:32 UTC (rev 9489) +++ trunk/octave-forge/main/control/devel/obsvf.m 2011-12-30 14:06:08 UTC (rev 9490) @@ -1,77 +0,0 @@ -## Copyright (C) 2010 Benjamin Fernandez -## Copyright (C) 2011 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}) -## @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}, @var{tol}) -## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}) -## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}, @var{TOL}) -## If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a -## similarity transformation Tc such that To = [t1;t2] where t1 is c -## and t2 is orthogonal to t1 -## -## @example -## @group -## Abar = To \ A * To , Bbar = To \ B , Cbar = C * To -## @end group -## @end example -## -## and the transformed system has the form -## -## @example -## @group -## | Ao 0 | | Bo | -## Abar = |----------|, Bbar = | --- |, Cbar = [Co | 0 ]. -## | A21 Ano| | Bno | -## @end group -## @end example -## -## where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And -## system is detectable if Ano has no eigenvalues in the right -## half plane. The last output K is a vector of length n containing the -## number of observable states. -## @end deftypefn - -## Author: Benjamin Fernandez <benjas@benjas-laptop> -## Created: 2010-05-02 -## Version: 0.1 - -function [ac, bc, cc, z, ncont] = obsvf (a, b = [], c, tol = []) - - if (nargin < 1 || nargin > 4) - print_usage (); - endif - - if (isa (a, "lti")) - if (nargin > 2) - print_usage (); - endif - [ac, bc, cc] = ctrbf (a.', b); # [sysbar, z, ncont] = ctrbf (sys.', tol); - ac = ac.'; - z = ncont = []; - else - if (nargin < 3) - print_usage (); - endif - [ac, tmp, cc, z, ncont] = ctrbf (a.', c.', b.', tol); - ac = ac.'; - bc = cc.'; - cc = tmp.'; - endif - -endfunction Copied: trunk/octave-forge/main/control/inst/ctrbf.m (from rev 9488, trunk/octave-forge/main/control/devel/ctrbf.m) =================================================================== --- trunk/octave-forge/main/control/inst/ctrbf.m (rev 0) +++ trunk/octave-forge/main/control/inst/ctrbf.m 2011-12-30 14:06:08 UTC (rev 9490) @@ -0,0 +1,122 @@ +## Copyright (C) 2010 Benjamin Fernandez +## Copyright (C) 2011 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}) +## @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}, @var{tol}) +## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}) +## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}, @var{TOL}) +## If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a +## similarity transformation Tc such that Tc = [t1 t2] where t1 +## is the controllable subspace and t2 is orthogonal to t1 +## +## @example +## @group +## Abar = Tc \ A * Tc , Bbar = Tc \ B , Cbar = C * Tc +## @end group +## @end example +## +## and the transformed system has the form +## +## @example +## @group +## | Ac A12| | Bc | +## Abar = |----------|, Bbar = | ---|, Cbar = [Cc | Cnc]. +## | 0 Anc| | 0 | +## @end group +## @end example +## +## where (Ac,Bc) is controllable, and Cc(sI-Ac)^(-1)Bc = C(sI-A)^(-1)B. +## and the system is stabilizable if Anc has no eigenvalues in +## the right half plane. The last output K is a vector of length n +## containing the number of controllable states. +## @end deftypefn + +## Author: Benjamin Fernandez <ma...@be...> +## Created: 2010-04-30 +## Version: 0.1 + +function [ac, bc, cc, z, ncont] = ctrbf (a, b = [], c, tol = []) + + if (nargin < 1 || nargin > 4) + print_usage (); + endif + + islti = isa (a, "lti"); + + if (islti) + if (nargin > 2) + print_usage (); + endif + sys = a; + tol = b; + [a, b, c] = ssdata (sys); + else + if (nargin < 3) + print_usage (); + endif + sys = ss (a, b, c); + [a, b, c] = ssdata (sys); + endif + + if (isempty (tol)) + tol = 0; # default tolerance + elseif (! is_real_scalar (tol)) + error ("ctrbf: tol must be a real scalar"); + endif + + [ac, bc, cc, z, ncont] = sltb01ud (a, b, c, tol); + + if (islti) + ac = set (sys, "a", ac, "b", bc, "c", cc, "scaled", false); + bc = z; + cc = ncont; + endif + +endfunction + +%!shared Ao, Bo, Co, Zo, Ae, Be, Ce, Ze, NCONT +%! A = [ -1.0 0.0 0.0 +%! -2.0 -2.0 -2.0 +%! -1.0 0.0 -3.0 ]; +%! +%! B = [ 1.0 0.0 0.0 +%! 0.0 2.0 1.0 ].'; +%! +%! C = [ 0.0 2.0 1.0 +%! 1.0 0.0 0.0 ]; +%! +%! [Ao, Bo, Co, Zo, NCONT] = ctrbf (A, B, C); +%! +%! Ae = [ -3.0000 2.2361 +%! 0.0000 -1.0000 ]; +%! +%! Be = [ 0.0000 -2.2361 +%! 1.0000 0.0000 ]; +%! +%! Ce = [ -2.2361 0.0000 +%! 0.0000 1.0000 ]; +%! +%! Ze = [ 0.0000 1.0000 0.0000 +%! -0.8944 0.0000 -0.4472 +%! -0.4472 0.0000 0.8944 ]; +%! +%!assert (Ao(1:NCONT, 1:NCONT), Ae, 1e-4); +%!assert (Bo(1:NCONT, :), Be, 1e-4); +%!assert (Co(:, 1:NCONT), Ce, 1e-4); +%!assert (Zo, Ze, 1e-4); Copied: trunk/octave-forge/main/control/inst/obsvf.m (from rev 9488, trunk/octave-forge/main/control/devel/obsvf.m) =================================================================== --- trunk/octave-forge/main/control/inst/obsvf.m (rev 0) +++ trunk/octave-forge/main/control/inst/obsvf.m 2011-12-30 14:06:08 UTC (rev 9490) @@ -0,0 +1,77 @@ +## Copyright (C) 2010 Benjamin Fernandez +## Copyright (C) 2011 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}) +## @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}, @var{tol}) +## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}) +## @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}, @var{TOL}) +## If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a +## similarity transformation Tc such that To = [t1;t2] where t1 is c +## and t2 is orthogonal to t1 +## +## @example +## @group +## Abar = To \ A * To , Bbar = To \ B , Cbar = C * To +## @end group +## @end example +## +## and the transformed system has the form +## +## @example +## @group +## | Ao 0 | | Bo | +## Abar = |----------|, Bbar = | --- |, Cbar = [Co | 0 ]. +## | A21 Ano| | Bno | +## @end group +## @end example +## +## where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And +## system is detectable if Ano has no eigenvalues in the right +## half plane. The last output K is a vector of length n containing the +## number of observable states. +## @end deftypefn + +## Author: Benjamin Fernandez <benjas@benjas-laptop> +## Created: 2010-05-02 +## Version: 0.1 + +function [ac, bc, cc, z, ncont] = obsvf (a, b = [], c, tol = []) + + if (nargin < 1 || nargin > 4) + print_usage (); + endif + + if (isa (a, "lti")) + if (nargin > 2) + print_usage (); + endif + [ac, bc, cc] = ctrbf (a.', b); # [sysbar, z, ncont] = ctrbf (sys.', tol); + ac = ac.'; + z = ncont = []; + else + if (nargin < 3) + print_usage (); + endif + [ac, tmp, cc, z, ncont] = ctrbf (a.', c.', b.', tol); + ac = ac.'; + bc = cc.'; + cc = tmp.'; + endif + +endfunction Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2011-12-30 13:54:32 UTC (rev 9489) +++ trunk/octave-forge/main/control/inst/test_control.m 2011-12-30 14:06:08 UTC (rev 9490) @@ -62,6 +62,7 @@ ## various oct-files test place test hsvd +test ctrbf ## various m-files test margin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-01-07 17:27:31
|
Revision: 9507 http://octave.svn.sourceforge.net/octave/?rev=9507&view=rev Author: paramaniac Date: 2012-01-07 17:27:22 +0000 (Sat, 07 Jan 2012) Log Message: ----------- control: prepare release of control-2.2.4 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/devel/pdfdoc/functions.texi trunk/octave-forge/main/control/doc/control.pdf Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-01-07 17:27:22 UTC (rev 9507) @@ -1,11 +1,11 @@ Name: Control -Version: 2.2.3 -Date: 2011-12-07 +Version: 2.2.4 +Date: 2012-01-07 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Description: Octave control systems package based on the proven SLICOT library -Depends: octave (>= 3.3.90) +Depends: octave (>= 3.4.0) Autoload: yes License: GPL version 3 or later Url: http://octave.sf.net, http://www.slicot.org Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/NEWS 2012-01-07 17:27:22 UTC (rev 9507) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.2.4 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.2.4 Release Date: 2012-01-07 Release Manager: Lukas Reichlin =============================================================================== ** Compatibility with Octave 3.6.0. (The makefile must specify the libraries Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-01-07 17:27:22 UTC (rev 9507) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.2.3.tar.gz control/ -md5 control-2.2.3.tar.gz -md5 control-2.2.3.tar.gz > md5_control_pkg.txt -uuencode control-2.2.3.tar.gz < control-2.2.3.tar.gz > control-2.2.3.tar.gz.uue +tar czf control-2.2.4.tar.gz control/ +md5 control-2.2.4.tar.gz +md5 control-2.2.4.tar.gz > md5_control_pkg.txt +uuencode control-2.2.4.tar.gz < control-2.2.4.tar.gz > control-2.2.4.tar.gz.uue octave -q --eval \ -"pkg install control-2.2.3.tar.gz" +"pkg install control-2.2.4.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.2.3 +rm -R ~/octave/control-2.2.4 ===================================================================================== Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-01-07 17:27:22 UTC (rev 9507) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.2.3 +@set VERSION 2.2.4 @finalout @c @afourwide @c %**end of header @@ -15,7 +15,7 @@ @author Lukas F. Reichlin @page @vskip 0pt plus 1filll -Copyright @copyright{} 2009-2011, Lukas F. Reichlin @email{lukas.reichlin@@gmail.com} +Copyright @copyright{} 2009-2012, Lukas F. Reichlin @email{lukas.reichlin@@gmail.com} This manual is generated automatically from the texinfo help strings of the package's functions. @@ -43,8 +43,7 @@ @item Pole placement techniques as well as @tex $ H_2 $ @end tex and @tex $ H_{\infty} $ @end tex synthesis methods. -@item Overloaded operators due to the use of the object-oriented features -introduced with Octave 3.2. +@item Overloaded operators due to the use of classes introduced with Octave 3.2. @item Support for descriptor state-space models and non-proper transfer functions. @item Improved @acronym{MATLAB} compatibility. @end itemize Modified: trunk/octave-forge/main/control/devel/pdfdoc/functions.texi =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-01-07 17:27:22 UTC (rev 9507) @@ -882,6 +882,37 @@ @end example @end ifnottex @end deftypefn +@section ctrbf + + @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}) + @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}, @var{tol}) + @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}) + @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}, @var{TOL}) + If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a + similarity transformation Tc such that Tc = [t1 t2] where t1 + is the controllable subspace and t2 is orthogonal to t1 + + @example + @group + Abar = Tc A * Tc , Bbar = Tc B , Cbar = C * Tc + @end group + @end example + + and the transformed system has the form + + @example + @group + | Ac A12| | Bc | + Abar = |----------|, Bbar = | ---|, Cbar = [Cc | Cnc]. + | 0 Anc| | 0 | + @end group + @end example + + where (Ac,Bc) is controllable, and Cc(sI-Ac)^(-1)Bc = C(sI-A)^(-1)B. + and the system is stabilizable if Anc has no eigenvalues in + the right half plane. The last output K is a vector of length n + containing the number of controllable states. + @end deftypefn @section @@lti/dcgain @deftypefn {Function File} {@var{k} =} dcgain (@var{sys}) @@ -1228,6 +1259,37 @@ @end example @end ifnottex @end deftypefn +@section obsvf + + @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}) + @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}, @var{tol}) + @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}) + @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}, @var{TOL}) + If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a + similarity transformation Tc such that To = [t1;t2] where t1 is c + and t2 is orthogonal to t1 + + @example + @group + Abar = To A * To , Bbar = To B , Cbar = C * To + @end group + @end example + + and the transformed system has the form + + @example + @group + | Ao 0 | | Bo | + Abar = |----------|, Bbar = | --- |, Cbar = [Co | 0 ]. + | A21 Ano| | Bno | + @end group + @end example + + where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And + system is detectable if Ano has no eigenvalues in the right + half plane. The last output K is a vector of length n containing the + number of observable states. + @end deftypefn @section @@lti/pole @deftypefn {Function File} {@var{p} =} pole (@var{sys}) Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-01-07 15:47:11 UTC (rev 9506) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-01-07 17:27:22 UTC (rev 9507) @@ -42,8 +42,7 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<KH=5W\xD5eS\xBD~oN\xEF82x -#\xC1\x96\xB0\xD2\xEA\xA1\x8B\xEA\xBE824M\xC4\xECH\x96\xA0\xC6(88@\xEF\x8B\xEDE\xB2\xB5a\xB4%\x92\x87c\xBFU\xE5\xA14\xEE\xF2\xBC\xED\xF2\xBDV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=_}f?\xFD\x90\xABmfЖ\xF1\xA1]m\x81\xB8~[\xAB\xDA\xCA6;z''P\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFD\x86\x8F`D\x81#\x8DQ|*{sY +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\x9Czj\xAE\xAA˦z\xFDޜ\xDEqd\xF0F\x82,a\xA5\xD5C/\xD5}qdh \x9A\x88ّ,A\x8DQpp\x80\xDEۋdk\xC3hK$>\xC7~\xAB4\xCACi\xDC\xE5y\xDB\xE5{\xAD\x98e\xBB\xEC\xCB`\xB1J1\xBD\x99\xE7\xC2\xC9\xDB\xEE\xD8f\xDD{\xBE\xFA\xCC~\xFA5: W\xDB̠-\xE3 B\xBB \xDAq\xFD\xB6V\xB5\x95mv\xF4NN\xA0$0\xEB3ƪSd\xE5\xCBf\xB5\xFB5\xC1\xFE\x88!F\xA3\xF8+\xC0sZ endstream endobj 14 0 obj << @@ -53,87 +52,89 @@ stream xڍTM\x8F\x9B0\xBD\xE7Wp+\x91/\xC6|\x84[ժ[\xA9ꡪrk{\xF0\x82V\xF8\x88l\xBB\xFF\xBE3;!\xD9m\xB5\x8A\xEC\xE7\xF1̛7xÏE;\xC1v\xA2\xAA~[\xD44-\xBE\xDEp\x97f\x82e\xA9\x80\xF5â,\xC9l\\xB4\xCA\xFAa\xBF\xB9Ȳ\x80Ǭ\x8CK\xECX\x96 \xCBD\xB0\xAF\x83\xE1\xC7\xF1\xB4Mv\xE1\xB3\xD1M\x8B\x8By\xFBk\xFF%\xC8R\x96P\x92\x89\xA4\xA4\xB8 \xF1\xFB\x87<]\xE7\x8A\x8B\x94^\xC5\xFD\x8CyF\xA1\xD7ey -\xE4r`j\xA3\x928.\xA3$\xE6\xFCn !¯\xCBq\x9Be\xA1\x9Ch\xFB\xC0\xE8\xF9]\xE9j\x9Ba\xDB\xE9\x93n>\xED\xCF\xFD&E\xC9~n\xB5a\xB1\xB8\x84?8@\x91\xAE\x91\xB5Z\xFEzt\xB9Ob\xE5k\xD67E,\xF7n9ʉ\xA0\x86\xB4\xDE7\xBD\xD4\xAB\xC6\xFE\x96`\xCAs\x96\xE7ٚ࿇\xE7\x83_\xD0y1\xBB,g\xC2i\xBDo5 -\xC7a/\xDE"\xBBm\x94\x94e\xE8\xF1F -\xCA\xC8Y\xD5\xCBe{9\xEBJv\xDD3E0\xB7\x87s\xAB\x9A\xD5=FB[՝\x9Ef\xA3\x87f"x<\xB8X\xBC\x84\xC0I\xDAI\xC1\xF3P6\xEA\x9D#pX\x86j\xD6\xE301\xEB\xAB\xCC\xF7 -|C\xD2\xCA\xF4z\x9A oG= \x83=\xA1%\x8F\xC0<R@/\x8F\xF6\xA1r\xA8 \xAE5|\fw\xF0\x84\x97\x95y\x84v{B\xAA\xF1\xA4\xD5D\xD1\xC4\x92: ŕ\x84\xB8?myhFL\xF2\xA4\xEB3\xD2H`.\xFB\xDAD\xE7\xB6\xE3\xA7\xB6.\xEF\x92u\xF10\x82\xE2xO\xA4\x8E.\x80\xAE\xB0\xC0Bэ -\xB7w\x8Cr\x91FM\xCA<\xD9\xEEk:\xF3\xF10PZP\x93oS;\x8DImx\x92\xDA;\xA76 |
From: <par...@us...> - 2012-02-09 13:56:19
|
Revision: 9600 http://octave.svn.sourceforge.net/octave/?rev=9600&view=rev Author: paramaniac Date: 2012-02-09 13:56:10 +0000 (Thu, 09 Feb 2012) Log Message: ----------- control: prepare release of control 2.2.5 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/devel/pdfdoc/functions.texi trunk/octave-forge/main/control/doc/control.pdf Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-02-09 13:56:10 UTC (rev 9600) @@ -1,6 +1,6 @@ Name: Control -Version: 2.2.4 -Date: 2012-01-07 +Version: 2.2.5 +Date: 2012-02-09 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/NEWS 2012-02-09 13:56:10 UTC (rev 9600) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.2.5 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.2.5 Release Date: 2012-02-09 Release Manager: Lukas Reichlin =============================================================================== ** Improved Matlab compatibility for frequency response commands. It is now Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-02-09 13:56:10 UTC (rev 9600) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.2.4.tar.gz control/ -md5 control-2.2.4.tar.gz -md5 control-2.2.4.tar.gz > md5_control_pkg.txt -uuencode control-2.2.4.tar.gz < control-2.2.4.tar.gz > control-2.2.4.tar.gz.uue +tar czf control-2.2.5.tar.gz control/ +md5 control-2.2.5.tar.gz +md5 control-2.2.5.tar.gz > md5_control_pkg.txt +uuencode control-2.2.5.tar.gz < control-2.2.5.tar.gz > control-2.2.5.tar.gz.uue octave -q --eval \ -"pkg install control-2.2.4.tar.gz" +"pkg install control-2.2.5.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.2.4 +rm -R ~/octave/control-2.2.5 ===================================================================================== Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-02-09 13:56:10 UTC (rev 9600) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.2.4 +@set VERSION 2.2.5 @finalout @c @afourwide @c %**end of header Modified: trunk/octave-forge/main/control/devel/pdfdoc/functions.texi =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-02-09 13:56:10 UTC (rev 9600) @@ -1651,6 +1651,9 @@ @item w Optional vector of frequency values. If @var{w} is not specified, it is calculated by the zeros and poles of the system. + Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, + where @var{wmin} and @var{wmax} denote minimum and maximum frequencies + in rad/s. @end table @strong{Outputs} @@ -1679,6 +1682,9 @@ @item w Optional vector of frequency values. If @var{w} is not specified, it is calculated by the zeros and poles of the system. + Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, + where @var{wmin} and @var{wmax} denote minimum and maximum frequencies + in rad/s. @end table @strong{Outputs} @@ -1842,6 +1848,9 @@ @item w Optional vector of frequency values. If @var{w} is not specified, it is calculated by the zeros and poles of the system. + Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, + where @var{wmin} and @var{wmax} denote minimum and maximum frequencies + in rad/s. @end table @strong{Outputs} @@ -1870,6 +1879,9 @@ @item w Optional vector of frequency values. If @var{w} is not specified, it is calculated by the zeros and poles of the system. + Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, + where @var{wmin} and @var{wmax} denote minimum and maximum frequencies + in rad/s. @end table @strong{Outputs} @@ -1900,6 +1912,9 @@ @item w Optional vector of frequency values. If @var{w} is not specified, it is calculated by the zeros and poles of the system. + Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, + where @var{wmin} and @var{wmax} denote minimum and maximum frequencies + in rad/s. @item ptype = 0 Singular values of the frequency response @var{H} of system @var{sys}. Default Value. @item ptype = 1 Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-02-09 13:42:44 UTC (rev 9599) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-02-09 13:56:10 UTC (rev 9600) @@ -42,7 +42,8 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\x9Czj\xAE\xAA˦z\xFDޜ\xDEqd\xF0F\x82,a\xA5\xD5C/\xD5}qdh \x9A\x88ّ,A\x8DQpp\x80\xDEۋdk\xC3hK$>\xC7~\xAB4\xCACi\xDC\xE5y\xDB\xE5{\xAD\x98e\xBB\xEC\xCB`\xB1J1\xBD\x99\xE7\xC2\xC9\xDB\xEE\xD8f\xDD{\xBE\xFA\xCC~\xFA5: W\xDB̠-\xE3 B\xBB \xDAq\xFD\xB6V\xB5\x95mv\xF4NN\xA0$0\xEB3ƪSd\xE5\xCBf\xB5\xFB5\xC1\xFE\x88!F\xA3\xF8+\xC0sZ +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<KX=5W\xD5eS\xBD~oN\xEF82x +#\xC1\x96\xB0\xD2\xEA\xA1\x8B\xEA\xBE824M\xC4\xECH\x96\xA0\xC6(88@\xEF\x8B\xEDE\xB2\xB5a\xB4%\x92\x87c\xBFU\xE5\xA14\xEE\xF2\xBC\xED\xF2\xBDV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=_}f?\xFD\x90\xABmfЖ\xF1\xA1]m\x81\xB8~[\xAB\xDA\xCA6;z''P\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFD\x86\x8F`D\x81#\x8DQ|-s[ endstream endobj 14 0 obj << @@ -107,7 +108,7 @@ endstream endobj 136 0 obj << -/Length 2424 +/Length 2425 /Filter /FlateDecode >> stream @@ -125,13 +126,14 @@ \x97\x8FT\x80!}\xCDu)\x90M R\xA8\xB6C\xAA\x87DP\xED\x90r\x95\xE9\xDDa\xF5X\x90*H}\xA4\xAC\xE1\xF2\x91 0\xA4\xA0\xAF\xA4@6)H\x9Di?[ -\x96l\xA8ް\x8BƮ\xBF[9߯>>\xAD\xB6\xCBO.s>L\xA1\xCC7_\xFEn\x8B#\xAB\xBD\xEE\x83\xCD^\xED\x90\xD5\xDE\xD1\xFD\xE3&j\x90M\x8Amδ'[ba\xD1\xDAv\xC6/\xF7ޝ*\xB2\xFB\xBF\xF5\xFC~r\x92\xADh\xBC4ɥI\xBEx\xE6\xED,\x97\xDD\x83 |
From: <par...@us...> - 2012-02-09 18:13:52
|
Revision: 9605 http://octave.svn.sourceforge.net/octave/?rev=9605&view=rev Author: paramaniac Date: 2012-02-09 18:13:44 +0000 (Thu, 09 Feb 2012) Log Message: ----------- control: remove completed tasks from projects file, require octave 3.6.0 in description Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/devel/PROJECTS Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-02-09 18:12:24 UTC (rev 9604) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-02-09 18:13:44 UTC (rev 9605) @@ -5,7 +5,7 @@ Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Description: Octave control systems package based on the proven SLICOT library -Depends: octave (>= 3.4.0) +Depends: octave (>= 3.6.0) Autoload: yes License: GPL version 3 or later Url: http://octave.sf.net, http://www.slicot.org Modified: trunk/octave-forge/main/control/devel/PROJECTS =================================================================== --- trunk/octave-forge/main/control/devel/PROJECTS 2012-02-09 18:12:24 UTC (rev 9604) +++ trunk/octave-forge/main/control/devel/PROJECTS 2012-02-09 18:13:44 UTC (rev 9605) @@ -74,11 +74,6 @@ will integrate the model and controller reduction commands for the first time. Don't forget margin.m. - * With Octave 3.6.0, arrayfun is now an oct-file like cellfun and not an - m-file anymore. Therefore, many calls to cellfun (in combination with num2cell) - can be replaced by calls to arrayfun alone. Examples are strseq, ctrb and - @ss/__freqresp__. Wait until control requires octave (>= 3.6.0). - ----------------------- Frequency Response Data: ----------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-22 18:15:27
|
Revision: 9653 http://octave.svn.sourceforge.net/octave/?rev=9653&view=rev Author: paramaniac Date: 2012-02-22 18:15:13 +0000 (Wed, 22 Feb 2012) Log Message: ----------- control: reorganize package makefile Modified Paths: -------------- trunk/octave-forge/main/control/src/Makefile Added Paths: ----------- trunk/octave-forge/main/control/src/slicot.tar.gz Removed Paths: ------------- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi trunk/octave-forge/main/control/src/AB01ND.f trunk/octave-forge/main/control/src/AB01OD.f trunk/octave-forge/main/control/src/AB04MD.f trunk/octave-forge/main/control/src/AB07MD.f trunk/octave-forge/main/control/src/AB08ND.f trunk/octave-forge/main/control/src/AB08NX.f trunk/octave-forge/main/control/src/AB13AD.f trunk/octave-forge/main/control/src/AB13AX.f trunk/octave-forge/main/control/src/AB13BD.f trunk/octave-forge/main/control/src/AB13DD.f trunk/octave-forge/main/control/src/AB13DX.f trunk/octave-forge/main/control/src/AG08BD.f trunk/octave-forge/main/control/src/AG08BY.f trunk/octave-forge/main/control/src/MA01AD.f trunk/octave-forge/main/control/src/MA02AD.f trunk/octave-forge/main/control/src/MA02BD.f trunk/octave-forge/main/control/src/MA02CD.f trunk/octave-forge/main/control/src/MA02DD.f trunk/octave-forge/main/control/src/MA02ED.f trunk/octave-forge/main/control/src/MA02GD.f trunk/octave-forge/main/control/src/MA02ID.f trunk/octave-forge/main/control/src/MB01PD.f trunk/octave-forge/main/control/src/MB01QD.f trunk/octave-forge/main/control/src/MB01RD.f trunk/octave-forge/main/control/src/MB01RU.f trunk/octave-forge/main/control/src/MB01RW.f trunk/octave-forge/main/control/src/MB01RX.f trunk/octave-forge/main/control/src/MB01RY.f trunk/octave-forge/main/control/src/MB01SD.f trunk/octave-forge/main/control/src/MB01UD.f trunk/octave-forge/main/control/src/MB02PD.f trunk/octave-forge/main/control/src/MB02RD.f trunk/octave-forge/main/control/src/MB02RZ.f trunk/octave-forge/main/control/src/MB02SD.f trunk/octave-forge/main/control/src/MB02SZ.f trunk/octave-forge/main/control/src/MB02UU.f trunk/octave-forge/main/control/src/MB02UV.f trunk/octave-forge/main/control/src/MB02VD.f trunk/octave-forge/main/control/src/MB03OY.f trunk/octave-forge/main/control/src/MB03PY.f trunk/octave-forge/main/control/src/MB03QD.f trunk/octave-forge/main/control/src/MB03QX.f trunk/octave-forge/main/control/src/MB03QY.f trunk/octave-forge/main/control/src/MB03UD.f trunk/octave-forge/main/control/src/MB03XD.f trunk/octave-forge/main/control/src/MB03XP.f trunk/octave-forge/main/control/src/MB03XU.f trunk/octave-forge/main/control/src/MB03YA.f trunk/octave-forge/main/control/src/MB03YD.f trunk/octave-forge/main/control/src/MB03YT.f trunk/octave-forge/main/control/src/MB04DD.f trunk/octave-forge/main/control/src/MB04ND.f trunk/octave-forge/main/control/src/MB04NY.f trunk/octave-forge/main/control/src/MB04OD.f trunk/octave-forge/main/control/src/MB04OX.f trunk/octave-forge/main/control/src/MB04OY.f trunk/octave-forge/main/control/src/MB04QB.f trunk/octave-forge/main/control/src/MB04QC.f trunk/octave-forge/main/control/src/MB04QF.f trunk/octave-forge/main/control/src/MB04QU.f trunk/octave-forge/main/control/src/MB04TB.f trunk/octave-forge/main/control/src/MB04TS.f trunk/octave-forge/main/control/src/MC01PD.f trunk/octave-forge/main/control/src/MC01PY.f trunk/octave-forge/main/control/src/SB01BD.f trunk/octave-forge/main/control/src/SB01BX.f trunk/octave-forge/main/control/src/SB01BY.f trunk/octave-forge/main/control/src/SB01FY.f trunk/octave-forge/main/control/src/SB02MR.f trunk/octave-forge/main/control/src/SB02MS.f trunk/octave-forge/main/control/src/SB02MV.f trunk/octave-forge/main/control/src/SB02MW.f trunk/octave-forge/main/control/src/SB02OD.f trunk/octave-forge/main/control/src/SB02OU.f trunk/octave-forge/main/control/src/SB02OV.f trunk/octave-forge/main/control/src/SB02OW.f trunk/octave-forge/main/control/src/SB02OY.f trunk/octave-forge/main/control/src/SB02QD.f trunk/octave-forge/main/control/src/SB02RD.f trunk/octave-forge/main/control/src/SB02RU.f trunk/octave-forge/main/control/src/SB02SD.f trunk/octave-forge/main/control/src/SB03MD.f trunk/octave-forge/main/control/src/SB03MV.f trunk/octave-forge/main/control/src/SB03MW.f trunk/octave-forge/main/control/src/SB03MX.f trunk/octave-forge/main/control/src/SB03MY.f trunk/octave-forge/main/control/src/SB03OD.f trunk/octave-forge/main/control/src/SB03OR.f trunk/octave-forge/main/control/src/SB03OT.f trunk/octave-forge/main/control/src/SB03OU.f trunk/octave-forge/main/control/src/SB03OV.f trunk/octave-forge/main/control/src/SB03OY.f trunk/octave-forge/main/control/src/SB03QX.f trunk/octave-forge/main/control/src/SB03QY.f trunk/octave-forge/main/control/src/SB03SX.f trunk/octave-forge/main/control/src/SB03SY.f trunk/octave-forge/main/control/src/SB04MD.f trunk/octave-forge/main/control/src/SB04MR.f trunk/octave-forge/main/control/src/SB04MU.f trunk/octave-forge/main/control/src/SB04MW.f trunk/octave-forge/main/control/src/SB04MY.f trunk/octave-forge/main/control/src/SB04PX.f trunk/octave-forge/main/control/src/SB04QD.f trunk/octave-forge/main/control/src/SB04QR.f trunk/octave-forge/main/control/src/SB04QU.f trunk/octave-forge/main/control/src/SB04QY.f trunk/octave-forge/main/control/src/SB08DD.f trunk/octave-forge/main/control/src/SB10DD.f trunk/octave-forge/main/control/src/SB10ED.f trunk/octave-forge/main/control/src/SB10FD.f trunk/octave-forge/main/control/src/SB10HD.f trunk/octave-forge/main/control/src/SB10ID.f trunk/octave-forge/main/control/src/SB10JD.f trunk/octave-forge/main/control/src/SB10KD.f trunk/octave-forge/main/control/src/SB10PD.f trunk/octave-forge/main/control/src/SB10QD.f trunk/octave-forge/main/control/src/SB10RD.f trunk/octave-forge/main/control/src/SB10SD.f trunk/octave-forge/main/control/src/SB10TD.f trunk/octave-forge/main/control/src/SB10UD.f trunk/octave-forge/main/control/src/SB10VD.f trunk/octave-forge/main/control/src/SB10WD.f trunk/octave-forge/main/control/src/SB10ZD.f trunk/octave-forge/main/control/src/SG02AD.f trunk/octave-forge/main/control/src/SG03AD.f trunk/octave-forge/main/control/src/SG03AX.f trunk/octave-forge/main/control/src/SG03AY.f trunk/octave-forge/main/control/src/SG03BD.f trunk/octave-forge/main/control/src/SG03BU.f trunk/octave-forge/main/control/src/SG03BV.f trunk/octave-forge/main/control/src/SG03BW.f trunk/octave-forge/main/control/src/SG03BX.f trunk/octave-forge/main/control/src/SG03BY.f trunk/octave-forge/main/control/src/TB01ID.f trunk/octave-forge/main/control/src/TB01KD.f trunk/octave-forge/main/control/src/TB01LD.f trunk/octave-forge/main/control/src/TB01PD.f trunk/octave-forge/main/control/src/TB01UD.f trunk/octave-forge/main/control/src/TB01XD.f trunk/octave-forge/main/control/src/TB01ZD.f trunk/octave-forge/main/control/src/TB04BD.f trunk/octave-forge/main/control/src/TB04BX.f trunk/octave-forge/main/control/src/TD03AY.f trunk/octave-forge/main/control/src/TD04AD.f trunk/octave-forge/main/control/src/TG01AD.f trunk/octave-forge/main/control/src/TG01BD.f trunk/octave-forge/main/control/src/TG01FD.f trunk/octave-forge/main/control/src/TG01HD.f trunk/octave-forge/main/control/src/TG01HX.f trunk/octave-forge/main/control/src/TG01ID.f trunk/octave-forge/main/control/src/TG01JD.f trunk/octave-forge/main/control/src/UE01MD.f trunk/octave-forge/main/control/src/select.f Deleted: trunk/octave-forge/main/control/devel/pdfdoc/functions.texi =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-02-22 17:58:29 UTC (rev 9652) +++ trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2012-02-22 18:15:13 UTC (rev 9653) @@ -1,3049 +0,0 @@ -@chapter Examples -@section MDSSystem - - Robust control of a mass-damper-spring system. - Type @code{which MDSSystem} to locate, - @code{edit MDSSystem} to open and simply - @code{MDSSystem} to run the example file. -@section optiPID - - Numerical optimization of a PID controller using an objective function. - The objective function is located in the file @command{optiPIDfun}. - Type @code{which optiPID} to locate, @code{edit optiPID} to open - and simply @code{optiPID} to run the example file. -@chapter Linear Time Invariant Models -@section dss - - @deftypefn {Function File} {@var{sys} =} dss (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} dss (@var{d}) - @deftypefnx {Function File} {@var{sys} =} dss (@var{a}, @var{b}, @var{c}, @var{d}, @var{e}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} dss (@var{a}, @var{b}, @var{c}, @var{d}, @var{e}, @var{tsam}, @dots{}) - Create or convert to descriptor state-space model. - - @strong{Inputs} - @table @var - @item sys - LTI model to be converted to state-space. - @item a - State transition matrix (n-by-n). - @item b - Input matrix (n-by-m). - @item c - Measurement matrix (p-by-n). - @item d - Feedthrough matrix (p-by-m). - @item e - Descriptor matrix (n-by-n). - @item tsam - Sampling time in seconds. If @var{tsam} is not specified, - a continuous-time model is assumed. - @item @dots{} - Optional pairs of properties and values. - Type @command{set (dss)} for more information. - @end table - - @strong{Outputs} - @table @var - @item sys - Descriptor state-space model. - @end table - - @strong{Equations} - @example - @group - . - E x = A x + B u - y = C x + D u - @end group - @end example - - @seealso{ss, tf} - @end deftypefn -@section frd - - @deftypefn {Function File} {@var{sys} =} frd (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} frd (@var{sys}, @var{w}) - @deftypefnx {Function File} {@var{sys} =} frd (@var{H}, @var{w}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} frd (@var{H}, @var{w}, @var{tsam}, @dots{}) - Create or convert to frequency response data. - - @strong{Inputs} - @table @var - @item sys - 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). H(i,j,k) contains the - response from input j to output i at frequency k. In the SISO case, - a vector (lw-by-1) or (1-by-lw) is accepted as well. - @item w - Frequency vector (lw-by-1) in radian per second [rad/s]. - Frequencies must be in ascending order. - @item tsam - Sampling time in seconds. If @var{tsam} is not specified, - a continuous-time model is assumed. - @item @dots{} - Optional pairs of properties and values. - Type @command{set (frd)} for more information. - @end table - - @strong{Outputs} - @table @var - @item sys - Frequency response data object. - @end table - - @seealso{dss, ss, tf} - @end deftypefn -@section ss - - @deftypefn {Function File} {@var{sys} =} ss (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} ss (@var{d}) - @deftypefnx {Function File} {@var{sys} =} ss (@var{a}, @var{b}) - @deftypefnx {Function File} {@var{sys} =} ss (@var{a}, @var{b}, @var{c}) - @deftypefnx {Function File} {@var{sys} =} ss (@var{a}, @var{b}, @var{c}, @var{d}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} ss (@var{a}, @var{b}, @var{c}, @var{d}, @var{tsam}, @dots{}) - Create or convert to state-space model. - - @strong{Inputs} - @table @var - @item sys - LTI model to be converted to state-space. - @item a - State transition matrix (n-by-n). - @item b - Input matrix (n-by-m). - @item c - Measurement matrix (p-by-n). - If @var{c} is empty @code{[]} or not specified, an identity matrix is assumed. - @item d - Feedthrough matrix (p-by-m). - If @var{d} is empty @code{[]} or not specified, a zero matrix is assumed. - @item tsam - Sampling time in seconds. If @var{tsam} is not specified, a continuous-time model is assumed. - @item @dots{} - Optional pairs of properties and values. - Type @command{set (ss)} for more information. - @end table - - @strong{Outputs} - @table @var - @item sys - State-space model. - @end table - - @strong{Example} - @example - @group - octave:1> a = [1 2 3; 4 5 6; 7 8 9]; - octave:2> b = [10; 11; 12]; - octave:3> stname = @{"V", "A", "kJ"@}; - octave:4> sys = ss (a, b, [], [], "stname", stname) - - sys.a = - V A kJ - V 1 2 3 - A 4 5 6 - kJ 7 8 9 - - sys.b = - u1 - V 10 - A 11 - kJ 12 - - sys.c = - V A kJ - y1 1 0 0 - y2 0 1 0 - y3 0 0 1 - - sys.d = - u1 - y1 0 - y2 0 - y3 0 - - Continuous-time model. - octave:5> - @end group - @end example - - @seealso{tf, dss} - @end deftypefn -@section tf - - @deftypefn {Function File} {@var{s} =} tf (@var{"s"}) - @deftypefnx {Function File} {@var{z} =} tf (@var{"z"}, @var{tsam}) - @deftypefnx {Function File} {@var{sys} =} tf (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} tf (@var{num}, @var{den}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} tf (@var{num}, @var{den}, @var{tsam}, @dots{}) - Create or convert to transfer function model. - - @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 coefficients of the polynomial in descending powers of - the transfer function variable. - num@{i,j@} contains the numerator polynomial from input j to output i. - In the SISO case, a single vector is accepted as well. - @item den - Denominator or cell of denominators. Each denominator must be a row vector - containing the coefficients of the polynomial in descending powers of - the transfer function variable. - den@{i,j@} contains the denominator polynomial from input j to output i. - In the SISO case, a single vector is accepted as well. - @item tsam - Sampling time in seconds. If @var{tsam} is not specified, a continuous-time - model is assumed. - @item @dots{} - Optional pairs of properties and values. - Type @command{set (tf)} for more information. - @end table - - @strong{Outputs} - @table @var - @item sys - Transfer function model. - @end table - - @strong{Example} - @example - @group - octave:1> s = tf ("s"); - octave:2> G = 1/(s+1) - - Transfer function "G" from input "u1" to output ... - - 1 - y1: ----- - s + 1 - - Continuous-time model. - @end group - @end example - @example - @group - octave:3> z = tf ("z", 0.2); - octave:4> H = 0.095/(z-0.9) - - Transfer function "H" from input "u1" to output ... - - 0.095 - y1: ------- - z - 0.9 - - Sampling time: 0.2 s - Discrete-time model. - @end group - @end example - @example - @group - octave:5> num = @{[1, 5, 7], [1]; [1, 7], [1, 5, 5]@}; - octave:6> den = @{[1, 5, 6], [1, 2]; [1, 8, 6], [1, 3, 2]@}; - octave:7> sys = tf (num, den) - - Transfer function "sys" from input "u1" to output ... - - s^2 + 5 s + 7 - y1: ------------- - s^2 + 5 s + 6 - - s + 7 - y2: ------------- - s^2 + 8 s + 6 - - Transfer function "sys" from input "u2" to output ... - - 1 - y1: ----- - s + 2 - - s^2 + 5 s + 5 - y2: ------------- - s^2 + 3 s + 2 - - Continuous-time model. - octave:8> - @end group - @end example - - @seealso{ss, dss} - @end deftypefn -@section zpk - - @deftypefn {Function File} {@var{s} =} zpk (@var{"s"}) - @deftypefnx {Function File} {@var{z} =} zpk (@var{"z"}, @var{tsam}) - @deftypefnx {Function File} {@var{sys} =} zpk (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} zpk (@var{k}) - @deftypefnx {Function File} {@var{sys} =} zpk (@var{z}, @var{p}, @var{k}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} zpk (@var{z}, @var{p}, @var{k}, @var{tsam}, @dots{}) - @deftypefnx {Function File} {@var{sys} =} zpk (@var{z}, @var{p}, @var{k}, @var{tsam}, @dots{}) - Create transfer function model from zero-pole-gain data. - This is just a stop-gap compatibility wrapper since zpk - models are not yet implemented. - - @strong{Inputs} - @table @var - @item sys - LTI model to be converted to transfer function. - @item z - Cell of vectors containing the zeros for each channel. - z@{i,j@} contains the zeros from input j to output i. - In the SISO case, a single vector is accepted as well. - @item p - Cell of vectors containing the poles for each channel. - p@{i,j@} contains the poles from input j to output i. - In the SISO case, a single vector is accepted as well. - @item k - Matrix containing the gains for each channel. - k(i,j) contains the gain from input j to output i. - @item tsam - Sampling time in seconds. If @var{tsam} is not specified, - a continuous-time model is assumed. - @item @dots{} - Optional pairs of properties and values. - Type @command{set (tf)} for more information. - @end table - - @strong{Outputs} - @table @var - @item sys - Transfer function model. - @end table - - @seealso{tf, ss, dss, frd} - @end deftypefn -@chapter Model Data Access -@section @@lti/dssdata - - @deftypefn {Function File} {[@var{a}, @var{b}, @var{c}, @var{d}, @var{e}, @var{tsam}] =} dssdata (@var{sys}) - @deftypefnx {Function File} {[@var{a}, @var{b}, @var{c}, @var{d}, @var{e}, @var{tsam}] =} dssdata (@var{sys}, @var{[]}) - Access descriptor state-space model data. - Argument @var{sys} is not limited to descriptor state-space models. - If @var{sys} is not a descriptor state-space model, it is converted automatically. - - @strong{Inputs} - @table @var - @item sys - Any type of LTI model. - @item [] - In case @var{sys} is not a dss model (descriptor matrix @var{e} empty), - @code{dssdata (sys, [])} returns the empty element @code{e = []} whereas - @code{dssdata (sys)} returns the identity matrix @code{e = eye (size (a))}. - @end table - - @strong{Outputs} - @table @var - @item a - State transition matrix (n-by-n). - @item b - Input matrix (n-by-m). - @item c - Measurement matrix (p-by-n). - @item d - Feedthrough matrix (p-by-m). - @item e - Descriptor matrix (n-by-n). - @item tsam - Sampling time in seconds. If @var{sys} is a continuous-time model, - a zero is returned. - @end table - @end deftypefn -@section @@lti/frdata - - @deftypefn {Function File} {[@var{H}, @var{w}, @var{tsam}] =} frdata (@var{sys}) - @deftypefnx {Function File} {[@var{H}, @var{w}, @var{tsam}] =} frdata (@var{sys}, @var{"vector"}) - Access frequency response data. - Argument @var{sys} is not limited to frequency response data objects. - If @var{sys} is not a frd object, it is converted automatically. - - @strong{Inputs} - @table @var - @item sys - Any type of LTI model. - @item "v", "vector" - In case @var{sys} is a SISO model, this option returns the frequency response - as a column vector (lw-by-1) instead of an array (p-by-m-by-lw). - @end table - - @strong{Outputs} - @table @var - @item H - Frequency response array (p-by-m-by-lw). H(i,j,k) contains the - response from input j to output i at frequency k. In the SISO case, - a vector (lw-by-1) is possible as well. - @item w - Frequency vector (lw-by-1) in radian per second [rad/s]. - Frequencies are in ascending order. - @item tsam - Sampling time in seconds. If @var{sys} is a continuous-time model, - a zero is returned. - @end table - @end deftypefn -@section @@lti/get - - @deftypefn {Function File} get (@var{sys}) - @deftypefnx {Function File} {@var{value} =} get (@var{sys}, @var{"property"}) - Access property values of LTI objects. - @end deftypefn -@section @@lti/set - - @deftypefn {Function File} set (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} set (@var{sys}, @var{"property"}, @var{value}) - Set or modify properties of LTI objects. - @end deftypefn -@section @@lti/ssdata - - @deftypefn {Function File} {[@var{a}, @var{b}, @var{c}, @var{d}, @var{tsam}] =} ssdata (@var{sys}) - Access state-space model data. - Argument @var{sys} is not limited to state-space models. - If @var{sys} is not a state-space model, it is converted automatically. - - @strong{Inputs} - @table @var - @item sys - Any type of LTI model. - @end table - - @strong{Outputs} - @table @var - @item a - State transition matrix (n-by-n). - @item b - Input matrix (n-by-m). - @item c - Measurement matrix (p-by-n). - @item d - Feedthrough matrix (p-by-m). - @item tsam - Sampling time in seconds. If @var{sys} is a continuous-time model, - a zero is returned. - @end table - @end deftypefn -@section @@lti/tfdata - - @deftypefn {Function File} {[@var{num}, @var{den}, @var{tsam}] =} tfdata (@var{sys}) - @deftypefnx {Function File} {[@var{num}, @var{den}, @var{tsam}] =} tfdata (@var{sys}, @var{"vector"}) - @deftypefnx {Function File} {[@var{num}, @var{den}, @var{tsam}] =} tfdata (@var{sys}, @var{"tfpoly"}) - Access transfer function data. - Argument @var{sys} is not limited to transfer function models. - If @var{sys} is not a transfer function, it is converted automatically. - - @strong{Inputs} - @table @var - @item sys - Any type of LTI model. - @item "v", "vector" - For SISO models, return @var{num} and @var{den} directly as column vectors - instead of cells containing a single column vector. - @end table - - @strong{Outputs} - @table @var - @item num - Cell of numerator(s). Each numerator is a row vector - containing the coefficients of the polynomial in descending powers of - the transfer function variable. - num@{i,j@} contains the numerator polynomial from input j to output i. - In the SISO case, a single vector is possible as well. - @item den - Cell of denominator(s). Each denominator is a row vector - containing the coefficients of the polynomial in descending powers of - the transfer function variable. - den@{i,j@} contains the denominator polynomial from input j to output i. - In the SISO case, a single vector is possible as well. - @item tsam - Sampling time in seconds. If @var{sys} is a continuous-time model, - a zero is returned. - @end table - @end deftypefn -@section @@lti/zpkdata - - @deftypefn {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}) - @deftypefnx {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}, @var{"v"}) - Access zero-pole-gain data. - - @strong{Inputs} - @table @var - @item sys - Any type of LTI model. - @item "v", "vector" - For SISO models, return @var{z} and @var{p} directly as column vectors - instead of cells containing a single column vector. - @end table - - @strong{Outputs} - @table @var - @item z - Cell of column vectors containing the zeros for each channel. - z@{i,j@} contains the zeros from input j to output i. - @item p - Cell of column vectors containing the poles for each channel. - p@{i,j@} contains the poles from input j to output i. - @item k - Matrix containing the gains for each channel. - k(i,j) contains the gain from input j to output i. - @item tsam - Sampling time in seconds. If @var{sys} is a continuous-time model, - a zero is returned. - @end table - @end deftypefn -@chapter Model Conversions -@section @@lti/c2d - - @deftypefn {Function File} {@var{sys} =} c2d (@var{sys}, @var{tsam}) - @deftypefnx {Function File} {@var{sys} =} c2d (@var{sys}, @var{tsam}, @var{method}) - @deftypefnx {Function File} {@var{sys} =} c2d (@var{sys}, @var{tsam}, @var{"prewarp"}, @var{w0}) - Convert the continuous lti model into its discrete-time equivalent. - - @strong{Inputs} - @table @var - @item sys - Continuous-time LTI model. - @item tsam - Sampling time in seconds. - @item method - Optional conversion method. If not specified, default method @var{"zoh"} - is taken. - @table @var - @item "zoh" - Zero-order hold or matrix exponential. - @item "tustin", "bilin" - Bilinear transformation or Tustin approximation. - @item "prewarp" - Bilinear transformation with pre-warping at frequency @var{w0}. - @end table - @end table - - @strong{Outputs} - @table @var - @item sys - Discrete-time LTI model. - @end table - @end deftypefn -@section @@lti/d2c - - @deftypefn {Function File} {@var{sys} =} d2c (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} d2c (@var{sys}, @var{method}) - @deftypefnx {Function File} {@var{sys} =} d2c (@var{sys}, @var{"prewarp"}, @var{w0}) - Convert the discrete lti model into its continuous-time equivalent. - - @strong{Inputs} - @table @var - @item sys - Discrete-time LTI model. - @item method - Optional conversion method. If not specified, default method @var{"zoh"} - is taken. - @table @var - @item "zoh" - Zero-order hold or matrix logarithm. - @item "tustin", "bilin" - Bilinear transformation or Tustin approximation. - @item "prewarp" - Bilinear transformation with pre-warping at frequency @var{w0}. - @end table - @end table - - @strong{Outputs} - @table @var - @item sys - Continuous-time LTI model. - @end table - @end deftypefn -@section @@lti/prescale - - @deftypefn {Function File} {[@var{scaledsys}, @var{info}] =} prescale (@var{sys}) - Prescale state-space model. - Frequency response commands perform automatic scaling unless model property - @var{scaled} is set to @var{true}. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @end table - - @strong{Outputs} - @table @var - @item scaledsys - Scaled state-space model. - @item info - Structure containing additional information. - @item info.SL - Left scaling factors. @code{Tl = diag (info.SL)}. - @item info.SR - Right scaling factors. @code{Tr = diag (info.SR)}. - @end table - - @strong{Equations} - @example - @group - Es = Tl * E * Tr - As = Tl * A * Tr - Bs = Tl * B - Cs = C * Tr - Ds = D - @end group - @end example - - For proper state-space models, @var{Tl} and @var{Tr} are inverse of each other. - - @strong{Algorithm}@* - Uses SLICOT TB01ID and TG01AD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.}. - @end deftypefn -@section @@lti/xperm - - @deftypefn {Function File} {@var{sys} =} xperm (@var{sys}, @var{st_idx}) - Reorder states in state-space models. - @end deftypefn -@chapter Model Interconnections -@section @@lti/append - - @deftypefn {Function File} {@var{sys} =} append (@var{sys1}, @var{sys2}) - Group LTI models by appending their inputs and outputs. - @end deftypefn -@section @@lti/blkdiag - - @deftypefn {Function File} {@var{sys} =} blkdiag (@var{sys1}, @var{sys2}) - Block-diagonal concatenation of LTI models. - @end deftypefn -@section @@lti/connect - - @deftypefn {Function File} {@var{sys} =} connect (@var{sys}, @var{cm}, @var{inputs}, @var{outputs}) - Arbitrary interconnections between the inputs and outputs of an LTI model. - @end deftypefn -@section @@lti/feedback - - @deftypefn {Function File} {@var{sys} =} feedback (@var{sys1}) - @deftypefnx {Function File} {@var{sys} =} feedback (@var{sys1}, @var{"+"}) - @deftypefnx {Function File} {@var{sys} =} feedback (@var{sys1}, @var{sys2}) - @deftypefnx {Function File} {@var{sys} =} feedback (@var{sys1}, @var{sys2}, @var{"+"}) - @deftypefnx {Function File} {@var{sys} =} feedback (@var{sys1}, @var{sys2}, @var{feedin}, @var{feedout}) - @deftypefnx {Function File} {@var{sys} =} feedback (@var{sys1}, @var{sys2}, @var{feedin}, @var{feedout}, @var{"+"}) - Feedback connection of two LTI models. - - @strong{Inputs} - @table @var - @item sys1 - LTI model of forward transmission. @code{[p1, m1] = size (sys1)}. - @item sys2 - LTI model of backward transmission. - If not specified, an identity matrix of appropriate size is taken. - @item feedin - Vector containing indices of inputs to @var{sys1} which are involved in the feedback loop. - The number of @var{feedin} indices and outputs of @var{sys2} must be equal. - If not specified, @code{1:m1} is taken. - @item feedout - Vector containing indices of outputs from @var{sys1} which are to be connected to @var{sys2}. - The number of @var{feedout} indices and inputs of @var{sys2} must be equal. - If not specified, @code{1:p1} is taken. - @item "+" - Positive feedback sign. If not specified, @var{"-"} for a negative feedback interconnection - is assumed. @var{+1} and @var{-1} are possible as well, but only from the third argument - onward due to ambiguity. - @end table - - @strong{Outputs} - @table @var - @item sys - Resulting LTI model. - @end table - - @strong{Block Diagram} - @example - @group - u + +--------+ y - ------>(+)----->| sys1 |-------+-------> - ^ - +--------+ | - | | - | +--------+ | - +-------| sys2 |<------+ - +--------+ - @end group - @end example - @end deftypefn -@section @@lti/lft - - @deftypefn {Function File} {@var{sys} =} lft (@var{sys1}, @var{sys2}) - @deftypefnx {Function File} {@var{sys} =} lft (@var{sys1}, @var{sys2}, @var{nu}, @var{ny}) - Linear fractional tranformation, also known as Redheffer star product. - - @strong{Inputs} - @table @var - @item sys1 - Upper LTI model. - @item sys2 - Lower LTI model. - @item nu - The last nu inputs of @var{sys1} are connected with the first nu outputs of @var{sys2}. - If not specified, @code{min (m1, p2)} is taken. - @item ny - The last ny outputs of @var{sys1} are connected with the first ny inputs of @var{sys2}. - If not specified, @code{min (p1, m2)} is taken. - @end table - - @strong{Outputs} - @table @var - @item sys - Resulting LTI model. - @end table - - @strong{Block Diagram} - @example - @group - .............sys.............. - : +--------+ : - w1 ------------>| |------------> z1 - : | sys1 | : - : u +---->| |-----+ y : - : | +--------+ | : Lower LFT - : | | : - : | +--------+ | : lft (sys1, sys2) - : +-----| sys2 |<----+ : - : +--------+ : - :............................: - @end group - @end example - @example - @group - .............sys.............. - : +--------+ : - : u +---->| sys1 |-----+ y : - : | +--------+ | : Upper LFT - : | | : - : | +--------+ | : lft (sys1, sys2) - : +-----| |<----+ : - : | sys2 | : - z2 <------------| |<------------ w2 - : +--------+ : - :............................: - @end group - @end example - @example - @group - .............sys.............. - : +--------+ : - w1 ------------>| |------------> z1 - : | sys1 | : - : u +---->| |-----+ y : - : | +--------+ | : - : | | : lft (sys1, sys2, nu, ny) - : | +--------+ | : - : +-----| |<----+ : - : | sys2 | : - z2 <------------| |<------------ w2 - : +--------+ : - :............................: - @end group - @end example - @end deftypefn -@section @@lti/mconnect - - @deftypefn {Function File} {@var{sys} =} mconnect (@var{sys}, @var{m}) - @deftypefnx {Function File} {@var{sys} =} mconnect (@var{sys}, @var{m}, @var{inputs}, @var{outputs}) - Arbitrary interconnections between the inputs and outputs of an LTI model. - - @strong{Inputs} - @table @var - @item sys - LTI system. - @item m - Connection matrix. Each row belongs to an input and each column represents an output. - @item inputs - Vector of indices of those inputs which are retained. If not specified, all inputs are kept. - @item outputs - Vector of indices of those outputs which are retained. If not specified, all outputs are kept. - @end table - - @strong{Outputs} - @table @var - @item sys - Interconnected system. - @end table - - @strong{Example} - @example - @group - Solve the system equations of - y(t) = G e(t) - e(t) = u(t) + M y(t) - in order to build - y(t) = H u(t) - The matrix M for a (p-by-m) system G - has m rows and p columns (m-by-p). - - Example for a 3x2 system: - u1 = -1*y1 + 5*y2 + 0*y3 - u2 = pi*y1 + 0*y2 - 7*y3 - - | -1 5 0 | - M = | pi 0 7 | - @end group - @end example - @end deftypefn -@section @@lti/parallel - - @deftypefn{Function File} {@var{sys} =} parallel (@var{sys1}, @var{sys2}) - Parallel connection of two LTI systems. - - @strong{Block Diagram} - @example - @group - .......................... - : +--------+ : - : +-->| sys1 |---+ : - u : | +--------+ | + : y - -------+ O---------> - : | +--------+ | + : - : +-->| sys2 |---+ : - : +--------+ : - :.........sys............: - - sys = parallel (sys1, sys2) - @end group - @end example - @end deftypefn -@section @@lti/series - - @deftypefn {Function File} {@var{sys} =} series (@var{sys1}, @var{sys2}) - @deftypefnx {Function File} {@var{sys} =} series (@var{sys1}, @var{sys2}, @var{outputs1}, @var{inputs2}) - Series connection of two LTI models. - - @strong{Block Diagram} - @example - @group - ..................................... - u : +--------+ y1 u2 +--------+ : y - ------>| sys1 |---------->| sys2 |-------> - : +--------+ +--------+ : - :................sys................. - - sys = series (sys1, sys2) - @end group - @end example - @example - @group - ..................................... - : v2 +--------+ : - : ---------->| | : y - : +--------+ y1 u2 | sys2 |-------> - u : | |---------->| | : - ------>| sys1 | z1 +--------+ : - : | |----------> : - : +--------+ : - :................sys................. - - outputs1 = [1] - inputs2 = [2] - sys = series (sys1, sys2, outputs1, inputs2) - @end group - @end example - @end deftypefn -@chapter Model Characteristics -@section ctrb - - @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 - @ifnottex - @example - 2 n-1 - Co = [ B AB A B ... A B ] - @end example - @end ifnottex - @end deftypefn -@section ctrbf - - @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}) - @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} ctrbf (@var{sys}, @var{tol}) - @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}) - @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} ctrbf (@var{A}, @var{B}, @var{C}, @var{TOL}) - If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a - similarity transformation Tc such that Tc = [t1 t2] where t1 - is the controllable subspace and t2 is orthogonal to t1 - - @example - @group - Abar = Tc A * Tc , Bbar = Tc B , Cbar = C * Tc - @end group - @end example - - and the transformed system has the form - - @example - @group - | Ac A12| | Bc | - Abar = |----------|, Bbar = | ---|, Cbar = [Cc | Cnc]. - | 0 Anc| | 0 | - @end group - @end example - - where (Ac,Bc) is controllable, and Cc(sI-Ac)^(-1)Bc = C(sI-A)^(-1)B. - and the system is stabilizable if Anc has no eigenvalues in - the right half plane. The last output K is a vector of length n - containing the number of controllable states. - @end deftypefn -@section @@lti/dcgain - - @deftypefn {Function File} {@var{k} =} dcgain (@var{sys}) - DC gain of LTI model. - - @strong{Inputs} - @table @var - @item sys - LTI system. - @end table - - @strong{Outputs} - @table @var - @item k - DC gain matrice. For a system with m inputs and p outputs, the array @var{k} - has dimensions [p, m]. - @end table - - @seealso{freqresp} - @end deftypefn -@section gram - - @deftypefn {Function File} {@var{W} =} gram (@var{sys}, @var{mode}) - @deftypefnx {Function File} {@var{Wc} =} gram (@var{a}, @var{b}) - @code{gram (@var{sys}, "c")} returns the controllability gramian of - the (continuous- or discrete-time) system @var{sys}. - @code{gram (@var{sys}, "o")} returns the observability gramian of the - (continuous- or discrete-time) system @var{sys}. - @code{gram (@var{a}, @var{b})} returns the controllability gramian - @var{Wc} of the continuous-time system @math{dx/dt = a x + b u}; - i.e., @var{Wc} satisfies @math{a Wc + m Wc' + b b' = 0}. - - @end deftypefn -@section hsvd - - @deftypefn{Function File} {@var{hsv} =} hsvd (@var{sys}) - @deftypefnx{Function File} {@var{hsv} =} hsvd (@var{sys}, @var{"offset"}, @var{offset}) - @deftypefnx{Function File} {@var{hsv} =} hsvd (@var{sys}, @var{"alpha"}, @var{alpha}) - Hankel singular values of the stable part of an LTI model. If no output arguments are - given, the Hankel singular values are displayed in a plot. - - @strong{Algorithm}@* - Uses SLICOT AB13AD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - @end deftypefn -@section @@lti/isct - - @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 -@section isctrb - - @deftypefn {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{sys}) - @deftypefnx {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{sys}, @var{tol}) - @deftypefnx {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{a}, @var{b}) - @deftypefnx {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{a}, @var{b}, @var{e}) - @deftypefnx {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{a}, @var{b}, @var{[]}, @var{tol}) - @deftypefnx {Function File} {[@var{bool}, @var{ncon}] =} isctrb (@var{a}, @var{b}, @var{e}, @var{tol}) - Logical check for system controllability. - For numerical reasons, @code{isctrb (sys)} - should be used instead of @code{rank (ctrb (sys))}. - - @strong{Inputs} - @table @var - @item sys - LTI model. Descriptor state-space models are possible. - @item a - State transition matrix. - @item b - Input matrix. - @item e - Descriptor matrix. - @item tol - Optional roundoff parameter. Default value is 0. - @end table - - @strong{Outputs} - @table @var - @item bool = 0 - System is not controllable. - @item bool = 1 - System is controllable. - @item ncon - Number of controllable states. - @end table - - @strong{Algorithm}@* - Uses SLICOT AB01OD and TG01HD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - - @seealso{isobsv} - @end deftypefn -@section isdetectable - - @deftypefn {Function File} {@var{bool} =} isdetectable (@var{sys}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{sys}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{[]}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{[]}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{[]}, @var{tol}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isdetectable (@var{a}, @var{c}, @var{e}, @var{tol}, @var{dflg}) - Logical test for system detectability. - All unstable modes must be observable or all unobservable states must be stable. - - @strong{Inputs} - @table @var - @item sys - LTI system. - @item a - State transition matrix. - @item c - Measurement matrix. - @item e - Descriptor matrix. - @item tol - Optional tolerance for stability. Default value is 0. - @item dflg = 0 - Matrices (@var{a}, @var{c}) are part of a continuous-time system. Default Value. - @item dflg = 1 - Matrices (@var{a}, @var{c}) are part of a discrete-time system. - @end table - - @strong{Outputs} - @table @var - @item bool = 0 - System is not detectable. - @item bool = 1 - System is detectable. - @end table - - - @strong{Algorithm}@* - Uses SLICOT AB01OD and TG01HD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - See @command{isstabilizable} for description of computational method. - @seealso{isstabilizable, isstable, isctrb, isobsv} - @end deftypefn -@section @@lti/isdt - - @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 -@section @@lti/isminimumphase - - @deftypefn {Function File} {@var{bool} =} isminimumphase (@var{sys}) - @deftypefnx {Function File} {@var{bool} =} isminimumphase (@var{sys}, @var{tol}) - Determine whether LTI system is minimum phase. - The zeros must lie in the left complex half-plane. - The name minimum-phase refers to the fact that such a system has the - minimum possible phase lag for the given magnitude response |sys(jw)|. - @end deftypefn -@section isobsv - - @deftypefn {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{sys}) - @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{sys}, @var{tol}) - @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}) - @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{e}) - @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{[]}, @var{tol}) - @deftypefnx {Function File} {[@var{bool}, @var{nobs}] =} isobsv (@var{a}, @var{c}, @var{e}, @var{tol}) - Logical check for system observability. - For numerical reasons, @code{isobsv (sys)} - should be used instead of @code{rank (obsv (sys))}. - - @strong{Inputs} - @table @var - @item sys - LTI model. Descriptor state-space models are possible. - @item a - State transition matrix. - @item c - Measurement matrix. - @item e - Descriptor matrix. - @item tol - Optional roundoff parameter. Default value is 0. - @end table - - @strong{Outputs} - @table @var - @item bool = 0 - System is not observable. - @item bool = 1 - System is observable. - @item nobs - Number of observable states. - @end table - - @strong{Algorithm}@* - Uses SLICOT AB01OD and TG01HD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - - @seealso{isctrb} - @end deftypefn -@section @@lti/issiso - - @deftypefn {Function File} {@var{bool} =} issiso (@var{sys}) - Determine whether LTI model is single-input/single-output (SISO). - @end deftypefn -@section isstabilizable - - @deftypefn {Function File} {@var{bool} =} isstabilizable (@var{sys}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{sys}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{e}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{[]}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{e}, @var{tol}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{[]}, @var{[]}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{e}, @var{[]}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{[]}, @var{tol}, @var{dflg}) - @deftypefnx {Function File} {@var{bool} =} isstabilizable (@var{a}, @var{b}, @var{e}, @var{tol}, @var{dflg}) - Logical check for system stabilizability. - All unstable modes must be controllable or all uncontrollable states must be stable. - - @strong{Inputs} - @table @var - @item sys - LTI system. - @item a - State transition matrix. - @item b - Input matrix. - @item e - Descriptor matrix. - @item tol - Optional tolerance for stability. Default value is 0. - @item dflg = 0 - Matrices (@var{a}, @var{b}) are part of a continuous-time system. Default Value. - @item dflg = 1 - Matrices (@var{a}, @var{b}) are part of a discrete-time system. - @end table - - @strong{Outputs} - @table @var - @item bool = 0 - System is not stabilizable. - @item bool = 1 - System is stabilizable. - @end table - - @strong{Algorithm}@* - Uses SLICOT AB01OD and TG01HD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - @example - @group - * Calculate staircase form (SLICOT AB01OD) - * Extract unobservable part of state transition matrix - * Calculate eigenvalues of unobservable part - * Check whether - real (ev) < -tol*(1 + abs (ev)) continuous-time - abs (ev) < 1 - tol discrete-time - @end group - @end example - @seealso{isdetectable, isstable, isctrb, isobsv} - @end deftypefn -@section @@lti/isstable - - @deftypefn {Function File} {@var{bool} =} isstable (@var{sys}) - @deftypefnx {Function File} {@var{bool} =} isstable (@var{sys}, @var{tol}) - Determine whether LTI system is stable. - @end deftypefn -@section @@lti/norm - - @deftypefn {Function File} {@var{gain} =} norm (@var{sys}, @var{2}) - @deftypefnx {Function File} {[@var{gain}, @var{wpeak}] =} norm (@var{sys}, @var{inf}) - @deftypefnx {Function File} {[@var{gain}, @var{wpeak}] =} norm (@var{sys}, @var{inf}, @var{tol}) - Return H-2 or L-inf norm of LTI model. - - @strong{Algorithm}@* - Uses SLICOT AB13BD and AB13DD by courtesy of - @uref{http://www.slicot.org, NICONET e.V.} - @end deftypefn -@section obsv - - @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 ob - 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 - @ifnottex - @example - @group - | C | - | CA | - Ob = | CA^2 | - | ... | - | CA^(n-1) | - @end group - @end example - @end ifnottex - @end deftypefn -@section obsvf - - @deftypefn{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}) - @deftypefnx{Function File} {[@var{sysbar}, @var{T}, @var{K}] =} obsvf (@var{sys}, @var{tol}) - @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}) - @deftypefnx{Function File} {[@var{Abar}, @var{Bbar}, @var{Cbar}, @var{T}, @var{K}] =} obsvf (@var{A}, @var{B}, @var{C}, @var{TOL}) - If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a - similarity transformation Tc such that To = [t1;t2] where t1 is c - and t2 is orthogonal to t1 - - @example - @group - Abar = To A * To , Bbar = To B , Cbar = C * To - @end group - @end example - - and the transformed system has the form - - @example - @group - | Ao 0 | | Bo | - Abar = |----------|, Bbar = | --- |, Cbar = [Co | 0 ]. - | A21 Ano| | Bno | - @end group - @end example - - where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And - system is detectable if Ano has no eigenvalues in the right - half plane. The last output K is a vector of length n containing the - number of observable states. - @end deftypefn -@section @@lti/pole - - @deftypefn {Function File} {@var{p} =} pole (@var{sys}) - Compute poles of LTI system. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @end table - - @strong{Outputs} - @table @var - @item p - Poles of @var{sys}. - @end table - @end deftypefn -@section pzmap - - @deftypefn {Function File} pzmap (@var{sys}) - @deftypefnx {Function File} {[@var{p}, @var{z}] =} pzmap (@var{sys}) - Plot the poles and zeros of an LTI system in the complex plane. - If no output arguments are given, the result is plotted on the screen. - Otherwise, the poles and zeros are computed and returned. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @end table - - @strong{Outputs} - @table @var - @item p - Poles of @var{sys}. - @item z - Transmission zeros of @var{sys}. - @end table - @end deftypefn -@section @@lti/size - - @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 -@section @@lti/zero - - @deftypefn {Function File} {@var{z} =} zero (@var{sys}) - @deftypefnx {Function File} {[@var{z}, @var{k}] =} zero (@var{sys}) - Compute transmission zeros and gain of LTI model. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @end table - - @strong{Outputs} - @table @var - @item z - Transmission zeros of @var{sys}. - @item k - Gain of @var{sys}. - @end table - @end deftypefn -@chapter Model Simplification -@section @@lti/minreal - - @deftypefn {Function File} {@var{sys} =} minreal (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} minreal (@var{sys}, @var{tol}) - Minimal realization or zero-pole cancellation of LTI models. - @end deftypefn -@section @@lti/sminreal - - @deftypefn {Function File} {@var{sys} =} sminreal (@var{sys}) - @deftypefnx {Function File} {@var{sys} =} sminreal (@var{sys}, @var{tol}) - Perform state-space model reduction based on structure. - Remove states which have no influence on the input-output behaviour. - The physical meaning of the states is retained. - - @strong{Inputs} - @table @var - @item sys - State-space model. - @item tol - Optional tolerance for controllability and observability. - Entries of the state-space matrices whose moduli are less or equal to @var{tol} - are assumed to be zero. Default value is 0. - @end table - - @strong{Outputs} - @table @var - @item sys - Reduced state-space model. - @end table - - @seealso{minreal} - @end deftypefn -@chapter Time Domain Analysis -@section covar - - @deftypefn{Function File} {[@var{p}, @var{q}] =} covar (@var{sys}, @var{w}) - Return the steady-state covariance. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @item w - Intensity of white noise inputs which drive @var{sys}. - @end table - - @strong{Outputs} - @table @var - @item p - Output covariance. - @item q - State covariance. - @end table - - @seealso{lyap, dlyap} - @end deftypefn -@section gensig - - @deftypefn{Function File} {[@var{u}, @var{t}] =} gensig (@var{sigtype}, @var{tau}) - @deftypefnx{Function File} {[@var{u}, @var{t}] =} gensig (@var{sigtype}, @var{tau}, @var{tfinal}) - @deftypefnx{Function File} {[@var{u}, @var{t}] =} gensig (@var{sigtype}, @var{tau}, @var{tfinal}, @var{tsam}) - Generate periodic signal. Useful in combination with lsim. - - @strong{Inputs} - @table @var - @item sigtype = "sin" - Sine wave. - @item sigtype = "cos" - Cosine wave. - @item sigtype = "square" - Square wave. - @item sigtype = "pulse" - Periodic pulse. - @item tau - Duration of one period in seconds. - @item tfinal - Optional duration of the signal in seconds. Default duration is 5 periods. - @item tsam - Optional sampling time in seconds. Default spacing is tau/64. - @end table - - @strong{Outputs} - @table @var - @item u - Vector of signal values. - @item t - Time vector of the signal. - @end table - - @seealso{lsim} - @end deftypefn -@section impulse - - @deftypefn{Function File} {[@var{y}, @var{t}, @var{x}] =} impulse (@var{sys}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} impulse (@var{sys}, @var{t}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} impulse (@var{sys}, @var{tfinal}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} impulse (@var{sys}, @var{tfinal}, @var{dt}) - Impulse response of LTI system. - If no output arguments are given, the response is printed on the screen. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @item t - Time vector. Should be evenly spaced. If not specified, it is calculated by - the poles of the system to reflect adequately the response transients. - @item tfinal - Optional simulation horizon. If not specified, it is calculated by - the poles of the system to reflect adequately the response transients. - @item dt - Optional sampling time. Be sure to choose it small enough to capture transient - phenomena. If not specified, it is calculated by the poles of the system. - @end table - - @strong{Outputs} - @table @var - @item y - Output response array. Has as many rows as time samples (length of t) - and as many columns as outputs. - @item t - Time row vector. - @item x - State trajectories array. Has @code{length (t)} rows and as many columns as states. - @end table - - @seealso{initial, lsim, step} - @end deftypefn -@section initial - - @deftypefn{Function File} {[@var{y}, @var{t}, @var{x}] =} initial (@var{sys}, @var{x0}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} initial (@var{sys}, @var{x0}, @var{t}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} initial (@var{sys}, @var{x0}, @var{tfinal}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} initial (@var{sys}, @var{x0}, @var{tfinal}, @var{dt}) - Initial condition response of state-space model. - If no output arguments are given, the response is printed on the screen. - - @strong{Inputs} - @table @var - @item sys - State-space model. - @item x0 - Vector of initial conditions for each state. - @item t - Optional time vector. Should be evenly spaced. If not specified, it is calculated - by the poles of the system to reflect adequately the response transients. - @item tfinal - Optional simulation horizon. If not specified, it is calculated by - the poles of the system to reflect adequately the response transients. - @item dt - Optional sampling time. Be sure to choose it small enough to capture transient - phenomena. If not specified, it is calculated by the poles of the system. - @end table - - @strong{Outputs} - @table @var - @item y - Output response array. Has as many rows as time samples (length of t) - and as many columns as outputs. - @item t - Time row vector. - @item x - State trajectories array. Has @code{length (t)} rows and as many columns as states. - @end table - - @strong{Example} - @example - @group - . - Continuous Time: x = A x , y = C x , x(0) = x0 - - Discrete Time: x[k+1] = A x[k] , y[k] = C x[k] , x[0] = x0 - @end group - @end example - - @seealso{impulse, lsim, step} - @end deftypefn -@section lsim - - @deftypefn{Function File} {[@var{y}, @var{t}, @var{x}] =} lsim (@var{sys}, @var{u}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} lsim (@var{sys}, @var{u}, @var{t}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} lsim (@var{sys}, @var{u}, @var{t}, @var{x0}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} lsim (@var{sys}, @var{u}, @var{t}, @var{[]}, @var{method}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} lsim (@var{sys}, @var{u}, @var{t}, @var{x0}, @var{method}) - Simulate LTI model response to arbitrary inputs. If no output arguments are given, - the system response is plotted on the screen. - - @strong{Inputs} - @table @var - @item sys - LTI model. System must be proper, i.e. it must not have more zeros than poles. - @item u - Vector or array of input signal. Needs @code{length(t)} rows and as many columns - as there are inputs. If @var{sys} is a single-input system, row vectors @var{u} - of length @code{length(t)} are accepted as well. - @item t - Time vector. Should be evenly spaced. If @var{sys} is a continuous-time system - and @var{t} is a real scalar, @var{sys} is discretized with sampling time - @code{tsam = t/(rows(u)-1)}. If @var{sys} is a discrete-time system and @var{t} - is not specified, vector @var{t} is assumed to be @code{0 : tsam : tsam*(rows(u)-1)}. - @item x0 - Vector of initial conditions for each state. If not specified, a zero vector is assumed. - @item method - Discretization method for continuous-time models. Default value is zoh - (zero-order hold). All methods from @code{c2d} are supported. - @end table - - @strong{Outputs} - @table @var - @item y - Output response array. Has as many rows as time samples (length of t) - and as many columns as outputs. - @item t - Time row vector. It is always evenly spaced. - @item x - State trajectories array. Has @code{length (t)} rows and as many columns as states. - @end table - - @seealso{impulse, initial, step} - @end deftypefn -@section step - - @deftypefn{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{t}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{tfinal}) - @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{tfinal}, @var{dt}) - Step response of LTI system. - If no output arguments are given, the response is printed on the screen. - - @strong{Inputs} - @table @var - @item sys - LTI model. - @item t - Time vector. Should be evenly spaced. If not specified, it is calculated by - the poles of the system to reflect adequately the response transients. - @item tfinal - Optional simulation horizon. If not specified, it is calculated by - the poles of the system to reflect adequately the response transients. - @item dt - Optional sampling time. Be sure to choose it small enough to capture transient - phenomena. If not specified, it is calculated by the poles of the system. - @end table - - @strong{Outputs} - @table @var - @item y - Output response array. Has as many rows as time samples (length of t) - and as many columns as outputs. - @item t - Time row vector. - @item x - State trajectories array. Has @code{length (t)} rows and as many columns as states. - @end table - - @seealso{impulse, initial, lsim} - @end deftypefn -@chapter Frequency Domain Analysis -@section bode - - @deftypefn {Function File} {[@var{mag}, @var{pha}, @var{w}] =} bode (@var{sys}) - @deftypefnx {Function File} {[@var{mag}, @var{pha}, @var{w}] =} bode (@var{sys}, @var{w}) - Bode diagram of frequency response. If no output arguments are given, - the response is printed on the screen. - - @strong{Inputs} - @table @var - @item sys - LTI system. Must be a single-input and single-output (SISO) system. - @item w - Optional vector of frequency values. If @var{w} is not specified, - it is calculated by the zeros and poles of the system. - Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, - where @var{wmin} and @var{wmax} denote minimum and maximum frequencies - in rad/s. - @end table - - @strong{Outputs} - @table @var - @item mag - Vector of magnitude. Has length of frequency vector @var{w}. - @item... [truncated message content] |
From: <par...@us...> - 2012-02-22 18:24:21
|
Revision: 9654 http://octave.svn.sourceforge.net/octave/?rev=9654&view=rev Author: paramaniac Date: 2012-02-22 18:24:10 +0000 (Wed, 22 Feb 2012) Log Message: ----------- control: reorganize package makefile (2) Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_control.m trunk/octave-forge/main/control/src/Makefile Modified: trunk/octave-forge/main/control/devel/makefile_control.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-22 18:15:13 UTC (rev 9653) +++ trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-22 18:24:10 UTC (rev 9654) @@ -11,6 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); +%{ makefile_chol makefile_conversions makefile_h2syn @@ -27,5 +28,10 @@ makefile_staircase makefile_tustin makefile_zero +%} +% system ("make clean"); +system ("make -j4 all"); +system ("rm *.o"); + cd (homedir); Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2012-02-22 18:15:13 UTC (rev 9653) +++ trunk/octave-forge/main/control/src/Makefile 2012-02-22 18:24:10 UTC (rev 9654) @@ -253,4 +253,7 @@ mkoctfile is_real_square_matrix.cc clean: - rm *.o core octave-core *.oct *~ \ No newline at end of file + rm -rf *.o core octave-core *.oct *~ *.f slicot + +realclean: clean + rm -rf *.a \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-22 18:34:29
|
Revision: 9655 http://octave.svn.sourceforge.net/octave/?rev=9655&view=rev Author: paramaniac Date: 2012-02-22 18:34:17 +0000 (Wed, 22 Feb 2012) Log Message: ----------- control: reorganize package makefile (3) Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_control.m trunk/octave-forge/main/control/src/Makefile Added Paths: ----------- trunk/octave-forge/main/control/src/TG04BX.fortran Removed Paths: ------------- trunk/octave-forge/main/control/src/TG04BX.f Modified: trunk/octave-forge/main/control/devel/makefile_control.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-22 18:24:10 UTC (rev 9654) +++ trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-22 18:34:17 UTC (rev 9655) @@ -30,7 +30,7 @@ makefile_zero %} -% system ("make clean"); +system ("make clean"); system ("make -j4 all"); system ("rm *.o"); Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2012-02-22 18:24:10 UTC (rev 9654) +++ trunk/octave-forge/main/control/src/Makefile 2012-02-22 18:34:17 UTC (rev 9655) @@ -27,6 +27,7 @@ tar -xzf slicot.tar.gz mv slicot/src/*.f . mv slicot/src_aux/*.f . + cp TG04BX.fortran TG04BX.f mkoctfile *.f \ ${LAPACK_LIBS} ${BLAS_LIBS} ${FLIBS} ar -r slicotlibrary.a *.o @@ -35,83 +36,46 @@ # transmission zeros of state-space models slab08nd.oct: slab08nd.cc slicotlibrary.a mkoctfile slab08nd.cc slicotlibrary.a \ - AB08ND.f AB08NX.f TB01ID.f MB03OY.f MB03PY.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # L-infinity norm slab13dd.oct: slab13dd.cc slicotlibrary.a mkoctfile slab13dd.cc slicotlibrary.a \ - AB13DD.f MA02AD.f MB01SD.f MB03XD.f TB01ID.f \ - TG01AD.f TG01BD.f AB13DX.f MA01AD.f MA02ID.f \ - MB03XP.f MB04DD.f MB04QB.f MB04TB.f MB03XU.f \ - MB04TS.f UE01MD.f MB02RD.f MB02SD.f MB04QC.f \ - MB04QF.f MB03YA.f MB03YD.f MB02RZ.f MB04QU.f \ - MB02SZ.f MB03YT.f \ ${LAPACK_LIBS} ${BLAS_LIBS} ${FLIBS} # H-2 controller synthesis - continuous-time slsb10hd.oct: slsb10hd.cc slicotlibrary.a mkoctfile slsb10hd.cc slicotlibrary.a \ - SB10HD.f SB10UD.f SB10VD.f SB10WD.f SB02RD.f \ - MB01RU.f SB02SD.f MA02ED.f SB02RU.f SB02MR.f \ - MB01SD.f SB02MS.f SB02MV.f SB02MW.f MA02AD.f \ - SB02QD.f MB02PD.f SB03QX.f SB03QY.f MB01RX.f \ - MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ - SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # H-2 controller synthesis - discrete-time slsb10ed.oct: slsb10ed.cc slicotlibrary.a mkoctfile slsb10ed.cc slicotlibrary.a \ - SB10ED.f SB10SD.f SB10TD.f SB10PD.f MB01RX.f \ - SB02SD.f SB02OD.f MB01RU.f SB02OU.f SB02OV.f \ - SB02OW.f MB01RY.f SB02OY.f SB03SX.f SB03SY.f \ - MA02ED.f select.f SB03MX.f SB02MR.f SB02MV.f \ - MB01UD.f SB03MV.f SB04PX.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # H-2 norm slab13bd.oct: slab13bd.cc slicotlibrary.a mkoctfile slab13bd.cc slicotlibrary.a \ - AB13BD.f SB08DD.f SB03OU.f SB01FY.f TB01LD.f \ - SB03OT.f MB04ND.f MB04OD.f MB03QX.f select.f \ - SB03OR.f MB04OX.f MB03QD.f SB03OY.f MA02AD.f \ - MB03QY.f SB04PX.f MB04NY.f MB04OY.f SB03OV.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # Pole assignment slsb01bd.oct: slsb01bd.cc slicotlibrary.a mkoctfile slsb01bd.cc slicotlibrary.a \ - SB01BD.f MB03QD.f MB03QY.f SB01BX.f SB01BY.f \ - select.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # H-inf controller synthesis - continuous-time slsb10fd.oct: slsb10fd.cc slicotlibrary.a mkoctfile slsb10fd.cc slicotlibrary.a \ - SB10FD.f SB10PD.f SB10QD.f SB10RD.f SB02RD.f \ - MB01RU.f MB01RX.f MA02AD.f SB02SD.f MA02ED.f \ - SB02RU.f SB02MR.f MB01SD.f SB02MS.f SB02MV.f \ - SB02MW.f SB02QD.f MB02PD.f SB03QX.f SB03QY.f \ - MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ - SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # H-inf controller synthesis - discrete-time slsb10dd.oct: slsb10dd.cc slicotlibrary.a mkoctfile slsb10dd.cc slicotlibrary.a \ - SB10DD.f MB01RU.f MB01RX.f SB02SD.f SB02OD.f \ - MA02AD.f SB02OU.f SB02OV.f SB02OW.f MB01RY.f \ - SB02OY.f SB03SX.f SB03SY.f MA02ED.f select.f \ - SB03MX.f SB02MR.f SB02MV.f MB01UD.f SB03MV.f \ - SB04PX.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # Lyapunov equations slsb03md.oct: slsb03md.cc slicotlibrary.a mkoctfile slsb03md.cc slicotlibrary.a \ - SB03MD.f select.f SB03MX.f SB03MY.f MB01RD.f \ - SB03MV.f SB03MW.f SB04PX.f \ ${LAPACK_LIBS} ${BLAS_LIBS} # Sylvester equations - continuous-time @@ -256,4 +220,4 @@ rm -rf *.o core octave-core *.oct *~ *.f slicot realclean: clean - rm -rf *.a \ No newline at end of file + rm -rf *.a Deleted: trunk/octave-forge/main/control/src/TG04BX.f =================================================================== --- trunk/octave-forge/main/control/src/TG04BX.f 2012-02-22 18:24:10 UTC (rev 9654) +++ trunk/octave-forge/main/control/src/TG04BX.f 2012-02-22 18:34:17 UTC (rev 9655) @@ -1,261 +0,0 @@ - SUBROUTINE TG04BX( IP, IZ, A, LDA, E, B, C, D, PR, PI, ZR, ZI, - $ GAIN, IWORK ) -C -C WARNING -C -C This routine is a modified version of TB04BX. It is intended -C for the Octave Control Systems Package and supports Descriptor -C State-Space models. TG04BX is *NOT* part of SLICOT and the -C authors from NICONET e.V. are *NOT* responsible for it. -C See file DESCRIPTION for the current maintainer of the Octave -C control package. -C -C SLICOT RELEASE 5.0. -C -C Copyright (c) 2002-2009 NICONET e.V. -C -C This program is free software: you can redistribute it and/or -C modify it under the terms of the GNU General Public License as -C published by the Free Software Foundation, either version 2 of -C the License, or (at your option) any later version. -C -C This program is distributed in the hope that it will be useful, -C but WITHOUT ANY WARRANTY; without even the implied warranty of -C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -C GNU General Public License for more details. -C -C You should have received a copy of the GNU General Public License -C along with this program. If not, see -C <http://www.gnu.org/licenses/>. -C -C PURPOSE -C -C To compute the gain of a single-input single-output linear system, -C given its state-space representation (A,b,c,d), and its poles and -C zeros. The matrix A is assumed to be in an upper Hessenberg form. -C The gain is computed using the formula -C -C -1 IP IZ -C g = (c*( S0*E - A ) *b + d)*Prod( S0 - Pi )/Prod( S0 - Zi ) , -C i=1 i=1 (1) -C -C where Pi, i = 1 : IP, and Zj, j = 1 : IZ, are the poles and zeros, -C respectively, and S0 is a real scalar different from all poles and -C zeros. -C -C ARGUMENTS -C -C Input/Output Parameters -C -C IP (input) INTEGER -C The number of the system poles. IP >= 0. -C -C IZ (input) INTEGER -C The number of the system zeros. IZ >= 0. -C -C A (input/output) DOUBLE PRECISION array, dimension (LDA,IP) -C On entry, the leading IP-by-IP part of this array must -C contain the state dynamics matrix A in an upper Hessenberg -C form. The elements below the second diagonal are not -C referenced. -C On exit, the leading IP-by-IP upper Hessenberg part of -C this array contains the LU factorization of the matrix -C A - S0*I, as computed by SLICOT Library routine MB02SD. -C -C LDA INTEGER -C The leading dimension of array A. LDA >= max(1,IP). -C -C B (input/output) DOUBLE PRECISION array, dimension (IP) -C On entry, this array must contain the system input -C vector b. -C On exit, this array contains the solution of the linear -C system ( A - S0*I )x = b . -C -C C (input) DOUBLE PRECISION array, dimension (IP) -C This array must contain the system output vector c. -C -C D (input) DOUBLE PRECISION -C The variable must contain the system feedthrough scalar d. -C -C PR (input) DOUBLE PRECISION array, dimension (IP) -C This array must contain the real parts of the system -C poles. Pairs of complex conjugate poles must be stored in -C consecutive memory locations. -C -C PI (input) DOUBLE PRECISION array, dimension (IP) -C This array must contain the imaginary parts of the system -C poles. -C -C ZR (input) DOUBLE PRECISION array, dimension (IZ) -C This array must contain the real parts of the system -C zeros. Pairs of complex conjugate zeros must be stored in -C consecutive memory locations. -C -C ZI (input) DOUBLE PRECISION array, dimension (IZ) -C This array must contain the imaginary parts of the system -C zeros. -C -C GAIN (output) DOUBLE PRECISION -C The gain of the linear system (A,b,c,d), given by (1). -C -C Workspace -C -C IWORK INTEGER array, dimension (IP) -C On exit, it contains the pivot indices; for 1 <= i <= IP, -C row i of the matrix A - S0*I was interchanged with -C row IWORK(i). -C -C METHOD -C -C The routine implements the method presented in [1]. A suitable -C value of S0 is chosen based on the system poles and zeros. -C Then, the LU factorization of the upper Hessenberg, nonsingular -C matrix A - S0*I is computed and used to solve the linear system -C in (1). -C -C REFERENCES -C -C [1] Varga, A. and Sima, V. -C Numerically Stable Algorithm for Transfer Function Matrix -C Evaluation. -C Int. J. Control, vol. 33, nr. 6, pp. 1123-1133, 1981. -C -C NUMERICAL ASPECTS -C -C The algorithm is numerically stable in practice and requires -C O(IP*IP) floating point operations. -C -C CONTRIBUTORS -C -C V. Sima, Research Institute for Informatics, Bucharest, May 2002. -C Partly based on the BIMASC Library routine GAIN by A. Varga. -C -C REVISIONS -C -C 2011-02-08 (Lukas Reichlin) Modifications for Descriptor Systems. -C -C KEYWORDS -C -C Eigenvalue, state-space representation, transfer function, zeros. -C -C ****************************************************************** -C -C .. Parameters .. - DOUBLE PRECISION ZERO, ONE, TWO, P1, ONEP1 - PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0, - $ P1 = 0.1D0, ONEP1 = 1.1D0 ) -C .. Scalar Arguments .. - DOUBLE PRECISION D, GAIN - INTEGER IP, IZ, LDA -C .. Array Arguments .. - DOUBLE PRECISION A(LDA,*), E(LDA,*), B(*), C(*), PI(*), PR(*), - $ ZI(*), ZR(*) - INTEGER IWORK(*) -C .. Local Scalars .. - INTEGER I, J, INFO - DOUBLE PRECISION S0, S -C .. External Functions .. - DOUBLE PRECISION DDOT - EXTERNAL DDOT -C .. External Subroutines .. - EXTERNAL MB02RD, MB02SD -C .. Intrinsic Functions .. - INTRINSIC ABS, MAX -C .. -C .. Executable Statements .. -C -C For efficiency, the input scalar parameters are not checked. -C -C Quick return if possible. -C -C IF( IP.EQ.0 ) THEN -C GAIN = ZERO -C RETURN -C END IF -C -C Compute a suitable value for S0 . -C - S0 = ZERO -C - DO 10 I = 1, IP - S = ABS( PR(I) ) - IF ( PI(I).NE.ZERO ) - $ S = S + ABS( PI(I) ) - S0 = MAX( S0, S ) - 10 CONTINUE -C - DO 20 I = 1, IZ - S = ABS( ZR(I) ) - IF ( ZI(I).NE.ZERO ) - $ S = S + ABS( ZI(I) ) - S0 = MAX( S0, S ) - 20 CONTINUE -C - S0 = TWO*S0 + P1 - IF ( S0.LE.ONE ) - $ S0 = ONEP1 -C -C Form A - S0*E . -C - DO 30 J = 1, LDA - DO 25 I = 1, LDA - A(I,J) = A(I,J) - S0*E(I,J) - 25 CONTINUE - 30 CONTINUE -C -C Compute the LU factorization of the matrix A - S0*E -C (guaranteed to be nonsingular). -C -C CALL MB02SD( IP, A, LDA, IWORK, INFO ) - CALL MB02SD( LDA, A, LDA, IWORK, INFO ) -C -C Solve the linear system (A - S0*E)*x = b . -C -C CALL MB02RD( 'No Transpose', IP, 1, A, LDA, IWORK, B, IP, INFO ) -C CALL MB02RD( 'No Transpose', IP, 1, A, LDA, IWORK, B, LDA, INFO ) - CALL MB02RD( 'No Transpose', LDA, 1, A, LDA, IWORK, B, LDA, INFO ) -C -1 -C Compute c*(S0*E - A) *b + d . -C -C GAIN = D - DDOT( IP, C, 1, B, 1 ) - GAIN = D - DDOT( LDA, C, 1, B, 1 ) -C -C Multiply by the products in terms of poles and zeros in (1). -C - I = 1 -C -C WHILE ( I <= IP ) DO -C - 40 IF ( I.LE.IP ) THEN - IF ( PI(I).EQ.ZERO ) THEN - GAIN = GAIN*( S0 - PR(I) ) - I = I + 1 - ELSE - GAIN = GAIN*( S0*( S0 - TWO*PR(I) ) + PR(I)**2 + PI(I)**2 ) - I = I + 2 - END IF - GO TO 40 - END IF -C -C END WHILE 40 -C - I = 1 -C -C WHILE ( I <= IZ ) DO -C - 50 IF ( I.LE.IZ ) THEN - IF ( ZI(I).EQ.ZERO ) THEN - GAIN = GAIN/( S0 - ZR(I) ) - I = I + 1 - ELSE - GAIN = GAIN/( S0*( S0 - TWO*ZR(I) ) + ZR(I)**2 + ZI(I)**2 ) - I = I + 2 - END IF - GO TO 50 - END IF -C -C END WHILE 50 -C - RETURN -C *** Last line of TG04BX *** - END Copied: trunk/octave-forge/main/control/src/TG04BX.fortran (from rev 9654, trunk/octave-forge/main/control/src/TG04BX.f) =================================================================== --- trunk/octave-forge/main/control/src/TG04BX.fortran (rev 0) +++ trunk/octave-forge/main/control/src/TG04BX.fortran 2012-02-22 18:34:17 UTC (rev 9655) @@ -0,0 +1,261 @@ + SUBROUTINE TG04BX( IP, IZ, A, LDA, E, B, C, D, PR, PI, ZR, ZI, + $ GAIN, IWORK ) +C +C WARNING +C +C This routine is a modified version of TB04BX. It is intended +C for the Octave Control Systems Package and supports Descriptor +C State-Space models. TG04BX is *NOT* part of SLICOT and the +C authors from NICONET e.V. are *NOT* responsible for it. +C See file DESCRIPTION for the current maintainer of the Octave +C control package. +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2009 NICONET e.V. +C +C This program is free software: you can redistribute it and/or +C modify it under the terms of the GNU General Public License as +C published by the Free Software Foundation, either version 2 of +C the License, or (at your option) any later version. +C +C This program is distributed in the hope that it will be useful, +C but WITHOUT ANY WARRANTY; without even the implied warranty of +C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +C GNU General Public License for more details. +C +C You should have received a copy of the GNU General Public License +C along with this program. If not, see +C <http://www.gnu.org/licenses/>. +C +C PURPOSE +C +C To compute the gain of a single-input single-output linear system, +C given its state-space representation (A,b,c,d), and its poles and +C zeros. The matrix A is assumed to be in an upper Hessenberg form. +C The gain is computed using the formula +C +C -1 IP IZ +C g = (c*( S0*E - A ) *b + d)*Prod( S0 - Pi )/Prod( S0 - Zi ) , +C i=1 i=1 (1) +C +C where Pi, i = 1 : IP, and Zj, j = 1 : IZ, are the poles and zeros, +C respectively, and S0 is a real scalar different from all poles and +C zeros. +C +C ARGUMENTS +C +C Input/Output Parameters +C +C IP (input) INTEGER +C The number of the system poles. IP >= 0. +C +C IZ (input) INTEGER +C The number of the system zeros. IZ >= 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,IP) +C On entry, the leading IP-by-IP part of this array must +C contain the state dynamics matrix A in an upper Hessenberg +C form. The elements below the second diagonal are not +C referenced. +C On exit, the leading IP-by-IP upper Hessenberg part of +C this array contains the LU factorization of the matrix +C A - S0*I, as computed by SLICOT Library routine MB02SD. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= max(1,IP). +C +C B (input/output) DOUBLE PRECISION array, dimension (IP) +C On entry, this array must contain the system input +C vector b. +C On exit, this array contains the solution of the linear +C system ( A - S0*I )x = b . +C +C C (input) DOUBLE PRECISION array, dimension (IP) +C This array must contain the system output vector c. +C +C D (input) DOUBLE PRECISION +C The variable must contain the system feedthrough scalar d. +C +C PR (input) DOUBLE PRECISION array, dimension (IP) +C This array must contain the real parts of the system +C poles. Pairs of complex conjugate poles must be stored in +C consecutive memory locations. +C +C PI (input) DOUBLE PRECISION array, dimension (IP) +C This array must contain the imaginary parts of the system +C poles. +C +C ZR (input) DOUBLE PRECISION array, dimension (IZ) +C This array must contain the real parts of the system +C zeros. Pairs of complex conjugate zeros must be stored in +C consecutive memory locations. +C +C ZI (input) DOUBLE PRECISION array, dimension (IZ) +C This array must contain the imaginary parts of the system +C zeros. +C +C GAIN (output) DOUBLE PRECISION +C The gain of the linear system (A,b,c,d), given by (1). +C +C Workspace +C +C IWORK INTEGER array, dimension (IP) +C On exit, it contains the pivot indices; for 1 <= i <= IP, +C row i of the matrix A - S0*I was interchanged with +C row IWORK(i). +C +C METHOD +C +C The routine implements the method presented in [1]. A suitable +C value of S0 is chosen based on the system poles and zeros. +C Then, the LU factorization of the upper Hessenberg, nonsingular +C matrix A - S0*I is computed and used to solve the linear system +C in (1). +C +C REFERENCES +C +C [1] Varga, A. and Sima, V. +C Numerically Stable Algorithm for Transfer Function Matrix +C Evaluation. +C Int. J. Control, vol. 33, nr. 6, pp. 1123-1133, 1981. +C +C NUMERICAL ASPECTS +C +C The algorithm is numerically stable in practice and requires +C O(IP*IP) floating point operations. +C +C CONTRIBUTORS +C +C V. Sima, Research Institute for Informatics, Bucharest, May 2002. +C Partly based on the BIMASC Library routine GAIN by A. Varga. +C +C REVISIONS +C +C 2011-02-08 (Lukas Reichlin) Modifications for Descriptor Systems. +C +C KEYWORDS +C +C Eigenvalue, state-space representation, transfer function, zeros. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE, TWO, P1, ONEP1 + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0, + $ P1 = 0.1D0, ONEP1 = 1.1D0 ) +C .. Scalar Arguments .. + DOUBLE PRECISION D, GAIN + INTEGER IP, IZ, LDA +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), E(LDA,*), B(*), C(*), PI(*), PR(*), + $ ZI(*), ZR(*) + INTEGER IWORK(*) +C .. Local Scalars .. + INTEGER I, J, INFO + DOUBLE PRECISION S0, S +C .. External Functions .. + DOUBLE PRECISION DDOT + EXTERNAL DDOT +C .. External Subroutines .. + EXTERNAL MB02RD, MB02SD +C .. Intrinsic Functions .. + INTRINSIC ABS, MAX +C .. +C .. Executable Statements .. +C +C For efficiency, the input scalar parameters are not checked. +C +C Quick return if possible. +C +C IF( IP.EQ.0 ) THEN +C GAIN = ZERO +C RETURN +C END IF +C +C Compute a suitable value for S0 . +C + S0 = ZERO +C + DO 10 I = 1, IP + S = ABS( PR(I) ) + IF ( PI(I).NE.ZERO ) + $ S = S + ABS( PI(I) ) + S0 = MAX( S0, S ) + 10 CONTINUE +C + DO 20 I = 1, IZ + S = ABS( ZR(I) ) + IF ( ZI(I).NE.ZERO ) + $ S = S + ABS( ZI(I) ) + S0 = MAX( S0, S ) + 20 CONTINUE +C + S0 = TWO*S0 + P1 + IF ( S0.LE.ONE ) + $ S0 = ONEP1 +C +C Form A - S0*E . +C + DO 30 J = 1, LDA + DO 25 I = 1, LDA + A(I,J) = A(I,J) - S0*E(I,J) + 25 CONTINUE + 30 CONTINUE +C +C Compute the LU factorization of the matrix A - S0*E +C (guaranteed to be nonsingular). +C +C CALL MB02SD( IP, A, LDA, IWORK, INFO ) + CALL MB02SD( LDA, A, LDA, IWORK, INFO ) +C +C Solve the linear system (A - S0*E)*x = b . +C +C CALL MB02RD( 'No Transpose', IP, 1, A, LDA, IWORK, B, IP, INFO ) +C CALL MB02RD( 'No Transpose', IP, 1, A, LDA, IWORK, B, LDA, INFO ) + CALL MB02RD( 'No Transpose', LDA, 1, A, LDA, IWORK, B, LDA, INFO ) +C -1 +C Compute c*(S0*E - A) *b + d . +C +C GAIN = D - DDOT( IP, C, 1, B, 1 ) + GAIN = D - DDOT( LDA, C, 1, B, 1 ) +C +C Multiply by the products in terms of poles and zeros in (1). +C + I = 1 +C +C WHILE ( I <= IP ) DO +C + 40 IF ( I.LE.IP ) THEN + IF ( PI(I).EQ.ZERO ) THEN + GAIN = GAIN*( S0 - PR(I) ) + I = I + 1 + ELSE + GAIN = GAIN*( S0*( S0 - TWO*PR(I) ) + PR(I)**2 + PI(I)**2 ) + I = I + 2 + END IF + GO TO 40 + END IF +C +C END WHILE 40 +C + I = 1 +C +C WHILE ( I <= IZ ) DO +C + 50 IF ( I.LE.IZ ) THEN + IF ( ZI(I).EQ.ZERO ) THEN + GAIN = GAIN/( S0 - ZR(I) ) + I = I + 1 + ELSE + GAIN = GAIN/( S0*( S0 - TWO*ZR(I) ) + ZR(I)**2 + ZI(I)**2 ) + I = I + 2 + END IF + GO TO 50 + END IF +C +C END WHILE 50 +C + RETURN +C *** Last line of TG04BX *** + END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-22 19:54:42
|
Revision: 9663 http://octave.svn.sourceforge.net/octave/?rev=9663&view=rev Author: paramaniac Date: 2012-02-22 19:54:36 +0000 (Wed, 22 Feb 2012) Log Message: ----------- move finished functions from package "control-devel" to "control" (3) Modified Paths: -------------- trunk/octave-forge/main/control/inst/test_control.m trunk/octave-forge/main/control/src/Makefile Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2012-02-22 19:46:06 UTC (rev 9662) +++ trunk/octave-forge/main/control/inst/test_control.m 2012-02-22 19:54:36 UTC (rev 9663) @@ -1,4 +1,4 @@ -## Copyright (C) 2010, 2011 Lukas F. Reichlin +## Copyright (C) 2010, 2011, 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -22,7 +22,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: May 2010 -## Version: 0.3 +## Version: 0.4 ## test collection test ltimodels @@ -59,6 +59,21 @@ test lyap test lyapchol +## model order reduction +test bstmodred +test btamodred +test hnamodred +## test spamodred # TODO: create test case + +## controller order reduction +test btaconred +test cfconred +test fwcfconred +## test spaconred # TODO: create test case + +## identification +test fitfrd + ## various oct-files test ctrbf test hsvd Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2012-02-22 19:46:06 UTC (rev 9662) +++ trunk/octave-forge/main/control/src/Makefile 2012-02-22 19:54:36 UTC (rev 9663) @@ -10,7 +10,9 @@ sltb01pd.oct slsb03od.oct slsg03bd.oct slag08bd.oct sltg01jd.oct \ sltg01hd.oct sltg01id.oct slsg02ad.oct sltg04bx.oct sltb01id.oct \ sltg01ad.oct slsb10id.oct slsb10kd.oct slsb10zd.oct sltb04bd.oct \ - slab04md.oct slsb10jd.oct sltd04ad.oct sltb01ud.oct \ + slab04md.oct slsb10jd.oct sltd04ad.oct sltb01ud.oct slab09hd.oct \ + slab09id.oct slab09jd.oct slsb16ad.oct slsb16bd.oct slsb16cd.oct \ + slsb10yd.oct \ is_real_scalar.oct is_real_vector.oct is_real_matrix.oct \ is_real_square_matrix.oct \ copy_NEWS @@ -203,6 +205,41 @@ mkoctfile sltb01ud.cc slicotlibrary.a \ ${LAPACK_LIBS} ${BLAS_LIBS} +# balanced stochastic truncation model reduction +slab09hd.oct: slab09hd.cc slicotlibrary.a + mkoctfile slab09hd.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# balanced truncation & singular perturbation approximation model reduction +slab09id.oct: slab09id.cc slicotlibrary.a + mkoctfile slab09id.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# hankel-norm approximation model reduction +slab09jd.oct: slab09jd.cc slicotlibrary.a + mkoctfile slab09jd.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# balanced truncation & singular perturbation approximation controller reduction +slsb16ad.oct: slsb16ad.cc slicotlibrary.a + mkoctfile slsb16ad.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# coprime factorization state-feedback controller reduction +slsb16bd.oct: slsb16bd.cc slicotlibrary.a + mkoctfile slsb16bd.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# frequency-weighted coprime factorization state-feedback controller reduction +slsb16cd.oct: slsb16cd.cc slicotlibrary.a + mkoctfile slsb16cd.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + +# fit state-space model to frequency response data +slsb10yd.oct: slsb10yd.cc slicotlibrary.a + mkoctfile slsb10yd.cc slicotlibrary.a \ + ${LAPACK_LIBS} ${BLAS_LIBS} + # helpers is_real_scalar.oct: is_real_scalar.cc mkoctfile is_real_scalar.cc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-22 20:03:26
|
Revision: 9664 http://octave.svn.sourceforge.net/octave/?rev=9664&view=rev Author: paramaniac Date: 2012-02-22 20:03:19 +0000 (Wed, 22 Feb 2012) Log Message: ----------- control: update index and manual version number Modified Paths: -------------- trunk/octave-forge/main/control/INDEX trunk/octave-forge/main/control/devel/pdfdoc/control.tex Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-02-22 19:54:36 UTC (rev 9663) +++ trunk/octave-forge/main/control/INDEX 2012-02-22 20:03:19 UTC (rev 9664) @@ -91,6 +91,18 @@ dlyapchol lyap lyapchol +Model Reduction + bstmodred + btamodred + hnamodred + spamodred +Controller Reduction + btaconred + cfconred + fwcfconred + spaconred +System Identification + fitfrd Overloaded Operators @lti/horzcat @lti/inv @@ -106,6 +118,7 @@ @lti/uminus @lti/vertcat Miscellaneous + options strseq test_control BMWengine Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-02-22 19:54:36 UTC (rev 9663) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-02-22 20:03:19 UTC (rev 9664) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.2.5 +@set VERSION 2.3.50 @finalout @c @afourwide @c %**end of header This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-26 10:59:33
|
Revision: 9695 http://octave.svn.sourceforge.net/octave/?rev=9695&view=rev Author: paramaniac Date: 2012-02-26 10:59:27 +0000 (Sun, 26 Feb 2012) Log Message: ----------- control: update news and description files Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-02-26 10:04:51 UTC (rev 9694) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-02-26 10:59:27 UTC (rev 9695) @@ -1,6 +1,6 @@ Name: Control -Version: 2.2.5 -Date: 2012-02-09 +Version: 2.3.49 +Date: 2012-02-26 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-02-26 10:04:51 UTC (rev 9694) +++ trunk/octave-forge/main/control/NEWS 2012-02-26 10:59:27 UTC (rev 9695) @@ -23,7 +23,10 @@ set (sys, "key", value) is now equivalent to sys = set (sys, "key", value). ** Revised package installation. The new solution compiles the SLICOT library - in a less barbaric way and brings along faster compile times. + in a less barbaric way and creates only a single oct-file containing all the + SLICOT routines. This also brings along faster compile times. + (Special thanks to Hans Buchmann, Carlo De Falco and Michael Goffioul for + their advice) =============================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-02-26 13:44:08
|
Revision: 9699 http://octave.svn.sourceforge.net/octave/?rev=9699&view=rev Author: paramaniac Date: 2012-02-26 13:44:01 +0000 (Sun, 26 Feb 2012) Log Message: ----------- control: add comments about purpose of the cc-files Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_control.m trunk/octave-forge/main/control/src/control_slicot_functions.cc Modified: trunk/octave-forge/main/control/devel/makefile_control.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-26 12:42:25 UTC (rev 9698) +++ trunk/octave-forge/main/control/devel/makefile_control.m 2012-02-26 13:44:01 UTC (rev 9699) @@ -11,8 +11,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -system ("make realclean"); # recompile slicotlibrary.a -## system ("make clean"); +## system ("make realclean"); # recompile slicotlibrary.a +system ("make clean"); system ("make -j4 all"); system ("rm *.o"); Modified: trunk/octave-forge/main/control/src/control_slicot_functions.cc =================================================================== --- trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-02-26 12:42:25 UTC (rev 9698) +++ trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-02-26 13:44:01 UTC (rev 9699) @@ -1,46 +1,48 @@ -//#define SLICOTCONTROL "control_slicot_functions" +/* TODO: * create common.h + * * add common.cc to makefile (control_slicot_functions.oct) + */ #include <octave/oct.h> -#include "common.cc" +#include "common.cc" // common code for all functions of the oct-file -#include "slab08nd.cc" -#include "slab13dd.cc" -#include "slsb10hd.cc" -#include "slsb10ed.cc" -#include "slab13bd.cc" -#include "slsb01bd.cc" -#include "slsb10fd.cc" -#include "slsb10dd.cc" -#include "slsb03md.cc" -#include "slsb04md.cc" -#include "slsb04qd.cc" -#include "slsg03ad.cc" -#include "slsb02od.cc" -#include "slab13ad.cc" -#include "slab01od.cc" -#include "sltb01pd.cc" -#include "slsb03od.cc" -#include "slsg03bd.cc" -#include "slag08bd.cc" -#include "sltg01jd.cc" -#include "sltg01hd.cc" -#include "sltg01id.cc" -#include "slsg02ad.cc" -#include "sltg04bx.cc" -#include "sltb01id.cc" -#include "sltg01ad.cc" -#include "slsb10id.cc" -#include "slsb10kd.cc" -#include "slsb10zd.cc" -#include "sltb04bd.cc" -#include "slab04md.cc" -#include "slsb10jd.cc" -#include "sltd04ad.cc" -#include "sltb01ud.cc" -#include "slab09hd.cc" -#include "slab09id.cc" -#include "slab09jd.cc" -#include "slsb16ad.cc" -#include "slsb16bd.cc" -#include "slsb16cd.cc" -#include "slsb10yd.cc" \ No newline at end of file +#include "slab08nd.cc" // transmission zeros of state-space models +#include "slab13dd.cc" // L-infinity norm +#include "slsb10hd.cc" // H-2 controller synthesis - continuous-time +#include "slsb10ed.cc" // H-2 controller synthesis - discrete-time +#include "slab13bd.cc" // H-2 norm +#include "slsb01bd.cc" // Pole assignment +#include "slsb10fd.cc" // H-infinity controller synthesis - continuous-time +#include "slsb10dd.cc" // H-infinity controller synthesis - discrete-time +#include "slsb03md.cc" // Lyapunov equations +#include "slsb04md.cc" // Sylvester equations - continuous-time +#include "slsb04qd.cc" // Sylvester equations - discrete-time +#include "slsg03ad.cc" // generalized Lyapunov equations +#include "slsb02od.cc" // algebraic Riccati equations +#include "slab13ad.cc" // Hankel singular values +#include "slab01od.cc" // staircase form using orthogonal transformations +#include "sltb01pd.cc" // minimal realization of state-space models +#include "slsb03od.cc" // Cholesky factor of Lyapunov equations +#include "slsg03bd.cc" // Cholesky factor of generalized Lyapunov equations +#include "slag08bd.cc" // transmission zeros of descriptor state-space models +#include "sltg01jd.cc" // minimal realization of descriptor state-space models +#include "sltg01hd.cc" // controllability staircase form of descriptor state-space models +#include "sltg01id.cc" // observability staircase form of descriptor state-space models +#include "slsg02ad.cc" // solution of algebraic Riccati equations for descriptor systems +#include "sltg04bx.cc" // gain of descriptor state-space models +#include "sltb01id.cc" // scaling of state-space models +#include "sltg01ad.cc" // scaling of descriptor state-space models +#include "slsb10id.cc" // H-infinity loop shaping - continuous-time +#include "slsb10kd.cc" // H-infinity loop shaping - discrete-time - strictly proper case +#include "slsb10zd.cc" // H-infinity loop shaping - discrete-time - proper case +#include "sltb04bd.cc" // State-space to transfer function conversion +#include "slab04md.cc" // bilinear transformation +#include "slsb10jd.cc" // descriptor to regular state-space conversion +#include "sltd04ad.cc" // transfer function to state-space conversion +#include "sltb01ud.cc" // controllable block Hessenberg realization +#include "slab09hd.cc" // balanced stochastic truncation model reduction +#include "slab09id.cc" // balanced truncation & singular perturbation approximation model reduction +#include "slab09jd.cc" // hankel-norm approximation model reduction +#include "slsb16ad.cc" // balanced truncation & singular perturbation approximation controller reduction +#include "slsb16bd.cc" // coprime factorization state-feedback controller reduction +#include "slsb16cd.cc" // frequency-weighted coprime factorization state-feedback controller reduction +#include "slsb10yd.cc" // fit state-space model to frequency response data This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-03-01 17:45:46
|
Revision: 9736 http://octave.svn.sourceforge.net/octave/?rev=9736&view=rev Author: paramaniac Date: 2012-03-01 17:45:35 +0000 (Thu, 01 Mar 2012) Log Message: ----------- control: work on documentation Modified Paths: -------------- trunk/octave-forge/main/control/inst/btamodred.m Added Paths: ----------- trunk/octave-forge/main/control/inst/Anderson.m trunk/octave-forge/main/control/inst/Madievski.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/anderson.m trunk/octave-forge/main/control/devel/madievski.m Deleted: trunk/octave-forge/main/control/devel/anderson.m =================================================================== --- trunk/octave-forge/main/control/devel/anderson.m 2012-03-01 17:23:50 UTC (rev 9735) +++ trunk/octave-forge/main/control/devel/anderson.m 2012-03-01 17:45:35 UTC (rev 9736) @@ -1,80 +0,0 @@ -%% -*- texinfo -*- -%% Frequency-weighted coprime factorization controller reduction. - -% =============================================================================== -% Coprime Factorization Controller Reduction Lukas Reichlin December 2011 -% =============================================================================== -% Reference: Anderson, B.D.O.: Controller Reduction: Concepts and Approaches -% IEEE Transactions of Automatic Control, Vol. 34, No. 8, August 1989 -% =============================================================================== - -% Tabula Rasa -clear all, close all, clc - -% Plant -A = [ -0.161 -6.004 -0.58215 -9.9835 -0.40727 -3.982 0.0 0.0 - 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 - 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 ]; - -B = [ 1.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 ]; - -C = [ 0.0 0.0 6.4432e-3 2.3196e-3 7.1252e-2 1.0002 0.10455 0.99551 ]; - -G = ss (A, B, C); - -% LQG Design -H = [ 0.0 0.0 0.0 0.0 0.55 11.0 1.32 18.0 ]; - -q1 = 1e-6; -q2 = 100; % [100, 1000, 2000] - -Q = q1 * H.' * H; -R = 1; - -W = q2 * B * B.'; -V = 1; - -F = lqr (G, Q, R) -L = lqr (G.', W, V).' - -% Coprime Factorization using Balanced Truncation Approximation -figure (1) -for k = 8:-1:2 - Kr = cfconred (G, F, L, k); % 'method', 'bfsr-bta' - T = feedback (G*Kr); - step (T, 200) - hold on -endfor -hold off - -% Coprime Factorization using Singular Perturbation Approximation -figure (2) -for k = 8:-1:2 - Kr = cfconred (G, F, L, k, 'method', 'bfsr-spa'); - T = feedback (G*Kr); - step (T, 200) - hold on -endfor -hold off - -% Frequency-Weighted Coprime Factorization using BTA -figure (3) -for k = 8:-1:2 - Kr = fwcfconred (G, F, L, k); - T = feedback (G*Kr); - step (T, 300) - hold on -endfor -hold off Deleted: trunk/octave-forge/main/control/devel/madievski.m =================================================================== --- trunk/octave-forge/main/control/devel/madievski.m 2012-03-01 17:23:50 UTC (rev 9735) +++ trunk/octave-forge/main/control/devel/madievski.m 2012-03-01 17:45:35 UTC (rev 9736) @@ -1,126 +0,0 @@ -%% -*- texinfo -*- -%% Frequency-weighted controller reduction. - -% =============================================================================== -% Frequency Weighted Controller Reduction Lukas Reichlin December 2011 -% =============================================================================== -% Reference: Madievski, A.G. and Anderson, B.D.O. -% Sampled-Data Controller Reduction Procedure -% IEEE Transactions of Automatic Control -% Vol. 40, No. 11, November 1995 -% =============================================================================== - -% Tabula Rasa -clear all, close all, clc - -% Plant -Ap1 = [ 0.0 1.0 - 0.0 0.0 ]; - -Ap2 = [ -0.015 0.765 - -0.765 -0.015 ]; - -Ap3 = [ -0.028 1.410 - -1.410 -0.028 ]; - -Ap4 = [ -0.04 1.85 - -1.85 -0.04 ]; - -Ap = blkdiag (Ap1, Ap2, Ap3, Ap4); - -Bp = [ 0.026 - -0.251 - 0.033 - -0.886 - -4.017 - 0.145 - 3.604 - 0.280 ]; - -Cp = [ -0.996 -0.105 0.261 0.009 -0.001 -0.043 0.002 -0.026 ]; - -Dp = [ 0.0 ]; - -P = ss (Ap, Bp, Cp, Dp); - -% Controller -Ac = [ -0.4077 0.9741 0.1073 0.0131 0.0023 -0.0186 -0.0003 -0.0098 - -0.0977 -0.1750 0.0215 -0.0896 -0.0260 0.0057 0.0109 -0.0105 - 0.0011 0.0218 -0.0148 0.7769 0.0034 -0.0013 -0.0014 0.0011 - -0.0361 -0.5853 -0.7701 -0.3341 -0.0915 0.0334 0.0378 -0.0290 - -0.1716 -2.6546 -0.0210 -1.4467 -0.4428 1.5611 0.1715 -0.1318 - -0.0020 0.0950 0.0029 0.0523 -1.3950 -0.0338 -0.0062 0.0045 - 0.1607 2.3824 0.0170 1.2979 0.3721 -0.1353 -0.1938 1.9685 - -0.0006 0.1837 0.0048 0.1010 0.0289 -0.0111 -1.8619 -0.0311 ]; - -Bc = [ -0.4105 - -0.0868 - -0.0004 - 0.0036 - 0.0081 - -0.0085 - -0.0004 - -0.0132 ]; - -Cc = [ -0.0447 -0.6611 -0.0047 -0.3601 -0.1033 0.0375 0.0427 -0.0329 ]; - -Dc = [ 0.0 ]; - -K = ss (Ac, Bc, Cc, Dc); - -% Controller Reduction -Kr4 = spaconred (P, K, 4, 'feedback', '-') -Kr2 = spaconred (P, K, 2, 'feedback', '-') - -% Open Loop -L = P * K; -Lr4 = P * Kr4; -Lr2 = P * Kr2; - -% Closed Loop -T = feedback (L); -Tr4 = feedback (Lr4); -Tr2 = feedback (Lr2); - -% Frequency Range -w = {1e-2, 1e1}; - -% Bode Plot of Controller -[mag, pha, w] = bode (K, w); -[magr4, phar4, wr4] = bode (Kr4, w); -[magr2, phar2, wr2] = bode (Kr2, w); - -mag = 20 * log10 (mag); -magr4 = 20 * log10 (magr4); -magr2 = 20 * log10 (magr2); - -figure (1) -subplot (2, 1, 1) -semilogx (w, mag, wr4, magr4, wr2, magr2) -axis ('tight') -ylim (__axis_margin__ (ylim)) -grid ('on') -title ('Bode Diagrams of K and Kr') -ylabel ('Magnitude [dB]') - -subplot (2, 1, 2) -semilogx (w, pha, wr4, phar4, wr2, phar2) -axis ('tight') -ylim (__axis_margin__ (ylim)) -grid ('on') -xlabel ('Frequency [rad/s]') -ylabel ('Phase [deg]') -legend ('K (8 states)', 'Kr (4 states)', 'Kr (2 states)', 'location', 'southwest') - -% Step Response of Closed Loop -[y, t] = step (T, 100); -[yr4, tr4] = step (Tr4, 100); -[yr2, tr2] = step (Tr2, 100); - -figure (2) -plot (t, y, tr4, yr4, tr2, yr2) -grid ('on') -title ('Step Response of Closed Loop') -xlabel ('Time [s]') -ylabel ('Output [-]') -legend ('K (8 states)', 'Kr (4 states)', 'Kr (2 states)', 'Location', 'SouthEast') Copied: trunk/octave-forge/main/control/inst/Anderson.m (from rev 9728, trunk/octave-forge/main/control/devel/anderson.m) =================================================================== --- trunk/octave-forge/main/control/inst/Anderson.m (rev 0) +++ trunk/octave-forge/main/control/inst/Anderson.m 2012-03-01 17:45:35 UTC (rev 9736) @@ -0,0 +1,80 @@ +%% -*- texinfo -*- +%% Frequency-weighted coprime factorization controller reduction. + +% =============================================================================== +% Coprime Factorization Controller Reduction Lukas Reichlin December 2011 +% =============================================================================== +% Reference: Anderson, B.D.O.: Controller Reduction: Concepts and Approaches +% IEEE Transactions of Automatic Control, Vol. 34, No. 8, August 1989 +% =============================================================================== + +% Tabula Rasa +clear all, close all, clc + +% Plant +A = [ -0.161 -6.004 -0.58215 -9.9835 -0.40727 -3.982 0.0 0.0 + 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 + 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 + 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 + 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 + 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 + 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 ]; + +B = [ 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 ]; + +C = [ 0.0 0.0 6.4432e-3 2.3196e-3 7.1252e-2 1.0002 0.10455 0.99551 ]; + +G = ss (A, B, C); + +% LQG Design +H = [ 0.0 0.0 0.0 0.0 0.55 11.0 1.32 18.0 ]; + +q1 = 1e-6; +q2 = 100; % [100, 1000, 2000] + +Q = q1 * H.' * H; +R = 1; + +W = q2 * B * B.'; +V = 1; + +F = lqr (G, Q, R) +L = lqr (G.', W, V).' + +% Coprime Factorization using Balanced Truncation Approximation +figure (1) +for k = 8:-1:2 + Kr = cfconred (G, F, L, k); % 'method', 'bfsr-bta' + T = feedback (G*Kr); + step (T, 200) + hold on +endfor +hold off + +% Coprime Factorization using Singular Perturbation Approximation +figure (2) +for k = 8:-1:2 + Kr = cfconred (G, F, L, k, 'method', 'bfsr-spa'); + T = feedback (G*Kr); + step (T, 200) + hold on +endfor +hold off + +% Frequency-Weighted Coprime Factorization using BTA +figure (3) +for k = 8:-1:2 + Kr = fwcfconred (G, F, L, k); + T = feedback (G*Kr); + step (T, 300) + hold on +endfor +hold off Copied: trunk/octave-forge/main/control/inst/Madievski.m (from rev 9728, trunk/octave-forge/main/control/devel/madievski.m) =================================================================== --- trunk/octave-forge/main/control/inst/Madievski.m (rev 0) +++ trunk/octave-forge/main/control/inst/Madievski.m 2012-03-01 17:45:35 UTC (rev 9736) @@ -0,0 +1,126 @@ +%% -*- texinfo -*- +%% Frequency-weighted controller reduction. + +% =============================================================================== +% Frequency Weighted Controller Reduction Lukas Reichlin December 2011 +% =============================================================================== +% Reference: Madievski, A.G. and Anderson, B.D.O. +% Sampled-Data Controller Reduction Procedure +% IEEE Transactions of Automatic Control +% Vol. 40, No. 11, November 1995 +% =============================================================================== + +% Tabula Rasa +clear all, close all, clc + +% Plant +Ap1 = [ 0.0 1.0 + 0.0 0.0 ]; + +Ap2 = [ -0.015 0.765 + -0.765 -0.015 ]; + +Ap3 = [ -0.028 1.410 + -1.410 -0.028 ]; + +Ap4 = [ -0.04 1.85 + -1.85 -0.04 ]; + +Ap = blkdiag (Ap1, Ap2, Ap3, Ap4); + +Bp = [ 0.026 + -0.251 + 0.033 + -0.886 + -4.017 + 0.145 + 3.604 + 0.280 ]; + +Cp = [ -0.996 -0.105 0.261 0.009 -0.001 -0.043 0.002 -0.026 ]; + +Dp = [ 0.0 ]; + +P = ss (Ap, Bp, Cp, Dp); + +% Controller +Ac = [ -0.4077 0.9741 0.1073 0.0131 0.0023 -0.0186 -0.0003 -0.0098 + -0.0977 -0.1750 0.0215 -0.0896 -0.0260 0.0057 0.0109 -0.0105 + 0.0011 0.0218 -0.0148 0.7769 0.0034 -0.0013 -0.0014 0.0011 + -0.0361 -0.5853 -0.7701 -0.3341 -0.0915 0.0334 0.0378 -0.0290 + -0.1716 -2.6546 -0.0210 -1.4467 -0.4428 1.5611 0.1715 -0.1318 + -0.0020 0.0950 0.0029 0.0523 -1.3950 -0.0338 -0.0062 0.0045 + 0.1607 2.3824 0.0170 1.2979 0.3721 -0.1353 -0.1938 1.9685 + -0.0006 0.1837 0.0048 0.1010 0.0289 -0.0111 -1.8619 -0.0311 ]; + +Bc = [ -0.4105 + -0.0868 + -0.0004 + 0.0036 + 0.0081 + -0.0085 + -0.0004 + -0.0132 ]; + +Cc = [ -0.0447 -0.6611 -0.0047 -0.3601 -0.1033 0.0375 0.0427 -0.0329 ]; + +Dc = [ 0.0 ]; + +K = ss (Ac, Bc, Cc, Dc); + +% Controller Reduction +Kr4 = spaconred (P, K, 4, 'feedback', '-') +Kr2 = spaconred (P, K, 2, 'feedback', '-') + +% Open Loop +L = P * K; +Lr4 = P * Kr4; +Lr2 = P * Kr2; + +% Closed Loop +T = feedback (L); +Tr4 = feedback (Lr4); +Tr2 = feedback (Lr2); + +% Frequency Range +w = {1e-2, 1e1}; + +% Bode Plot of Controller +[mag, pha, w] = bode (K, w); +[magr4, phar4, wr4] = bode (Kr4, w); +[magr2, phar2, wr2] = bode (Kr2, w); + +mag = 20 * log10 (mag); +magr4 = 20 * log10 (magr4); +magr2 = 20 * log10 (magr2); + +figure (1) +subplot (2, 1, 1) +semilogx (w, mag, wr4, magr4, wr2, magr2) +axis ('tight') +ylim (__axis_margin__ (ylim)) +grid ('on') +title ('Bode Diagrams of K and Kr') +ylabel ('Magnitude [dB]') + +subplot (2, 1, 2) +semilogx (w, pha, wr4, phar4, wr2, phar2) +axis ('tight') +ylim (__axis_margin__ (ylim)) +grid ('on') +xlabel ('Frequency [rad/s]') +ylabel ('Phase [deg]') +legend ('K (8 states)', 'Kr (4 states)', 'Kr (2 states)', 'location', 'southwest') + +% Step Response of Closed Loop +[y, t] = step (T, 100); +[yr4, tr4] = step (Tr4, 100); +[yr2, tr2] = step (Tr2, 100); + +figure (2) +plot (t, y, tr4, yr4, tr2, yr2) +grid ('on') +title ('Step Response of Closed Loop') +xlabel ('Time [s]') +ylabel ('Output [-]') +legend ('K (8 states)', 'Kr (4 states)', 'Kr (2 states)', 'Location', 'SouthEast') Modified: trunk/octave-forge/main/control/inst/btamodred.m =================================================================== --- trunk/octave-forge/main/control/inst/btamodred.m 2012-03-01 17:23:50 UTC (rev 9735) +++ trunk/octave-forge/main/control/inst/btamodred.m 2012-03-01 17:45:35 UTC (rev 9736) @@ -180,15 +180,25 @@ ## @item 'equil', 'scale' ## Boolean indicating whether equilibration (scaling) should be ## performed on system @var{G} prior to order reduction. +## This is done by state transformations. ## Default value is true if @code{G.scaled == false} and ## false if @code{G.scaled == true}. +## Note that for @acronym{MIMO} models,. ## @end table ## +## For @acronym{MIMO} models, proper scaling of both inputs and outputs +## is of utmost importance. The input and output scaling can @strong{not} +## be done by the equilibration option or the @command{prescale} command +## because these functions perform state transformations only. +## Signals should not be scaled simply to the range of, say, -1 to +1. +## For all inputs (or outputs), a change from +1 to +2 should be of the +## same importance for the model. +## Think of a chemical reactor, the importance could be the cost to control this +## reactor. Then a change on each input from +1.5 to +2.0 would cost 50$. +## Otherwise, important behaviour of @var{G} could be neglected just because +## the corresponding signals have smaller numbers than those of other, +## less important effects of @var{G}. ## -## UNSTABLE (from bstmodred) -## -## MIMO (from bstmodred) -## ## Approximation Properties: ## @itemize @bullet ## @item This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-03-06 13:49:22
|
Revision: 9754 http://octave.svn.sourceforge.net/octave/?rev=9754&view=rev Author: paramaniac Date: 2012-03-06 13:49:13 +0000 (Tue, 06 Mar 2012) Log Message: ----------- control: prepare release of control-2.3.50 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/INDEX trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/doc/control.pdf Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-03-06 08:38:16 UTC (rev 9753) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-03-06 13:49:13 UTC (rev 9754) @@ -1,6 +1,6 @@ Name: Control -Version: 2.3.49 -Date: 2012-02-26 +Version: 2.3.50 +Date: 2012-03-06 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-03-06 08:38:16 UTC (rev 9753) +++ trunk/octave-forge/main/control/INDEX 2012-03-06 13:49:13 UTC (rev 9754) @@ -82,6 +82,7 @@ lqr Robust Control augw + fitfrd h2syn hinfsyn mixsyn @@ -103,8 +104,6 @@ cfconred fwcfconred spaconred -System Identification - fitfrd Overloaded Operators @lti/horzcat @lti/inv Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-03-06 08:38:16 UTC (rev 9753) +++ trunk/octave-forge/main/control/NEWS 2012-03-06 13:49:13 UTC (rev 9754) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.50 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.3.50 Release Date: 2012-03-06 Release Manager: Lukas Reichlin =============================================================================== ** Added new functions for frequency-weighted model and controller order @@ -12,24 +12,35 @@ hnamodred fwcfconred spamodred spaconred +** Anderson, Madievski + -- Added two examples for controller reduction. The m-files are named after + the authors of the corresponding papers. + +** fitfrd + -- Added function to fit frequency response data with a state-space model. + +** set + -- The set command doesn't need a return argument anymore in order to save + the modified values. set (sys, "key", value) is now equivalent to + sys = set (sys, "key", value). + ** Require Octave version 3.6.0 or better. (The frequency response plotting commands have been simplified. They now use the fixed "axis tight" command. This is a first step towards multiple systems in one plot, e.g. bode (sys1, sys2, sys3). Furthermore, the code takes advantage of the new "arrayfun" function which became a faster oct-file instead of an m-file) -** set - -- The set command doesn't need a return argument anymore in order to save - the modified values. set (sys, "key", value) is now equivalent to - sys = set (sys, "key", value). - -** Revised package installation. The new solution compiles the SLICOT library - in a less barbaric way and creates only a single oct-file containing all the - SLICOT routines. This also brings along faster compile times. +** Revised package installation and cleanup efforts under the hood. + The new solution compiles the SLICOT library in a less barbaric way and + creates only a single oct-file containing all the SLICOT routines. + This also brings along faster compile times. (Special thanks to Hans Buchmann, Carlo De Falco and Michael Goffioul for their advice) +** doc/control.pdf + -- Extended PDF manual. + =============================================================================== control-2.2.5 Release Date: 2012-02-09 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-03-06 08:38:16 UTC (rev 9753) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-03-06 13:49:13 UTC (rev 9754) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.2.5.tar.gz control/ -md5 control-2.2.5.tar.gz -md5 control-2.2.5.tar.gz > md5_control_pkg.txt -uuencode control-2.2.5.tar.gz < control-2.2.5.tar.gz > control-2.2.5.tar.gz.uue +tar czf control-2.3.50.tar.gz control/ +md5 control-2.3.50.tar.gz +md5 control-2.3.50.tar.gz > md5_control_pkg.txt +uuencode control-2.3.50.tar.gz < control-2.3.50.tar.gz > control-2.3.50.tar.gz.uue octave -q --eval \ -"pkg install control-2.2.5.tar.gz" +"pkg install control-2.3.50.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.2.5 +rm -R ~/octave/control-2.3.50 ===================================================================================== Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-03-06 08:38:16 UTC (rev 9753) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-03-06 13:49:13 UTC (rev 9754) @@ -42,8 +42,7 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<KX=5W\xD5eS\xBD~oN\xEF82x -#\xC1\x96\xB0\xD2\xEA\xA1\x8B\xEA\xBE824M\xC4\xECH\x96\xA0\xC6(88@\xEF\x8B\xEDE\xB2\xB5a\xB4%\x92\x87c\xBFU\xE5\xA14\xEE\xF2\xBC\xED\xF2\xBDV̲]\xF6e\xB0\xD8\xA5\x98\xDE\xCCs\xE1\xE4mwl\xB3\xEE=_}f?\xFD\x90\xABmfЖ\xF1\xA1]m\x81\xB8~[\xAB\xDA\xCA6;z''P\x98\xF5c\xD5)\xB2\xF2e\xB3\xDA\xFD\x86\x8F`D\x81#\x8DQ|-s[ +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\xC9Ϩ\xA7檺l\xAA\xD7\xEF\xD5\xE9!GOaD\xC9W\xDA=\xF4bQ\xDDKf\x81\xA2\x89\x98-\xC9\xD4\xE8}\xF1\xBDH\xBE6\x8C\xBED\xF2\xE1\xE3p\xEC\xB7J\xA3<\x94\xC6]\x9E\xB7]\xBEY\xB6˾\xFB\xA1ӛy.\x9C\xBC\xED\x8Emֽ\xE7\xAB\xCF\xEC\xA7o\xA3r\xB5\xCD\xDA2\x9E \xB4\x8B\xA2-\xD7okU[\xD9fG\xEF\xE4J\xB3>c\xAC:EV\xBElV\xBB_\xC3\xF0\xEC\x8F(b\xA41\x8AO\x94\xC6s\x8C endstream endobj 14 0 obj << @@ -61,188 +60,193 @@ endstream endobj 19 0 obj << -/Length 2032 +/Length 2069 /Filter /FlateDecode >> stream -xڭXKs\xDC6\xBE\xEBW̑\xAA2i\xBE\xC0GN+o\xADbm)v\xCAR\x92C\xB2\x88\xC4\xCC`\x92\x80\xD4D\xF9\xF5\xE9F\x8EL9N*\xA5*h4\x80~~ݘd\xC3_\xB2)\xD3MYeQ\x95\x95\x9B\xA6\xBB\x88-U\xEF64\xF8\xF4\xEDE\xE2\xF8r\x96E,\xCF`\xFCE\xB6\x90\xA5\xCC\xF2\x85\x8BS\xDF\xDD_\xBC\xBD.\xD9&)\xA34a\xF9\xE6~k\xAFM\x8B(\xC6Y\xBB\xF99\xF8^\x8B-o\xC4\xE5\xFF\xEE\xFF\xFB\xF6\x9Ak\xD5q\x9D k\xBC \xD3*\x8Ak\xC7y\xBF?q\xD5Q]\xA42\xA5)\\x86\xD2Y\x9Eo?\xFC\xB0v\Xťg\xFA،\xFC2\xAD\x82'\xFC'.ìL\x82f\xE8q6\xEAA\xE1\xC0$<^2\xF0\x9D\xE3\xDA\xEA\xA1\xC3Q\x8C{\xCB@h#a\x9F%\xA4\xC4A\xC7q\x95\xEB\xD6\xD0Mݤ\xB4W -\x87\xCB-\xED|\xC0\x8D\xCF4\xBE\x9D\xE8^\xB7\xE5:"\xF2'!\xADP{%{Ts\xE6uT\xE4\x9B0ɢ\x84%\xA4\xEF\xE1\xC0<\xCBi\xF0\x9B܈\x96\x86(,.\x8D`JK8\xE8\xE1d\x89\xDE19\xB9\xFA\xD0\x93n\xA7\x92\x9A\xEB\xE75d\xE0\xCE4\xF1ֽ\xBB\xBD\xF9\xF7\xC7\xFB5/de\x94\xE7\x9Dʜ\x81W\xBD\x9C\xBD8\x92t\x9F\x99W\x89\xB4"?\x89\xBE\xF5Jq\xB7\xC2\xC9$i \xF1\x9A\x9E\xDBD\x8B\x83\x82 \xEBmk\xC6q\xB04 -\xBE\x93(\x8E\x92\x84\xE8\xB3G`|\xE2\xA6u\xDC5\xC38\x8A\xD69\xF82 ZZ?\xC0z\xCEU4\xB7^\xC0 -V=\xA4\x98qj\xDD\xFD&"\xC9oFCL\x97\xBDJ\xF0q\xD2\xC2\xED\xE1Z|C\x96//,YEu\xCE@\xC5"J\xB2\x9AT\xFC%N\xCA5\xA3'iT |
From: <par...@us...> - 2012-04-21 13:03:39
|
Revision: 10304 http://octave.svn.sourceforge.net/octave/?rev=10304&view=rev Author: paramaniac Date: 2012-04-21 13:03:28 +0000 (Sat, 21 Apr 2012) Log Message: ----------- control: finish filt with doc, add to index Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/filt.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/filt.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-04-21 11:46:37 UTC (rev 10303) +++ trunk/octave-forge/main/control/INDEX 2012-04-21 13:03:28 UTC (rev 10304) @@ -6,6 +6,7 @@ Madievski Linear Time Invariant Models dss + filt frd ss tf Deleted: trunk/octave-forge/main/control/devel/filt.m =================================================================== --- trunk/octave-forge/main/control/devel/filt.m 2012-04-21 11:46:37 UTC (rev 10303) +++ trunk/octave-forge/main/control/devel/filt.m 2012-04-21 13:03:28 UTC (rev 10304) @@ -1,38 +0,0 @@ -function sys = filt (num = {}, den = {}, tsam = -1, varargin) - - if (! iscell (num)) - num = {num}; - endif - - if (! iscell (den)) - den = {den}; - endif - - ## shall i remove trailing zeros before postpadding? - num = cellfun (@__remove_trailing_zeros__, num, "uniformoutput", false); - den = cellfun (@__remove_trailing_zeros__, den, "uniformoutput", false); - - lnum = cellfun (@length, num, "uniformoutput", false); - lden = cellfun (@length, den, "uniformoutput", false); - - lmax = cellfun (@max, lnum, lden, "uniformoutput", false); - - num = cellfun (@postpad, num, lmax, "uniformoutput", false); - den = cellfun (@postpad, den, lmax, "uniformoutput", false); - - sys = tf (num, den, tsam, varargin{:}); - -endfunction - - -function p = __remove_trailing_zeros__ (p) - - idx = find (p != 0); - - if (isempty (idx)) - p = 0; - else - p = p(1 : idx(end)); - endif - -endfunction \ No newline at end of file Copied: trunk/octave-forge/main/control/inst/filt.m (from rev 10303, trunk/octave-forge/main/control/devel/filt.m) =================================================================== --- trunk/octave-forge/main/control/inst/filt.m (rev 0) +++ trunk/octave-forge/main/control/inst/filt.m 2012-04-21 13:03:28 UTC (rev 10304) @@ -0,0 +1,121 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{sys} =} filt (@var{num}, @var{den}, @dots{}) +## @deftypefnx {Function File} {@var{sys} =} filt (@var{num}, @var{den}, @var{tsam}, @dots{}) +## Create discrete transfer function model from data in DSP format. +## +## @strong{Inputs} +## @table @var +## @item num +## Numerator or cell of numerators. Each numerator must be a row vector +## containing the coefficients of the polynomial in ascending powers of z^-1. +## num@{i,j@} contains the numerator polynomial from input j to output i. +## In the SISO case, a single vector is accepted as well. +## @item den +## Denominator or cell of denominators. Each denominator must be a row vector +## containing the coefficients of the polynomial in ascending powers of z^-1. +## den@{i,j@} contains the denominator polynomial from input j to output i. +## In the SISO case, a single vector is accepted as well. +## @item tsam +## Sampling time in seconds. If @var{tsam} is not specified, +## default value -1 (unspecified) is taken. +## @item @dots{} +## Optional pairs of properties and values. +## Type @command{set (tf)} for more information. +## @end table +## +## @strong{Outputs} +## @table @var +## @item sys +## Discrete-time transfer function model. +## @end table +## +## @strong{Example} +## @example +## @group +## 3 z^-1 +## H(z^-1) = ------------------- +## 1 + 4 z^-1 + 2 z^-2 +## +## octave:1> H = filt ([0, 3], [1, 4, 2]) +## +## Transfer function 'H' from input 'u1' to output ... +## +## 3 z +## y1: ------------- +## z^2 + 4 z + 2 +## +## Sampling time: unspecified +## Discrete-time model. +## @end group +## @end example +## +## @seealso{tf} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + +function sys = filt (num = {}, den = {}, tsam = -1, varargin) + + if (! iscell (num)) + num = {num}; + endif + + if (! iscell (den)) + den = {den}; + endif + + ## convert from z^-1 to z + ## expand each channel by z^x, where x is the largest exponent of z^-1 (z^-x) + + ## remove trailing zeros + ## such that polynomials are as short as possible + num = cellfun (@__remove_trailing_zeros__, num, "uniformoutput", false); + den = cellfun (@__remove_trailing_zeros__, den, "uniformoutput", false); + + ## make numerator and denominator polynomials equally long + ## by adding trailing zeros + lnum = cellfun (@length, num, "uniformoutput", false); + lden = cellfun (@length, den, "uniformoutput", false); + + lmax = cellfun (@max, lnum, lden, "uniformoutput", false); + + num = cellfun (@postpad, num, lmax, "uniformoutput", false); + den = cellfun (@postpad, den, lmax, "uniformoutput", false); + + ## use standard tf constructor + ## sys is stored and displayed in standard z form, not z^-1 + sys = tf (num, den, tsam, varargin{:}); + +endfunction + + +function p = __remove_trailing_zeros__ (p) + + idx = find (p != 0); + + if (isempty (idx)) + p = 0; + else + p = p(1 : idx(end)); + endif + +endfunction \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-04-21 14:03:47
|
Revision: 10306 http://octave.svn.sourceforge.net/octave/?rev=10306&view=rev Author: paramaniac Date: 2012-04-21 14:03:37 +0000 (Sat, 21 Apr 2012) Log Message: ----------- control: add filtdata, news draft Modified Paths: -------------- trunk/octave-forge/main/control/NEWS Added Paths: ----------- trunk/octave-forge/main/control/inst/@lti/filtdata.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-04-21 13:43:25 UTC (rev 10305) +++ trunk/octave-forge/main/control/NEWS 2012-04-21 14:03:37 UTC (rev 10306) @@ -1,6 +1,13 @@ Summary of important user-visible changes for releases of the control package =============================================================================== +control-2.3.51 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +=============================================================================== + +** filt, filtdata + -- Added function to specify disrete-time transfer functions in DSP format. + +=============================================================================== control-2.3.50 Release Date: 2012-03-06 Release Manager: Lukas Reichlin =============================================================================== Added: trunk/octave-forge/main/control/inst/@lti/filtdata.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/filtdata.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/filtdata.m 2012-04-21 14:03:37 UTC (rev 10306) @@ -0,0 +1,77 @@ +## Copyright (C) 2011 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}) +## @deftypefnx {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}, @var{"v"}) +## Access zero-pole-gain data. +## +## @strong{Inputs} +## @table @var +## @item sys +## Any type of LTI model. +## @item "v", "vector" +## For SISO models, return @var{z} and @var{p} directly as column vectors +## instead of cells containing a single column vector. +## @end table +## +## @strong{Outputs} +## @table @var +## @item z +## Cell of column vectors containing the zeros for each channel. +## z@{i,j@} contains the zeros from input j to output i. +## @item p +## Cell of column vectors containing the poles for each channel. +## p@{i,j@} contains the poles from input j to output i. +## @item k +## Matrix containing the gains for each channel. +## k(i,j) contains the gain from input j to output i. +## @item tsam +## Sampling time in seconds. If @var{sys} is a continuous-time model, +## a zero is returned. +## @end table +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: September 2011 +## Version: 0.1 + +function [num, den, tsam] = filtdata (sys, rtype = "cell") + + [num, den, tsam] = tfdata (sys); + + ## make numerator and denominator polynomials equally long + ## by adding leading zeros + lnum = cellfun (@length, num, "uniformoutput", false); + lden = cellfun (@length, den, "uniformoutput", false); + + lmax = cellfun (@max, lnum, lden, "uniformoutput", false); + + num = cellfun (@prepad, num, lmax, "uniformoutput", false); + den = cellfun (@prepad, den, lmax, "uniformoutput", false); + + ## remove trailing zeros + ## such that polynomials are as short as possible + num = cellfun (@__remove_trailing_zeros__, num, "uniformoutput", false); + den = cellfun (@__remove_trailing_zeros__, den, "uniformoutput", false); + + if (lower (rtype(1)) == "v" && issiso (sys)) + num = num{1}; + den = den{1}; + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-04-21 17:27:01
|
Revision: 10307 http://octave.svn.sourceforge.net/octave/?rev=10307&view=rev Author: paramaniac Date: 2012-04-21 17:11:22 +0000 (Sat, 21 Apr 2012) Log Message: ----------- control: finish filt and filtdata, test & docstrings included Modified Paths: -------------- trunk/octave-forge/main/control/INDEX trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/@lti/filtdata.m trunk/octave-forge/main/control/inst/filt.m trunk/octave-forge/main/control/inst/test_control.m Added Paths: ----------- trunk/octave-forge/main/control/inst/__remove_trailing_zeros__.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-04-21 14:03:37 UTC (rev 10306) +++ trunk/octave-forge/main/control/INDEX 2012-04-21 17:11:22 UTC (rev 10307) @@ -13,6 +13,7 @@ zpk Model Data Access @lti/dssdata + @lti/filtdata @lti/frdata @lti/get @lti/set Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-04-21 14:03:37 UTC (rev 10306) +++ trunk/octave-forge/main/control/NEWS 2012-04-21 17:11:22 UTC (rev 10307) @@ -5,8 +5,12 @@ =============================================================================== ** filt, filtdata - -- Added function to specify disrete-time transfer functions in DSP format. + -- Added function "filt" to specify disrete-time transfer functions in DSP + format. + -- Added function "filtdata" to return any type of discrete-time LTI model + in DSP format. + =============================================================================== control-2.3.50 Release Date: 2012-03-06 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/inst/@lti/filtdata.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/filtdata.m 2012-04-21 14:03:37 UTC (rev 10306) +++ trunk/octave-forge/main/control/inst/@lti/filtdata.m 2012-04-21 17:11:22 UTC (rev 10307) @@ -1,4 +1,4 @@ -## Copyright (C) 2011 Lukas F. Reichlin +## Copyright (C) 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -16,42 +16,52 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}) -## @deftypefnx {Function File} {[@var{z}, @var{p}, @var{k}, @var{tsam}] =} zpkdata (@var{sys}, @var{"v"}) -## Access zero-pole-gain data. +## @deftypefn {Function File} {[@var{num}, @var{den}, @var{tsam}] =} filtdata (@var{sys}) +## @deftypefnx {Function File} {[@var{num}, @var{den}, @var{tsam}] =} filtdata (@var{sys}, @var{"vector"}) +## Access discrete-time transfer function data in DSP format. +## Argument @var{sys} is not limited to transfer function models. +## If @var{sys} is not a transfer function, it is converted automatically. ## ## @strong{Inputs} ## @table @var ## @item sys -## Any type of LTI model. +## Any type of discrete-time LTI model. ## @item "v", "vector" -## For SISO models, return @var{z} and @var{p} directly as column vectors +## For SISO models, return @var{num} and @var{den} directly as column vectors ## instead of cells containing a single column vector. ## @end table ## ## @strong{Outputs} ## @table @var -## @item z -## Cell of column vectors containing the zeros for each channel. -## z@{i,j@} contains the zeros from input j to output i. -## @item p -## Cell of column vectors containing the poles for each channel. -## p@{i,j@} contains the poles from input j to output i. -## @item k -## Matrix containing the gains for each channel. -## k(i,j) contains the gain from input j to output i. +## @item num +## Cell of numerator(s). Each numerator is a row vector +## containing the coefficients of the polynomial in ascending powers of z^-1. +## num@{i,j@} contains the numerator polynomial from input j to output i. +## In the SISO case, a single vector is possible as well. +## @item den +## Cell of denominator(s). Each denominator is a row vector +## containing the coefficients of the polynomial in descending powers of z^-1. +## den@{i,j@} contains the denominator polynomial from input j to output i. +## In the SISO case, a single vector is possible as well. ## @item tsam -## Sampling time in seconds. If @var{sys} is a continuous-time model, -## a zero is returned. +## Sampling time in seconds. If @var{tsam} is not specified, -1 is returned. ## @end table ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> -## Created: September 2011 +## Created: April 2012 ## Version: 0.1 function [num, den, tsam] = filtdata (sys, rtype = "cell") + if (nargin > 2) + print_usage (); + endif + + if (! isdt (sys)) + error ("lti: filtdata: require discrete-time system"); + endif + [num, den, tsam] = tfdata (sys); ## make numerator and denominator polynomials equally long Added: trunk/octave-forge/main/control/inst/__remove_trailing_zeros__.m =================================================================== --- trunk/octave-forge/main/control/inst/__remove_trailing_zeros__.m (rev 0) +++ trunk/octave-forge/main/control/inst/__remove_trailing_zeros__.m 2012-04-21 17:11:22 UTC (rev 10307) @@ -0,0 +1,36 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Remove trailing zeros from a polynomial, except for polynomials +## which are of length 1. For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + +function p = __remove_trailing_zeros__ (p) + + idx = find (p != 0); + + if (isempty (idx)) + p = 0; + else + p = p(1 : idx(end)); + endif + +endfunction Modified: trunk/octave-forge/main/control/inst/filt.m =================================================================== --- trunk/octave-forge/main/control/inst/filt.m 2012-04-21 14:03:37 UTC (rev 10306) +++ trunk/octave-forge/main/control/inst/filt.m 2012-04-21 17:11:22 UTC (rev 10307) @@ -121,15 +121,15 @@ endfunction - -function p = __remove_trailing_zeros__ (p) - - idx = find (p != 0); - - if (isempty (idx)) - p = 0; - else - p = p(1 : idx(end)); - endif - -endfunction \ No newline at end of file +%!shared num, den, n1, d1, n2, d2, n2e, d2e +%! num = [0, 3]; +%! den = [1, 4, 2]; +%! sys = filt (num, den); +%! [n1, d1] = filtdata (sys, "vector"); +%! [n2, d2] = tfdata (sys, "vector"); +%! n2e = [3, 0]; +%! d2e = [1, 4, 2]; +%!assert (n1, num, 1e-4); +%!assert (d1, den, 1e-4); +%!assert (n2, n2e, 1e-4); +%!assert (d2, d2e, 1e-4); Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2012-04-21 14:03:37 UTC (rev 10306) +++ trunk/octave-forge/main/control/inst/test_control.m 2012-04-21 17:11:22 UTC (rev 10307) @@ -81,6 +81,7 @@ ## various m-files test ctrb +test filt test initial test issample test margin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-03 20:16:25
|
Revision: 10357 http://octave.svn.sourceforge.net/octave/?rev=10357&view=rev Author: paramaniac Date: 2012-05-03 19:54:40 +0000 (Thu, 03 May 2012) Log Message: ----------- control: add ctranspose for LTI models Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/@frd/__ctranspose__.m trunk/octave-forge/main/control/inst/@lti/ctranspose.m trunk/octave-forge/main/control/inst/@ss/__ctranspose__.m trunk/octave-forge/main/control/inst/@tf/__ctranspose__.m trunk/octave-forge/main/control/inst/@tfpoly/conj_ct.m trunk/octave-forge/main/control/inst/@tfpoly/conj_dt.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-05-03 17:31:31 UTC (rev 10356) +++ trunk/octave-forge/main/control/INDEX 2012-05-03 19:54:40 UTC (rev 10357) @@ -107,6 +107,7 @@ fwcfconred spaconred Overloaded Operators + @lti/ctranspose @lti/horzcat @lti/inv @lti/minus Added: trunk/octave-forge/main/control/inst/@frd/__ctranspose__.m =================================================================== --- trunk/octave-forge/main/control/inst/@frd/__ctranspose__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@frd/__ctranspose__.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,35 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate transpose of FRD objects. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function sys = __ctranspose__ (sys) + + [p, m, l] = size (sys.H); + + H = mat2cell (sys.H, p, m, ones (1, l))(:); + + H = cellfun (@ctranspose, H, "uniformoutput", false); + + sys.H = cat (3, H{:}); + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/@lti/ctranspose.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/ctranspose.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/ctranspose.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,39 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate transpose of LTI objects. Used by Octave for "sys'". + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function sys = ctranspose (sys) + + if (nargin != 1) # prevent sys = ctranspose (sys1, sys2, sys3, ...) + error ("lti: ctranspose: this is an unary operator"); + endif + + [p, m] = size (sys); + ct = isct (sys); + + sys = __ctranspose__ (sys, ct); + + sys.inname = repmat ({""}, p, 1); + sys.outname = repmat ({""}, m, 1); + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/@ss/__ctranspose__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__ctranspose__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@ss/__ctranspose__.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,54 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate transpose of SS models. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function sys = __ctranspose__ (sys, ct) + + a = sys.a; + b = sys.b; + c = sys.c; + d = sys.d; + e = sys.e; + + if (ct) # continuous-time + sys.a = -a.'; + sys.b = -c.'; + sys.c = b.'; + sys.d = d.'; + sys.e = e.'; + sys.stname = repmat ({""}, rows (a), 1); + else # discrete-time + [n, m] = size (b); + p = rows (c); + if (isempty (e)) + e = eye (n); + endif + sys.a = blkdiag (e.', eye (p)); + sys.b = [zeros(n, p); -eye(p)]; + sys.c = [b.', zeros(m, p)]; + sys.d = d.'; + sys.e = [a.', c.'; zeros(p, n+p)]; + sys.stname = repmat ({""}, n+p, 1); + endif + +endfunction Added: trunk/octave-forge/main/control/inst/@tf/__ctranspose__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__ctranspose__.m (rev 0) +++ trunk/octave-forge/main/control/inst/@tf/__ctranspose__.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,42 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate transpose of TF models. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function sys = __ctranspose__ (sys, ct) + + num = sys.num; + den = sys.den; + + if (ct) # continuous-time + num = cellfun (@conj_ct, num, "uniformoutput", false); + den = cellfun (@conj_ct, den, "uniformoutput", false); + else # discrete-time + num = cellfun (@conj_dt, num, "uniformoutput", false); + den = cellfun (@conj_dt, den, "uniformoutput", false); + ## TODO: shall I make "den" a monic polynomial? + endif + + sys.num = num.'; + sys.den = den.'; + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/inst/@tfpoly/conj_ct.m =================================================================== --- trunk/octave-forge/main/control/inst/@tfpoly/conj_ct.m (rev 0) +++ trunk/octave-forge/main/control/inst/@tfpoly/conj_ct.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,30 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate of continuous-time polynomial. Replace s by -s. +## For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function p = conj_ct (p) + + p.poly(2:2:end) = -p.poly(2:2:end); + +endfunction Added: trunk/octave-forge/main/control/inst/@tfpoly/conj_dt.m =================================================================== --- trunk/octave-forge/main/control/inst/@tfpoly/conj_dt.m (rev 0) +++ trunk/octave-forge/main/control/inst/@tfpoly/conj_dt.m 2012-05-03 19:54:40 UTC (rev 10357) @@ -0,0 +1,30 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Conjugate of discrete-time polynomial. Replace z by 1/z. +## For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: May 2012 +## Version: 0.1 + +function p = conj_dt (p) + + p.poly = fliplr (p.poly); + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-03 14:04:10
|
Revision: 10559 http://octave.svn.sourceforge.net/octave/?rev=10559&view=rev Author: paramaniac Date: 2012-06-03 14:04:04 +0000 (Sun, 03 Jun 2012) Log Message: ----------- control: remove whitespace between @ and { which caused problems with generate_html Modified Paths: -------------- trunk/octave-forge/main/control/doc/control.pdf trunk/octave-forge/main/control/inst/@lti/transpose.m Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-06-03 13:51:44 UTC (rev 10558) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-06-03 14:04:04 UTC (rev 10559) @@ -3279,8 +3279,8 @@ 966 0 obj << /Producer (pdfTeX-1.40.12) /Creator (TeX) -/CreationDate (D:20120603154532+02'00') -/ModDate (D:20120603154532+02'00') +/CreationDate (D:20120603160139+02'00') +/ModDate (D:20120603160139+02'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) kpathsea version 6.0.1) >> endobj @@ -3313,7 +3313,7 @@ /W [1 3 1] /Root 965 0 R /Info 966 0 R -/ID [<CA738F7C45E3205DA4F6C76549534E2C> <CA738F7C45E3205DA4F6C76549534E2C>] +/ID [<E6F8037627641F1152201403FA3918DF> <E6F8037627641F1152201403FA3918DF>] /Length 2241 /Filter /FlateDecode >> Modified: trunk/octave-forge/main/control/inst/@lti/transpose.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/transpose.m 2012-06-03 13:51:44 UTC (rev 10558) +++ trunk/octave-forge/main/control/inst/@lti/transpose.m 2012-06-03 14:04:04 UTC (rev 10559) @@ -18,7 +18,7 @@ ## -*- texinfo -*- ## Transpose of LTI objects. Used by Octave for "sys.'". ## Useful for dual problems, i.e. controllability and observability -## or designing estimator gains with @command{lqr} and @command {place}. +## or designing estimator gains with @command{lqr} and @command{place}. ## Author: Lukas Reichlin <luk...@gm...> ## Created: February 2010 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-03 13:51:53
|
Revision: 10558 http://octave.svn.sourceforge.net/octave/?rev=10558&view=rev Author: paramaniac Date: 2012-06-03 13:51:44 +0000 (Sun, 03 Jun 2012) Log Message: ----------- control: prepare release of control-2.3.51 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/lqe.m trunk/octave-forge/main/control/devel/makefile_control.m trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/doc/control.pdf trunk/octave-forge/main/control/inst/filt.m trunk/octave-forge/main/control/inst/optiPID.m trunk/octave-forge/main/control/inst/test_control.m trunk/octave-forge/main/control/src/Makefile Added Paths: ----------- trunk/octave-forge/main/control/devel/lapack-3.4.1.tgz Removed Paths: ------------- trunk/octave-forge/main/control/src/lapack-3.4.1.tgz Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-06-03 13:51:44 UTC (rev 10558) @@ -1,6 +1,6 @@ Name: Control -Version: 2.3.50 -Date: 2012-03-06 +Version: 2.3.51 +Date: 2012-06-03 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/NEWS 2012-06-03 13:51:44 UTC (rev 10558) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.51 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.3.51 Release Date: 2012-06-03 Release Manager: Lukas Reichlin =============================================================================== ** filt, filtdata, tf @@ -16,15 +16,18 @@ ** ctranspose Conjugate transpose or pertransposition of LTI objects. - Used by Octave for "sys’". For a transfer-function matrix G, G’ denotes the - conjugate of G given by G.’(-s) for a continuous-time system or G.’(1/z) for + Used by Octave for "sys'". For a transfer-function matrix G, G' denotes the + conjugate of G given by G.'(-s) for a continuous-time system or G.'(1/z) for a discrete-time system. The frequency response of the pertransposition of G is the Hermitian (conjugate) transpose of G(jw), - i.e. freqresp (G’, w) = freqresp (G, w)’. - WARNING: Do NOT use this for dual problems, use the transpose "sys.’" + i.e. freqresp (G', w) = freqresp (G, w)'. + WARNING: Do NOT use this for dual problems, use the transpose "sys.'" (note the dot) instead. +** test_control + Add a few remarks to the help text regarding the severity of failing tests. + =============================================================================== control-2.3.50 Release Date: 2012-03-06 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-06-03 13:51:44 UTC (rev 10558) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.3.50.tar.gz control/ -md5 control-2.3.50.tar.gz -md5 control-2.3.50.tar.gz > md5_control_pkg.txt -uuencode control-2.3.50.tar.gz < control-2.3.50.tar.gz > control-2.3.50.tar.gz.uue +tar czf control-2.3.51.tar.gz control/ +md5 control-2.3.51.tar.gz +md5 control-2.3.51.tar.gz > md5_control_pkg.txt +uuencode control-2.3.51.tar.gz < control-2.3.51.tar.gz > control-2.3.51.tar.gz.uue octave -q --eval \ -"pkg install control-2.3.50.tar.gz" +"pkg install control-2.3.51.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.3.50 +rm -R ~/octave/control-2.3.51 ===================================================================================== Copied: trunk/octave-forge/main/control/devel/lapack-3.4.1.tgz (from rev 10554, trunk/octave-forge/main/control/src/lapack-3.4.1.tgz) =================================================================== (Binary files differ) Modified: trunk/octave-forge/main/control/devel/lqe.m =================================================================== --- trunk/octave-forge/main/control/devel/lqe.m 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/devel/lqe.m 2012-06-03 13:51:44 UTC (rev 10558) @@ -65,7 +65,7 @@ ## L = eig (A - B*G) ## @end group ## @end example -## @seealso{care, dare, dlqr} +## @seealso{lqr, care, dare, dlqe} ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> Modified: trunk/octave-forge/main/control/devel/makefile_control.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_control.m 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/devel/makefile_control.m 2012-06-03 13:51:44 UTC (rev 10558) @@ -13,7 +13,7 @@ ## system ("make realclean"); # recompile slicotlibrary.a system ("make clean"); -system ("make -j4 all"); +system ("make -j1 all"); system ("rm *.o"); cd (homedir); Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-06-03 13:51:44 UTC (rev 10558) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.3.50 +@set VERSION 2.3.51 @finalout @c @afourwide @c %**end of header Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-06-02 20:50:08 UTC (rev 10557) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-06-03 13:51:44 UTC (rev 10558) @@ -42,7 +42,7 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\xC9Ϩ\xA7檺l\xAA\xD7\xEF\xD5\xE9!GOaD\xC9W\xDA=\xF4bQ\xDDKf\x81\xA2\x89\x98-\xC9\xD4\xE8}\xF1\xBDH\xBE6\x8C\xBED\xF2\xE1\xE3p\xEC\xB7J\xA3<\x94\xC6]\x9E\xB7]\xBEY\xB6˾\xFB\xA1ӛy.\x9C\xBC\xED\x8Emֽ\xE7\xAB\xCF\xEC\xA7o\xA3r\xB5\xCD\xDA2\x9E \xB4\x8B\xA2-\xD7okU[\xD9fG\xEF\xE4J\xB3>c\xAC:EV\xBElV\xBB_\xC3\xF0\xEC\x8F(b\xA41\x8AO\x94\xC6s\x8C +\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\xC9\xD5SsU]6\xD5\xEB\xF7\xEA\xF4\x90#\x83\xA70"\x8Cd\x89+\xEDz\xB1\xA8\xEE\x8B%\xB3@\xD1D̖d j\x8C\x82\x83\xF4\xBE\xF8^$_F_"\xF9\xF0q8\xF6[\xA5QJ\xE3.\xCF\xDB.\xDFk\xC5,\xDBe_\x8B\xFDP\x8A\xE9\xCD<N\xDEv\xC76\xEB\xDE\xF3\xD5g\xF6ӷ\xD1\xB9\xDAfmO\xDA\xC5 |
From: <par...@us...> - 2012-06-03 19:34:16
|
Revision: 10560 http://octave.svn.sourceforge.net/octave/?rev=10560&view=rev Author: paramaniac Date: 2012-06-03 19:34:09 +0000 (Sun, 03 Jun 2012) Log Message: ----------- control: add uplus operator for LTI models Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/@lti/uplus.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-06-03 14:04:04 UTC (rev 10559) +++ trunk/octave-forge/main/control/INDEX 2012-06-03 19:34:09 UTC (rev 10560) @@ -120,6 +120,7 @@ @lti/subsref @lti/transpose @lti/uminus + @lti/uplus @lti/vertcat Miscellaneous options Added: trunk/octave-forge/main/control/inst/@lti/uplus.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/uplus.m (rev 0) +++ trunk/octave-forge/main/control/inst/@lti/uplus.m 2012-06-03 19:34:09 UTC (rev 10560) @@ -0,0 +1,31 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Unary plus of LTI object. Used by Octave for "+sys". + +## Author: Lukas Reichlin <luk...@gm...> +## Created: June 2012 +## Version: 0.1 + +function sys = uplus (sys) + + if (nargin != 1) # prevent sys = uplus (sys1, sys2, sys3, ...) + error ("lti: uplus: this is an unary operator"); + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-21 07:17:01
|
Revision: 10649 http://octave.svn.sourceforge.net/octave/?rev=10649&view=rev Author: paramaniac Date: 2012-06-21 07:16:50 +0000 (Thu, 21 Jun 2012) Log Message: ----------- control: move completed functions into place Modified Paths: -------------- trunk/octave-forge/main/control/INDEX trunk/octave-forge/main/control/NEWS Added Paths: ----------- trunk/octave-forge/main/control/inst/dlqe.m trunk/octave-forge/main/control/inst/lqe.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/dlqe.m trunk/octave-forge/main/control/devel/lqe.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-06-21 07:08:29 UTC (rev 10648) +++ trunk/octave-forge/main/control/INDEX 2012-06-21 07:16:50 UTC (rev 10649) @@ -78,9 +78,11 @@ place rlocus Linear-Quadratic Control + dlqe dlqr estim kalman + lqe lqr Robust Control augw Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-06-21 07:08:29 UTC (rev 10648) +++ trunk/octave-forge/main/control/NEWS 2012-06-21 07:16:50 UTC (rev 10649) @@ -7,8 +7,12 @@ ** Fixed a silly mistake in MIMO transfer function to state-space conversion. The bug has been introduced with control-2.3.51. (Thanks to Jim Rawlings for providing the test case) - +** dlqe, lqe + Added new functions for linear quadratic estimators. + (Thanks to Megan Zagrobelny) + + =============================================================================== control-2.3.51 Release Date: 2012-06-03 Release Manager: Lukas Reichlin =============================================================================== Deleted: trunk/octave-forge/main/control/devel/dlqe.m =================================================================== --- trunk/octave-forge/main/control/devel/dlqe.m 2012-06-21 07:08:29 UTC (rev 10648) +++ trunk/octave-forge/main/control/devel/dlqe.m 2012-06-21 07:16:50 UTC (rev 10649) @@ -1,105 +0,0 @@ -## Copyright (C) 2012 Lukas F. Reichlin -## Copyright (C) 2012 Megan Zagrobelny -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) -## Kalman filter for discrete-time systems. -## -## @example -## @group -## x[k] = Ax[k] + Bu[k] + Gw[k] (State equation) -## y[k] = Cx[k] + Du[k] + v[k] (Measurement Equation) -## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S -## @end group -## @end example -## -## @strong{Inputs} -## @table @var -## @item sys -## Continuous or discrete-time LTI model (p-by-m, n states). -## @item a -## State transition matrix of discrete-time system (n-by-n). -## @item g -## Process noise matrix of discrete-time system (n-by-g). -## @item c -## Measurement matrix of discrete-time system (p-by-n). -## @item q -## Process noise covariance matrix (g-by-g). -## @item r -## Measurement noise covariance matrix (p-by-p). -## @item s -## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. -## @end table -## -## @strong{Outputs} -## @table @var -## @item l -## Kalman filter gain matrix (n-by-p). -## @item p -## Unique stabilizing solution of the discrete-time Riccati equation (n-by-n). -## @item z -## Error covariance (n-by-n), cov(x(k|k)-x) -## @item e -## Closed-loop poles (n-by-1). -## @end table -## -## @strong{Equations} -## @example -## @group -## x[k|k] = x[k|k-1] + L(y[k] - Cx[k|k-1] -Du[k]) -## -## x[k+1|k] = Ax[k|k] + Bu[k] for S=0 -## -## x[k+1|k] = Ax[k|k] + Bu[k] + G*S*(C*P*C' + R)^-1*(y[k] - C*x[k|k-1]) for non-zero S -## -## -## E = eig(A - A*L*C) for S=0 -## -## E = eig(A - A*L*C - G*S*(C*P*C' + Rv)^-1*C) for non-zero S -## -## @end group -## @end example -## @seealso{dare, care, dlqr, lqr, lqe} -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: April 2012 -## Version: 0.1 - -function [l, p, z, e] = dlqe (a, g, c, q, r, s = []) - - if (nargin < 5 || nargin > 6) - print_usage (); - endif - - if (isempty (g)) - [~, p, e] = dlqr (a.', c.', q, r, s); # dlqe (a, [], c, q, r, s), g=I - elseif (isempty (s)) - [~, p, e] = dlqr (a.', c.', g*q*g.', r); - else - [~, p, e] = dlqr (a.', c.', g*q*g.', r, g*s); - endif - - l = p*c.' / (c*p*c.' + r); - - z = p - l*c*p; - -endfunction Deleted: trunk/octave-forge/main/control/devel/lqe.m =================================================================== --- trunk/octave-forge/main/control/devel/lqe.m 2012-06-21 07:08:29 UTC (rev 10648) +++ trunk/octave-forge/main/control/devel/lqe.m 2012-06-21 07:16:50 UTC (rev 10649) @@ -1,100 +0,0 @@ -## Copyright (C) 2012 Lukas F. Reichlin -## Copyright (C) 2012 Megan Zagrobelny -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{sys}, @var{q}, @var{r}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{sys}, @var{q}, @var{r}, @var{s}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) -## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) -## Kalman filter for continuous-time systems. -## -## @example -## @group -## . -## x = Ax + Bu + Gw (State equation) -## y = Cx + Du + v (Measurement Equation) -## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S -## @end group -## @end example -## -## @strong{Inputs} -## @table @var -## @item sys -## Continuous or discrete-time LTI model (p-by-m, n states). -## @item a -## State transition matrix of continuous-time system (n-by-n). -## @item g -## Process noise matrix of continuous-time system (n-by-g). -## @item c -## Measurement matrix of continuous-time system (p-by-n). -## @item q -## Process noise covariance matrix (g-by-g). -## @item r -## Measurement noise covariance matrix (p-by-p). -## @item s -## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. -## @end table -## -## @strong{Outputs} -## @table @var -## @item l -## Kalman filter gain matrix (n-by-p). -## @item p -## Unique stabilizing solution of the continuous-time Riccati equation (n-by-n). -## @item e -## Closed-loop poles (n-by-1). -## @end table -## -## @strong{Equations} -## @example -## @group -## . -## x = Ax + Bu + L(y - Cx -Du) -## -## E = eig(A - L*C) -## -## @end group -## @end example -## @seealso{dare, care, dlqr, lqr, dlqe} -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: April 2012 -## Version: 0.1 - -function [l, p, e] = lqe (a, g, c, q = [], r = [], s = []) - - if (nargin < 3 || nargin > 6) - print_usage (); - endif - - if (isa (a, "lti")) - [l, p, e] = lqr (a.', g, c, q); # lqe (sys, q, r, s), g=I, works like lqr (sys.', q, r, s).' - elseif (isempty (g)) - [l, p, e] = lqr (a.', c.', q, r, s); # lqe (a, [], c, q, r, s), g=I, works like lqr (a.', c.', q, r, s).' - elseif (isempty (s)) - [l, p, e] = lqr (a.', c.', g*q*g.', r); - else - [l, p, e] = lqr (a.', c.', g*q*g.', r, g*s); - endif - - l = l.'; - -endfunction Copied: trunk/octave-forge/main/control/inst/dlqe.m (from rev 10648, trunk/octave-forge/main/control/devel/dlqe.m) =================================================================== --- trunk/octave-forge/main/control/inst/dlqe.m (rev 0) +++ trunk/octave-forge/main/control/inst/dlqe.m 2012-06-21 07:16:50 UTC (rev 10649) @@ -0,0 +1,105 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## Copyright (C) 2012 Megan Zagrobelny +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) +## Kalman filter for discrete-time systems. +## +## @example +## @group +## x[k] = Ax[k] + Bu[k] + Gw[k] (State equation) +## y[k] = Cx[k] + Du[k] + v[k] (Measurement Equation) +## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S +## @end group +## @end example +## +## @strong{Inputs} +## @table @var +## @item sys +## Continuous or discrete-time LTI model (p-by-m, n states). +## @item a +## State transition matrix of discrete-time system (n-by-n). +## @item g +## Process noise matrix of discrete-time system (n-by-g). +## @item c +## Measurement matrix of discrete-time system (p-by-n). +## @item q +## Process noise covariance matrix (g-by-g). +## @item r +## Measurement noise covariance matrix (p-by-p). +## @item s +## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. +## @end table +## +## @strong{Outputs} +## @table @var +## @item l +## Kalman filter gain matrix (n-by-p). +## @item p +## Unique stabilizing solution of the discrete-time Riccati equation (n-by-n). +## @item z +## Error covariance (n-by-n), cov(x(k|k)-x) +## @item e +## Closed-loop poles (n-by-1). +## @end table +## +## @strong{Equations} +## @example +## @group +## x[k|k] = x[k|k-1] + L(y[k] - Cx[k|k-1] -Du[k]) +## +## x[k+1|k] = Ax[k|k] + Bu[k] for S=0 +## +## x[k+1|k] = Ax[k|k] + Bu[k] + G*S*(C*P*C' + R)^-1*(y[k] - C*x[k|k-1]) for non-zero S +## +## +## E = eig(A - A*L*C) for S=0 +## +## E = eig(A - A*L*C - G*S*(C*P*C' + Rv)^-1*C) for non-zero S +## +## @end group +## @end example +## @seealso{dare, care, dlqr, lqr, lqe} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + +function [l, p, z, e] = dlqe (a, g, c, q, r, s = []) + + if (nargin < 5 || nargin > 6) + print_usage (); + endif + + if (isempty (g)) + [~, p, e] = dlqr (a.', c.', q, r, s); # dlqe (a, [], c, q, r, s), g=I + elseif (isempty (s)) + [~, p, e] = dlqr (a.', c.', g*q*g.', r); + else + [~, p, e] = dlqr (a.', c.', g*q*g.', r, g*s); + endif + + l = p*c.' / (c*p*c.' + r); + + z = p - l*c*p; + +endfunction Copied: trunk/octave-forge/main/control/inst/lqe.m (from rev 10648, trunk/octave-forge/main/control/devel/lqe.m) =================================================================== --- trunk/octave-forge/main/control/inst/lqe.m (rev 0) +++ trunk/octave-forge/main/control/inst/lqe.m 2012-06-21 07:16:50 UTC (rev 10649) @@ -0,0 +1,100 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## Copyright (C) 2012 Megan Zagrobelny +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{sys}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{sys}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) +## Kalman filter for continuous-time systems. +## +## @example +## @group +## . +## x = Ax + Bu + Gw (State equation) +## y = Cx + Du + v (Measurement Equation) +## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S +## @end group +## @end example +## +## @strong{Inputs} +## @table @var +## @item sys +## Continuous or discrete-time LTI model (p-by-m, n states). +## @item a +## State transition matrix of continuous-time system (n-by-n). +## @item g +## Process noise matrix of continuous-time system (n-by-g). +## @item c +## Measurement matrix of continuous-time system (p-by-n). +## @item q +## Process noise covariance matrix (g-by-g). +## @item r +## Measurement noise covariance matrix (p-by-p). +## @item s +## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. +## @end table +## +## @strong{Outputs} +## @table @var +## @item l +## Kalman filter gain matrix (n-by-p). +## @item p +## Unique stabilizing solution of the continuous-time Riccati equation (n-by-n). +## @item e +## Closed-loop poles (n-by-1). +## @end table +## +## @strong{Equations} +## @example +## @group +## . +## x = Ax + Bu + L(y - Cx -Du) +## +## E = eig(A - L*C) +## +## @end group +## @end example +## @seealso{dare, care, dlqr, lqr, dlqe} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + +function [l, p, e] = lqe (a, g, c, q = [], r = [], s = []) + + if (nargin < 3 || nargin > 6) + print_usage (); + endif + + if (isa (a, "lti")) + [l, p, e] = lqr (a.', g, c, q); # lqe (sys, q, r, s), g=I, works like lqr (sys.', q, r, s).' + elseif (isempty (g)) + [l, p, e] = lqr (a.', c.', q, r, s); # lqe (a, [], c, q, r, s), g=I, works like lqr (a.', c.', q, r, s).' + elseif (isempty (s)) + [l, p, e] = lqr (a.', c.', g*q*g.', r); + else + [l, p, e] = lqr (a.', c.', g*q*g.', r, g*s); + endif + + l = l.'; + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |