From: <par...@us...> - 2010-10-05 07:44:59
|
Revision: 7803 http://octave.svn.sourceforge.net/octave/?rev=7803&view=rev Author: paramaniac Date: 2010-10-05 07:44:52 +0000 (Tue, 05 Oct 2010) Log Message: ----------- control: add compatibility notes Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_chol.m trunk/octave-forge/main/control/devel/makefile_h2syn.m trunk/octave-forge/main/control/devel/makefile_hankel.m trunk/octave-forge/main/control/devel/makefile_hinfsyn.m trunk/octave-forge/main/control/devel/makefile_lqr.m trunk/octave-forge/main/control/devel/makefile_lyap.m trunk/octave-forge/main/control/devel/makefile_minreal.m trunk/octave-forge/main/control/devel/makefile_norm.m trunk/octave-forge/main/control/devel/makefile_place.m trunk/octave-forge/main/control/devel/makefile_staircase.m trunk/octave-forge/main/control/devel/makefile_zero.m Modified: trunk/octave-forge/main/control/devel/makefile_chol.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_chol.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_chol.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_h2syn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_h2syn.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_h2syn.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_hankel.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hankel.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_hankel.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_hinfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_lqr.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lqr.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_lqr.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_lyap.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lyap.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_lyap.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_minreal.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_minreal.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_norm.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_norm.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_norm.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_place.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_place.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_place.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_staircase.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_staircase.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_staircase.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); Modified: trunk/octave-forge/main/control/devel/makefile_zero.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_zero.m 2010-10-05 06:29:05 UTC (rev 7802) +++ trunk/octave-forge/main/control/devel/makefile_zero.m 2010-10-05 07:44:52 UTC (rev 7803) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-05 20:23:55
|
Revision: 7804 http://octave.svn.sourceforge.net/octave/?rev=7804&view=rev Author: paramaniac Date: 2010-10-05 20:23:48 +0000 (Tue, 05 Oct 2010) Log Message: ----------- control: add documentation Added Paths: ----------- trunk/octave-forge/main/control/devel/INFO trunk/octave-forge/main/control/devel/PROJECTS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE Added: trunk/octave-forge/main/control/devel/INFO =================================================================== --- trunk/octave-forge/main/control/devel/INFO (rev 0) +++ trunk/octave-forge/main/control/devel/INFO 2010-10-05 20:23:48 UTC (rev 7804) @@ -0,0 +1,3 @@ +With the current Makefile, the folder "devel" and its content +is ignored by "pkg install". The folder is intended for draft +code and other stuff which is not suitable for "normal" users. \ No newline at end of file Added: trunk/octave-forge/main/control/devel/PROJECTS =================================================================== --- trunk/octave-forge/main/control/devel/PROJECTS (rev 0) +++ trunk/octave-forge/main/control/devel/PROJECTS 2010-10-05 20:23:48 UTC (rev 7804) @@ -0,0 +1,80 @@ +<html> +<pre> +Control PROJECTS -*- text -*- +================ + +grep FIXME and/or TODO for more information + + +------- +General: +------- + + * Multiplot feature for time and frequency response functions. + sigma (sys1, sys2, ...), step (sys1, "b", sys2, "r", ...) + + * Improve c2d, e.g. "tustin" option. + + * Implement d2c. + + * Improve @lti/subsasgn.m + + * Improve @lti/parallel.m + + * n-th order approximation of time delay exp (tau*s) + sys = pade (tau, n) + + * Implement frd models (easy) and adapt __frequency_response__.m + + * Implement zpk models (harder) and @zpset similar to @tfpoly. + + * SLICOT model and controller reduction. Separate control-reduction package? + + * SLICOT system identification. Separate control-identification package? + +------------------ +State-Space Models: +------------------ + + * Fix poles of descriptor models (@ss/__pole__.m) + + * Fix gain of descriptor models (slag08bd.cc) + + * Scaling: TB01ID/TD (ss) and TG01AD (dss) ? + + * Balancing: TB01TD ? + + * Use SLICOT for @ss/__sys2tf__.m + + * Prescaling for __freqresp__.m ? + +------------------------ +Transfer Function Models: +------------------------ + + * Support "z^-1" as tfvar (@tf and @tfpoly) + + * MIMO tf interconnections (@tf/__sys_connect__.m) + + * Use SLICOT for tf2ss conversion (@tf/__sys2ss__.m) + + * Implement c2d conversion (@tf/__c2d__.m) + +------ +Always: +------ + + * Squash bugs. + + * Write/improve documentation. If you implement a feature without documentation, + nobody besides you will ever use it! Don't waste your time :-) + + * Add tests. + + * Test the control package on different platforms. + + * Compare results to those from other free and non-free implementations of an + Octave-like language. + +</pre> +</html> \ No newline at end of file Added: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE (rev 0) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2010-10-05 20:23:48 UTC (rev 7804) @@ -0,0 +1,47 @@ +===================================================================================== +Prepare control-2.0 Package for Release +===================================================================================== +USAGE: * update version number in the commands below + * copy-paste entire block at once to the terminal + * <http://octave.sourceforge.net/developers.html> + +TODO: * create a nice shell script for this task +===================================================================================== + +cd +mkdir ~/octave/__TEMP__ +cd +svn export control ~/octave/__TEMP__/control +rm -R ~/octave/__TEMP__/control/devel +cd ~/octave/__TEMP__ +grep -i version control/DESCRIPTION +tar czf control-2.0.0.tar.gz control/ +md5 control-2.0.0.tar.gz +md5 control-2.0.0.tar.gz > md5_control_pkg.txt +uuencode control-2.0.0.tar.gz < control-2.0.0.tar.gz > control-2.0.0.tar.gz.uue +octave -q --eval \ +"pkg install control-2.0.0.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 +md5 control-html.tar.gz +md5 control-html.tar.gz > md5_control_html.txt +uuencode control-html.tar.gz < control-html.tar.gz > control-html.tar.gz.uue + + +===================================================================================== +Aftermath +===================================================================================== + +rm -R ~/octave/__TEMP__ +rm -R ~/octave/control-2.0.0 + + +===================================================================================== +Clean up after makefile_*.m +===================================================================================== + +rm ~/control/src/*.o + + +===================================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-08 22:17:26
|
Revision: 7818 http://octave.svn.sourceforge.net/octave/?rev=7818&view=rev Author: paramaniac Date: 2010-10-08 22:17:19 +0000 (Fri, 08 Oct 2010) Log Message: ----------- control: add FRD models in a very early development stage Added Paths: ----------- trunk/octave-forge/main/control/devel/@frd/ trunk/octave-forge/main/control/devel/@frd/display.m trunk/octave-forge/main/control/devel/@frd/frd.m trunk/octave-forge/main/control/devel/__frd_dim__.m trunk/octave-forge/main/control/devel/frd_test.m Added: trunk/octave-forge/main/control/devel/@frd/display.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/display.m (rev 0) +++ trunk/octave-forge/main/control/devel/@frd/display.m 2010-10-08 22:17:19 UTC (rev 7818) @@ -0,0 +1,49 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Display routine for SS objects. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: February 2010 +## Version: 0.1 + +function display (sys) + + [inname, outname, tsam] = __lti_data__ (sys.lti); + + [inname, m] = __labels__ (inname, "u"); + [outname, p] = __labels__ (outname, "y"); + + disp (""); + + disp (["Frequency response """, inputname(1), """ from input "]); + + sys.H + sys.w + + display (sys.lti); # display sampling time + + if (tsam == -1) + disp ("Static gain."); + elseif (tsam == 0) + disp ("Continuous-time model."); + else + disp ("Discrete-time model."); + endif + +endfunction Added: trunk/octave-forge/main/control/devel/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/frd.m (rev 0) +++ trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-08 22:17:19 UTC (rev 7818) @@ -0,0 +1,93 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{sys} =} frd (@var{sys}, @var{w}) +## @deftypefnx {Function File} {@var{sys} =} frd (@var{H}, @var{w}) +## @deftypefnx {Function File} {@var{sys} =} frd (@var{H}, @var{w}, @var{tsam}) +## Create or convert to frequency response data. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: February 2010 +## Version: 0.1 + +function sys = frd (H = [], w = [], varargin) + + ## model precedence: frd > ss > zpk > tf > double + superiorto ("ss", "zpk", "tf", "double"); + + argc = 0; + + switch (nargin) + case 0 + tsam = -1; + + case 1 + if (isa (H, "frd")) # already in frd form + sys = H; + return; + else + print_usage (); + endif + + case 2 + if (isa (H, "lti")) # another lti object + [sys, alti] = __sys2frd__ (H, w); + sys.lti = alti; # preserve lti properties + return; + else # sys = frd (H, w) + tsam = 0; + endif + + otherwise # default case + argc = numel (varargin); + + if (issample (varargin{1}, 1)) # sys = frd (H, w, tsam, "prop1, "val1", ...) + tsam = varargin{1}; + argc--; + if (argc > 0) + varargin = varargin(2:end); + endif + else # sys = frd (H, w, "prop1, "val1", ...) + tsam = 0; + endif + + endswitch + + if (ndims (H) != 3 && ! isempty (H)) + H = reshape (H, 1, 1, []); + elseif (isempty (H)) + H = zeros (0, 0, 0); + tsam = -1; + endif + + w = reshape (w, [], 1); + + [p, m] = __frd_dim__ (H, w); + + frdata = struct ("H", H, "w", w); + + ltisys = lti (p, m, tsam); + + sys = class (frdata, "frd", ltisys); + + if (argc > 0) + sys = set (sys, varargin{:}); + endif + +endfunction Added: trunk/octave-forge/main/control/devel/__frd_dim__.m =================================================================== --- trunk/octave-forge/main/control/devel/__frd_dim__.m (rev 0) +++ trunk/octave-forge/main/control/devel/__frd_dim__.m 2010-10-08 22:17:19 UTC (rev 7818) @@ -0,0 +1,49 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Number of outputs and inputs of transfer function numerator and +## denominator. For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: February 2010 +## Version: 0.1 + +function [p, m, l] = __frd_dim__ (H, w) + + if (! isnumeric (H)) # TODO: watch out for __set__ vector case + error ("frd: H must be a 3-dimensional numeric array"); + endif + + if (! isempty (w) && (! is_real_vector (w) || any (w < 0))) + error ("frd: w must be a vector of positive real numbers"); + endif + + if (isempty (H)) + p = m = l = 0; + else + [p, m, l] = size (H); + endif + + lw = length (w); + + if (l != lw) + error ("frd: H (%dx%dx%d) and w (%d) must have equal length", + p, m, l, lw); + endif + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/devel/frd_test.m =================================================================== --- trunk/octave-forge/main/control/devel/frd_test.m (rev 0) +++ trunk/octave-forge/main/control/devel/frd_test.m 2010-10-08 22:17:19 UTC (rev 7818) @@ -0,0 +1,9 @@ +sys = frd (1, 1) + +sys = frd (2+5i, 3, 0.1) + +sys = frd (ones (2, 3, 5), 1:5) + +frd + +frd ([], []) \ 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...> - 2010-10-08 19:53:23
|
Revision: 7817 http://octave.svn.sourceforge.net/octave/?rev=7817&view=rev Author: paramaniac Date: 2010-10-08 19:53:14 +0000 (Fri, 08 Oct 2010) Log Message: ----------- control: add draft code Added Paths: ----------- trunk/octave-forge/main/control/devel/ss2tf/ trunk/octave-forge/main/control/devel/ss2tf/MA02AD.f trunk/octave-forge/main/control/devel/ss2tf/MB01PD.f trunk/octave-forge/main/control/devel/ss2tf/MB01QD.f trunk/octave-forge/main/control/devel/ss2tf/MB02RD.f trunk/octave-forge/main/control/devel/ss2tf/MB02SD.f trunk/octave-forge/main/control/devel/ss2tf/MC01PD.f trunk/octave-forge/main/control/devel/ss2tf/MC01PY.f trunk/octave-forge/main/control/devel/ss2tf/TB01ID.f trunk/octave-forge/main/control/devel/ss2tf/TB01ZD.f trunk/octave-forge/main/control/devel/ss2tf/TB04BD.dat trunk/octave-forge/main/control/devel/ss2tf/TB04BD.f trunk/octave-forge/main/control/devel/ss2tf/TB04BD.html trunk/octave-forge/main/control/devel/ss2tf/TB04BD.res trunk/octave-forge/main/control/devel/ss2tf/TB04BX.f trunk/octave-forge/main/control/devel/ss2tf/common.cc trunk/octave-forge/main/control/devel/ss2tf/makefile_ss2tf.m trunk/octave-forge/main/control/devel/ss2tf/sltb04bd.cc trunk/octave-forge/main/control/devel/ss2tf/test_ss2tf.m Added: trunk/octave-forge/main/control/devel/ss2tf/MA02AD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MA02AD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MA02AD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,108 @@ + SUBROUTINE MA02AD( JOB, M, N, A, LDA, B, LDB ) +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 transpose all or part of a two-dimensional matrix A into +C another matrix B. +C +C ARGUMENTS +C +C Mode Parameters +C +C JOB CHARACTER*1 +C Specifies the part of the matrix A to be transposed into B +C as follows: +C = 'U': Upper triangular part; +C = 'L': Lower triangular part; +C Otherwise: All of the matrix A. +C +C Input/Output Parameters +C +C M (input) INTEGER +C The number of rows of the matrix A. M >= 0. +C +C N (input) INTEGER +C The number of columns of the matrix A. N >= 0. +C +C A (input) DOUBLE PRECISION array, dimension (LDA,N) +C The m-by-n matrix A. If JOB = 'U', only the upper +C triangle or trapezoid is accessed; if JOB = 'L', only the +C lower triangle or trapezoid is accessed. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,M). +C +C B (output) DOUBLE PRECISION array, dimension (LDB,M) +C B = A' in the locations specified by JOB. +C +C LDB INTEGER +C The leading dimension of the array B. LDB >= max(1,N). +C +C CONTRIBUTOR +C +C A. Varga, German Aerospace Center, +C DLR Oberpfaffenhofen, March 1998. +C Based on the RASP routine DMTRA. +C +C REVISIONS +C +C - +C +C ****************************************************************** +C +C .. Scalar Arguments .. + CHARACTER JOB + INTEGER LDA, LDB, M, N +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), B(LDB,*) +C .. Local Scalars .. + INTEGER I, J +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. Intrinsic Functions .. + INTRINSIC MIN +C +C .. Executable Statements .. +C + IF( LSAME( JOB, 'U' ) ) THEN + DO 20 J = 1, N + DO 10 I = 1, MIN( J, M ) + B(J,I) = A(I,J) + 10 CONTINUE + 20 CONTINUE + ELSE IF( LSAME( JOB, 'L' ) ) THEN + DO 40 J = 1, N + DO 30 I = J, M + B(J,I) = A(I,J) + 30 CONTINUE + 40 CONTINUE + ELSE + DO 60 J = 1, N + DO 50 I = 1, M + B(J,I) = A(I,J) + 50 CONTINUE + 60 CONTINUE + END IF +C + RETURN +C *** Last line of MA02AD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MB01PD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MB01PD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MB01PD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,271 @@ + SUBROUTINE MB01PD( SCUN, TYPE, M, N, KL, KU, ANRM, NBL, NROWS, A, + $ LDA, INFO ) +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 scale a matrix or undo scaling. Scaling is performed, if +C necessary, so that the matrix norm will be in a safe range of +C representable numbers. +C +C ARGUMENTS +C +C Mode Parameters +C +C SCUN CHARACTER*1 +C SCUN indicates the operation to be performed. +C = 'S': scale the matrix. +C = 'U': undo scaling of the matrix. +C +C TYPE CHARACTER*1 +C TYPE indicates the storage type of the input matrix. +C = 'G': A is a full matrix. +C = 'L': A is a (block) lower triangular matrix. +C = 'U': A is an (block) upper triangular matrix. +C = 'H': A is an (block) upper Hessenberg matrix. +C = 'B': A is a symmetric band matrix with lower bandwidth +C KL and upper bandwidth KU and with the only the +C lower half stored. +C = 'Q': A is a symmetric band matrix with lower bandwidth +C KL and upper bandwidth KU and with the only the +C upper half stored. +C = 'Z': A is a band matrix with lower bandwidth KL and +C upper bandwidth KU. +C +C Input/Output Parameters +C +C M (input) INTEGER +C The number of rows of the matrix A. M >= 0. +C +C N (input) INTEGER +C The number of columns of the matrix A. N >= 0. +C +C KL (input) INTEGER +C The lower bandwidth of A. Referenced only if TYPE = 'B', +C 'Q' or 'Z'. +C +C KU (input) INTEGER +C The upper bandwidth of A. Referenced only if TYPE = 'B', +C 'Q' or 'Z'. +C +C ANRM (input) DOUBLE PRECISION +C The norm of the initial matrix A. ANRM >= 0. +C When ANRM = 0 then an immediate return is effected. +C ANRM should be preserved between the call of the routine +C with SCUN = 'S' and the corresponding one with SCUN = 'U'. +C +C NBL (input) INTEGER +C The number of diagonal blocks of the matrix A, if it has a +C block structure. To specify that matrix A has no block +C structure, set NBL = 0. NBL >= 0. +C +C NROWS (input) INTEGER array, dimension max(1,NBL) +C NROWS(i) contains the number of rows and columns of the +C i-th diagonal block of matrix A. The sum of the values +C NROWS(i), for i = 1: NBL, should be equal to min(M,N). +C The elements of the array NROWS are not referenced if +C NBL = 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading M by N part of this array must +C contain the matrix to be scaled/unscaled. +C On exit, the leading M by N part of A will contain +C the modified matrix. +C The storage mode of A is specified by TYPE. +C +C LDA (input) INTEGER +C The leading dimension of the array A. LDA >= max(1,M). +C +C Error Indicator +C +C INFO (output) INTEGER +C = 0: successful exit +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C Denote by ANRM the norm of the matrix, and by SMLNUM and BIGNUM, +C two positive numbers near the smallest and largest safely +C representable numbers, respectively. The matrix is scaled, if +C needed, such that the norm of the result is in the range +C [SMLNUM, BIGNUM]. The scaling factor is represented as a ratio +C of two numbers, one of them being ANRM, and the other one either +C SMLNUM or BIGNUM, depending on ANRM being less than SMLNUM or +C larger than BIGNUM, respectively. For undoing the scaling, the +C norm is again compared with SMLNUM or BIGNUM, and the reciprocal +C of the previous scaling factor is used. +C +C CONTRIBUTOR +C +C V. Sima, Katholieke Univ. Leuven, Belgium, Nov. 1996. +C +C REVISIONS +C +C Oct. 2001, V. Sima, Research Institute for Informatics, Bucharest. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + CHARACTER SCUN, TYPE + INTEGER INFO, KL, KU, LDA, M, MN, N, NBL + DOUBLE PRECISION ANRM +C .. Array Arguments .. + INTEGER NROWS ( * ) + DOUBLE PRECISION A( LDA, * ) +C .. Local Scalars .. + LOGICAL FIRST, LSCALE + INTEGER I, ISUM, ITYPE + DOUBLE PRECISION BIGNUM, SMLNUM +C .. External Functions .. + LOGICAL LSAME + DOUBLE PRECISION DLAMCH + EXTERNAL DLAMCH, LSAME +C .. +C .. External Subroutines .. + EXTERNAL DLABAD, MB01QD, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX, MIN +C .. Save statement .. + SAVE BIGNUM, FIRST, SMLNUM +C .. Data statements .. + DATA FIRST/.TRUE./ +C .. +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + INFO = 0 + LSCALE = LSAME( SCUN, 'S' ) + IF( LSAME( TYPE, 'G' ) ) THEN + ITYPE = 0 + ELSE IF( LSAME( TYPE, 'L' ) ) THEN + ITYPE = 1 + ELSE IF( LSAME( TYPE, 'U' ) ) THEN + ITYPE = 2 + ELSE IF( LSAME( TYPE, 'H' ) ) THEN + ITYPE = 3 + ELSE IF( LSAME( TYPE, 'B' ) ) THEN + ITYPE = 4 + ELSE IF( LSAME( TYPE, 'Q' ) ) THEN + ITYPE = 5 + ELSE IF( LSAME( TYPE, 'Z' ) ) THEN + ITYPE = 6 + ELSE + ITYPE = -1 + END IF +C + MN = MIN( M, N ) +C + ISUM = 0 + IF( NBL.GT.0 ) THEN + DO 10 I = 1, NBL + ISUM = ISUM + NROWS(I) + 10 CONTINUE + END IF +C + IF( .NOT.LSCALE .AND. .NOT.LSAME( SCUN, 'U' ) ) THEN + INFO = -1 + ELSE IF( ITYPE.EQ.-1 ) THEN + INFO = -2 + ELSE IF( M.LT.0 ) THEN + INFO = -3 + ELSE IF( N.LT.0 .OR. + $ ( ( ITYPE.EQ.4 .OR. ITYPE.EQ.5 ) .AND. N.NE.M ) ) THEN + INFO = -4 + ELSE IF( ANRM.LT.ZERO ) THEN + INFO = -7 + ELSE IF( NBL.LT.0 ) THEN + INFO = -8 + ELSE IF( NBL.GT.0 .AND. ISUM.NE.MN ) THEN + INFO = -9 + ELSE IF( ITYPE.LE.3 .AND. LDA.LT.MAX( 1, M ) ) THEN + INFO = -11 + ELSE IF( ITYPE.GE.4 ) THEN + IF( KL.LT.0 .OR. KL.GT.MAX( M-1, 0 ) ) THEN + INFO = -5 + ELSE IF( KU.LT.0 .OR. KU.GT.MAX( N-1, 0 ) .OR. + $ ( ( ITYPE.EQ.4 .OR. ITYPE.EQ.5 ) .AND. KL.NE.KU ) ) + $ THEN + INFO = -6 + ELSE IF( ( ITYPE.EQ.4 .AND. LDA.LT.KL+1 ) .OR. + $ ( ITYPE.EQ.5 .AND. LDA.LT.KU+1 ) .OR. + $ ( ITYPE.EQ.6 .AND. LDA.LT.2*KL+KU+1 ) ) THEN + INFO = -11 + END IF + END IF +C + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'MB01PD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF( MN.EQ.0 .OR. ANRM.EQ.ZERO ) + $ RETURN +C + IF ( FIRST ) THEN +C +C Get machine parameters. +C + SMLNUM = DLAMCH( 'S' ) / DLAMCH( 'P' ) + BIGNUM = ONE / SMLNUM + CALL DLABAD( SMLNUM, BIGNUM ) + FIRST = .FALSE. + END IF +C + IF ( LSCALE ) THEN +C +C Scale A, if its norm is outside range [SMLNUM,BIGNUM]. +C + IF( ANRM.LT.SMLNUM ) THEN +C +C Scale matrix norm up to SMLNUM. +C + CALL MB01QD( TYPE, M, N, KL, KU, ANRM, SMLNUM, NBL, NROWS, + $ A, LDA, INFO ) + ELSE IF( ANRM.GT.BIGNUM ) THEN +C +C Scale matrix norm down to BIGNUM. +C + CALL MB01QD( TYPE, M, N, KL, KU, ANRM, BIGNUM, NBL, NROWS, + $ A, LDA, INFO ) + END IF +C + ELSE +C +C Undo scaling. +C + IF( ANRM.LT.SMLNUM ) THEN + CALL MB01QD( TYPE, M, N, KL, KU, SMLNUM, ANRM, NBL, NROWS, + $ A, LDA, INFO ) + ELSE IF( ANRM.GT.BIGNUM ) THEN + CALL MB01QD( TYPE, M, N, KL, KU, BIGNUM, ANRM, NBL, NROWS, + $ A, LDA, INFO ) + END IF + END IF +C + RETURN +C *** Last line of MB01PD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MB01QD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MB01QD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MB01QD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,334 @@ + SUBROUTINE MB01QD( TYPE, M, N, KL, KU, CFROM, CTO, NBL, NROWS, A, + $ LDA, INFO ) +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 multiply the M by N real matrix A by the real scalar CTO/CFROM. +C This is done without over/underflow as long as the final result +C CTO*A(I,J)/CFROM does not over/underflow. TYPE specifies that +C A may be full, (block) upper triangular, (block) lower triangular, +C (block) upper Hessenberg, or banded. +C +C ARGUMENTS +C +C Mode Parameters +C +C TYPE CHARACTER*1 +C TYPE indices the storage type of the input matrix. +C = 'G': A is a full matrix. +C = 'L': A is a (block) lower triangular matrix. +C = 'U': A is a (block) upper triangular matrix. +C = 'H': A is a (block) upper Hessenberg matrix. +C = 'B': A is a symmetric band matrix with lower bandwidth +C KL and upper bandwidth KU and with the only the +C lower half stored. +C = 'Q': A is a symmetric band matrix with lower bandwidth +C KL and upper bandwidth KU and with the only the +C upper half stored. +C = 'Z': A is a band matrix with lower bandwidth KL and +C upper bandwidth KU. +C +C Input/Output Parameters +C +C M (input) INTEGER +C The number of rows of the matrix A. M >= 0. +C +C N (input) INTEGER +C The number of columns of the matrix A. N >= 0. +C +C KL (input) INTEGER +C The lower bandwidth of A. Referenced only if TYPE = 'B', +C 'Q' or 'Z'. +C +C KU (input) INTEGER +C The upper bandwidth of A. Referenced only if TYPE = 'B', +C 'Q' or 'Z'. +C +C CFROM (input) DOUBLE PRECISION +C CTO (input) DOUBLE PRECISION +C The matrix A is multiplied by CTO/CFROM. A(I,J) is +C computed without over/underflow if the final result +C CTO*A(I,J)/CFROM can be represented without over/ +C underflow. CFROM must be nonzero. +C +C NBL (input) INTEGER +C The number of diagonal blocks of the matrix A, if it has a +C block structure. To specify that matrix A has no block +C structure, set NBL = 0. NBL >= 0. +C +C NROWS (input) INTEGER array, dimension max(1,NBL) +C NROWS(i) contains the number of rows and columns of the +C i-th diagonal block of matrix A. The sum of the values +C NROWS(i), for i = 1: NBL, should be equal to min(M,N). +C The array NROWS is not referenced if NBL = 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C The matrix to be multiplied by CTO/CFROM. See TYPE for +C the storage type. +C +C LDA (input) INTEGER +C The leading dimension of the array A. LDA >= max(1,M). +C +C Error Indicator +C +C INFO INTEGER +C Not used in this implementation. +C +C METHOD +C +C Matrix A is multiplied by the real scalar CTO/CFROM, taking into +C account the specified storage mode of the matrix. +C MB01QD is a version of the LAPACK routine DLASCL, modified for +C dealing with block triangular, or block Hessenberg matrices. +C For efficiency, no tests of the input scalar parameters are +C performed. +C +C CONTRIBUTOR +C +C V. Sima, Katholieke Univ. Leuven, Belgium, Nov. 1996. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. +C .. Scalar Arguments .. + CHARACTER TYPE + INTEGER INFO, KL, KU, LDA, M, N, NBL + DOUBLE PRECISION CFROM, CTO +C .. +C .. Array Arguments .. + INTEGER NROWS ( * ) + DOUBLE PRECISION A( LDA, * ) +C .. +C .. Local Scalars .. + LOGICAL DONE, NOBLC + INTEGER I, IFIN, ITYPE, J, JFIN, JINI, K, K1, K2, K3, + $ K4 + DOUBLE PRECISION BIGNUM, CFROM1, CFROMC, CTO1, CTOC, MUL, SMLNUM +C .. +C .. External Functions .. + LOGICAL LSAME + DOUBLE PRECISION DLAMCH + EXTERNAL LSAME, DLAMCH +C .. +C .. Intrinsic Functions .. + INTRINSIC ABS, MAX, MIN +C .. +C .. Executable Statements .. +C + IF( LSAME( TYPE, 'G' ) ) THEN + ITYPE = 0 + ELSE IF( LSAME( TYPE, 'L' ) ) THEN + ITYPE = 1 + ELSE IF( LSAME( TYPE, 'U' ) ) THEN + ITYPE = 2 + ELSE IF( LSAME( TYPE, 'H' ) ) THEN + ITYPE = 3 + ELSE IF( LSAME( TYPE, 'B' ) ) THEN + ITYPE = 4 + ELSE IF( LSAME( TYPE, 'Q' ) ) THEN + ITYPE = 5 + ELSE + ITYPE = 6 + END IF +C +C Quick return if possible. +C + IF( MIN( M, N ).EQ.0 ) + $ RETURN +C +C Get machine parameters. +C + SMLNUM = DLAMCH( 'S' ) + BIGNUM = ONE / SMLNUM +C + CFROMC = CFROM + CTOC = CTO +C + 10 CONTINUE + CFROM1 = CFROMC*SMLNUM + CTO1 = CTOC / BIGNUM + IF( ABS( CFROM1 ).GT.ABS( CTOC ) .AND. CTOC.NE.ZERO ) THEN + MUL = SMLNUM + DONE = .FALSE. + CFROMC = CFROM1 + ELSE IF( ABS( CTO1 ).GT.ABS( CFROMC ) ) THEN + MUL = BIGNUM + DONE = .FALSE. + CTOC = CTO1 + ELSE + MUL = CTOC / CFROMC + DONE = .TRUE. + END IF +C + NOBLC = NBL.EQ.0 +C + IF( ITYPE.EQ.0 ) THEN +C +C Full matrix +C + DO 30 J = 1, N + DO 20 I = 1, M + A( I, J ) = A( I, J )*MUL + 20 CONTINUE + 30 CONTINUE +C + ELSE IF( ITYPE.EQ.1 ) THEN +C + IF ( NOBLC ) THEN +C +C Lower triangular matrix +C + DO 50 J = 1, N + DO 40 I = J, M + A( I, J ) = A( I, J )*MUL + 40 CONTINUE + 50 CONTINUE +C + ELSE +C +C Block lower triangular matrix +C + JFIN = 0 + DO 80 K = 1, NBL + JINI = JFIN + 1 + JFIN = JFIN + NROWS( K ) + DO 70 J = JINI, JFIN + DO 60 I = JINI, M + A( I, J ) = A( I, J )*MUL + 60 CONTINUE + 70 CONTINUE + 80 CONTINUE + END IF +C + ELSE IF( ITYPE.EQ.2 ) THEN +C + IF ( NOBLC ) THEN +C +C Upper triangular matrix +C + DO 100 J = 1, N + DO 90 I = 1, MIN( J, M ) + A( I, J ) = A( I, J )*MUL + 90 CONTINUE + 100 CONTINUE +C + ELSE +C +C Block upper triangular matrix +C + JFIN = 0 + DO 130 K = 1, NBL + JINI = JFIN + 1 + JFIN = JFIN + NROWS( K ) + IF ( K.EQ.NBL ) JFIN = N + DO 120 J = JINI, JFIN + DO 110 I = 1, MIN( JFIN, M ) + A( I, J ) = A( I, J )*MUL + 110 CONTINUE + 120 CONTINUE + 130 CONTINUE + END IF +C + ELSE IF( ITYPE.EQ.3 ) THEN +C + IF ( NOBLC ) THEN +C +C Upper Hessenberg matrix +C + DO 150 J = 1, N + DO 140 I = 1, MIN( J+1, M ) + A( I, J ) = A( I, J )*MUL + 140 CONTINUE + 150 CONTINUE +C + ELSE +C +C Block upper Hessenberg matrix +C + JFIN = 0 + DO 180 K = 1, NBL + JINI = JFIN + 1 + JFIN = JFIN + NROWS( K ) +C + IF ( K.EQ.NBL ) THEN + JFIN = N + IFIN = N + ELSE + IFIN = JFIN + NROWS( K+1 ) + END IF +C + DO 170 J = JINI, JFIN + DO 160 I = 1, MIN( IFIN, M ) + A( I, J ) = A( I, J )*MUL + 160 CONTINUE + 170 CONTINUE + 180 CONTINUE + END IF +C + ELSE IF( ITYPE.EQ.4 ) THEN +C +C Lower half of a symmetric band matrix +C + K3 = KL + 1 + K4 = N + 1 + DO 200 J = 1, N + DO 190 I = 1, MIN( K3, K4-J ) + A( I, J ) = A( I, J )*MUL + 190 CONTINUE + 200 CONTINUE +C + ELSE IF( ITYPE.EQ.5 ) THEN +C +C Upper half of a symmetric band matrix +C + K1 = KU + 2 + K3 = KU + 1 + DO 220 J = 1, N + DO 210 I = MAX( K1-J, 1 ), K3 + A( I, J ) = A( I, J )*MUL + 210 CONTINUE + 220 CONTINUE +C + ELSE IF( ITYPE.EQ.6 ) THEN +C +C Band matrix +C + K1 = KL + KU + 2 + K2 = KL + 1 + K3 = 2*KL + KU + 1 + K4 = KL + KU + 1 + M + DO 240 J = 1, N + DO 230 I = MAX( K1-J, K2 ), MIN( K3, K4-J ) + A( I, J ) = A( I, J )*MUL + 230 CONTINUE + 240 CONTINUE +C + END IF +C + IF( .NOT.DONE ) + $ GO TO 10 +C + RETURN +C *** Last line of MB01QD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MB02RD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MB02RD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MB02RD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,197 @@ + SUBROUTINE MB02RD( TRANS, N, NRHS, H, LDH, IPIV, B, LDB, INFO ) +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 solve a system of linear equations +C H * X = B or H' * X = B +C with an upper Hessenberg N-by-N matrix H using the LU +C factorization computed by MB02SD. +C +C ARGUMENTS +C +C Mode Parameters +C +C TRANS CHARACTER*1 +C Specifies the form of the system of equations: +C = 'N': H * X = B (No transpose) +C = 'T': H'* X = B (Transpose) +C = 'C': H'* X = B (Conjugate transpose = Transpose) +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the matrix H. N >= 0. +C +C NRHS (input) INTEGER +C The number of right hand sides, i.e., the number of +C columns of the matrix B. NRHS >= 0. +C +C H (input) DOUBLE PRECISION array, dimension (LDH,N) +C The factors L and U from the factorization H = P*L*U +C as computed by MB02SD. +C +C LDH INTEGER +C The leading dimension of the array H. LDH >= max(1,N). +C +C IPIV (input) INTEGER array, dimension (N) +C The pivot indices from MB02SD; for 1<=i<=N, row i of the +C matrix was interchanged with row IPIV(i). +C +C B (input/output) DOUBLE PRECISION array, dimension +C (LDB,NRHS) +C On entry, the right hand side matrix B. +C On exit, the solution matrix X. +C +C LDB INTEGER +C The leading dimension of the array B. LDB >= max(1,N). +C +C Error Indicator +C +C INFO (output) INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C The routine uses the factorization +C H = P * L * U +C where P is a permutation matrix, L is lower triangular with unit +C diagonal elements (and one nonzero subdiagonal), and U is upper +C triangular. +C +C REFERENCES +C +C - +C +C NUMERICAL ASPECTS +C 2 +C The algorithm requires 0( N x NRHS ) operations. +C +C CONTRIBUTOR +C +C V. Sima, Katholieke Univ. Leuven, Belgium, June 1998. +C +C REVISIONS +C +C - +C +C KEYWORDS +C +C Hessenberg form, matrix algebra. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ONE + PARAMETER ( ONE = 1.0D+0 ) +C .. Scalar Arguments .. + CHARACTER TRANS + INTEGER INFO, LDB, LDH, N, NRHS +C .. +C .. Array Arguments .. + INTEGER IPIV( * ) + DOUBLE PRECISION B( LDB, * ), H( LDH, * ) +C .. Local Scalars .. + LOGICAL NOTRAN + INTEGER J, JP +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DAXPY, DSWAP, DTRSM, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX +C .. Executable Statements .. +C +C Test the input parameters. +C + INFO = 0 + NOTRAN = LSAME( TRANS, 'N' ) + IF( .NOT.NOTRAN .AND. .NOT.LSAME( TRANS, 'T' ) .AND. .NOT. + $ LSAME( TRANS, 'C' ) ) THEN + INFO = -1 + ELSE IF( N.LT.0 ) THEN + INFO = -2 + ELSE IF( NRHS.LT.0 ) THEN + INFO = -3 + ELSE IF( LDH.LT.MAX( 1, N ) ) THEN + INFO = -5 + ELSE IF( LDB.LT.MAX( 1, N ) ) THEN + INFO = -8 + END IF + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'MB02RD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF( N.EQ.0 .OR. NRHS.EQ.0 ) + $ RETURN +C + IF( NOTRAN ) THEN +C +C Solve H * X = B. +C +C Solve L * X = B, overwriting B with X. +C +C L is represented as a product of permutations and unit lower +C triangular matrices L = P(1) * L(1) * ... * P(n-1) * L(n-1), +C where each transformation L(i) is a rank-one modification of +C the identity matrix. +C + DO 10 J = 1, N - 1 + JP = IPIV( J ) + IF( JP.NE.J ) + $ CALL DSWAP( NRHS, B( JP, 1 ), LDB, B( J, 1 ), LDB ) + CALL DAXPY( NRHS, -H( J+1, J ), B( J, 1 ), LDB, B( J+1, 1 ), + $ LDB ) + 10 CONTINUE +C +C Solve U * X = B, overwriting B with X. +C + CALL DTRSM( 'Left', 'Upper', 'No transpose', 'Non-unit', N, + $ NRHS, ONE, H, LDH, B, LDB ) +C + ELSE +C +C Solve H' * X = B. +C +C Solve U' * X = B, overwriting B with X. +C + CALL DTRSM( 'Left', 'Upper', 'Transpose', 'Non-unit', N, NRHS, + $ ONE, H, LDH, B, LDB ) +C +C Solve L' * X = B, overwriting B with X. +C + DO 20 J = N - 1, 1, -1 + CALL DAXPY( NRHS, -H( J+1, J ), B( J+1, 1 ), LDB, B( J, 1 ), + $ LDB ) + JP = IPIV( J ) + IF( JP.NE.J ) + $ CALL DSWAP( NRHS, B( JP, 1 ), LDB, B( J, 1 ), LDB ) + 20 CONTINUE + END IF +C + RETURN +C *** Last line of MB02RD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MB02SD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MB02SD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MB02SD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,164 @@ + SUBROUTINE MB02SD( N, H, LDH, IPIV, INFO ) +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 an LU factorization of an n-by-n upper Hessenberg +C matrix H using partial pivoting with row interchanges. +C +C ARGUMENTS +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the matrix H. N >= 0. +C +C H (input/output) DOUBLE PRECISION array, dimension (LDH,N) +C On entry, the n-by-n upper Hessenberg matrix to be +C factored. +C On exit, the factors L and U from the factorization +C H = P*L*U; the unit diagonal elements of L are not stored, +C and L is lower bidiagonal. +C +C LDH INTEGER +C The leading dimension of the array H. LDH >= max(1,N). +C +C IPIV (output) INTEGER array, dimension (N) +C The pivot indices; for 1 <= i <= N, row i of the matrix +C was interchanged with row IPIV(i). +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value; +C > 0: if INFO = i, U(i,i) is exactly zero. The +C factorization has been completed, but the factor U +C is exactly singular, and division by zero will occur +C if it is used to solve a system of equations. +C +C METHOD +C +C The factorization has the form +C H = P * L * U +C where P is a permutation matrix, L is lower triangular with unit +C diagonal elements (and one nonzero subdiagonal), and U is upper +C triangular. +C +C This is the right-looking Level 1 BLAS version of the algorithm +C (adapted after DGETF2). +C +C REFERENCES +C +C - +C +C NUMERICAL ASPECTS +C 2 +C The algorithm requires 0( N ) operations. +C +C CONTRIBUTOR +C +C V. Sima, Katholieke Univ. Leuven, Belgium, June 1998. +C +C REVISIONS +C +C V. Sima, Research Institute for Informatics, Bucharest, Oct. 2000, +C Jan. 2005. +C +C KEYWORDS +C +C Hessenberg form, matrix algebra. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO + PARAMETER ( ZERO = 0.0D+0 ) +C .. Scalar Arguments .. + INTEGER INFO, LDH, N +C .. Array Arguments .. + INTEGER IPIV(*) + DOUBLE PRECISION H(LDH,*) +C .. Local Scalars .. + INTEGER J, JP +C .. External Subroutines .. + EXTERNAL DAXPY, DSWAP, XERBLA +C .. Intrinsic Functions .. + INTRINSIC ABS, MAX +C .. +C .. Executable Statements .. +C +C Check the scalar input parameters. +C + INFO = 0 + IF( N.LT.0 ) THEN + INFO = -1 + ELSE IF( LDH.LT.MAX( 1, N ) ) THEN + INFO = -3 + END IF + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'MB02SD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF( N.EQ.0 ) + $ RETURN +C + DO 10 J = 1, N +C +C Find pivot and test for singularity. +C + JP = J + IF ( J.LT.N ) THEN + IF ( ABS( H( J+1, J ) ).GT.ABS( H( J, J ) ) ) + $ JP = J + 1 + END IF + IPIV( J ) = JP + IF( H( JP, J ).NE.ZERO ) THEN +C +C Apply the interchange to columns J:N. +C + IF( JP.NE.J ) + $ CALL DSWAP( N-J+1, H( J, J ), LDH, H( JP, J ), LDH ) +C +C Compute element J+1 of J-th column. +C + IF( J.LT.N ) + $ H( J+1, J ) = H( J+1, J )/H( J, J ) +C + ELSE IF( INFO.EQ.0 ) THEN +C + INFO = J + END IF +C + IF( J.LT.N ) THEN +C +C Update trailing submatrix. +C + CALL DAXPY( N-J, -H( J+1, J ), H( J, J+1 ), LDH, + $ H( J+1, J+1 ), LDH ) + END IF + 10 CONTINUE + RETURN +C *** Last line of MB02SD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MC01PD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MC01PD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MC01PD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,159 @@ + SUBROUTINE MC01PD( K, REZ, IMZ, P, DWORK, INFO ) +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 coefficients of a real polynomial P(x) from its +C zeros. +C +C ARGUMENTS +C +C Input/Output Parameters +C +C K (input) INTEGER +C The number of zeros (and hence the degree) of P(x). +C K >= 0. +C +C REZ (input) DOUBLE PRECISION array, dimension (K) +C IMZ (input) DOUBLE PRECISION array, dimension (K) +C The real and imaginary parts of the i-th zero of P(x) +C must be stored in REZ(i) and IMZ(i), respectively, where +C i = 1, 2, ..., K. The zeros may be supplied in any order, +C except that complex conjugate zeros must appear +C consecutively. +C +C P (output) DOUBLE PRECISION array, dimension (K+1) +C This array contains the coefficients of P(x) in increasing +C powers of x. If K = 0, then P(1) is set to one. +C +C Workspace +C +C DWORK DOUBLE PRECISION array, dimension (K+1) +C If K = 0, this array is not referenced. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value; +C > 0: if INFO = i, (REZ(i),IMZ(i)) is a complex zero but +C (REZ(i-1),IMZ(i-1)) is not its conjugate. +C +C METHOD +C +C The routine computes the coefficients of the real K-th degree +C polynomial P(x) as +C +C P(x) = (x - r(1)) * (x - r(2)) * ... * (x - r(K)) +C +C where r(i) = (REZ(i),IMZ(i)). +C +C Note that REZ(i) = REZ(j) and IMZ(i) = -IMZ(j) if r(i) and r(j) +C form a complex conjugate pair (where i <> j), and that IMZ(i) = 0 +C if r(i) is real. +C +C NUMERICAL ASPECTS +C +C None. +C +C CONTRIBUTOR +C +C Release 3.0: V. Sima, Katholieke Univ. Leuven, Belgium, Mar. 1997. +C Supersedes Release 2.0 routine MC01DD by A.J. Geurts. +C +C REVISIONS +C +C V. Sima, May 2002. +C +C KEYWORDS +C +C Elementary polynomial operations, polynomial operations. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + INTEGER INFO, K +C .. Array Arguments .. + DOUBLE PRECISION DWORK(*), IMZ(*), P(*), REZ(*) +C .. Local Scalars .. + INTEGER I + DOUBLE PRECISION U, V +C .. External Subroutines .. + EXTERNAL DAXPY, DCOPY, XERBLA +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + IF( K.LT.0 ) THEN + INFO = -1 +C +C Error return. +C + CALL XERBLA( 'MC01PD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + INFO = 0 + P(1) = ONE + IF ( K.EQ.0 ) + $ RETURN +C + I = 1 +C WHILE ( I <= K ) DO + 20 IF ( I.LE.K ) THEN + U = REZ(I) + V = IMZ(I) + DWORK(1) = ZERO +C + IF ( V.EQ.ZERO ) THEN + CALL DCOPY( I, P, 1, DWORK(2), 1 ) + CALL DAXPY( I, -U, P, 1, DWORK, 1 ) + I = I + 1 +C + ELSE + IF ( I.EQ.K ) THEN + INFO = K + RETURN + ELSE IF ( ( U.NE.REZ(I+1) ) .OR. ( V.NE.-IMZ(I+1) ) ) THEN + INFO = I + 1 + RETURN + END IF +C + DWORK(2) = ZERO + CALL DCOPY( I, P, 1, DWORK(3), 1 ) + CALL DAXPY( I, -(U + U), P, 1, DWORK(2), 1 ) + CALL DAXPY( I, U**2+V**2, P, 1, DWORK, 1 ) + I = I + 2 + END IF +C + CALL DCOPY( I, DWORK, 1, P, 1 ) + GO TO 20 + END IF +C END WHILE 20 +C + RETURN +C *** Last line of MC01PD *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/MC01PY.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/MC01PY.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/MC01PY.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,157 @@ + SUBROUTINE MC01PY( K, REZ, IMZ, P, DWORK, INFO ) +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 coefficients of a real polynomial P(x) from its +C zeros. The coefficients are stored in decreasing order of the +C powers of x. +C +C ARGUMENTS +C +C Input/Output Parameters +C +C K (input) INTEGER +C The number of zeros (and hence the degree) of P(x). +C K >= 0. +C +C REZ (input) DOUBLE PRECISION array, dimension (K) +C IMZ (input) DOUBLE PRECISION array, dimension (K) +C The real and imaginary parts of the i-th zero of P(x) +C must be stored in REZ(i) and IMZ(i), respectively, where +C i = 1, 2, ..., K. The zeros may be supplied in any order, +C except that complex conjugate zeros must appear +C consecutively. +C +C P (output) DOUBLE PRECISION array, dimension (K+1) +C This array contains the coefficients of P(x) in decreasing +C powers of x. +C +C Workspace +C +C DWORK DOUBLE PRECISION array, dimension (K) +C If K = 0, this array is not referenced. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value; +C > 0: if INFO = i, (REZ(i),IMZ(i)) is a complex zero but +C (REZ(i-1),IMZ(i-1)) is not its conjugate. +C +C METHOD +C +C The routine computes the coefficients of the real K-th degree +C polynomial P(x) as +C +C P(x) = (x - r(1)) * (x - r(2)) * ... * (x - r(K)) +C +C where r(i) = (REZ(i),IMZ(i)). +C +C Note that REZ(i) = REZ(j) and IMZ(i) = -IMZ(j) if r(i) and r(j) +C form a complex conjugate pair (where i <> j), and that IMZ(i) = 0 +C if r(i) is real. +C +C NUMERICAL ASPECTS +C +C None. +C +C CONTRIBUTOR +C +C V. Sima, Research Institute for Informatics, Bucharest, May 2002. +C +C REVISIONS +C +C - +C +C KEYWORDS +C +C Elementary polynomial operations, polynomial operations. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + INTEGER INFO, K +C .. Array Arguments .. + DOUBLE PRECISION DWORK(*), IMZ(*), P(*), REZ(*) +C .. Local Scalars .. + INTEGER I + DOUBLE PRECISION U, V +C .. External Subroutines .. + EXTERNAL DAXPY, DCOPY, XERBLA +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + IF( K.LT.0 ) THEN + INFO = -1 +C +C Error return. +C + CALL XERBLA( 'MC01PY', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + INFO = 0 + P(1) = ONE + IF ( K.EQ.0 ) + $ RETURN +C + I = 1 +C WHILE ( I <= K ) DO + 20 IF ( I.LE.K ) THEN + U = REZ(I) + V = IMZ(I) + DWORK(I) = ZERO +C + IF ( V.EQ.ZERO ) THEN + CALL DAXPY( I, -U, P, 1, DWORK, 1 ) +C + ELSE + IF ( I.EQ.K ) THEN + INFO = K + RETURN + ELSE IF ( ( U.NE.REZ(I+1) ) .OR. ( V.NE.-IMZ(I+1) ) ) THEN + INFO = I + 1 + RETURN + END IF +C + DWORK(I+1) = ZERO + CALL DAXPY( I, -(U + U), P, 1, DWORK, 1 ) + CALL DAXPY( I, U**2+V**2, P, 1, DWORK(2), 1 ) + I = I + 1 + END IF +C + CALL DCOPY( I, DWORK, 1, P(2), 1 ) + I = I + 1 + GO TO 20 + END IF +C END WHILE 20 +C + RETURN +C *** Last line of MC01PY *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/TB01ID.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/TB01ID.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/TB01ID.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,402 @@ + SUBROUTINE TB01ID( JOB, N, M, P, MAXRED, A, LDA, B, LDB, C, LDC, + $ SCALE, INFO ) +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 reduce the 1-norm of a system matrix +C +C S = ( A B ) +C ( C 0 ) +C +C corresponding to the triple (A,B,C), by balancing. This involves +C a diagonal similarity transformation inv(D)*A*D applied +C iteratively to A to make the rows and columns of +C -1 +C diag(D,I) * S * diag(D,I) +C +C as close in norm as possible. +C +C The balancing can be performed optionally on the following +C particular system matrices +C +C S = A, S = ( A B ) or S = ( A ) +C ( C ) +C +C ARGUMENTS +C +C Mode Parameters +C +C JOB CHARACTER*1 +C Indicates which matrices are involved in balancing, as +C follows: +C = 'A': All matrices are involved in balancing; +C = 'B': B and A matrices are involved in balancing; +C = 'C': C and A matrices are involved in balancing; +C = 'N': B and C matrices are not involved in balancing. +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the matrix A, the number of rows of matrix B +C and the number of columns of matrix C. +C N represents the dimension of the state vector. N >= 0. +C +C M (input) INTEGER. +C The number of columns of matrix B. +C M represents the dimension of input vector. M >= 0. +C +C P (input) INTEGER. +C The number of rows of matrix C. +C P represents the dimension of output vector. P >= 0. +C +C MAXRED (input/output) DOUBLE PRECISION +C On entry, the maximum allowed reduction in the 1-norm of +C S (in an iteration) if zero rows or columns are +C encountered. +C If MAXRED > 0.0, MAXRED must be larger than one (to enable +C the norm reduction). +C If MAXRED <= 0.0, then the value 10.0 for MAXRED is +C used. +C On exit, if the 1-norm of the given matrix S is non-zero, +C the ratio between the 1-norm of the given matrix and the +C 1-norm of the balanced matrix. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading N-by-N part of this array must +C contain the system state matrix A. +C On exit, the leading N-by-N part of this array contains +C the balanced matrix inv(D)*A*D. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,N). +C +C B (input/output) DOUBLE PRECISION array, dimension (LDB,M) +C On entry, if M > 0, the leading N-by-M part of this array +C must contain the system input matrix B. +C On exit, if M > 0, the leading N-by-M part of this array +C contains the balanced matrix inv(D)*B. +C The array B is not referenced if M = 0. +C +C LDB INTEGER +C The leading dimension of the array B. +C LDB >= MAX(1,N) if M > 0. +C LDB >= 1 if M = 0. +C +C C (input/output) DOUBLE PRECISION array, dimension (LDC,N) +C On entry, if P > 0, the leading P-by-N part of this array +C must contain the system output matrix C. +C On exit, if P > 0, the leading P-by-N part of this array +C contains the balanced matrix C*D. +C The array C is not referenced if P = 0. +C +C LDC INTEGER +C The leading dimension of the array C. LDC >= MAX(1,P). +C +C SCALE (output) DOUBLE PRECISION array, dimension (N) +C The scaling factors applied to S. If D(j) is the scaling +C factor applied to row and column j, then SCALE(j) = D(j), +C for j = 1,...,N. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit. +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C Balancing consists of applying a diagonal similarity +C transformation +C -1 +C diag(D,I) * S * diag(D,I) +C +C to make the 1-norms of each row of the first N rows of S and its +C corresponding column nearly equal. +C +C Information about the diagonal matrix D is returned in the vector +C SCALE. +C +C REFERENCES +C +C [1] Anderson, E., Bai, Z., Bischof, C., Demmel, J., Dongarra, J., +C Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A., +C Ostrouchov, S., and Sorensen, D. +C LAPACK Users' Guide: Second Edition. +C SIAM, Philadelphia, 1995. +C +C NUMERICAL ASPECTS +C +C None. +C +C CONTRIBUTOR +C +C Release 3.0: V. Sima, Katholieke Univ. Leuven, Belgium, Jan. 1998. +C This subroutine is based on LAPACK routine DGEBAL, and routine +C BALABC (A. Varga, German Aerospace Research Establishment, DLR). +C +C REVISIONS +C +C - +C +C KEYWORDS +C +C Balancing, eigenvalue, matrix algebra, matrix operations, +C similarity transformation. +C +C ********************************************************************* +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) + DOUBLE PRECISION SCLFAC + PARAMETER ( SCLFAC = 1.0D+1 ) + DOUBLE PRECISION FACTOR, MAXR + PARAMETER ( FACTOR = 0.95D+0, MAXR = 10.0D+0 ) +C .. +C .. Scalar Arguments .. + CHARACTER JOB + INTEGER INFO, LDA, LDB, LDC, M, N, P + DOUBLE PRECISION MAXRED +C .. +C .. Array Arguments .. + DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ), + $ SCALE( * ) +C .. +C .. Local Scalars .. + LOGICAL NOCONV, WITHB, WITHC + INTEGER I, ICA, IRA, J + DOUBLE PRECISION CA, CO, F, G, MAXNRM, RA, RO, S, SFMAX1, + $ SFMAX2, SFMIN1, SFMIN2, SNORM, SRED +C .. +C .. External Functions .. + LOGICAL LSAME + INTEGER IDAMAX + DOUBLE PRECISION DASUM, DLAMCH + EXTERNAL DASUM, DLAMCH, IDAMAX, LSAME +C .. +C .. External Subroutines .. + EXTERNAL DSCAL, XERBLA +C .. +C .. Intrinsic Functions .. + INTRINSIC ABS, MAX, MIN +C .. +C .. Executable Statements .. +C +C Test the scalar input arguments. +C + INFO = 0 + WITHB = LSAME( JOB, 'A' ) .OR. LSAME( JOB, 'B' ) + WITHC = LSAME( JOB, 'A' ) .OR. LSAME( JOB, 'C' ) +C + IF( .NOT.WITHB .AND. .NOT.WITHC .AND. .NOT.LSAME( JOB, 'N' ) ) + $ THEN + INFO = -1 + ELSE IF( N.LT.0 ) THEN + INFO = -2 + ELSE IF( M.LT.0 ) THEN + INFO = -3 + ELSE IF( P.LT.0 ) THEN + INFO = -4 + ELSE IF( MAXRED.GT.ZERO .AND. MAXRED.LT.ONE ) THEN + INFO = -5 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -7 + ELSE IF( ( M.GT.0 .AND. LDB.LT.MAX( 1, N ) ) .OR. + $ ( M.EQ.0 .AND. LDB.LT.1 ) ) THEN + INFO = -9 + ELSE IF( LDC.LT.MAX( 1, P ) ) THEN + INFO = -11 + END IF + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'TB01ID', -INFO ) + RETURN + END IF +C + IF( N.EQ.0 ) + $ RETURN +C +C Compute the 1-norm of the required part of matrix S and exit if +C it is zero. +C + SNORM = ZERO +C + DO 10 J = 1, N + SCALE( J ) = ONE + CO = DASUM( N, A( 1, J ), 1 ) + IF( WITHC .AND. P.GT.0 ) + $ CO = CO + DASUM( P, C( 1, J ), 1 ) + SNORM = MAX( SNORM, CO ) + 10 CONTINUE +C + IF( WITHB ) THEN +C + DO 20 J = 1, M + SNORM = MAX( SNORM, DASUM( N, B( 1, J ), 1 ) ) + 20 CONTINUE +C + END IF +C + IF( SNORM.EQ.ZERO ) + $ RETURN +C +C Set some machine parameters and the maximum reduction in the +C 1-norm of S if zero rows or columns are encountered. +C + SFMIN1 = DLAMCH( 'S' ) / DLAMCH( 'P' ) + SFMAX1 = ONE / SFMIN1 + SFMIN2 = SFMIN1*SCLFAC + SFMAX2 = ONE / SFMIN2 +C + SRED = MAXRED + IF( SRED.LE.ZERO ) SRED = MAXR +C + MAXNRM = MAX( SNORM/SRED, SFMIN1 ) +C +C Balance the matrix. +C +C Iterative loop for norm reduction. +C + 30 CONTINUE + NOCONV = .FALSE. +C + DO 90 I = 1, N + CO = ZERO + RO = ZERO +C + DO 40 J = 1, N + IF( J.EQ.I ) + $ GO TO 40 + CO = CO + ABS( A( J, I ) ) + RO = RO + ABS( A( I, J ) ) + 40 CONTINUE +C + ICA = IDAMAX( N, A( 1, I ), 1 ) + CA = ABS( A( ICA, I ) ) + IRA = IDAMAX( N, A( I, 1 ), LDA ) + RA = ABS( A( I, IRA ) ) +C + IF( WITHC .AND. P.GT.0 ) THEN + CO = CO + DASUM( P, C( 1, I ), 1 ) + ICA = IDAMAX( P, C( 1, I ), 1 ) + CA = MAX( CA, ABS( C( ICA, I ) ) ) + END IF +C + IF( WITHB .AND. M.GT.0 ) THEN + RO = RO + DASUM( M, B( I, 1 ), LDB ) + IRA = IDAMAX( M, B( I, 1 ), LDB ) + RA = MAX( RA, ABS( B( I, IRA ) ) ) + END IF +C +C Special case of zero CO and/or RO. +C + IF( CO.EQ.ZERO .AND. RO.EQ.ZERO ) + $ GO TO 90 + IF( CO.EQ.ZERO ) THEN + IF( RO.LE.MAXNRM ) + $ GO TO 90 + CO = MAXNRM + END IF + IF( RO.EQ.ZERO ) THEN + IF( CO.LE.MAXNRM ) + $ GO TO 90 + RO = MAXNRM + END IF +C +C Guard against zero CO or RO due to underflow. +C + G = RO / SCLFAC + F = ONE + S = CO + RO + 50 CONTINUE + IF( CO.GE.G .OR. MAX( F, CO, CA ).GE.SFMAX2 .OR. + $ MIN( RO, G, RA ).LE.SFMIN2 )GO TO 60 + F = F*SCLFAC + CO = CO*SCLFAC + CA = CA*SCLFAC + G = G / SCLFAC + RO = RO / SCLFAC + RA = RA / SCLFAC + GO TO 50 +C + 60 CONTINUE + G = CO / SCLFAC + 70 CONTINUE + IF( G.LT.RO .OR. MAX( RO, RA ).GE.SFMAX2 .OR. + $ MIN( F, CO, G, CA ).LE.SFMIN2 )GO TO 80 + F = F / SCLFAC + CO = CO / SCLFAC + CA = CA / SCLFAC + G = G / SCLFAC + RO = RO*SCLFAC + RA = RA*SCLFAC + GO TO 70 +C +C Now balance. +C + 80 CONTINUE + IF( ( CO+RO ).GE.FACTOR*S ) + $ GO TO 90 + IF( F.LT.ONE .AND. SCALE( I ).LT.ONE ) THEN + IF( F*SCALE( I ).LE.SFMIN1 ) + $ GO TO 90 + END IF + IF( F.GT.ONE .AND. SCALE( I ).GT.ONE ) THEN + IF( SCALE( I ).GE.SFMAX1 / F ) + $ GO TO 90 + END IF + G = ONE / F + SCALE( I ) = SCALE( I )*F + NOCONV = .TRUE. +C + CALL DSCAL( N, G, A( I, 1 ), LDA ) + CALL DSCAL( N, F, A( 1, I ), 1 ) + IF( M.GT.0 ) CALL DSCAL( M, G, B( I, 1 ), LDB ) + IF( P.GT.0 ) CALL DSCAL( P, F, C( 1, I ), 1 ) +C + 90 CONTINUE +C + IF( NOCONV ) + $ GO TO 30 +C +C Set the norm reduction parameter. +C + MAXRED = SNORM + SNORM = ZERO +C + DO 100 J = 1, N + CO = DASUM( N, A( 1, J ), 1 ) + IF( WITHC .AND. P.GT.0 ) + $ CO = CO + DASUM( P, C( 1, J ), 1 ) + SNORM = MAX( SNORM, CO ) + 100 CONTINUE +C + IF( WITHB ) THEN +C + DO 110 J = 1, M + SNORM = MAX( SNORM, DASUM( N, B( 1, J ), 1 ) ) + 110 CONTINUE +C + END IF + MAXRED = MAXRED/SNORM + RETURN +C *** Last line of TB01ID *** + END Added: trunk/octave-forge/main/control/devel/ss2tf/TB01ZD.f =================================================================== --- trunk/octave-forge/main/control/devel/ss2tf/TB01ZD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ss2tf/TB01ZD.f 2010-10-08 19:53:14 UTC (rev 7817) @@ -0,0 +1,440 @@ + SUBROUTINE TB01ZD( JOBZ, N, P, A, LDA, B, C, LDC, NCONT, Z, LDZ, + $ TAU, TOL, DWORK, LDWORK, INFO ) +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 find a controllable realization for the linear time-invariant +C single-input system +C +C ... [truncated message content] |
From: <par...@us...> - 2010-10-09 09:39:27
|
Revision: 7824 http://octave.svn.sourceforge.net/octave/?rev=7824&view=rev Author: paramaniac Date: 2010-10-09 09:39:21 +0000 (Sat, 09 Oct 2010) Log Message: ----------- control: more work on frd models Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/__transpose__.m trunk/octave-forge/main/control/devel/__frd_dim__.m trunk/octave-forge/main/control/devel/frd_test.m Added Paths: ----------- trunk/octave-forge/main/control/devel/@frd/__sys_inverse__.m Added: trunk/octave-forge/main/control/devel/@frd/__sys_inverse__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__sys_inverse__.m (rev 0) +++ trunk/octave-forge/main/control/devel/@frd/__sys_inverse__.m 2010-10-09 09:39:21 UTC (rev 7824) @@ -0,0 +1,35 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Inversion of FRD models. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2010 +## Version: 0.1 + +function sys = __sys_inverse__ (sys) + + [p, m, l] = size (sys.H); + + H = mat2cell (sys.H, p, m, ones (1, l))(:); + + H = cellfun (@inv, H, "uniformoutput", false); + + sys.H = cat (3, H{:}); + +endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/@frd/__transpose__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__transpose__.m 2010-10-09 08:15:33 UTC (rev 7823) +++ trunk/octave-forge/main/control/devel/@frd/__transpose__.m 2010-10-09 09:39:21 UTC (rev 7824) @@ -24,12 +24,12 @@ function sys = __transpose__ (sys) - H = sys.H; + [p, m, l] = size (sys.H); - for k = 1 : size (H, 3) - H(:, :, k) = H(:, :, k).' - endfor + H = mat2cell (sys.H, p, m, ones (1, l))(:); - sys.H = H; + H = cellfun (@transpose, H, "uniformoutput", false); + sys.H = cat (3, H{:}); + endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/__frd_dim__.m =================================================================== --- trunk/octave-forge/main/control/devel/__frd_dim__.m 2010-10-09 08:15:33 UTC (rev 7823) +++ trunk/octave-forge/main/control/devel/__frd_dim__.m 2010-10-09 09:39:21 UTC (rev 7824) @@ -33,13 +33,13 @@ error ("frd: w must be a vector of positive real numbers"); endif - if (isempty (H)) - p = m = l = 0; - else - [p, m, l] = size (H); + lw = length (w); + + if (lw > 1 && (! issorted (w) || w(1) >= w(end) || length (unique (w)) != lw)) + error ("frd: vector w must contain unique frequencies in ascending order"); endif - lw = length (w); + [p, m, l] = size (H); if (l != lw) error ("frd: H (%dx%dx%d) and w (%d) must have equal length", Modified: trunk/octave-forge/main/control/devel/frd_test.m =================================================================== --- trunk/octave-forge/main/control/devel/frd_test.m 2010-10-09 08:15:33 UTC (rev 7823) +++ trunk/octave-forge/main/control/devel/frd_test.m 2010-10-09 09:39:21 UTC (rev 7824) @@ -40,7 +40,12 @@ sigma (P_frd, [], 3) +sys1 = frd (reshape (1:60, 3, 4, []), 1:5) +sys1.' +sys2 = frd (reshape (1:45, 3, 3, []), 1:5) +inv (sys2) + %{ P = frd ((1:45)*(1-2i), logspace (-2,3,45)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-09 11:25:02
|
Revision: 7825 http://octave.svn.sourceforge.net/octave/?rev=7825&view=rev Author: paramaniac Date: 2010-10-09 11:24:56 +0000 (Sat, 09 Oct 2010) Log Message: ----------- control: sys_prune for frd models Added Paths: ----------- trunk/octave-forge/main/control/devel/@frd/__sys_prune__.m trunk/octave-forge/main/control/devel/test_frd.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/frd_test.m Added: trunk/octave-forge/main/control/devel/@frd/__sys_prune__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__sys_prune__.m (rev 0) +++ trunk/octave-forge/main/control/devel/@frd/__sys_prune__.m 2010-10-09 11:24:56 UTC (rev 7825) @@ -0,0 +1,33 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Submodel extraction and reordering for FRD objects. +## This file is part of the Model Abstraction Layer. +## For internal use only. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2010 +## Version: 0.1 + +function sys = __sys_prune__ (sys, out_idx, in_idx, st_idx = ":") + + sys.lti = __lti_prune__ (sys.lti, out_idx, in_idx); + + sys.H = sys.H(out_idx, in_idx, :); + +endfunction \ No newline at end of file Deleted: trunk/octave-forge/main/control/devel/frd_test.m =================================================================== --- trunk/octave-forge/main/control/devel/frd_test.m 2010-10-09 09:39:21 UTC (rev 7824) +++ trunk/octave-forge/main/control/devel/frd_test.m 2010-10-09 11:24:56 UTC (rev 7825) @@ -1,64 +0,0 @@ -sys = frd (1, 1) - -sys = frd (2+5i, 3, 0.1) - -sys = frd (ones (2, 3, 5), 1:5) - -frd - -frd ([], []) - - - -P_ss = Boeing707; -w = logspace (-2, 2, 500); -H = freqresp (P_ss, w); -P_frd = frd (H, w); - -figure (1) -subplot (2, 1, 1) -sigma (P_ss) -subplot (2, 1, 2) -sigma (P_frd) - -figure (2) -subplot (2, 1, 1) -sigma (P_ss, [], 1) -subplot (2, 1, 2) -sigma (P_frd, [], 1) - -figure (3) -subplot (2, 1, 1) -sigma (P_ss, [], 2) -subplot (2, 1, 2) -sigma (P_frd, [], 2) - -figure (4) -subplot (2, 1, 1) -sigma (P_ss, [], 3) -subplot (2, 1, 2) -sigma (P_frd, [], 3) - - -sys1 = frd (reshape (1:60, 3, 4, []), 1:5) -sys1.' - -sys2 = frd (reshape (1:45, 3, 3, []), 1:5) -inv (sys2) - -%{ -P = frd ((1:45)*(1-2i), logspace (-2,3,45)) - -figure (1) -sigma (P) -sigma (P, [], 0) - -figure (2) -sigma (P, [], 1) - -figure (3) -sigma (P, [], 2) - -figure (4) -sigma (P, [], 3) -%} \ No newline at end of file Copied: trunk/octave-forge/main/control/devel/test_frd.m (from rev 7824, trunk/octave-forge/main/control/devel/frd_test.m) =================================================================== --- trunk/octave-forge/main/control/devel/test_frd.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_frd.m 2010-10-09 11:24:56 UTC (rev 7825) @@ -0,0 +1,78 @@ +sys = frd (1, 1) + +sys = frd (2+5i, 3, 0.1) + +sys = frd (ones (2, 3, 5), 1:5) + +frd + +frd ([], []) + + + +P_ss = Boeing707; +w = logspace (-2, 2, 500); +H = freqresp (P_ss, w); +P_frd = frd (H, w); + +figure (1) +subplot (2, 1, 1) +sigma (P_ss) +subplot (2, 1, 2) +sigma (P_frd) + +figure (2) +subplot (2, 1, 1) +sigma (P_ss, [], 1) +subplot (2, 1, 2) +sigma (P_frd, [], 1) + +figure (3) +subplot (2, 1, 1) +sigma (P_ss, [], 2) +subplot (2, 1, 2) +sigma (P_frd, [], 2) + +figure (4) +subplot (2, 1, 1) +sigma (P_ss, [], 3) +subplot (2, 1, 2) +sigma (P_frd, [], 3) + + +sys1 = frd (reshape (1:60, 3, 4, []), 1:5) +sys1.' + +sys2 = frd (reshape (1:45, 3, 3, []), 1:5) +inv (sys2) + + +P_ss = Boeing707; +T_ss = feedback (P_ss); + +P_frd = frd (P_ss); +T_frd = feedback (P_frd); + +figure (5) +subplot (2, 1, 1) +sigma (T_ss) +subplot (2, 1, 2) +sigma (T_frd) + + +%{ +P = frd ((1:45)*(1-2i), logspace (-2,3,45)) + +figure (1) +sigma (P) +sigma (P, [], 0) + +figure (2) +sigma (P, [], 1) + +figure (3) +sigma (P, [], 2) + +figure (4) +sigma (P, [], 3) +%} \ 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...> - 2010-10-09 13:08:16
|
Revision: 7827 http://octave.svn.sourceforge.net/octave/?rev=7827&view=rev Author: paramaniac Date: 2010-10-09 13:08:10 +0000 (Sat, 09 Oct 2010) Log Message: ----------- control: add sys_connect for frd models, improve constructor Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/frd.m trunk/octave-forge/main/control/devel/__frd_dim__.m Added Paths: ----------- trunk/octave-forge/main/control/devel/@frd/__sys_connect__.m Added: trunk/octave-forge/main/control/devel/@frd/__sys_connect__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__sys_connect__.m (rev 0) +++ trunk/octave-forge/main/control/devel/@frd/__sys_connect__.m 2010-10-09 13:08:10 UTC (rev 7827) @@ -0,0 +1,54 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{retsys} =} __sys_connect__ (@var{sys}, @var{M}) +## This function is part of the Model Abstraction Layer. No argument checking. +## For internal use only. +## @example +## @group +## Problem: Solve the system equations of +## Y(s) = G(s) E(s) +## E(s) = U(s) + M Y(s) +## in order to build +## Y(s) = H(s) U(s) +## Solution: +## Y(s) = G(s) [U(s) + M Y(s)] +## Y(s) = G(s) U(s) + G(s) M Y(s) +## Y(s) = [I - G(s) M]^-1 G(s) U(s) +## \_______ _______/ +## H(s) +## @end group +## @end example +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2010 +## Version: 0.1 + +function sys = __sys_connect__ (sys, M) + + [p, m, l] = size (sys.H); + + I = eye (p); + H = mat2cell (sys.H, p, m, ones (1, l))(:); + + H = cellfun (@(x) [I - x*M] \ x, H, "uniformoutput", false); + + sys.H = cat (3, H{:}); + +endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 11:32:29 UTC (rev 7826) +++ trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 13:08:10 UTC (rev 7827) @@ -73,8 +73,24 @@ endswitch + ## TODO: create separate function if (ndims (H) != 3 && ! isempty (H)) - H = reshape (H, 1, 1, []); + if (is_real_scalar (H)) # static gain (H is a scalar) + H = reshape (H, 1, 1, []); + tsam = -1; + elseif (isvector (H)) # SISO system (H is a vector) + H = reshape (H, 1, 1, []); + else # static gain (H is a matrix) + if (! is_real_matrix (H)) + error ("frd: static gain matrix must be real"); + endif + H = reshape (H, rows (H), []); + lw = length (w); + if (lw > 1) + H = repmat (H, [1, 1, lw]); # needed for "frd1 + matrix2" or "matrix1 * frd2) + endif + tsam = -1; + endif elseif (isempty (H)) H = zeros (0, 0, 0); tsam = -1; @@ -89,7 +105,7 @@ ltisys = lti (p, m, tsam); sys = class (frdata, "frd", ltisys); - +sys.lti.tsam if (argc > 0) sys = set (sys, varargin{:}); endif Modified: trunk/octave-forge/main/control/devel/__frd_dim__.m =================================================================== --- trunk/octave-forge/main/control/devel/__frd_dim__.m 2010-10-09 11:32:29 UTC (rev 7826) +++ trunk/octave-forge/main/control/devel/__frd_dim__.m 2010-10-09 13:08:10 UTC (rev 7827) @@ -29,6 +29,19 @@ error ("frd: H must be a 3-dimensional numeric array"); endif + lw = length (w); + + if (lw > 1 && (! is_real_vector (w) || any (w < 0) \ + || ! issorted (w) || w(1) >= w(end) || length (unique (w)) != lw)) + error ("frd: w must be a vector of positive real numbers"); + elseif (lw == 1 && ! issample (w, -1)) + error ("frd: scalar w must be a valid sampling time"); + endif +%{ + if (! isnumeric (H)) # TODO: watch out for __set__ vector case + error ("frd: H must be a 3-dimensional numeric array"); + endif + if (! isempty (w) && (! is_real_vector (w) || any (w < 0))) error ("frd: w must be a vector of positive real numbers"); endif @@ -37,8 +50,10 @@ if (lw > 1 && (! issorted (w) || w(1) >= w(end) || length (unique (w)) != lw)) error ("frd: vector w must contain unique frequencies in ascending order"); + elseif (lw == 1 && ! issample (w, -1)) + error ("frd: scalar w must be a valid sampling time"); endif - +%} [p, m, l] = size (H); if (l != lw) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-09 13:42:22
|
Revision: 7829 http://octave.svn.sourceforge.net/octave/?rev=7829&view=rev Author: paramaniac Date: 2010-10-09 13:42:15 +0000 (Sat, 09 Oct 2010) Log Message: ----------- control: fix __set__ for frd models Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/__set__.m trunk/octave-forge/main/control/devel/@frd/frd.m Added Paths: ----------- trunk/octave-forge/main/control/devel/__adjust_frd_data__.m Modified: trunk/octave-forge/main/control/devel/@frd/__set__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__set__.m 2010-10-09 13:09:17 UTC (rev 7828) +++ trunk/octave-forge/main/control/devel/@frd/__set__.m 2010-10-09 13:42:15 UTC (rev 7829) @@ -24,18 +24,14 @@ function sys = __set__ (sys, prop, val) - switch (prop) # {<internal name>, <user name>} + switch (prop) # {<internal name>, <user name>} case {"h", "r", "resp", "response"} - if (ndims (val) != 3 && ! isempty (val)) # TODO: share code with @frd/frd.m - val = reshape (val, 1, 1, []); - elseif (isempty (val)) - val = zeros (0, 0, 0); - endif + val = __adjust_frd_data__ (val, sys.w, 0); __frd_dim__ (val, sys.w); sys.H = val; case {"w", "f", "freq", "frequency"} - val = reshape (val, [], 1); + [jnk, val] = __adjust_frd_data__ (sys.H, val, 0); ## TODO: use [~, val] for octave 3.4 __frd_dim__ (sys.H, val); sys.w = val; Modified: trunk/octave-forge/main/control/devel/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 13:09:17 UTC (rev 7828) +++ trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 13:42:15 UTC (rev 7829) @@ -73,31 +73,8 @@ endswitch - ## TODO: create separate function - if (ndims (H) != 3 && ! isempty (H)) - if (is_real_scalar (H)) # static gain (H is a scalar) - H = reshape (H, 1, 1, []); - tsam = -1; - elseif (isvector (H)) # SISO system (H is a vector) - H = reshape (H, 1, 1, []); - else # static gain (H is a matrix) - if (! is_real_matrix (H)) - error ("frd: static gain matrix must be real"); - endif - H = reshape (H, rows (H), []); - lw = length (w); - if (lw > 1) - H = repmat (H, [1, 1, lw]); # needed for "frd1 + matrix2" or "matrix1 * frd2) - endif - tsam = -1; - endif - elseif (isempty (H)) - H = zeros (0, 0, 0); - tsam = -1; - endif + [H, w, tsam] = __adjust_frd_data__ (H, w, tsam); - w = reshape (w, [], 1); - [p, m] = __frd_dim__ (H, w); frdata = struct ("H", H, "w", w); Added: trunk/octave-forge/main/control/devel/__adjust_frd_data__.m =================================================================== --- trunk/octave-forge/main/control/devel/__adjust_frd_data__.m (rev 0) +++ trunk/octave-forge/main/control/devel/__adjust_frd_data__.m 2010-10-09 13:42:15 UTC (rev 7829) @@ -0,0 +1,51 @@ +## Copyright (C) 2010 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 this program. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## Common code for adjusting FRD model data. +## Used by @frd/frd.m and @frd/__set__.m + +## Author: Lukas Reichlin <luk...@gm...> +## Created: October 2010 +## Version: 0.1 + +function [H, w, tsam] = __adjust_frd_data__ (H, w, tsam); + + if (ndims (H) != 3 && ! isempty (H)) + if (is_real_scalar (H)) # static gain (H is a real scalar) + H = reshape (H, 1, 1, []); + tsam = -1; + elseif (isvector (H)) # SISO system (H is a complex vector) + H = reshape (H, 1, 1, []); + elseif (is_real_matrix (H)) # static gain (H is a real matrix) + H = reshape (H, rows (H), []); + lw = length (w); + if (lw > 1) + H = repmat (H, [1, 1, lw]); # needed for "frd1 + matrix2" or "matrix1 * frd2) + endif + tsam = -1; + else + error ("frd: static gain matrix must be real"); + endif + elseif (isempty (H)) + H = zeros (0, 0, 0); + tsam = -1; + endif + + w = reshape (w, [], 1); + +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...> - 2010-10-09 19:06:27
|
Revision: 7831 http://octave.svn.sourceforge.net/octave/?rev=7831&view=rev Author: paramaniac Date: 2010-10-09 19:06:20 +0000 (Sat, 09 Oct 2010) Log Message: ----------- control: complete frd model interconnections Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/__sys_group__.m trunk/octave-forge/main/control/devel/@frd/frd.m trunk/octave-forge/main/control/devel/test_frd.m Modified: trunk/octave-forge/main/control/devel/@frd/__sys_group__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__sys_group__.m 2010-10-09 13:43:42 UTC (rev 7830) +++ trunk/octave-forge/main/control/devel/@frd/__sys_group__.m 2010-10-09 19:06:20 UTC (rev 7831) @@ -43,29 +43,36 @@ [p1, m1, l1] = size (sys1.H); [p2, m2, l2] = size (sys2.H); + ## TODO: tolerances for frequencies, i.e. don't check for equality - if (lw1 == lw2 && all (sys1.w == sys2.w)) + ## find intersection of frequency vectors + if (lw1 == lw2 && all (sys1.w == sys2.w)) # identical frequency vectors retsys.w = sys1.w; - else - retsys.w = intersect (sys1.w, sys2.w); + H1 = sys1.H; + H2 = sys2.H; + else # differing frequency vectors + ## find common frequencies + retsys.w = w = intersect (sys1.w, sys2.w); + w = num2cell (w); + + ## indices of common frequencies + w1_idx = cellfun (@(x) find (sys1.w == x), w); + w2_idx = cellfun (@(x) find (sys2.w == x), w); + + ## extract common responses + H1 = sys1.H(:, :, w1_idx); + H2 = sys2.H(:, :, w2_idx); endif - % l filtern - H1 = sys1.H(:, :, w1_idx); - H2 = sys2.H(:, :, w2_idx); - + ## block-diagonal concatenation + lw = length (retsys.w); z12 = zeros (p1, m2); z21 = zeros (p2, m1); + H1 = mat2cell (H1, p1, m1, ones (1, lw))(:); + H2 = mat2cell (H2, p2, m2, ones (1, lw))(:); -% H1 = mat2cell (H1, p1, m1, ones (1, l))(:); -% H2 = mat2cell (H2, p2, m2, ones (1, l))(:); - H1 = mat2cell (H1, p1, m1, ones (1, l1))(:); - H2 = mat2cell (H2, p2, m2, ones (1, l2))(:); - H = cellfun (@(x, y) [x, z12; z21, y], H1, H2, "uniformoutput", false); retsys.H = cat (3, H{:}); -% welche indices von H1, H2 ? --> vorher ausmisten - endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 13:43:42 UTC (rev 7830) +++ trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-09 19:06:20 UTC (rev 7831) @@ -82,7 +82,7 @@ ltisys = lti (p, m, tsam); sys = class (frdata, "frd", ltisys); -sys.lti.tsam + if (argc > 0) sys = set (sys, varargin{:}); endif Modified: trunk/octave-forge/main/control/devel/test_frd.m =================================================================== --- trunk/octave-forge/main/control/devel/test_frd.m 2010-10-09 13:43:42 UTC (rev 7830) +++ trunk/octave-forge/main/control/devel/test_frd.m 2010-10-09 19:06:20 UTC (rev 7831) @@ -1,12 +1,12 @@ -sys = frd (1, 1) +sys1 = frd (1, 1) -sys = frd (2+5i, 3, 0.1) +sys2 = frd (2+5i, 3, 0.1) -sys = frd (ones (2, 3, 5), 1:5) +sys3 = frd (ones (2, 3, 5), 1:5) -frd +sys4 = frd -frd ([], []) +sys5 = frd ([], []) @@ -40,11 +40,13 @@ sigma (P_frd, [], 3) -sys1 = frd (reshape (1:60, 3, 4, []), 1:5) -sys1.' +%sys1 = frd (reshape (1:60, 3, 4, []), 1:5) +%sys1.' +P_frd.'; -sys2 = frd (reshape (1:45, 3, 3, []), 1:5) -inv (sys2) +%sys2 = frd (reshape (1:45, 3, 3, []), 1:5) +%inv (sys2) +inv (P_frd); P_ss = Boeing707; @@ -55,11 +57,25 @@ figure (5) subplot (2, 1, 1) -sigma (T_ss) +% sigma (T_ss) +sigma (T_ss, T_frd.w) subplot (2, 1, 2) sigma (T_frd) +figure (6) +subplot (2, 1, 1) +% sigma (T_ss + P_ss) +sigma (T_ss + P_ss, T_frd.w) +subplot (2, 1, 2) +sigma (T_frd + P_frd) +figure (7) +subplot (2, 1, 1) +% sigma (T_ss * P_ss) +sigma (T_ss * P_ss, T_frd.w) +subplot (2, 1, 2) +sigma (T_frd * P_frd) + %{ P = frd ((1:45)*(1-2i), logspace (-2,3,45)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-10 10:21:56
|
Revision: 7836 http://octave.svn.sourceforge.net/octave/?rev=7836&view=rev Author: paramaniac Date: 2010-10-10 10:21:50 +0000 (Sun, 10 Oct 2010) Log Message: ----------- control: remove unused argument Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/__set__.m trunk/octave-forge/main/control/devel/@frd/frd.m trunk/octave-forge/main/control/devel/__adjust_frd_data__.m Modified: trunk/octave-forge/main/control/devel/@frd/__set__.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/__set__.m 2010-10-10 10:08:25 UTC (rev 7835) +++ trunk/octave-forge/main/control/devel/@frd/__set__.m 2010-10-10 10:21:50 UTC (rev 7836) @@ -26,12 +26,12 @@ switch (prop) # {<internal name>, <user name>} case {"h", "r", "resp", "response"} - val = __adjust_frd_data__ (val, sys.w, 0); + val = __adjust_frd_data__ (val, sys.w); __frd_dim__ (val, sys.w); sys.H = val; case {"w", "f", "freq", "frequency"} - [jnk, val] = __adjust_frd_data__ (sys.H, val, 0); ## TODO: use [~, val] for octave 3.4 + [jnk, val] = __adjust_frd_data__ (sys.H, val); ## TODO: use [~, val] for octave 3.4 __frd_dim__ (sys.H, val); sys.w = val; Modified: trunk/octave-forge/main/control/devel/@frd/frd.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-10 10:08:25 UTC (rev 7835) +++ trunk/octave-forge/main/control/devel/@frd/frd.m 2010-10-10 10:21:50 UTC (rev 7836) @@ -85,7 +85,7 @@ endswitch - [H, w, tsam] = __adjust_frd_data__ (H, w, tsam); + [H, w] = __adjust_frd_data__ (H, w); [p, m] = __frd_dim__ (H, w); Modified: trunk/octave-forge/main/control/devel/__adjust_frd_data__.m =================================================================== --- trunk/octave-forge/main/control/devel/__adjust_frd_data__.m 2010-10-10 10:08:25 UTC (rev 7835) +++ trunk/octave-forge/main/control/devel/__adjust_frd_data__.m 2010-10-10 10:21:50 UTC (rev 7836) @@ -23,7 +23,7 @@ ## Created: October 2010 ## Version: 0.1 -function [H, w, tsam] = __adjust_frd_data__ (H, w, tsam); +function [H, w] = __adjust_frd_data__ (H, w); w = reshape (w, [], 1); lw = length (w); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2010-10-16 09:41:29
|
Revision: 7848 http://octave.svn.sourceforge.net/octave/?rev=7848&view=rev Author: paramaniac Date: 2010-10-16 09:41:22 +0000 (Sat, 16 Oct 2010) Log Message: ----------- control: bugfix for cases like frd (ss (5)) + 4 Modified Paths: -------------- trunk/octave-forge/main/control/devel/__adjust_frd_data__.m trunk/octave-forge/main/control/devel/test_frd.m Modified: trunk/octave-forge/main/control/devel/__adjust_frd_data__.m =================================================================== --- trunk/octave-forge/main/control/devel/__adjust_frd_data__.m 2010-10-15 18:54:14 UTC (rev 7847) +++ trunk/octave-forge/main/control/devel/__adjust_frd_data__.m 2010-10-16 09:41:22 UTC (rev 7848) @@ -32,14 +32,14 @@ if (isscalar (H)) H = reshape (H, 1, 1, []); if (lw > 1) - H = repmat (H, [1, 1, lw]); # needed for "frd1 + scalar2" or "scalar1 * frd2) + H = repmat (H, [1, 1, lw]); # needed for "frd1 + scalar2" or "scalar1 * frd2) endif - elseif (isvector (H)) # SISO system (H is a vector) + elseif (isvector (H) && length (H) == lw) # SISO system (H is a vector) H = reshape (H, 1, 1, []); elseif (ismatrix (H)) H = reshape (H, rows (H), []); if (lw > 1) - H = repmat (H, [1, 1, lw]); # needed for "frd1 + matrix2" or "matrix1 * frd2) + H = repmat (H, [1, 1, lw]); # needed for "frd1 + matrix2" or "matrix1 * frd2) endif else error ("frd: first argument H invalid"); Modified: trunk/octave-forge/main/control/devel/test_frd.m =================================================================== --- trunk/octave-forge/main/control/devel/test_frd.m 2010-10-15 18:54:14 UTC (rev 7847) +++ trunk/octave-forge/main/control/devel/test_frd.m 2010-10-16 09:41:22 UTC (rev 7848) @@ -83,7 +83,9 @@ % k2 = frd (tf ([1, 2; 3, 4])) k2 = frd (tf (5)); +frd (ss (5)) + 4; + %{ P = frd ((1:45)*(1-2i), logspace (-2,3,45)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-01-16 10:43:31
|
Revision: 8055 http://octave.svn.sourceforge.net/octave/?rev=8055&view=rev Author: paramaniac Date: 2011-01-16 10:43:25 +0000 (Sun, 16 Jan 2011) Log Message: ----------- control: remove mac-specific flags Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_chol.m trunk/octave-forge/main/control/devel/makefile_h2syn.m trunk/octave-forge/main/control/devel/makefile_hankel.m trunk/octave-forge/main/control/devel/makefile_hinfsyn.m trunk/octave-forge/main/control/devel/makefile_lqr.m trunk/octave-forge/main/control/devel/makefile_lyap.m trunk/octave-forge/main/control/devel/makefile_minreal.m trunk/octave-forge/main/control/devel/makefile_norm.m trunk/octave-forge/main/control/devel/makefile_place.m trunk/octave-forge/main/control/devel/makefile_staircase.m trunk/octave-forge/main/control/devel/makefile_zero.m Modified: trunk/octave-forge/main/control/devel/makefile_chol.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_chol.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_chol.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,15 +11,13 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb03od.cc \ +mkoctfile slsb03od.cc \ SB03OD.f select.f SB03OU.f SB03OT.f MB04ND.f \ MB04OD.f SB03OR.f SB03OY.f SB04PX.f MB04NY.f \ MB04OY.f SB03OV.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg03bd.cc \ +mkoctfile slsg03bd.cc \ SG03BD.f SG03BV.f SG03BU.f SG03BW.f SG03BX.f \ SG03BY.f MB02UU.f MB02UV.f Modified: trunk/octave-forge/main/control/devel/makefile_h2syn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10hd.cc \ +mkoctfile slsb10hd.cc \ 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 \ @@ -23,8 +19,7 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10ed.cc \ +mkoctfile slsb10ed.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_hankel.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13ad.cc \ +mkoctfile slab13ad.cc \ AB13AD.f TB01ID.f TB01KD.f AB13AX.f MA02DD.f \ MB03UD.f TB01LD.f SB03OU.f MB03QX.f select.f \ SB03OT.f MB03QD.f MB04ND.f MB04OD.f MB03QY.f \ Modified: trunk/octave-forge/main/control/devel/makefile_hinfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10fd.cc \ +mkoctfile slsb10fd.cc \ 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 \ @@ -23,8 +19,7 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10dd.cc \ +mkoctfile slsb10dd.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_lqr.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,13 +11,11 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb02od.cc \ +mkoctfile slsb02od.cc \ SB02OD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ SB02MR.f SB02MV.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg02ad.cc \ +mkoctfile slsg02ad.cc \ SG02AD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ MB01SD.f MB02VD.f MB02PD.f MA02GD.f Modified: trunk/octave-forge/main/control/devel/makefile_lyap.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,25 +12,21 @@ cd (srcdir); ## Lypunov -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb03md.cc \ +mkoctfile slsb03md.cc \ SB03MD.f select.f SB03MX.f SB03MY.f MB01RD.f \ SB03MV.f SB03MW.f SB04PX.f ## Sylvester -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb04md.cc \ +mkoctfile slsb04md.cc \ SB04MD.f SB04MU.f SB04MY.f SB04MR.f SB04MW.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb04qd.cc \ +mkoctfile slsb04qd.cc \ SB04QD.f SB04QU.f SB04QY.f SB04MW.f SB04QR.f ## Generalized Lyapunov -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg03ad.cc \ +mkoctfile slsg03ad.cc \ SG03AD.f MB01RW.f MB01RD.f SG03AX.f SG03AY.f \ MB02UU.f MB02UV.f Modified: trunk/octave-forge/main/control/devel/makefile_minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,13 +11,11 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltb01pd.cc \ +mkoctfile sltb01pd.cc \ TB01PD.f TB01XD.f TB01ID.f AB07MD.f TB01UD.f \ MB03OY.f MB01PD.f MB01QD.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg01jd.cc \ +mkoctfile sltg01jd.cc \ TG01JD.f TG01AD.f TB01XD.f MA02CD.f TG01HX.f cd (homedir); \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/makefile_norm.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_norm.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_norm.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,16 +12,14 @@ cd (srcdir); ## H-2 norm -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13bd.cc \ +mkoctfile slab13bd.cc \ 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 ## L-inf norm -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13dd.cc \ +mkoctfile slab13dd.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_place.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_place.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_place.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb01bd.cc \ +mkoctfile slsb01bd.cc \ SB01BD.f MB03QD.f MB03QY.f SB01BX.f SB01BY.f \ select.f Modified: trunk/octave-forge/main/control/devel/makefile_staircase.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_staircase.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_staircase.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,18 +12,15 @@ cd (srcdir); ## staircase form using orthogonal transformations -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab01od.cc \ +mkoctfile slab01od.cc \ AB01OD.f AB01ND.f MB03OY.f MB01PD.f MB01QD.f ## controllability staircase form of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg01hd.cc \ +mkoctfile sltg01hd.cc \ TG01HD.f TG01HX.f ## observability staircase form of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg01id.cc \ +mkoctfile sltg01id.cc \ TG01ID.f TB01XD.f MA02CD.f AB07MD.f TG01HX.f \ MA02BD.f Modified: trunk/octave-forge/main/control/devel/makefile_zero.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_zero.m 2011-01-12 16:17:45 UTC (rev 8054) +++ trunk/octave-forge/main/control/devel/makefile_zero.m 2011-01-16 10:43:25 UTC (rev 8055) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,13 +12,11 @@ cd (srcdir); ## transmission zeros of state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab08nd.cc \ +mkoctfile slab08nd.cc \ AB08ND.f AB08NX.f TB01ID.f MB03OY.f MB03PY.f ## transmission zeros of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slag08bd.cc \ +mkoctfile slag08bd.cc \ AG08BD.f AG08BY.f TG01AD.f TB01XD.f MA02CD.f \ TG01FD.f MA02BD.f MB03OY.f This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-01-17 22:00:41
|
Revision: 8063 http://octave.svn.sourceforge.net/octave/?rev=8063&view=rev Author: paramaniac Date: 2011-01-17 22:00:34 +0000 (Mon, 17 Jan 2011) Log Message: ----------- control: Undo Rev 8055. Some tests from test_control.m fail without mac-specific flags, both octave 3.2.4 and 3.3.55. Revision Links: -------------- http://octave.svn.sourceforge.net/octave/?rev=8055&view=rev Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_chol.m trunk/octave-forge/main/control/devel/makefile_h2syn.m trunk/octave-forge/main/control/devel/makefile_hankel.m trunk/octave-forge/main/control/devel/makefile_hinfsyn.m trunk/octave-forge/main/control/devel/makefile_lqr.m trunk/octave-forge/main/control/devel/makefile_lyap.m trunk/octave-forge/main/control/devel/makefile_minreal.m trunk/octave-forge/main/control/devel/makefile_norm.m trunk/octave-forge/main/control/devel/makefile_place.m trunk/octave-forge/main/control/devel/makefile_staircase.m trunk/octave-forge/main/control/devel/makefile_zero.m Modified: trunk/octave-forge/main/control/devel/makefile_chol.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_chol.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_chol.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,13 +14,15 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slsb03od.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb03od.cc \ SB03OD.f select.f SB03OU.f SB03OT.f MB04ND.f \ MB04OD.f SB03OR.f SB03OY.f SB04PX.f MB04NY.f \ MB04OY.f SB03OV.f -mkoctfile slsg03bd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsg03bd.cc \ SG03BD.f SG03BV.f SG03BU.f SG03BW.f SG03BX.f \ SG03BY.f MB02UU.f MB02UV.f Modified: trunk/octave-forge/main/control/devel/makefile_h2syn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,7 +14,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slsb10hd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb10hd.cc \ 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 \ @@ -19,7 +23,8 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile slsb10ed.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb10ed.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_hankel.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,7 +14,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slab13ad.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab13ad.cc \ AB13AD.f TB01ID.f TB01KD.f AB13AX.f MA02DD.f \ MB03UD.f TB01LD.f SB03OU.f MB03QX.f select.f \ SB03OT.f MB03QD.f MB04ND.f MB04OD.f MB03QY.f \ Modified: trunk/octave-forge/main/control/devel/makefile_hinfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,7 +14,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slsb10fd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb10fd.cc \ 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 \ @@ -19,7 +23,8 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile slsb10dd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb10dd.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_lqr.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,11 +14,13 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slsb02od.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb02od.cc \ SB02OD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ SB02MR.f SB02MV.f -mkoctfile slsg02ad.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsg02ad.cc \ SG02AD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ MB01SD.f MB02VD.f MB02PD.f MA02GD.f Modified: trunk/octave-forge/main/control/devel/makefile_lyap.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -12,21 +15,25 @@ cd (srcdir); ## Lypunov -mkoctfile slsb03md.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb03md.cc \ SB03MD.f select.f SB03MX.f SB03MY.f MB01RD.f \ SB03MV.f SB03MW.f SB04PX.f ## Sylvester -mkoctfile slsb04md.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb04md.cc \ SB04MD.f SB04MU.f SB04MY.f SB04MR.f SB04MW.f -mkoctfile slsb04qd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb04qd.cc \ SB04QD.f SB04QU.f SB04QY.f SB04MW.f SB04QR.f ## Generalized Lyapunov -mkoctfile slsg03ad.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsg03ad.cc \ SG03AD.f MB01RW.f MB01RD.f SG03AX.f SG03AY.f \ MB02UU.f MB02UV.f Modified: trunk/octave-forge/main/control/devel/makefile_minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,11 +14,13 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile sltb01pd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + sltb01pd.cc \ TB01PD.f TB01XD.f TB01ID.f AB07MD.f TB01UD.f \ MB03OY.f MB01PD.f MB01QD.f -mkoctfile sltg01jd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + sltg01jd.cc \ TG01JD.f TG01AD.f TB01XD.f MA02CD.f TG01HX.f cd (homedir); \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/makefile_norm.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_norm.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_norm.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -12,14 +15,16 @@ cd (srcdir); ## H-2 norm -mkoctfile slab13bd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab13bd.cc \ 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 ## L-inf norm -mkoctfile slab13dd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab13dd.cc \ 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 \ Modified: trunk/octave-forge/main/control/devel/makefile_place.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_place.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_place.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,7 +14,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slsb01bd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slsb01bd.cc \ SB01BD.f MB03QD.f MB03QY.f SB01BX.f SB01BY.f \ select.f Modified: trunk/octave-forge/main/control/devel/makefile_staircase.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_staircase.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_staircase.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -12,15 +15,18 @@ cd (srcdir); ## staircase form using orthogonal transformations -mkoctfile slab01od.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab01od.cc \ AB01OD.f AB01ND.f MB03OY.f MB01PD.f MB01QD.f ## controllability staircase form of descriptor state-space models -mkoctfile sltg01hd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + sltg01hd.cc \ TG01HD.f TG01HX.f ## observability staircase form of descriptor state-space models -mkoctfile sltg01id.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + sltg01id.cc \ TG01ID.f TB01XD.f MA02CD.f AB07MD.f TG01HX.f \ MA02BD.f Modified: trunk/octave-forge/main/control/devel/makefile_zero.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_zero.m 2011-01-17 19:57:02 UTC (rev 8062) +++ trunk/octave-forge/main/control/devel/makefile_zero.m 2011-01-17 22:00:34 UTC (rev 8063) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -12,11 +15,13 @@ cd (srcdir); ## transmission zeros of state-space models -mkoctfile slab08nd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab08nd.cc \ AB08ND.f AB08NX.f TB01ID.f MB03OY.f MB03PY.f ## transmission zeros of descriptor state-space models -mkoctfile slag08bd.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slag08bd.cc \ AG08BD.f AG08BY.f TG01AD.f TB01XD.f MA02CD.f \ TG01FD.f MA02BD.f MB03OY.f This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-02-11 22:16:22
|
Revision: 8106 http://octave.svn.sourceforge.net/octave/?rev=8106&view=rev Author: paramaniac Date: 2011-02-11 22:16:16 +0000 (Fri, 11 Feb 2011) Log Message: ----------- control: add first draft code for "multiplot" feature to /devel Added Paths: ----------- trunk/octave-forge/main/control/devel/__frequency_response_2__.m trunk/octave-forge/main/control/devel/__frequency_vector_2__.m trunk/octave-forge/main/control/devel/bode2.m trunk/octave-forge/main/control/devel/bode2test.m trunk/octave-forge/main/control/devel/zeromake.m Added: trunk/octave-forge/main/control/devel/__frequency_response_2__.m =================================================================== --- trunk/octave-forge/main/control/devel/__frequency_response_2__.m (rev 0) +++ trunk/octave-forge/main/control/devel/__frequency_response_2__.m 2011-02-11 22:16:16 UTC (rev 8106) @@ -0,0 +1,67 @@ +## Copyright (C) 2009, 2010 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 -*- +## Return frequency response H and frequency vector w. +## If w is empty, it will be calculated by __frequency_vector__. + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2009 +## Version: 0.2 + +% function [H, w] = __frequency_response_2__ (sys, w = [], mimoflag = 0, resptype = 0, wbounds = "std", cellflag = false) +function [H, w] = __frequency_response_2__ (mimoflag = 0, resptype = 0, wbounds = "std", cellflag = false, varargin) + + sys_vec = cellfun (@(x) isa (x, "lti"), varargin) # true or false + sys_idx = find (sys_vec) + + w_vec = cellfun (@is_real_vector, varargin) + w_idx = find (w_vec) + +% w_idx(end) + + if (isempty (w_idx)) + w = __frequency_vector_2__ (wbounds, varargin{sys_idx}) + endif + +varargin{sys_idx} + + ## check arguments + if(! isa (sys, "lti")) + error ("frequency_response: first argument sys must be an LTI system"); + endif + + if (! mimoflag && ! issiso (sys)) + error ("frequency_response: require SISO system"); + endif + + if (isa (sys, "frd")) + if (isempty (w)) + w = get (sys, "w"); + else + warning ("frequency_response: second argument w is ignored"); + endif + elseif (isempty (w)) # find interesting frequency range w if not specified + w = __frequency_vector__ (sys, wbounds); + elseif (! is_real_vector (w)) + error ("frequency_response: second argument w must be a vector of frequencies"); + endif + + ## frequency response + H = __freqresp__ (sys, w, resptype, cellflag); + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/devel/__frequency_vector_2__.m =================================================================== --- trunk/octave-forge/main/control/devel/__frequency_vector_2__.m (rev 0) +++ trunk/octave-forge/main/control/devel/__frequency_vector_2__.m 2011-02-11 22:16:16 UTC (rev 8106) @@ -0,0 +1,167 @@ +## Copyright (C) 1996, 2000, 2004, 2005, 2006, 2007 +## Auburn University. All rights reserved. +## +## +## This program 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. +## +## This program 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 this program; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{w} =} __frequency_vector__ (@var{sys}) +## Get default range of frequencies based on cutoff frequencies of system +## poles and zeros. +## Frequency range is the interval +## @iftex +## @tex +## $ [ 10^{w_{min}}, 10^{w_{max}} ] $ +## @end tex +## @end iftex +## @ifinfo +## [10^@var{wmin}, 10^@var{wmax}] +## @end ifinfo +## +## Used by @command{__frequency_response__} +## @end deftypefn + +## Adapted-By: Lukas Reichlin <luk...@gm...> +## Date: October 2009 +## Version: 0.2 + +function w = __frequency_vector_2__ (wbounds = "std", varargin) + + zer = cellfun ("@lti/zero", varargin, "uniformoutput", false) + pol = cellfun ("@lti/pole", varargin, "uniformoutput", false) + +% zer = cat (1, zer{:}) +% pol = cat (1, pol{:}) + + ct_idx = find (cellfun ("@lti/isct", varargin)) + dt_idx = setdiff (1 : nargin-1, ct_idx) + + %if (length (dt_idx) > 0) + tsam = cellfun (@(x) abs (get (x, "tsam")), varargin(dt_idx)) + %endif + +% zer_ct = cat (1, zer{ct_idx}) +% pol_ct = cat (1, pol{ct_idx}) + +% zer_dt = cat (1, zer{dt_idx}) +% pol_dt = cat (1, pol{dt_idx}) + + zer_ct = reshape (cat (1, zer{ct_idx}), 1, []) + pol_ct = reshape (cat (1, pol{ct_idx}), 1, []) + + zer_dt = reshape (cat (1, zer{dt_idx}), 1, []) + pol_dt = reshape (cat (1, pol{dt_idx}), 1, []) + + + if (length (ct_idx) > 0) ## continuous + iip = find (abs(pol) > norm(pol)*eps); + iiz = find (abs(zer) > norm(zer)*eps); + czer = zer(iiz); + cpol = pol(iip); + endif + +% zer = cat (1, zer{:}) +% pol = cat (1, pol{:}) + + +% zer = zero (sys); +% pol = pole (sys); +% tsam = abs (get (sys, "tsam")); # tsam could be -1 +% discrete = ! isct (sys); # static gains (tsam = -2) are assumed continuous + + ## make sure zer, pol are row vectors + pol = reshape (pol_ct, 1, []) + zer = reshape (zer, 1, []) + + ## check for natural frequencies away from omega = 0 + if (discrete) + ## The 2nd conditions prevents log(0) in the next log command + iiz = find (abs(zer-1) > norm(zer)*eps && abs(zer) > norm(zer)*eps); + iip = find (abs(pol-1) > norm(pol)*eps && abs(pol) > norm(pol)*eps); + + ## avoid dividing empty matrices, it would work but looks nasty + if (! isempty (iiz)) + czer = log (zer(iiz))/tsam; + else + czer = []; + endif + + if (! isempty (iip)) + cpol = log (pol(iip))/tsam; + else + cpol = []; + endif + else + ## continuous + iip = find (abs(pol) > norm(pol)*eps); + iiz = find (abs(zer) > norm(zer)*eps); + + if (! isempty (zer)) + czer = zer(iiz); + else + czer = []; + endif + if (! isempty (pol)) + cpol = pol(iip); + else + cpol = []; + endif + endif + + if (isempty (iip) && isempty (iiz)) + ## no poles/zeros away from omega = 0; pick defaults + dec_min = 0; # -1 + dec_max = 2; # 3 + else + dec_min = floor (log10 (min (abs ([cpol, czer])))); + dec_max = ceil (log10 (max (abs ([cpol, czer])))); + endif + + ## expand to show the entirety of the "interesting" portion of the plot + switch (wbounds) + case "std" # standard + if (dec_min == dec_max) + dec_min -= 2; + dec_max += 2; + else + dec_min--; + dec_max++; + endif + case "ext" # extended (for nyquist) + if (any (abs (pol) < sqrt (eps))) # look for integrators + ## dec_min -= 0.5; + dec_max += 2; + else + dec_min -= 2; + dec_max += 2; + endif + otherwise + error ("frequency_range: second argument invalid"); + endswitch + + ## run discrete frequency all the way to pi + if (discrete) + dec_max = log10 (pi/tsam); + endif + + ## create frequency vector + zp = [abs(zer), abs(pol)]; + idx = find (zp > 10^dec_min & zp < 10^dec_max); + zp = zp(idx); + + w = logspace (dec_min, dec_max, 500); + w = unique ([w, zp]); # unique also sorts frequency vector + +endfunction Added: trunk/octave-forge/main/control/devel/bode2.m =================================================================== --- trunk/octave-forge/main/control/devel/bode2.m (rev 0) +++ trunk/octave-forge/main/control/devel/bode2.m 2011-02-11 22:16:16 UTC (rev 8106) @@ -0,0 +1,98 @@ +## Copyright (C) 2009, 2010 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{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. +## @end table +## +## @strong{Outputs} +## @table @var +## @item mag +## Vector of magnitude. Has length of frequency vector @var{w}. +## @item pha +## Vector of phase. Has length of frequency vector @var{w}. +## @item w +## Vector of frequency values used. +## @end table +## +## @seealso{nichols, nyquist, sigma} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2009 +## Version: 0.2 + +function [mag_r, pha_r, w_r] = bode2 (varargin) + + ## TODO: multiplot feature: bode (sys1, "b", sys2, "r", ...) + +% if (nargin == 0 || nargin > 2) +% print_usage (); +% endif + + [H, w] = __frequency_response_2__ (false, 0, "std", false, varargin{:}); + + H = reshape (H, [], 1); + mag = abs (H); + pha = unwrap (arg (H)) * 180 / pi; + + if (! nargout) + mag_db = 20 * log10 (mag); + + wv = [min(w), max(w)]; + ax_vec_mag = __axis_limits__ ([reshape(w, [], 1), reshape(mag_db, [], 1)]); + ax_vec_mag(1:2) = wv; + ax_vec_pha = __axis_limits__ ([reshape(w, [], 1), reshape(pha, [], 1)]); + ax_vec_pha(1:2) = wv; + + if (isct (sys)) + xl_str = "Frequency [rad/s]"; + else + xl_str = sprintf ("Frequency [rad/s] w_N = %g", pi / get (sys, "tsam")); + endif + + subplot (2, 1, 1) + semilogx (w, mag_db) + axis (ax_vec_mag) + grid ("on") + title (["Bode Diagram of ", inputname(1)]) + ylabel ("Magnitude [dB]") + + subplot (2, 1, 2) + semilogx (w, pha) + axis (ax_vec_pha) + grid ("on") + xlabel (xl_str) + ylabel ("Phase [deg]") + else + mag_r = mag; + pha_r = pha; + w_r = w; + endif + +endfunction \ No newline at end of file Added: trunk/octave-forge/main/control/devel/bode2test.m =================================================================== --- trunk/octave-forge/main/control/devel/bode2test.m (rev 0) +++ trunk/octave-forge/main/control/devel/bode2test.m 2011-02-11 22:16:16 UTC (rev 8106) @@ -0,0 +1,12 @@ +A = ss (-2, 3, 4, 5); +B = ss (-1, 1, 1, 0); +C = ss (-4, 7, 10, 12); +w = [1 2 3 4 5 6 7]; + +%bode2 (A, B, "b", w, C) +%bode2 (A, B, "b", C) +%bode2 (A, B, "b", C, WestlandLynx) +%bode2 (WestlandLynx) +%bode2 (A, B, "b", c2d (C, 0.375), WestlandLynx) +bode2 (A, c2d (B, 0.223), "b", c2d (C, 0.375), WestlandLynx) + Added: trunk/octave-forge/main/control/devel/zeromake.m =================================================================== --- trunk/octave-forge/main/control/devel/zeromake.m (rev 0) +++ trunk/octave-forge/main/control/devel/zeromake.m 2011-02-11 22:16:16 UTC (rev 8106) @@ -0,0 +1 @@ +mkoctfile TG04BX.f MB02RD.f MB02SD.f \ 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...> - 2011-05-09 21:34:52
|
Revision: 8255 http://octave.svn.sourceforge.net/octave/?rev=8255&view=rev Author: paramaniac Date: 2011-05-09 21:34:44 +0000 (Mon, 09 May 2011) Log Message: ----------- control: add draft code for prescale command Added Paths: ----------- trunk/octave-forge/main/control/devel/scale/ trunk/octave-forge/main/control/devel/scale/TB01ID.dat trunk/octave-forge/main/control/devel/scale/TB01ID.f trunk/octave-forge/main/control/devel/scale/TB01ID.html trunk/octave-forge/main/control/devel/scale/TB01ID.res trunk/octave-forge/main/control/devel/scale/common.cc trunk/octave-forge/main/control/devel/scale/makefile_scale.m trunk/octave-forge/main/control/devel/scale/scale.m trunk/octave-forge/main/control/devel/scale/sltb01id.cc Property Changed: ---------------- trunk/octave-forge/main/control/devel/ trunk/octave-forge/main/control/devel/ss2tf/ Property changes on: trunk/octave-forge/main/control/devel ___________________________________________________________________ Added: svn:ignore + makefiles_2011_05_05_2158_no_veclib_args.zip Property changes on: trunk/octave-forge/main/control/devel/scale ___________________________________________________________________ Added: svn:ignore + TB01ID.oct sltb01id.oct Added: trunk/octave-forge/main/control/devel/scale/TB01ID.dat =================================================================== --- trunk/octave-forge/main/control/devel/scale/TB01ID.dat (rev 0) +++ trunk/octave-forge/main/control/devel/scale/TB01ID.dat 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,17 @@ + TB01ID EXAMPLE PROGRAM DATA + 5 2 5 A 0.0 + 0.0 1.0000e+000 0.0 0.0 0.0 + -1.5800e+006 -1.2570e+003 0.0 0.0 0.0 + 3.5410e+014 0.0 -1.4340e+003 0.0 -5.3300e+011 + 0.0 0.0 0.0 0.0 1.0000e+000 + 0.0 0.0 0.0 -1.8630e+004 -1.4820e+000 + 0.0 0.0 + 1.1030e+002 0.0 + 0.0 0.0 + 0.0 0.0 + 0.0 8.3330e-003 + 1.0000e+000 0.0 0.0 0.0 0.0 + 0.0 0.0 1.0000e+000 0.0 0.0 + 0.0 0.0 0.0 1.0000e+000 0.0 + 6.6640e-001 0.0 -6.2000e-013 0.0 0.0 + 0.0 0.0 -1.0000e-003 1.8960e+006 1.5080e+002 Added: trunk/octave-forge/main/control/devel/scale/TB01ID.f =================================================================== --- trunk/octave-forge/main/control/devel/scale/TB01ID.f (rev 0) +++ trunk/octave-forge/main/control/devel/scale/TB01ID.f 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,402 @@ + SUBROUTINE TB01ID( JOB, N, M, P, MAXRED, A, LDA, B, LDB, C, LDC, + $ SCALE, INFO ) +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 reduce the 1-norm of a system matrix +C +C S = ( A B ) +C ( C 0 ) +C +C corresponding to the triple (A,B,C), by balancing. This involves +C a diagonal similarity transformation inv(D)*A*D applied +C iteratively to A to make the rows and columns of +C -1 +C diag(D,I) * S * diag(D,I) +C +C as close in norm as possible. +C +C The balancing can be performed optionally on the following +C particular system matrices +C +C S = A, S = ( A B ) or S = ( A ) +C ( C ) +C +C ARGUMENTS +C +C Mode Parameters +C +C JOB CHARACTER*1 +C Indicates which matrices are involved in balancing, as +C follows: +C = 'A': All matrices are involved in balancing; +C = 'B': B and A matrices are involved in balancing; +C = 'C': C and A matrices are involved in balancing; +C = 'N': B and C matrices are not involved in balancing. +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the matrix A, the number of rows of matrix B +C and the number of columns of matrix C. +C N represents the dimension of the state vector. N >= 0. +C +C M (input) INTEGER. +C The number of columns of matrix B. +C M represents the dimension of input vector. M >= 0. +C +C P (input) INTEGER. +C The number of rows of matrix C. +C P represents the dimension of output vector. P >= 0. +C +C MAXRED (input/output) DOUBLE PRECISION +C On entry, the maximum allowed reduction in the 1-norm of +C S (in an iteration) if zero rows or columns are +C encountered. +C If MAXRED > 0.0, MAXRED must be larger than one (to enable +C the norm reduction). +C If MAXRED <= 0.0, then the value 10.0 for MAXRED is +C used. +C On exit, if the 1-norm of the given matrix S is non-zero, +C the ratio between the 1-norm of the given matrix and the +C 1-norm of the balanced matrix. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading N-by-N part of this array must +C contain the system state matrix A. +C On exit, the leading N-by-N part of this array contains +C the balanced matrix inv(D)*A*D. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,N). +C +C B (input/output) DOUBLE PRECISION array, dimension (LDB,M) +C On entry, if M > 0, the leading N-by-M part of this array +C must contain the system input matrix B. +C On exit, if M > 0, the leading N-by-M part of this array +C contains the balanced matrix inv(D)*B. +C The array B is not referenced if M = 0. +C +C LDB INTEGER +C The leading dimension of the array B. +C LDB >= MAX(1,N) if M > 0. +C LDB >= 1 if M = 0. +C +C C (input/output) DOUBLE PRECISION array, dimension (LDC,N) +C On entry, if P > 0, the leading P-by-N part of this array +C must contain the system output matrix C. +C On exit, if P > 0, the leading P-by-N part of this array +C contains the balanced matrix C*D. +C The array C is not referenced if P = 0. +C +C LDC INTEGER +C The leading dimension of the array C. LDC >= MAX(1,P). +C +C SCALE (output) DOUBLE PRECISION array, dimension (N) +C The scaling factors applied to S. If D(j) is the scaling +C factor applied to row and column j, then SCALE(j) = D(j), +C for j = 1,...,N. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit. +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C Balancing consists of applying a diagonal similarity +C transformation +C -1 +C diag(D,I) * S * diag(D,I) +C +C to make the 1-norms of each row of the first N rows of S and its +C corresponding column nearly equal. +C +C Information about the diagonal matrix D is returned in the vector +C SCALE. +C +C REFERENCES +C +C [1] Anderson, E., Bai, Z., Bischof, C., Demmel, J., Dongarra, J., +C Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A., +C Ostrouchov, S., and Sorensen, D. +C LAPACK Users' Guide: Second Edition. +C SIAM, Philadelphia, 1995. +C +C NUMERICAL ASPECTS +C +C None. +C +C CONTRIBUTOR +C +C Release 3.0: V. Sima, Katholieke Univ. Leuven, Belgium, Jan. 1998. +C This subroutine is based on LAPACK routine DGEBAL, and routine +C BALABC (A. Varga, German Aerospace Research Establishment, DLR). +C +C REVISIONS +C +C - +C +C KEYWORDS +C +C Balancing, eigenvalue, matrix algebra, matrix operations, +C similarity transformation. +C +C ********************************************************************* +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) + DOUBLE PRECISION SCLFAC + PARAMETER ( SCLFAC = 1.0D+1 ) + DOUBLE PRECISION FACTOR, MAXR + PARAMETER ( FACTOR = 0.95D+0, MAXR = 10.0D+0 ) +C .. +C .. Scalar Arguments .. + CHARACTER JOB + INTEGER INFO, LDA, LDB, LDC, M, N, P + DOUBLE PRECISION MAXRED +C .. +C .. Array Arguments .. + DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ), + $ SCALE( * ) +C .. +C .. Local Scalars .. + LOGICAL NOCONV, WITHB, WITHC + INTEGER I, ICA, IRA, J + DOUBLE PRECISION CA, CO, F, G, MAXNRM, RA, RO, S, SFMAX1, + $ SFMAX2, SFMIN1, SFMIN2, SNORM, SRED +C .. +C .. External Functions .. + LOGICAL LSAME + INTEGER IDAMAX + DOUBLE PRECISION DASUM, DLAMCH + EXTERNAL DASUM, DLAMCH, IDAMAX, LSAME +C .. +C .. External Subroutines .. + EXTERNAL DSCAL, XERBLA +C .. +C .. Intrinsic Functions .. + INTRINSIC ABS, MAX, MIN +C .. +C .. Executable Statements .. +C +C Test the scalar input arguments. +C + INFO = 0 + WITHB = LSAME( JOB, 'A' ) .OR. LSAME( JOB, 'B' ) + WITHC = LSAME( JOB, 'A' ) .OR. LSAME( JOB, 'C' ) +C + IF( .NOT.WITHB .AND. .NOT.WITHC .AND. .NOT.LSAME( JOB, 'N' ) ) + $ THEN + INFO = -1 + ELSE IF( N.LT.0 ) THEN + INFO = -2 + ELSE IF( M.LT.0 ) THEN + INFO = -3 + ELSE IF( P.LT.0 ) THEN + INFO = -4 + ELSE IF( MAXRED.GT.ZERO .AND. MAXRED.LT.ONE ) THEN + INFO = -5 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -7 + ELSE IF( ( M.GT.0 .AND. LDB.LT.MAX( 1, N ) ) .OR. + $ ( M.EQ.0 .AND. LDB.LT.1 ) ) THEN + INFO = -9 + ELSE IF( LDC.LT.MAX( 1, P ) ) THEN + INFO = -11 + END IF + IF( INFO.NE.0 ) THEN + CALL XERBLA( 'TB01ID', -INFO ) + RETURN + END IF +C + IF( N.EQ.0 ) + $ RETURN +C +C Compute the 1-norm of the required part of matrix S and exit if +C it is zero. +C + SNORM = ZERO +C + DO 10 J = 1, N + SCALE( J ) = ONE + CO = DASUM( N, A( 1, J ), 1 ) + IF( WITHC .AND. P.GT.0 ) + $ CO = CO + DASUM( P, C( 1, J ), 1 ) + SNORM = MAX( SNORM, CO ) + 10 CONTINUE +C + IF( WITHB ) THEN +C + DO 20 J = 1, M + SNORM = MAX( SNORM, DASUM( N, B( 1, J ), 1 ) ) + 20 CONTINUE +C + END IF +C + IF( SNORM.EQ.ZERO ) + $ RETURN +C +C Set some machine parameters and the maximum reduction in the +C 1-norm of S if zero rows or columns are encountered. +C + SFMIN1 = DLAMCH( 'S' ) / DLAMCH( 'P' ) + SFMAX1 = ONE / SFMIN1 + SFMIN2 = SFMIN1*SCLFAC + SFMAX2 = ONE / SFMIN2 +C + SRED = MAXRED + IF( SRED.LE.ZERO ) SRED = MAXR +C + MAXNRM = MAX( SNORM/SRED, SFMIN1 ) +C +C Balance the matrix. +C +C Iterative loop for norm reduction. +C + 30 CONTINUE + NOCONV = .FALSE. +C + DO 90 I = 1, N + CO = ZERO + RO = ZERO +C + DO 40 J = 1, N + IF( J.EQ.I ) + $ GO TO 40 + CO = CO + ABS( A( J, I ) ) + RO = RO + ABS( A( I, J ) ) + 40 CONTINUE +C + ICA = IDAMAX( N, A( 1, I ), 1 ) + CA = ABS( A( ICA, I ) ) + IRA = IDAMAX( N, A( I, 1 ), LDA ) + RA = ABS( A( I, IRA ) ) +C + IF( WITHC .AND. P.GT.0 ) THEN + CO = CO + DASUM( P, C( 1, I ), 1 ) + ICA = IDAMAX( P, C( 1, I ), 1 ) + CA = MAX( CA, ABS( C( ICA, I ) ) ) + END IF +C + IF( WITHB .AND. M.GT.0 ) THEN + RO = RO + DASUM( M, B( I, 1 ), LDB ) + IRA = IDAMAX( M, B( I, 1 ), LDB ) + RA = MAX( RA, ABS( B( I, IRA ) ) ) + END IF +C +C Special case of zero CO and/or RO. +C + IF( CO.EQ.ZERO .AND. RO.EQ.ZERO ) + $ GO TO 90 + IF( CO.EQ.ZERO ) THEN + IF( RO.LE.MAXNRM ) + $ GO TO 90 + CO = MAXNRM + END IF + IF( RO.EQ.ZERO ) THEN + IF( CO.LE.MAXNRM ) + $ GO TO 90 + RO = MAXNRM + END IF +C +C Guard against zero CO or RO due to underflow. +C + G = RO / SCLFAC + F = ONE + S = CO + RO + 50 CONTINUE + IF( CO.GE.G .OR. MAX( F, CO, CA ).GE.SFMAX2 .OR. + $ MIN( RO, G, RA ).LE.SFMIN2 )GO TO 60 + F = F*SCLFAC + CO = CO*SCLFAC + CA = CA*SCLFAC + G = G / SCLFAC + RO = RO / SCLFAC + RA = RA / SCLFAC + GO TO 50 +C + 60 CONTINUE + G = CO / SCLFAC + 70 CONTINUE + IF( G.LT.RO .OR. MAX( RO, RA ).GE.SFMAX2 .OR. + $ MIN( F, CO, G, CA ).LE.SFMIN2 )GO TO 80 + F = F / SCLFAC + CO = CO / SCLFAC + CA = CA / SCLFAC + G = G / SCLFAC + RO = RO*SCLFAC + RA = RA*SCLFAC + GO TO 70 +C +C Now balance. +C + 80 CONTINUE + IF( ( CO+RO ).GE.FACTOR*S ) + $ GO TO 90 + IF( F.LT.ONE .AND. SCALE( I ).LT.ONE ) THEN + IF( F*SCALE( I ).LE.SFMIN1 ) + $ GO TO 90 + END IF + IF( F.GT.ONE .AND. SCALE( I ).GT.ONE ) THEN + IF( SCALE( I ).GE.SFMAX1 / F ) + $ GO TO 90 + END IF + G = ONE / F + SCALE( I ) = SCALE( I )*F + NOCONV = .TRUE. +C + CALL DSCAL( N, G, A( I, 1 ), LDA ) + CALL DSCAL( N, F, A( 1, I ), 1 ) + IF( M.GT.0 ) CALL DSCAL( M, G, B( I, 1 ), LDB ) + IF( P.GT.0 ) CALL DSCAL( P, F, C( 1, I ), 1 ) +C + 90 CONTINUE +C + IF( NOCONV ) + $ GO TO 30 +C +C Set the norm reduction parameter. +C + MAXRED = SNORM + SNORM = ZERO +C + DO 100 J = 1, N + CO = DASUM( N, A( 1, J ), 1 ) + IF( WITHC .AND. P.GT.0 ) + $ CO = CO + DASUM( P, C( 1, J ), 1 ) + SNORM = MAX( SNORM, CO ) + 100 CONTINUE +C + IF( WITHB ) THEN +C + DO 110 J = 1, M + SNORM = MAX( SNORM, DASUM( N, B( 1, J ), 1 ) ) + 110 CONTINUE +C + END IF + MAXRED = MAXRED/SNORM + RETURN +C *** Last line of TB01ID *** + END Added: trunk/octave-forge/main/control/devel/scale/TB01ID.html =================================================================== --- trunk/octave-forge/main/control/devel/scale/TB01ID.html (rev 0) +++ trunk/octave-forge/main/control/devel/scale/TB01ID.html 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,312 @@ +<HTML> +<HEAD><TITLE>TB01ID - SLICOT Library Routine Documentation</TITLE> +</HEAD> +<BODY> + +<H2><A Name="TB01ID">TB01ID</A></H2> +<H3> +Balancing a system matrix corresponding to a triplet (A,B,C) +</H3> +<A HREF ="#Specification"><B>[Specification]</B></A> +<A HREF ="#Arguments"><B>[Arguments]</B></A> +<A HREF ="#Method"><B>[Method]</B></A> +<A HREF ="#References"><B>[References]</B></A> +<A HREF ="#Comments"><B>[Comments]</B></A> +<A HREF ="#Example"><B>[Example]</B></A> + +<P> +<B><FONT SIZE="+1">Purpose</FONT></B> +<PRE> + To reduce the 1-norm of a system matrix + + S = ( A B ) + ( C 0 ) + + corresponding to the triple (A,B,C), by balancing. This involves + a diagonal similarity transformation inv(D)*A*D applied + iteratively to A to make the rows and columns of + -1 + diag(D,I) * S * diag(D,I) + + as close in norm as possible. + + The balancing can be performed optionally on the following + particular system matrices + + S = A, S = ( A B ) or S = ( A ) + ( C ) + +</PRE> +<A name="Specification"><B><FONT SIZE="+1">Specification</FONT></B></A> +<PRE> + SUBROUTINE TB01ID( JOB, N, M, P, MAXRED, A, LDA, B, LDB, C, LDC, + $ SCALE, INFO ) +C .. Scalar Arguments .. + CHARACTER JOB + INTEGER INFO, LDA, LDB, LDC, M, N, P + DOUBLE PRECISION MAXRED +C .. Array Arguments .. + DOUBLE PRECISION A( LDA, * ), B( LDB, * ), C( LDC, * ), + $ SCALE( * ) + +</PRE> +<A name="Arguments"><B><FONT SIZE="+1">Arguments</FONT></B></A> +<P> + +<B>Mode Parameters</B> +<PRE> + JOB CHARACTER*1 + Indicates which matrices are involved in balancing, as + follows: + = 'A': All matrices are involved in balancing; + = 'B': B and A matrices are involved in balancing; + = 'C': C and A matrices are involved in balancing; + = 'N': B and C matrices are not involved in balancing. + +</PRE> +<B>Input/Output Parameters</B> +<PRE> + N (input) INTEGER + The order of the matrix A, the number of rows of matrix B + and the number of columns of matrix C. + N represents the dimension of the state vector. N >= 0. + + M (input) INTEGER. + The number of columns of matrix B. + M represents the dimension of input vector. M >= 0. + + P (input) INTEGER. + The number of rows of matrix C. + P represents the dimension of output vector. P >= 0. + + MAXRED (input/output) DOUBLE PRECISION + On entry, the maximum allowed reduction in the 1-norm of + S (in an iteration) if zero rows or columns are + encountered. + If MAXRED > 0.0, MAXRED must be larger than one (to enable + the norm reduction). + If MAXRED <= 0.0, then the value 10.0 for MAXRED is + used. + On exit, if the 1-norm of the given matrix S is non-zero, + the ratio between the 1-norm of the given matrix and the + 1-norm of the balanced matrix. + + A (input/output) DOUBLE PRECISION array, dimension (LDA,N) + On entry, the leading N-by-N part of this array must + contain the system state matrix A. + On exit, the leading N-by-N part of this array contains + the balanced matrix inv(D)*A*D. + + LDA INTEGER + The leading dimension of the array A. LDA >= max(1,N). + + B (input/output) DOUBLE PRECISION array, dimension (LDB,M) + On entry, if M > 0, the leading N-by-M part of this array + must contain the system input matrix B. + On exit, if M > 0, the leading N-by-M part of this array + contains the balanced matrix inv(D)*B. + The array B is not referenced if M = 0. + + LDB INTEGER + The leading dimension of the array B. + LDB >= MAX(1,N) if M > 0. + LDB >= 1 if M = 0. + + C (input/output) DOUBLE PRECISION array, dimension (LDC,N) + On entry, if P > 0, the leading P-by-N part of this array + must contain the system output matrix C. + On exit, if P > 0, the leading P-by-N part of this array + contains the balanced matrix C*D. + The array C is not referenced if P = 0. + + LDC INTEGER + The leading dimension of the array C. LDC >= MAX(1,P). + + SCALE (output) DOUBLE PRECISION array, dimension (N) + The scaling factors applied to S. If D(j) is the scaling + factor applied to row and column j, then SCALE(j) = D(j), + for j = 1,...,N. + +</PRE> +<B>Error Indicator</B> +<PRE> + INFO INTEGER + = 0: successful exit. + < 0: if INFO = -i, the i-th argument had an illegal + value. + +</PRE> +<A name="Method"><B><FONT SIZE="+1">Method</FONT></B></A> +<PRE> + Balancing consists of applying a diagonal similarity + transformation + -1 + diag(D,I) * S * diag(D,I) + + to make the 1-norms of each row of the first N rows of S and its + corresponding column nearly equal. + + Information about the diagonal matrix D is returned in the vector + SCALE. + +</PRE> +<A name="References"><B><FONT SIZE="+1">References</FONT></B></A> +<PRE> + [1] Anderson, E., Bai, Z., Bischof, C., Demmel, J., Dongarra, J., + Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A., + Ostrouchov, S., and Sorensen, D. + LAPACK Users' Guide: Second Edition. + SIAM, Philadelphia, 1995. + +</PRE> +<A name="Numerical Aspects"><B><FONT SIZE="+1">Numerical Aspects</FONT></B></A> +<PRE> + None. + +</PRE> + +<A name="Comments"><B><FONT SIZE="+1">Further Comments</FONT></B></A> +<PRE> + None +</PRE> + +<A name="Example"><B><FONT SIZE="+1">Example</FONT></B></A> +<P> +<B>Program Text</B> +<PRE> +* TB01ID EXAMPLE PROGRAM TEXT. +* Copyright (c) 2002-2009 NICONET e.V. +* +* .. Parameters .. + INTEGER NIN, NOUT + PARAMETER ( NIN = 5, NOUT = 6 ) + INTEGER NMAX, MMAX, PMAX + PARAMETER ( NMAX = 20, MMAX = 20, PMAX = 20 ) + INTEGER LDA, LDB, LDC + PARAMETER ( LDA = NMAX, LDB = NMAX, LDC = PMAX ) +* .. Local Scalars .. + CHARACTER*1 JOB + INTEGER I, INFO, J, M, N, P + DOUBLE PRECISION MAXRED +* .. Local Arrays .. + DOUBLE PRECISION A(LDA,NMAX), B(LDB,MMAX), C(LDC,NMAX), + $ SCALE(NMAX) +* .. External Subroutines .. + EXTERNAL TB01ID, UD01MD +* .. Executable Statements .. +* + WRITE ( NOUT, FMT = 99999 ) +* Skip the heading in the data file and read the data. + READ ( NIN, FMT = '()' ) + READ ( NIN, FMT = * ) N, M, P, JOB, MAXRED + IF ( N.LT.0 .OR. N.GT.NMAX ) THEN + WRITE ( NOUT, FMT = 99993 ) N + ELSE + READ ( NIN, FMT = * ) ( ( A(I,J), J = 1,N ), I = 1,N ) + IF ( M.LT.0 .OR. M.GT.MMAX ) THEN + WRITE ( NOUT, FMT = 99992 ) M + ELSE + READ ( NIN, FMT = * ) ( ( B(I,J), J = 1,M ), I = 1,N ) + IF ( P.LT.0 .OR. P.GT.MMAX ) THEN + WRITE ( NOUT, FMT = 99991 ) P + ELSE + READ ( NIN, FMT = * ) ( ( C(I,J), J = 1,N ), I = 1,P ) +* Balance system matrix S. + CALL TB01ID( JOB, N, M, P, MAXRED, A, LDA, B, LDB, C, + $ LDC, SCALE, INFO ) +* + IF ( INFO.NE.0 ) THEN + WRITE ( NOUT, FMT = 99998 ) INFO + ELSE + CALL UD01MD( N, N, 5, NOUT, A, LDA, + $ 'The balanced matrix A', INFO ) + IF ( M.GT.0 ) + $ CALL UD01MD( N, M, 5, NOUT, B, LDB, + $ 'The balanced matrix B', INFO ) + IF ( P.GT.0 ) + $ CALL UD01MD( P, N, 5, NOUT, C, LDC, + $ 'The balanced matrix C', INFO ) + CALL UD01MD( 1, N, 5, NOUT, SCALE, 1, + $ 'The scaling vector SCALE', INFO ) + WRITE ( NOUT, FMT = 99994 ) MAXRED + END IF + END IF + END IF + END IF + STOP +* +99999 FORMAT (' TB01ID EXAMPLE PROGRAM RESULTS',/1X) +99998 FORMAT (' INFO on exit from TB01ID = ',I2) +99994 FORMAT (/' MAXRED is ',E13.4) +99993 FORMAT (/' N is out of range.',/' N = ',I5) +99992 FORMAT (/' M is out of range.',/' M = ',I5) +99991 FORMAT (/' P is out of range.',/' P = ',I5) + END +</PRE> +<B>Program Data</B> +<PRE> + TB01ID EXAMPLE PROGRAM DATA + 5 2 5 A 0.0 + 0.0 1.0000e+000 0.0 0.0 0.0 + -1.5800e+006 -1.2570e+003 0.0 0.0 0.0 + 3.5410e+014 0.0 -1.4340e+003 0.0 -5.3300e+011 + 0.0 0.0 0.0 0.0 1.0000e+000 + 0.0 0.0 0.0 -1.8630e+004 -1.4820e+000 + 0.0 0.0 + 1.1030e+002 0.0 + 0.0 0.0 + 0.0 0.0 + 0.0 8.3330e-003 + 1.0000e+000 0.0 0.0 0.0 0.0 + 0.0 0.0 1.0000e+000 0.0 0.0 + 0.0 0.0 0.0 1.0000e+000 0.0 + 6.6640e-001 0.0 -6.2000e-013 0.0 0.0 + 0.0 0.0 -1.0000e-003 1.8960e+006 1.5080e+002 +</PRE> +<B>Program Results</B> +<PRE> + TB01ID EXAMPLE PROGRAM RESULTS + + The balanced matrix A ( 5X 5) + + 1 2 3 4 5 + 1 0.0000000D+00 0.1000000D+05 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 -0.1580000D+03 -0.1257000D+04 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 3 0.3541000D+05 0.0000000D+00 -0.1434000D+04 0.0000000D+00 -0.5330000D+03 + 4 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+03 + 5 0.0000000D+00 0.0000000D+00 0.0000000D+00 -0.1863000D+03 -0.1482000D+01 + + The balanced matrix B ( 5X 2) + + 1 2 + 1 0.0000000D+00 0.0000000D+00 + 2 0.1103000D+04 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 + 4 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.8333000D+02 + + The balanced matrix C ( 5X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 0.0000000D+00 0.0000000D+00 0.1000000D+06 0.0000000D+00 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D-05 0.0000000D+00 + 4 0.6664000D-05 0.0000000D+00 -0.6200000D-07 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.0000000D+00 -0.1000000D+03 0.1896000D+01 0.1508000D-01 + + The scaling vector SCALE ( 1X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.1000000D+00 0.1000000D+06 0.1000000D-05 0.1000000D-03 + + + MAXRED is 0.3488E+10 +</PRE> + +<HR> +<p> +Click <a href=../../SLICOT/arc/T/TB/TB01/TB01ID.tar.gz><B>here</B></a> to get a compressed (gzip) tar file containing the source code +of the routine, the example program, data, documentation, and related files. +</p> +<A HREF=../libindex.html><B>Return to index</B></A></BODY> +</HTML> Added: trunk/octave-forge/main/control/devel/scale/TB01ID.res =================================================================== --- trunk/octave-forge/main/control/devel/scale/TB01ID.res (rev 0) +++ trunk/octave-forge/main/control/devel/scale/TB01ID.res 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,36 @@ + TB01ID EXAMPLE PROGRAM RESULTS + + The balanced matrix A ( 5X 5) + + 1 2 3 4 5 + 1 0.0000000D+00 0.1000000D+05 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 -0.1580000D+03 -0.1257000D+04 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 3 0.3541000D+05 0.0000000D+00 -0.1434000D+04 0.0000000D+00 -0.5330000D+03 + 4 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+03 + 5 0.0000000D+00 0.0000000D+00 0.0000000D+00 -0.1863000D+03 -0.1482000D+01 + + The balanced matrix B ( 5X 2) + + 1 2 + 1 0.0000000D+00 0.0000000D+00 + 2 0.1103000D+04 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 + 4 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.8333000D+02 + + The balanced matrix C ( 5X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 0.0000000D+00 0.0000000D+00 0.1000000D+06 0.0000000D+00 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D-05 0.0000000D+00 + 4 0.6664000D-05 0.0000000D+00 -0.6200000D-07 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.0000000D+00 -0.1000000D+03 0.1896000D+01 0.1508000D-01 + + The scaling vector SCALE ( 1X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.1000000D+00 0.1000000D+06 0.1000000D-05 0.1000000D-03 + + + MAXRED is 0.3488E+10 Added: trunk/octave-forge/main/control/devel/scale/common.cc =================================================================== --- trunk/octave-forge/main/control/devel/scale/common.cc (rev 0) +++ trunk/octave-forge/main/control/devel/scale/common.cc 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,53 @@ +/* + +Copyright (C) 2010 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/>. + +Common code for oct-files. + +Author: Lukas Reichlin <luk...@gm...> +Created: April 2010 +Version: 0.1 + +*/ + + +int max (int a, int b) +{ + if (a > b) + return a; + else + return b; +} + +int max (int a, int b, int c) +{ + return max (max (a, b), c); +} + +int max (int a, int b, int c, int d) +{ + return max (max (a, b), max (c, d)); +} + +int min (int a, int b) +{ + if (a < b) + return a; + else + return b; +} Added: trunk/octave-forge/main/control/devel/scale/makefile_scale.m =================================================================== --- trunk/octave-forge/main/control/devel/scale/makefile_scale.m (rev 0) +++ trunk/octave-forge/main/control/devel/scale/makefile_scale.m 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,5 @@ +## scaling of state-space models +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + sltb01id.cc \ + TB01ID.f + Added: trunk/octave-forge/main/control/devel/scale/scale.m =================================================================== --- trunk/octave-forge/main/control/devel/scale/scale.m (rev 0) +++ trunk/octave-forge/main/control/devel/scale/scale.m 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,68 @@ + +a = [ + 0.0 1.0000e+000 0.0 0.0 0.0 + -1.5800e+006 -1.2570e+003 0.0 0.0 0.0 + 3.5410e+014 0.0 -1.4340e+003 0.0 -5.3300e+011 + 0.0 0.0 0.0 0.0 1.0000e+000 + 0.0 0.0 0.0 -1.8630e+004 -1.4820e+000 +]; + +b = [ + 0.0 0.0 + 1.1030e+002 0.0 + 0.0 0.0 + 0.0 0.0 + 0.0 8.3330e-003 +]; + +c = [ + 1.0000e+000 0.0 0.0 0.0 0.0 + 0.0 0.0 1.0000e+000 0.0 0.0 + 0.0 0.0 0.0 1.0000e+000 0.0 + 6.6640e-001 0.0 -6.2000e-013 0.0 0.0 + 0.0 0.0 -1.0000e-003 1.8960e+006 1.5080e+002 +]; + +[as, bs, cs, maxred, scale] = sltb01id (a, b, c, 0); + +as, bs, cs, maxred, scale + + +%{ + TB01ID EXAMPLE PROGRAM RESULTS + + The balanced matrix A ( 5X 5) + + 1 2 3 4 5 + 1 0.0000000D+00 0.1000000D+05 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 -0.1580000D+03 -0.1257000D+04 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 3 0.3541000D+05 0.0000000D+00 -0.1434000D+04 0.0000000D+00 -0.5330000D+03 + 4 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D+03 + 5 0.0000000D+00 0.0000000D+00 0.0000000D+00 -0.1863000D+03 -0.1482000D+01 + + The balanced matrix B ( 5X 2) + + 1 2 + 1 0.0000000D+00 0.0000000D+00 + 2 0.1103000D+04 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 + 4 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.8333000D+02 + + The balanced matrix C ( 5X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.0000000D+00 + 2 0.0000000D+00 0.0000000D+00 0.1000000D+06 0.0000000D+00 0.0000000D+00 + 3 0.0000000D+00 0.0000000D+00 0.0000000D+00 0.1000000D-05 0.0000000D+00 + 4 0.6664000D-05 0.0000000D+00 -0.6200000D-07 0.0000000D+00 0.0000000D+00 + 5 0.0000000D+00 0.0000000D+00 -0.1000000D+03 0.1896000D+01 0.1508000D-01 + + The scaling vector SCALE ( 1X 5) + + 1 2 3 4 5 + 1 0.1000000D-04 0.1000000D+00 0.1000000D+06 0.1000000D-05 0.1000000D-03 + + + MAXRED is 0.3488E+10 +%} \ No newline at end of file Added: trunk/octave-forge/main/control/devel/scale/sltb01id.cc =================================================================== --- trunk/octave-forge/main/control/devel/scale/sltb01id.cc (rev 0) +++ trunk/octave-forge/main/control/devel/scale/sltb01id.cc 2011-05-09 21:34:44 UTC (rev 8255) @@ -0,0 +1,114 @@ +/* + +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/>. + +Balance state-space model. +Uses SLICOT TB01ID by courtesy of NICONET e.V. +<http://www.slicot.org> + +Author: Lukas Reichlin <luk...@gm...> +Created: May 2011 +Version: 0.1 + +*/ + +#include <octave/oct.h> +#include <f77-fcn.h> +#include "common.cc" + +extern "C" +{ + int F77_FUNC (tb01id, TB01ID) + (char& JOB, + int& N, int& M, int& P, + double& MAXRED, + double* A, int& LDA, + double* B, int& LDB, + double* C, int& LDC, + double* SCALE, + int& INFO); +} + +DEFUN_DLD (sltb01id, args, nargout, + "-*- texinfo -*-\n\ +Slicot TB01ID 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 job = 'A'; + + Matrix a = args(0).matrix_value (); + Matrix b = args(1).matrix_value (); + Matrix c = args(2).matrix_value (); + double maxred = 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); + + + // arguments out + ColumnVector scale (n); + + + // error indicators + int info = 0; + + + // SLICOT routine TB01ID + F77_XFCN (tb01id, TB01ID, + (job, + n, m, p, + maxred, + a.fortran_vec (), lda, + b.fortran_vec (), ldb, + c.fortran_vec (), ldc, + scale.fortran_vec (), + info)); + + if (f77_exception_encountered) + error ("ss: prescale: sltb01id: exception in SLICOT subroutine TB01ID"); + + if (info != 0) + error ("ss: prescale: sltb01id: TB01ID returned info = %d", info); + + + // return values + retval(0) = a; + retval(1) = b; + retval(2) = c; + retval(3) = octave_value (maxred); + retval(4) = scale; + } + + return retval; +} Property changes on: trunk/octave-forge/main/control/devel/ss2tf ___________________________________________________________________ Added: svn:ignore + sltb04bd.oct This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-06-29 18:47:29
|
Revision: 8367 http://octave.svn.sourceforge.net/octave/?rev=8367&view=rev Author: paramaniac Date: 2011-06-29 18:47:23 +0000 (Wed, 29 Jun 2011) Log Message: ----------- control: use * for svn ignore Property Changed: ---------------- trunk/octave-forge/main/control/devel/ trunk/octave-forge/main/control/devel/ss2tf/ Property changes on: trunk/octave-forge/main/control/devel ___________________________________________________________________ Modified: svn:ignore - makefiles_2011_05_05_2158_no_veclib_args.zip + *.zip Property changes on: trunk/octave-forge/main/control/devel/ss2tf ___________________________________________________________________ Modified: svn:ignore - sltb04bd.oct + *.oct This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-07-07 21:39:51
|
Revision: 8381 http://octave.svn.sourceforge.net/octave/?rev=8381&view=rev Author: paramaniac Date: 2011-07-07 21:39:42 +0000 (Thu, 07 Jul 2011) Log Message: ----------- control: add fortran files for model and controller reduction Added Paths: ----------- trunk/octave-forge/main/control/devel/slred/ trunk/octave-forge/main/control/devel/slred/reduction_methods.txt trunk/octave-forge/main/control/devel/slred/slconred/ trunk/octave-forge/main/control/devel/slred/slconred/AB05PD.f trunk/octave-forge/main/control/devel/slred/slconred/AB05QD.f trunk/octave-forge/main/control/devel/slred/slconred/AB07ND.f trunk/octave-forge/main/control/devel/slred/slconred/AB09AD.f trunk/octave-forge/main/control/devel/slred/slconred/AB09AX.f trunk/octave-forge/main/control/devel/slred/slconred/AB09BD.f trunk/octave-forge/main/control/devel/slred/slconred/AB09BX.f trunk/octave-forge/main/control/devel/slred/slconred/AB09DD.f trunk/octave-forge/main/control/devel/slred/slconred/AB09IX.f trunk/octave-forge/main/control/devel/slred/slconred/MA02AD.f trunk/octave-forge/main/control/devel/slred/slconred/MA02DD.f trunk/octave-forge/main/control/devel/slred/slconred/MA02GD.f trunk/octave-forge/main/control/devel/slred/slconred/MB01SD.f trunk/octave-forge/main/control/devel/slred/slconred/MB01WD.f trunk/octave-forge/main/control/devel/slred/slconred/MB01YD.f trunk/octave-forge/main/control/devel/slred/slconred/MB01ZD.f trunk/octave-forge/main/control/devel/slred/slconred/MB02UD.f trunk/octave-forge/main/control/devel/slred/slconred/MB03QD.f trunk/octave-forge/main/control/devel/slred/slconred/MB03QX.f trunk/octave-forge/main/control/devel/slred/slconred/MB03QY.f trunk/octave-forge/main/control/devel/slred/slconred/MB03UD.f trunk/octave-forge/main/control/devel/slred/slconred/MB04ND.f trunk/octave-forge/main/control/devel/slred/slconred/MB04NY.f trunk/octave-forge/main/control/devel/slred/slconred/MB04OD.f trunk/octave-forge/main/control/devel/slred/slconred/MB04OY.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OD.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OR.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OT.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OU.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OV.f trunk/octave-forge/main/control/devel/slred/slconred/SB03OY.f trunk/octave-forge/main/control/devel/slred/slconred/SB04PX.f trunk/octave-forge/main/control/devel/slred/slconred/SB08GD.f trunk/octave-forge/main/control/devel/slred/slconred/SB08HD.f trunk/octave-forge/main/control/devel/slred/slconred/SB16AD.f trunk/octave-forge/main/control/devel/slred/slconred/SB16AY.f trunk/octave-forge/main/control/devel/slred/slconred/SB16BD.f trunk/octave-forge/main/control/devel/slred/slconred/SB16CD.f trunk/octave-forge/main/control/devel/slred/slconred/SB16CY.f trunk/octave-forge/main/control/devel/slred/slconred/TB01ID.f trunk/octave-forge/main/control/devel/slred/slconred/TB01KD.f trunk/octave-forge/main/control/devel/slred/slconred/TB01LD.f trunk/octave-forge/main/control/devel/slred/slconred/TB01WD.f trunk/octave-forge/main/control/devel/slred/slconred/makefile_slconred.m trunk/octave-forge/main/control/devel/slred/slconred/select.f trunk/octave-forge/main/control/devel/slred/slmodred/ trunk/octave-forge/main/control/devel/slred/slmodred/AB04MD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB07MD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB07ND.f trunk/octave-forge/main/control/devel/slred/slmodred/AB08MD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB08NX.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09AX.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09CX.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09DD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09HD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09HY.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09ID.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09IX.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09IY.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09JD.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09JV.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09JW.f trunk/octave-forge/main/control/devel/slred/slmodred/AB09JX.f trunk/octave-forge/main/control/devel/slred/slmodred/AG07BD.f trunk/octave-forge/main/control/devel/slred/slmodred/MA02AD.f trunk/octave-forge/main/control/devel/slred/slmodred/MA02BD.f trunk/octave-forge/main/control/devel/slred/slmodred/MA02DD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01PD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01QD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01SD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01WD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01YD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB01ZD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03OY.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03PY.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03QD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03QX.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03QY.f trunk/octave-forge/main/control/devel/slred/slmodred/MB03UD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB04ND.f trunk/octave-forge/main/control/devel/slred/slmodred/MB04NY.f trunk/octave-forge/main/control/devel/slred/slmodred/MB04OD.f trunk/octave-forge/main/control/devel/slred/slmodred/MB04OX.f trunk/octave-forge/main/control/devel/slred/slmodred/MB04OY.f trunk/octave-forge/main/control/devel/slred/slmodred/SB01FY.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MD.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MR.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MS.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MU.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MV.f trunk/octave-forge/main/control/devel/slred/slmodred/SB02MW.f trunk/octave-forge/main/control/devel/slred/slmodred/SB03OR.f trunk/octave-forge/main/control/devel/slred/slmodred/SB03OT.f trunk/octave-forge/main/control/devel/slred/slmodred/SB03OU.f trunk/octave-forge/main/control/devel/slred/slmodred/SB03OV.f trunk/octave-forge/main/control/devel/slred/slmodred/SB03OY.f trunk/octave-forge/main/control/devel/slred/slmodred/SB04PX.f trunk/octave-forge/main/control/devel/slred/slmodred/SB04PY.f trunk/octave-forge/main/control/devel/slred/slmodred/SB08CD.f trunk/octave-forge/main/control/devel/slred/slmodred/SB08DD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01ID.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01KD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01LD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01PD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01UD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01WD.f trunk/octave-forge/main/control/devel/slred/slmodred/TB01XD.f trunk/octave-forge/main/control/devel/slred/slmodred/delctg.f trunk/octave-forge/main/control/devel/slred/slmodred/makefile_slmodred.m trunk/octave-forge/main/control/devel/slred/slmodred/select.f Added: trunk/octave-forge/main/control/devel/slred/reduction_methods.txt =================================================================== --- trunk/octave-forge/main/control/devel/slred/reduction_methods.txt (rev 0) +++ trunk/octave-forge/main/control/devel/slred/reduction_methods.txt 2011-07-07 21:39:42 UTC (rev 8381) @@ -0,0 +1,57 @@ +Reduction Methods + +absolute/additive error + BTA balanced truncation + SPA singular perturbation approximation + HNA Hankel-norm approximation + +relative/multiplicative error + BST balanced stochastic truncation + + +modred Model Reduction + +AB 09 ID - BTA SR + - BTA BFSR + - SPA SR + - SPA BFSR + FW BTA SR + FW BTA BFSR + FW SPA SR + FW SPA BFSR + +AB 09 JD - HNA + FW HNA + +AB 09 HD BST BTA SR + BST BTA BFSR + BST SPA SR + BST SPA BFSR + + +conred Controller Reduction + +SB 16 AD - BTA SR + - BTA BFSR + - SPA SR + - SPA BFSR + FW BTA SR + FW BTA BFSR + FW SPA SR + FW SPA BFSR + +SB 16 BD CF BTA SR + CF BTA BFSR + CF SPA SR + CF SPA BFSR + +SB 16 CD FWCF BTA SR + FWCF BTA BFSR + + + +FW frequency-weighted +CF coprime factorization + +SR square-root +BFSR balancing-free square-root \ No newline at end of file Property changes on: trunk/octave-forge/main/control/devel/slred/slconred ___________________________________________________________________ Added: svn:ignore + *.oct Added: trunk/octave-forge/main/control/devel/slred/slconred/AB05PD.f =================================================================== --- trunk/octave-forge/main/control/devel/slred/slconred/AB05PD.f (rev 0) +++ trunk/octave-forge/main/control/devel/slred/slconred/AB05PD.f 2011-07-07 21:39:42 UTC (rev 8381) @@ -0,0 +1,385 @@ + SUBROUTINE AB05PD( OVER, N1, M, P, N2, ALPHA, A1, LDA1, B1, LDB1, + $ C1, LDC1, D1, LDD1, A2, LDA2, B2, LDB2, C2, + $ LDC2, D2, LDD2, N, A, LDA, B, LDB, C, LDC, D, + $ LDD, INFO) +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 state-space model G = (A,B,C,D) corresponding to +C the sum G = G1 + alpha*G2, where G1 = (A1,B1,C1,D1) and +C G2 = (A2,B2,C2,D2). G, G1, and G2 are the transfer-function +C matrices of the corresponding state-space models. +C +C ARGUMENTS +C +C Mode Parameters +C +C OVER CHARACTER*1 +C Indicates whether the user wishes to overlap pairs of +C arrays, as follows: +C = 'N': Do not overlap; +C = 'O': Overlap pairs of arrays: A1 and A, B1 and B, +C C1 and C, and D1 and D, i.e. the same name is +C effectively used for each pair (for all pairs) +C in the routine call. In this case, setting +C LDA1 = LDA, LDB1 = LDB, LDC1 = LDC, and LDD1 = LDD +C will give maximum efficiency. +C +C Input/Output Parameters +C +C N1 (input) INTEGER +C The number of state variables in the first system, i.e. +C the order of the matrix A1, the number of rows of B1 and +C the number of columns of C1. N1 >= 0. +C +C M (input) INTEGER +C The number of input variables of the two systems, i.e. the +C number of columns of matrices B1, D1, B2 and D2. M >= 0. +C +C P (input) INTEGER +C The number of output variables of the two systems, i.e. +C the number of rows of matrices C1, D1, C2 and D2. P >= 0. +C +C N2 (input) INTEGER +C The number of state variables in the second system, i.e. +C the order of the matrix A2, the number of rows of B2 and +C the number of columns of C2. N2 >= 0. +C +C ALPHA (input) DOUBLE PRECISION +C The coefficient multiplying G2. +C +C A1 (input) DOUBLE PRECISION array, dimension (LDA1,N1) +C The leading N1-by-N1 part of this array must contain the +C state transition matrix A1 for the first system. +C +C LDA1 INTEGER +C The leading dimension of array A1. LDA1 >= MAX(1,N1). +C +C B1 (input) DOUBLE PRECISION array, dimension (LDB1,M) +C The leading N1-by-M part of this array must contain the +C input/state matrix B1 for the first system. +C +C LDB1 INTEGER +C The leading dimension of array B1. LDB1 >= MAX(1,N1). +C +C C1 (input) DOUBLE PRECISION array, dimension (LDC1,N1) +C The leading P-by-N1 part of this array must contain the +C state/output matrix C1 for the first system. +C +C LDC1 INTEGER +C The leading dimension of array C1. +C LDC1 >= MAX(1,P) if N1 > 0. +C LDC1 >= 1 if N1 = 0. +C +C D1 (input) DOUBLE PRECISION array, dimension (LDD1,M) +C The leading P-by-M part of this array must contain the +C input/output matrix D1 for the first system. +C +C LDD1 INTEGER +C The leading dimension of array D1. LDD1 >= MAX(1,P). +C +C A2 (input) DOUBLE PRECISION array, dimension (LDA2,N2) +C The leading N2-by-N2 part of this array must contain the +C state transition matrix A2 for the second system. +C +C LDA2 INTEGER +C The leading dimension of array A2. LDA2 >= MAX(1,N2). +C +C B2 (input) DOUBLE PRECISION array, dimension (LDB2,M) +C The leading N2-by-M part of this array must contain the +C input/state matrix B2 for the second system. +C +C LDB2 INTEGER +C The leading dimension of array B2. LDB2 >= MAX(1,N2). +C +C C2 (input) DOUBLE PRECISION array, dimension (LDC2,N2) +C The leading P-by-N2 part of this array must contain the +C state/output matrix C2 for the second system. +C +C LDC2 INTEGER +C The leading dimension of array C2. +C LDC2 >= MAX(1,P) if N2 > 0. +C LDC2 >= 1 if N2 = 0. +C +C D2 (input) DOUBLE PRECISION array, dimension (LDD2,M) +C The leading P-by-M part of this array must contain the +C input/output matrix D2 for the second system. +C +C LDD2 INTEGER +C The leading dimension of array D2. LDD2 >= MAX(1,P). +C +C N (output) INTEGER +C The number of state variables (N1 + N2) in the resulting +C system, i.e. the order of the matrix A, the number of rows +C of B and the number of columns of C. +C +C A (output) DOUBLE PRECISION array, dimension (LDA,N1+N2) +C The leading N-by-N part of this array contains the state +C transition matrix A for the resulting system. +C The array A can overlap A1 if OVER = 'O'. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= MAX(1,N1+N2). +C +C B (output) DOUBLE PRECISION array, dimension (LDB,M) +C The leading N-by-M part of this array contains the +C input/state matrix B for the resulting system. +C The array B can overlap B1 if OVER = 'O'. +C +C LDB INTEGER +C The leading dimension of array B. LDB >= MAX(1,N1+N2). +C +C C (output) DOUBLE PRECISION array, dimension (LDC,N1+N2) +C The leading P-by-N part of this array contains the +C state/output matrix C for the resulting system. +C The array C can overlap C1 if OVER = 'O'. +C +C LDC INTEGER +C The leading dimension of array C. +C LDC >= MAX(1,P) if N1+N2 > 0. +C LDC >= 1 if N1+N2 = 0. +C +C D (output) DOUBLE PRECISION array, dimension (LDD,M) +C The leading P-by-M part of this array contains the +C input/output matrix D for the resulting system. +C The array D can overlap D1 if OVER = 'O'. +C +C LDD INTEGER +C The leading dimension of array D. LDD >= MAX(1,P). +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C The matrices of the resulting systems are determined as: +C +C ( A1 0 ) ( B1 ) +C A = ( ) , B = ( ) , +C ( 0 A2 ) ( B2 ) +C +C C = ( C1 alpha*C2 ) , D = D1 + alpha*D2 . +C +C REFERENCES +C +C None +C +C NUMERICAL ASPECTS +C +C None +C +C CONTRIBUTORS +C +C A. Varga, German Aerospace Research Establishment, +C Oberpfaffenhofen, Germany, and V. Sima, Katholieke Univ. Leuven, +C Belgium, Nov. 1996. +C +C REVISIONS +C +C V. Sima, Research Institute for Informatics, Bucharest, July 2003, +C Feb. 2004. +C +C KEYWORDS +C +C Multivariable system, state-space model, state-space +C representation. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO=0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + CHARACTER OVER + INTEGER INFO, LDA, LDA1, LDA2, LDB, LDB1, LDB2, LDC, + $ LDC1, LDC2, LDD, LDD1, LDD2, M, N, N1, N2, P + DOUBLE PRECISION ALPHA +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), A1(LDA1,*), A2(LDA2,*), B(LDB,*), + $ B1(LDB1,*), B2(LDB2,*), C(LDC,*), C1(LDC1,*), + $ C2(LDC2,*), D(LDD,*), D1(LDD1,*), D2(LDD2,*) +C .. Local Scalars .. + LOGICAL LOVER + INTEGER I, J, N1P1 +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DAXPY, DLACPY, DLASCL, DLASET, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX, MIN +C .. Executable Statements .. +C + LOVER = LSAME( OVER, 'O' ) + N = N1 + N2 + INFO = 0 +C +C Test the input scalar arguments. +C + IF( .NOT.LOVER .AND. .NOT.LSAME( OVER, 'N' ) ) THEN + INFO = -1 + ELSE IF( N1.LT.0 ) THEN + INFO = -2 + ELSE IF( M.LT.0 ) THEN + INFO = -3 + ELSE IF( P.LT.0 ) THEN + INFO = -4 + ELSE IF( N2.LT.0 ) THEN + INFO = -5 + ELSE IF( LDA1.LT.MAX( 1, N1 ) ) THEN + INFO = -8 + ELSE IF( LDB1.LT.MAX( 1, N1 ) ) THEN + INFO = -10 + ELSE IF( ( N1.GT.0 .AND. LDC1.LT.MAX( 1, P ) ) .OR. + $ ( N1.EQ.0 .AND. LDC1.LT.1 ) ) THEN + INFO = -12 + ELSE IF( LDD1.LT.MAX( 1, P ) ) THEN + INFO = -14 + ELSE IF( LDA2.LT.MAX( 1, N2 ) ) THEN + INFO = -16 + ELSE IF( LDB2.LT.MAX( 1, N2 ) ) THEN + INFO = -18 + ELSE IF( ( N2.GT.0 .AND. LDC2.LT.MAX( 1, P ) ) .OR. + $ ( N2.EQ.0 .AND. LDC2.LT.1 ) ) THEN + INFO = -20 + ELSE IF( LDD2.LT.MAX( 1, P ) ) THEN + INFO = -22 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -25 + ELSE IF( LDB.LT.MAX( 1, N ) ) THEN + INFO = -27 + ELSE IF( ( N.GT.0 .AND. LDC.LT.MAX( 1, P ) ) .OR. + $ ( N.EQ.0 .AND. LDC.LT.1 ) ) THEN + INFO = -29 + ELSE IF( LDD.LT.MAX( 1, P ) ) THEN + INFO = -31 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'AB05PD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( MAX( N, MIN( M, P ) ).EQ.0 ) + $ RETURN +C + N1P1 = N1 + 1 +C +C ( A1 0 ) +C Construct A = ( ) . +C ( 0 A2 ) +C + IF ( LOVER .AND. LDA1.LE.LDA ) THEN + IF ( LDA1.LT.LDA ) THEN +C + DO 20 J = N1, 1, -1 + DO 10 I = N1, 1, -1 + A(I,J) = A1(I,J) + 10 CONTINUE + 20 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', N1, N1, A1, LDA1, A, LDA ) + END IF +C + IF ( N2.GT.0 ) THEN + CALL DLASET( 'F', N1, N2, ZERO, ZERO, A(1,N1P1), LDA ) + CALL DLASET( 'F', N2, N1, ZERO, ZERO, A(N1P1,1), LDA ) + CALL DLACPY( 'F', N2, N2, A2, LDA2, A(N1P1,N1P1), LDA ) + END IF +C +C ( B1 ) +C Construct B = ( ) . +C ( B2 ) +C + IF ( LOVER .AND. LDB1.LE.LDB ) THEN + IF ( LDB1.LT.LDB ) THEN +C + DO 40 J = M, 1, -1 + DO 30 I = N1, 1, -1 + B(I,J) = B1(I,J) + 30 CONTINUE + 40 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', N1, M, B1, LDB1, B, LDB ) + END IF +C + IF ( N2.GT.0 ) + $ CALL DLACPY( 'F', N2, M, B2, LDB2, B(N1P1,1), LDB ) +C +C Construct C = ( C1 alpha*C2 ) . +C + IF ( LOVER .AND. LDC1.LE.LDC ) THEN + IF ( LDC1.LT.LDC ) THEN +C + DO 60 J = N1, 1, -1 + DO 50 I = P, 1, -1 + C(I,J) = C1(I,J) + 50 CONTINUE + 60 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', P, N1, C1, LDC1, C, LDC ) + END IF +C + IF ( N2.GT.0 ) THEN + CALL DLACPY( 'F', P, N2, C2, LDC2, C(1,N1P1), LDC ) + IF ( ALPHA.NE.ONE ) + $ CALL DLASCL( 'G', 0, 0, ONE, ALPHA, P, N2, C(1,N1P1), LDC, + $ INFO ) + END IF +C +C Construct D = D1 + alpha*D2 . +C + IF ( LOVER .AND. LDD1.LE.LDD ) THEN + IF ( LDD1.LT.LDD ) THEN +C + DO 80 J = M, 1, -1 + DO 70 I = P, 1, -1 + D(I,J) = D1(I,J) + 70 CONTINUE + 80 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', P, M, D1, LDD1, D, LDD ) + END IF +C + DO 90 J = 1, M + CALL DAXPY( P, ALPHA, D2(1,J), 1, D(1,J), 1 ) + 90 CONTINUE +C + RETURN +C *** Last line of AB05PD *** + END Added: trunk/octave-forge/main/control/devel/slred/slconred/AB05QD.f =================================================================== --- trunk/octave-forge/main/control/devel/slred/slconred/AB05QD.f (rev 0) +++ trunk/octave-forge/main/control/devel/slred/slconred/AB05QD.f 2011-07-07 21:39:42 UTC (rev 8381) @@ -0,0 +1,419 @@ + SUBROUTINE AB05QD( OVER, N1, M1, P1, N2, M2, P2, A1, LDA1, B1, + $ LDB1, C1, LDC1, D1, LDD1, A2, LDA2, B2, LDB2, + $ C2, LDC2, D2, LDD2, N, M, P, A, LDA, B, LDB, + $ C, LDC, D, LDD, INFO ) +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 append two systems G1 and G2 in state-space form together. +C If G1 = (A1,B1,C1,D1) and G2 = (A2,B2,C2,D2) are the state-space +C models of the given two systems having the transfer-function +C matrices G1 and G2, respectively, this subroutine constructs the +C state-space model G = (A,B,C,D) which corresponds to the +C transfer-function matrix +C +C ( G1 0 ) +C G = ( ) +C ( 0 G2 ) +C +C ARGUMENTS +C +C Mode Parameters +C +C OVER CHARACTER*1 +C Indicates whether the user wishes to overlap pairs of +C arrays, as follows: +C = 'N': Do not overlap; +C = 'O': Overlap pairs of arrays: A1 and A, B1 and B, +C C1 and C, and D1 and D, i.e. the same name is +C effectively used for each pair (for all pairs) +C in the routine call. In this case, setting +C LDA1 = LDA, LDB1 = LDB, LDC1 = LDC, and LDD1 = LDD +C will give maximum efficiency. +C +C Input/Output Parameters +C +C N1 (input) INTEGER +C The number of state variables in the first system, i.e. +C the order of the matrix A1, the number of rows of B1 and +C the number of columns of C1. N1 >= 0. +C +C M1 (input) INTEGER +C The number of input variables in the first system, i.e. +C the number of columns of matrices B1 and D1. M1 >= 0. +C +C P1 (input) INTEGER +C The number of output variables in the first system, i.e. +C the number of rows of matrices C1 and D1. P1 >= 0. +C +C N2 (input) INTEGER +C The number of state variables in the second system, i.e. +C the order of the matrix A2, the number of rows of B2 and +C the number of columns of C2. N2 >= 0. +C +C M2 (input) INTEGER +C The number of input variables in the second system, i.e. +C the number of columns of matrices B2 and D2. M2 >= 0. +C +C P2 (input) INTEGER +C The number of output variables in the second system, i.e. +C the number of rows of matrices C2 and D2. P2 >= 0. +C +C A1 (input) DOUBLE PRECISION array, dimension (LDA1,N1) +C The leading N1-by-N1 part of this array must contain the +C state transition matrix A1 for the first system. +C +C LDA1 INTEGER +C The leading dimension of array A1. LDA1 >= MAX(1,N1). +C +C B1 (input) DOUBLE PRECISION array, dimension (LDB1,M1) +C The leading N1-by-M1 part of this array must contain the +C input/state matrix B1 for the first system. +C +C LDB1 INTEGER +C The leading dimension of array B1. LDB1 >= MAX(1,N1). +C +C C1 (input) DOUBLE PRECISION array, dimension (LDC1,N1) +C The leading P1-by-N1 part of this array must contain the +C state/output matrix C1 for the first system. +C +C LDC1 INTEGER +C The leading dimension of array C1. +C LDC1 >= MAX(1,P1) if N1 > 0. +C LDC1 >= 1 if N1 = 0. +C +C D1 (input) DOUBLE PRECISION array, dimension (LDD1,M1) +C The leading P1-by-M1 part of this array must contain the +C input/output matrix D1 for the first system. +C +C LDD1 INTEGER +C The leading dimension of array D1. LDD1 >= MAX(1,P1). +C +C A2 (input) DOUBLE PRECISION array, dimension (LDA2,N2) +C The leading N2-by-N2 part of this array must contain the +C state transition matrix A2 for the second system. +C +C LDA2 INTEGER +C The leading dimension of array A2. LDA2 >= MAX(1,N2). +C +C B2 (input) DOUBLE PRECISION array, dimension (LDB2,M2) +C The leading N2-by-M2 part of this array must contain the +C input/state matrix B2 for the second system. +C +C LDB2 INTEGER +C The leading dimension of array B2. LDB2 >= MAX(1,N2). +C +C C2 (input) DOUBLE PRECISION array, dimension (LDC2,N2) +C The leading P2-by-N2 part of this array must contain the +C state/output matrix C2 for the second system. +C +C LDC2 INTEGER +C The leading dimension of array C2. +C LDC2 >= MAX(1,P2) if N2 > 0. +C LDC2 >= 1 if N2 = 0. +C +C D2 (input) DOUBLE PRECISION array, dimension (LDD2,M2) +C The leading P2-by-M2 part of this array must contain the +C input/output matrix D2 for the second system. +C +C LDD2 INTEGER +C The leading dimension of array D2. LDD2 >= MAX(1,P2). +C +C N (output) INTEGER +C The number of state variables (N1 + N2) in the resulting +C system, i.e. the order of the matrix A, the number of rows +C of B and the number of columns of C. +C +C M (output) INTEGER +C The number of input variables (M1 + M2) in the resulting +C system, i.e. the number of columns of B and D. +C +C P (output) INTEGER +C The number of output variables (P1 + P2) of the resulting +C system, i.e. the number of rows of C and D. +C +C A (output) DOUBLE PRECISION array, dimension (LDA,N1+N2) +C The leading N-by-N part of this array contains the state +C transition matrix A for the resulting system. +C The array A can overlap A1 if OVER = 'O'. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= MAX(1,N1+N2). +C +C B (output) DOUBLE PRECISION array, dimension (LDB,M1+M2) +C The leading N-by-M part of this array contains the +C input/state matrix B for the resulting system. +C The array B can overlap B1 if OVER = 'O'. +C +C LDB INTEGER +C The leading dimension of array B. LDB >= MAX(1,N1+N2). +C +C C (output) DOUBLE PRECISION array, dimension (LDC,N1+N2) +C The leading P-by-N part of this array contains the +C state/output matrix C for the resulting system. +C The array C can overlap C1 if OVER = 'O'. +C +C LDC INTEGER +C The leading dimension of array C. +C LDC >= MAX(1,P1+P2) if N1+N2 > 0. +C LDC >= 1 if N1+N2 = 0. +C +C D (output) DOUBLE PRECISION array, dimension (LDD,M1+M2) +C The leading P-by-M part of this array contains the +C input/output matrix D for the resulting system. +C The array D can overlap D1 if OVER = 'O'. +C +C LDD INTEGER +C The leading dimension of array D. LDD >= MAX(1,P1+P2). +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C The matrices of the resulting systems are determined as: +C +C ( A1 0 ) ( B1 0 ) +C A = ( ) , B = ( ) , +C ( 0 A2 ) ( 0 B2 ) +C +C ( C1 0 ) ( D1 0 ) +C C = ( ) , D = ( ) . +C ( 0 C2 ) ( 0 D2 ) +C +C REFERENCES +C +C None +C +C CONTRIBUTORS +C +C A. Varga, German Aerospace Research Establishment, +C Oberpfaffenhofen, Germany, and V. Sima, Katholieke Univ. Leuven, +C Belgium, Nov. 1996. +C +C REVISIONS +C +C V. Sima, Research Institute for Informatics, Bucharest, Feb. 2004. +C +C KEYWORDS +C +C Multivariable system, state-space model, state-space +C representation. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO + PARAMETER ( ZERO=0.0D0 ) +C .. Scalar Arguments .. + CHARACTER OVER + INTEGER INFO, LDA, LDA1, LDA2, LDB, LDB1, LDB2, LDC, + $ LDC1, LDC2, LDD, LDD1, LDD2, M, M1, M2, N, N1, + $ N2, P, P1, P2 +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), A1(LDA1,*), A2(LDA2,*), B(LDB,*), + $ B1(LDB1,*), B2(LDB2,*), C(LDC,*), C1(LDC1,*), + $ C2(LDC2,*), D(LDD,*), D1(LDD1,*), D2(LDD2,*) +C .. Local Scalars .. + LOGICAL LOVER + INTEGER I, J +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DLACPY, DLASET, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX, MIN +C .. Executable Statements .. +C + LOVER = LSAME( OVER, 'O' ) + N = N1 + N2 + M = M1 + M2 + P = P1 + P2 + INFO = 0 +C +C Test the input scalar arguments. +C + IF( .NOT.LOVER .AND. .NOT.LSAME( OVER, 'N' ) ) THEN + INFO = -1 + ELSE IF( N1.LT.0 ) THEN + INFO = -2 + ELSE IF( M1.LT.0 ) THEN + INFO = -3 + ELSE IF( P1.LT.0 ) THEN + INFO = -4 + ELSE IF( N2.LT.0 ) THEN + INFO = -5 + ELSE IF( M2.LT.0 ) THEN + INFO = -6 + ELSE IF( P2.LT.0 ) THEN + INFO = -7 + ELSE IF( LDA1.LT.MAX( 1, N1 ) ) THEN + INFO = -9 + ELSE IF( LDB1.LT.MAX( 1, N1 ) ) THEN + INFO = -11 + ELSE IF( ( N1.GT.0 .AND. LDC1.LT.MAX( 1, P1 ) ) .OR. + $ ( N1.EQ.0 .AND. LDC1.LT.1 ) ) THEN + INFO = -13 + ELSE IF( LDD1.LT.MAX( 1, P1 ) ) THEN + INFO = -15 + ELSE IF( LDA2.LT.MAX( 1, N2 ) ) THEN + INFO = -17 + ELSE IF( LDB2.LT.MAX( 1, N2 ) ) THEN + INFO = -19 + ELSE IF( ( N2.GT.0 .AND. LDC2.LT.MAX( 1, P2 ) ) .OR. + $ ( N2.EQ.0 .AND. LDC2.LT.1 ) ) THEN + INFO = -21 + ELSE IF( LDD2.LT.MAX( 1, P2 ) ) THEN + INFO = -23 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -28 + ELSE IF( LDB.LT.MAX( 1, N ) ) THEN + INFO = -30 + ELSE IF( ( N.GT.0 .AND. LDC.LT.MAX( 1, P ) ) .OR. + $ ( N.EQ.0 .AND. LDC.LT.1 ) ) THEN + INFO = -32 + ELSE IF( LDD.LT.MAX( 1, P ) ) THEN + INFO = -34 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'AB05QD', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( MAX( N, MIN( M, P ) ).EQ.0 ) + $ RETURN +C ( A1 0 ) +C Construct A = ( ) . +C ( 0 A2 ) +C + IF ( LOVER .AND. LDA1.LE.LDA ) THEN + IF ( LDA1.LT.LDA ) THEN +C + DO 20 J = N1, 1, -1 + DO 10 I = N1, 1, -1 + A(I,J) = A1(I,J) + 10 CONTINUE + 20 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', N1, N1, A1, LDA1, A, LDA ) + END IF +C + IF ( N2.GT.0 ) THEN + CALL DLASET( 'F', N1, N2, ZERO, ZERO, A(1,N1+1), LDA ) + CALL DLASET( 'F', N2, N1, ZERO, ZERO, A(N1+1,1), LDA ) + CALL DLACPY( 'F', N2, N2, A2, LDA2, A(N1+1,N1+1), LDA ) + END IF +C +C ( B1 0 ) +C Construct B = ( ) . +C ( 0 B2 ) +C + IF ( LOVER .AND. LDB1.LE.LDB ) THEN + IF ( LDB1.LT.LDB ) THEN +C + DO 40 J = M1, 1, -1 + DO 30 I = N1, 1, -1 + B(I,J) = B1(I,J) + 30 CONTINUE + 40 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', N1, M1, B1, LDB1, B, LDB ) + END IF +C + IF ( M2.GT.0 ) + $ CALL DLASET( 'F', N1, M2, ZERO, ZERO, B(1,M1+1), LDB ) + IF ( N2.GT.0 ) THEN + CALL DLASET( 'F', N2, M1, ZERO, ZERO, B(N1+1,1), LDB ) + IF ( M2.GT.0 ) + $ CALL DLACPY( 'F', N2, M2, B2, LDB2, B(N1+1,M1+1), LDB ) + END IF +C +C ( C1 0 ) +C Construct C = ( ) . +C ( 0 C2 ) +C + IF ( LOVER .AND. LDC1.LE.LDC ) THEN + IF ( LDC1.LT.LDC ) THEN +C + DO 60 J = N1, 1, -1 + DO 50 I = P1, 1, -1 + C(I,J) = C1(I,J) + 50 CONTINUE + 60 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', P1, N1, C1, LDC1, C, LDC ) + END IF +C + IF ( N2.GT.0 ) + $ CALL DLASET( 'F', P1, N2, ZERO, ZERO, C(1,N1+1), LDC ) + IF ( P2.GT.0 ) THEN + IF ( N1.GT.0 ) + $ CALL DLASET( 'F', P2, N1, ZERO, ZERO, C(P1+1,1), LDC ) + IF ( N2.GT.0 ) + $ CALL DLACPY( 'F', P2, N2, C2, LDC2, C(P1+1,N1+1), LDC ) + END IF +C +C ( D1 0 ) +C Construct D = ( ) . +C ( 0 D2 ) +C + IF ( LOVER .AND. LDD1.LE.LDD ) THEN + IF ( LDD1.LT.LDD ) THEN +C + DO 80 J = M1, 1, -1 + DO 70 I = P1, 1, -1 + D(I,J) = D1(I,J) + 70 CONTINUE + 80 CONTINUE +C + END IF + ELSE + CALL DLACPY( 'F', P1, M1, D1, LDD1, D, LDD ) + END IF +C + IF ( M2.GT.0 ) + $ CALL DLASET( 'F', P1, M2, ZERO, ZERO, D(1,M1+1), LDD ) + IF ( P2.GT.0 ) THEN + CALL DLASET( 'F', P2, M1, ZERO, ZERO, D(P1+1,1), LDD ) + IF ( M2.GT.0 ) + $ CALL DLACPY( 'F', P2, M2, D2, LDD2, D(P1+1,M1+1), LDD ) + END IF +C + RETURN +C *** Last line of AB05QD *** + END Added: trunk/octave-forge/main/control/devel/slred/slconred/AB07ND.f =================================================================== --- trunk/octave-forge/main/control/devel/slred/slconred/AB07ND.f (rev 0) +++ trunk/octave-forge/main/control/devel/slred/slconred/AB07ND.f 2011-07-07 21:39:42 UTC (rev 8381) @@ -0,0 +1,303 @@ + SUBROUTINE AB07ND( N, M, A, LDA, B, LDB, C, LDC, D, LDD, RCOND, + $ IWORK, DWORK, LDWORK, INFO ) +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 inverse (Ai,Bi,Ci,Di) of a given system (A,B,C,D). +C +C ARGUMENTS +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the state matrix A. N >= 0. +C +C M (input) INTEGER +C The number of system inputs and outputs. M >= 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading N-by-N part of this array must +C contain the state matrix A of the original system. +C On exit, the leading N-by-N part of this array contains +C the state matrix Ai of the inverse system. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= MAX(1,N). +C +C B (input/output) DOUBLE PRECISION array, dimension (LDB,M) +C On entry, the leading N-by-M part of this array must +C contain the input matrix B of the original system. +C On exit, the leading N-by-M part of this array contains +C the input matrix Bi of the inverse system. +C +C LDB INTEGER +C The leading dimension of the array B. LDB >= MAX(1,N). +C +C C (input/output) DOUBLE PRECISION array, dimension (LDC,N) +C On entry, the leading M-by-N part of this array must +C contain the output matrix C of the original system. +C On exit, the leading M-by-N part of this array contains +C the output matrix Ci of the inverse system. +C +C LDC INTEGER +C The leading dimension of the array C. LDC >= MAX(1,M). +C +C D (input/output) DOUBLE PRECISION array, dimension (LDD,M) +C On entry, the leading M-by-M part of this array must +C contain the feedthrough matrix D of the original system. +C On exit, the leading M-by-M part of this array contains +C the feedthrough matrix Di of the inverse system. +C +C LDD INTEGER +C The leading dimension of the array D. LDD >= MAX(1,M). +C +C RCOND (output) DOUBLE PRECISION +C The estimated reciprocal condition number of the +C feedthrough matrix D of the original system. +C +C Workspace +C +C IWORK INTEGER array, dimension (2*M) +C +C DWORK DOUBLE PRECISION array, dimension (LDWORK) +C On exit, if INFO = 0 or M+1, DWORK(1) returns the optimal +C value of LDWORK. +C +C LDWORK INTEGER +C The length of the array DWORK. LDWORK >= MAX(1,4*M). +C For good performance, LDWORK should be larger. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value; +C = i: the matrix D is exactly singular; the (i,i) diagonal +C element is zero, i <= M; RCOND was set to zero; +C = M+1: the matrix D is numerically singular, i.e., RCOND +C is less than the relative machine precision, EPS +C (see LAPACK Library routine DLAMCH). The +C calculations have been completed, but the results +C could be very inaccurate. +C +C METHOD +C +C The matrices of the inverse system are computed with the formulas: +C -1 -1 -1 -1 +C Ai = A - B*D *C, Bi = -B*D , Ci = D *C, Di = D . +C +C NUMERICAL ASPECTS +C +C The accuracy depends mainly on the condition number of the matrix +C D to be inverted. The estimated reciprocal condition number is +C returned in RCOND. +C +C CONTRIBUTORS +C +C A. Varga, German Aerospace Center, Oberpfaffenhofen, March 2000. +C D. Sima, University of Bucharest, April 2000. +C V. Sima, Research Institute for Informatics, Bucharest, Apr. 2000. +C Based on the routine SYSINV, A. Varga, 1992. +C +C REVISIONS +C +C A. Varga, German Aerospace Center, Oberpfaffenhofen, July 2000. +C +C KEYWORDS +C +C Inverse system, state-space model, state-space representation. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + DOUBLE PRECISION RCOND + INTEGER INFO, LDA, LDB, LDC, LDD, LDWORK, M, N +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), B(LDB,*), C(LDC,*), D(LDD,*), + $ DWORK(*) + INTEGER IWORK(*) +C .. Local Scalars .. + DOUBLE PRECISION DNORM + INTEGER BL, CHUNK, I, IERR, J, MAXWRK + LOGICAL BLAS3, BLOCK +C .. External Functions .. + DOUBLE PRECISION DLAMCH, DLANGE + INTEGER ILAENV + EXTERNAL DLAMCH, DLANGE, ILAENV +C .. External Subroutines .. + EXTERNAL DCOPY, DGECON, DGEMM, DGEMV, DGETRF, DGETRI, + $ DLACPY, XERBLA +C .. Intrinsic Functions .. + INTRINSIC DBLE, MAX, MIN +C .. Executable Statements .. +C + INFO = 0 +C +C Test the input scalar arguments. +C + IF( N.LT.0 ) THEN + INFO = -1 + ELSE IF( M.LT.0 ) THEN + INFO = -2 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -4 + ELSE IF( LDB.LT.MAX( 1, N ) ) THEN + INFO = -6 + ELSE IF( LDC.LT.MAX( 1, M ) ) THEN + INFO = -8 + ELSE IF( LDD.LT.MAX( 1, M ) ) THEN + INFO = -10 + ELSE IF( LDWORK.LT.MAX( 1, 4*M ) ) THEN + INFO = -14 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'AB07ND', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( M.EQ.0 ) THEN + RCOND = ONE + DWORK(1) = ONE + RETURN + END IF +C +C Factorize D. +C + CALL DGETRF( M, M, D, LDD, IWORK, INFO ) + IF ( INFO.NE.0 ) THEN + RCOND = ZERO + RETURN + END IF +C +C Compute the reciprocal condition number of the matrix D. +C Workspace: need 4*M. +C (Note: Comments in the code beginning "Workspace:" describe the +C minimal amount of workspace needed at that point in the code, +C as well as the preferred amount for good performance. +C NB refers to the optimal block size for the immediately +C following subroutine, as returned by ILAENV.) +C + DNORM = DLANGE( '1-norm', M, M, D, LDD, DWORK ) + CALL DGECON( '1-norm', M, D, LDD, DNORM, RCOND, DWORK, IWORK(M+1), + $ IERR ) + IF ( RCOND.LT.DLAMCH( 'Epsilon' ) ) + $ INFO = M + 1 +C -1 +C Compute Di = D . +C Workspace: need M; +C prefer M*NB. +C + MAXWRK = MAX( 4*M, M*ILAENV( 1, 'DGETRI', ' ', M, -1, -1, -1 ) ) + CALL DGETRI( M, D, LDD, IWORK, DWORK, LDWORK, IERR ) + IF ( N.GT.0 ) THEN + CHUNK = LDWORK / M + BLAS3 = CHUNK.GE.N .AND. M.GT.1 + BLOCK = MIN( CHUNK, M ).GT.1 +C -1 +C Compute Bi = -B*D . +C + IF ( BLAS3 ) THEN +C +C Enough workspace for a fast BLAS 3 algorithm. +C + CALL DLACPY( 'Full', N, M, B, LDB, DWORK, N ) + CALL DGEMM( 'NoTranspose', 'NoTranspose', N, M, M, -ONE, + $ DWORK, N, D, LDD, ZERO, B, LDB ) +C + ELSE IF( BLOCK ) THEN +C +C Use as many rows of B as possible. +C + DO 10 I = 1, N, CHUNK + BL = MIN( N-I+1, CHUNK ) + CALL DLACPY( 'Full', BL, M, B(I,1), LDB, DWORK, BL ) + CALL DGEMM( 'NoTranspose', 'NoTranspose', BL, M, M, -ONE, + $ DWORK, BL, D, LDD, ZERO, B(I,1), LDB ) + 10 CONTINUE +C + ELSE +C +C Use a BLAS 2 algorithm. +C + DO 20 I = 1, N + CALL DCOPY( M, B(I,1), LDB, DWORK, 1 ) + CALL DGEMV( 'Transpose', M, M, -ONE, D, LDD, DWORK, 1, + $ ZERO, B(I,1), LDB ) + 20 CONTINUE +C + END IF +C +C Compute Ai = A + Bi*C. +C + CALL DGEMM( 'NoTranspose', 'NoTranspose', N, N, M, ONE, B, LDB, + $ C, LDC, ONE, A, LDA ) +C -1 +C Compute C <-- D *C. +C + IF ( BLAS3 ) THEN +C +C Enough workspace for a fast BLAS 3 algorithm. +C + CALL DLACPY( 'Full', M, N, C, LDC, DWORK, M ) + CALL DGEMM( 'NoTranspose', 'NoTranspose', M, N, M, ONE, + $ D, LDD, DWORK, M, ZERO, C, LDC ) +C + ELSE IF( BLOCK ) THEN +C +C Use as many columns of C as possible. +C + DO 30 J = 1, N, CHUNK + BL = MIN( N-J+1, CHUNK ) + CALL DLACPY( 'Full', M, BL, C(1,J), LDC, DWORK, M ) + CALL DGEMM( 'NoTranspose', 'NoTranspose', M, BL, M, ONE, + $ D, LDD, DWORK, M, ZERO, C(1,J), LDC ) + 30 CONTINUE +C + ELSE +C +C Use a BLAS 2 algorithm. +C + DO 40 J = 1, N + CALL DCOPY( M, C(1,J), 1, DWORK, 1 ) + CALL DGEMV( 'NoTranspose', M, M, ONE, D, LDD, DWORK, 1, + $ ZERO, C(1,J), 1 ) + 40 CONTINUE +C + END IF + END IF +C +C Return optimal workspace in DWORK(1). +C + DWORK(1) = DBLE( MAX( MAXWRK, N*M ) ) + RETURN +C +C *** Last line of AB07ND *** + END Added: trunk/octave-forge/main/control/devel/slred/slconred/AB09AD.f =================================================================== --- trunk/octave-forge/main/control/devel/slred/slconred/AB09AD.f (rev 0) +++ trunk/octave-forge/main/control/devel/slred/slconred/AB09AD.f 2011-07-07 21:39:42 UTC (rev 8381) @@ -0,0 +1,363 @@ + SUBROUTINE AB09AD( DICO, JOB, EQUIL, ORDSEL, N, M, P, NR, A, LDA, + $ B, LDB, C, LDC, HSV, TOL, IWORK, DWORK, LDWORK, + $ IWARN, INFO ) +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 a reduced order model (Ar,Br,Cr) for a stable original +C state-space representation (A,B,C) by using either the square-root +C or the balancing-free square-root Balance & Truncate (B & T) +C model reduction method. +C +C ARGUMENTS +C +C Mode Parameters +C +C DICO CHARACTER*1 +C Specifies the type of the original system as follows: +C = 'C': continuous-time system; +C = 'D': discrete-time system. +C +C JOB CHARACTER*1 +C Specifies the model reduction approach to be used +C as follows: +C = 'B': use the square-root Balance & Truncate method; +C = 'N': use the balancing-free square-root +C Balance & Truncate method. +C +C EQUIL CHARACTER*1 +C Specifies whether the user wishes to preliminarily +C equilibrate the triplet (A,B,C) as follows: +C = 'S': perform equilibration (scaling); +C = 'N': do not perform equilibration. +C +C ORDSEL CHARACTER*1 +C Specifies the order selection method as follows: +C = 'F': the resulting order NR is fixed; +C = 'A': the resulting order NR is automatically determined +C on basis of the given tolerance TOL. +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the original state-space representation, i.e. +C the order of the matrix A. N >= 0. +C +C M (input) INTEGER +C The number of system inputs. M >= 0. +C +C P (input) INTEGER +C The number of system outputs. P >= 0. +C +C NR (input/output) INTEGER +C On entry with ORDSEL = 'F', NR is the desired order of the +C resulting reduced order system. 0 <= NR <= N. +C On exit, if INFO = 0, NR is the order of the resulting +C reduced order model. NR is set as follows: +C if ORDSEL = 'F', NR is equal to MIN(NR,NMIN), where NR +C is the desired order on entry and NMIN is the order of a +C minimal realization of the given system; NMIN is +C determined as the number of Hankel singular values greater +C than N*EPS*HNORM(A,B,C), where EPS is the machine +C precision (see LAPACK Library Routine DLAMCH) and +C HNORM(A,B,C) is the Hankel norm of the system (computed +C in HSV(1)); +C if ORDSEL = 'A', NR is equal to the number of Hankel +C singular values greater than MAX(TOL,N*EPS*HNORM(A,B,C)). +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading N-by-N part of this array must +C contain the state dynamics matrix A. +C On exit, if INFO = 0, the leading NR-by-NR part of this +C array contains the state dynamics matrix Ar of the reduced +C order system. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= MAX(1,N). +C +C B (input/output) DOUBLE PRECISION array, dimension (LDB,M) +C On entry, the leading N-by-M part of this array must +C contain the original input/state matrix B. +C On exit, if INFO = 0, the leading NR-by-M part of this +C array contains the input/state matrix Br of the reduced +C order system. +C +C LDB INTEGER +C The leading dimension of array B. LDB >= MAX(1,N). +C +C C (input/output) DOUBLE PRECISION array, dimension (LDC,N) +C On entry, the leading P-by-N part of this array must +C contain the original state/output matrix C. +C On exit, if INFO = 0, the leading P-by-NR part of this +C array contains the state/output matrix Cr of the reduced +C order system. +C +C LDC INTEGER +C The leading dimension of array C. LDC >= MAX(1,P). +C +C HSV (output) DOUBLE PRECISION array, dimension (N) +C If INFO = 0, it contains the Hankel singular values of +C the original system ordered decreasingly. HSV(1) is the +C Hankel norm of the system. +C +C Tolerances +C +C TOL DOUBLE PRECISION +C If ORDSEL = 'A', TOL contains the tolerance for +C determining the order of reduced system. +C For model reduction, the recommended value is +C TOL = c*HNORM(A,B,C), where c is a constant in the +C interval [0.00001,0.001], and HNORM(A,B,C) is the +C Hankel-norm of the given system (computed in HSV(1)). +C For computing a minimal realization, the recommended +C value is TOL = N*EPS*HNORM(A,B,C), where EPS is the +C machine precision (see LAPACK Library Routine DLAMCH). +C This value is used by default if TOL <= 0 on entry. +C If ORDSEL = 'F', the value of TOL is ignored. +C +C Workspace +C +C IWORK INTEGER array, dimension (LIWORK) +C LIWORK = 0, if JOB = 'B'; +C LIWORK = N, if JOB = 'N'. +C +C DWORK DOUBLE PRECISION array, dimension (LDWORK) +C On exit, if INFO = 0, DWORK(1) returns the optimal value +C of LDWORK. +C +C LDWORK INTEGER +C The length of the array DWORK. +C LDWORK >= MAX(1,N*(2*N+MAX(N,M,P)+5)+N*(N+1)/2). +C For optimum performance LDWORK should be larger. +C +C Warning Indicator +C +C IWARN INTEGER +C = 0: no warning; +C = 1: with ORDSEL = 'F', the selected order NR is greater +C than the order of a minimal realization of the +C given system. In this case, the resulting NR is +C set automatically to a value corresponding to the +C order of a minimal realization of the system. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value; +C = 1: the reduction of A to the real Schur form failed; +C = 2: the state matrix A is not stable (if DICO = 'C') +C or not convergent (if DICO = 'D'); +C = 3: the computation of Hankel singular values failed. +C +C METHOD +C +C Let be the stable linear system +C +C d[x(t)] = Ax(t) + Bu(t) +C y(t) = Cx(t) (1) +C +C where d[x(t)] is dx(t)/dt for a continuous-time system and x(t+1) +C for a discrete-time system. The subroutine AB09AD determines for +C the given system (1), the matrices of a reduced order system +C +C d[z(t)] = Ar*z(t) + Br*u(t) +C yr(t) = Cr*z(t) (2) +C +C such that +C +C HSV(NR) <= INFNORM(G-Gr) <= 2*[HSV(NR+1) + ... + HSV(N)], +C +C where G and Gr are transfer-function matrices of the systems +C (A,B,C) and (Ar,Br,Cr), respectively, and INFNORM(G) is the +C infinity-norm of G. +C +C If JOB = 'B', the square-root Balance & Truncate method of [1] +C is used and, for DICO = 'C', the resulting model is balanced. +C By setting TOL <= 0, the routine can be used to compute balanced +C minimal state-space realizations of stable systems. +C +C If JOB = 'N', the balancing-free square-root version of the +C Balance & Truncate method [2] is used. +C By setting TOL <= 0, the routine can be used to compute minimal +C state-space realizations of stable systems. +C +C REFERENCES +C +C [1] Tombs M.S. and Postlethwaite I. +C Truncated balanced realization of stable, non-minimal +C state-space systems. +C Int. J. Control, Vol. 46, pp. 1319-1330, 1987. +C +C [2] Varga A. +C Efficient minimal realization procedure based on balancing. +C Proc. of IMACS/IFAC Symp. MCTS, Lille, France, May 1991, +C A. El Moudui, P. Borne, S. G. Tzafestas (Eds.), +C Vol. 2, pp. 42-46. +C +C NUMERICAL ASPECTS +C +C The implemented methods rely on accuracy enhancing square-root or +C balancing-free square-root techniques. +C 3 +C The algorithms require less than 30N floating point operations. +C +C CONTRIBUTOR +C +C C. Oara and A. Varga, German Aerospace Center, +C DLR Oberpfaffenhofen, March 1998. +C Based on the RASP routines SRBT and SRBFT. +C +C REVISIONS +C +C May 2, 1998. +C November 11, 1998, V. Sima, Research Institute for Informatics, +C Bucharest. +C +C KEYWORDS +C +C Balancing, minimal state-space representation, model reduction, +C multivariable system, state-space model. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ONE, C100 + PARAMETER ( ONE = 1.0D0, C100 = 100.0D0 ) +C .. Scalar Arguments .. + CHARACTER DICO, EQUIL, JOB, ORDSEL + INTEGER INFO, IWARN, LDA, LDB, LDC, LDWORK, M, N, NR, P + DOUBLE PRECISION TOL +C .. Array Arguments .. + INTEGER IWORK(*) + DOUBLE PRECISION A(LDA,*), B(LDB,*), C(LDC,*), DWORK(*), HSV(*) +C .. Local Scalars .. + LOGICAL FIXORD + INTEGER IERR, KI, KR, KT, KTI, KW, NN + DOUBLE PRECISION MAXRED, WRKOPT +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL AB09AX, TB01ID, TB01WD, XERBLA +C .. Intrinsic Functions .. + INTRINSIC DBLE, MAX, MIN +C .. Executable Statements .. +C + INFO = 0 + IWARN = 0 + FIXORD = LSAME( ORDSEL, 'F' ) +C +C Test the input scalar arguments. +C + IF( .NOT. ( LSAME( DICO, 'C' ) .OR. LSAME( DICO, 'D' ) ) ) THEN + INFO = -1 + ELSE IF( .NOT. ( LSAME( JOB, 'B' ) .OR. LSAME( JOB, 'N' ) ) ) THEN + INFO = -2 + ELSE IF( .NOT. ( LSAME( EQUIL, 'S' ) .OR. + $ LSAME( EQUIL, 'N' ) ) ) THEN + INFO = -3 + ELSE IF( .NOT. ( FIXORD .OR. LSAME( ORDSEL, 'A' ) ) ) THEN + INFO = -4 + ELSE IF( N.LT.0 ) THEN + INFO = -5 + ELSE IF( M.LT.0 ) THEN + INFO = -6 + ELSE IF... [truncated message content] |
From: <par...@us...> - 2011-07-19 07:28:31
|
Revision: 8386 http://octave.svn.sourceforge.net/octave/?rev=8386&view=rev Author: paramaniac Date: 2011-07-19 07:28:25 +0000 (Tue, 19 Jul 2011) Log Message: ----------- control: draft code for frd models display routine Modified Paths: -------------- trunk/octave-forge/main/control/devel/@frd/display.m Added Paths: ----------- trunk/octave-forge/main/control/devel/frd_display.m Modified: trunk/octave-forge/main/control/devel/@frd/display.m =================================================================== --- trunk/octave-forge/main/control/devel/@frd/display.m 2011-07-18 22:34:37 UTC (rev 8385) +++ trunk/octave-forge/main/control/devel/@frd/display.m 2011-07-19 07:28:25 UTC (rev 8386) @@ -1,4 +1,4 @@ -## Copyright (C) 2010 Lukas F. Reichlin +## Copyright (C) 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -24,6 +24,7 @@ function display (sys) + sysname = inputname (1); [inname, outname, tsam] = __lti_data__ (sys.lti); [inname, m] = __labels__ (inname, "u"); @@ -31,19 +32,76 @@ disp (""); - disp (["Frequency response """, inputname(1), """ from input "]); + for i = 1 : m + disp (["Frequency response \"", sysname, "\" from input \"", inname{i}, "\" to output ..."]); + __disp_resp__ (sys.H(:,i,:), sys.w, outname); + endfor - sys.H - sys.w - display (sys.lti); # display sampling time if (tsam == -2) disp ("Static gain."); elseif (tsam == 0) - disp ("Continuous-time model."); + disp ("Continuous-time frequency response."); else - disp ("Discrete-time model."); + disp ("Discrete-time frequency response."); endif endfunction + + +function __disp_freq__ () + +endfunction + + +function __disp_resp__ (H, w, outname) + + len = rows (w); + + % Hier kommt H, wie bei ss nur soviele Ausgänge pro Zeile anzeigen wie terminal size + % H kann auch komplex sein --> zwei Kolonnen + + H = mat2cell (H, ones (1, rows (H)), 1, len)(:); + H = cellfun (@__resp2str__, H, outname, "uniformoutput", false) + +endfunction + + +% Noch nicht in Betrieb, kann in display selbst aufgerufen werden, dann nur einmal aufrufen +% und Resultat immer wieder übergeben +function str = __freq2str__ (w, title = "w [rad/s]") + + len = rows (w); + str = __vec2str__ (w); + line = repmat ("-", 1, max (columns (str), columns (title))); + str = strvcat (title, line, str); + space = repmat (" ", len+2, 1); + str = [space, str]; + +endfunction + + +% Für Cellfun +function str = __resp2str__ (H, outname) + + len = length (H); + str = __vec2str__ (H); + line = repmat ("-", 1, max (columns (str), columns (outname))); + str = strvcat (outname, line, str); + space = repmat (" ", len+2, 1); + str = [space, str]; + % Noch für complex ergänzen +endfunction + + +function col = __vec2str__ (vec, str) + + vec = num2cell (vec(:)); + col = cellfun (@(x) sprintf ("%.4f", x), vec, "uniformoutput", false); + col = strjust (char (col), "right"); + if (nargin > 1) + col = [col, repmat(str, length (vec), 1)]; + endif + +endfunction Added: trunk/octave-forge/main/control/devel/frd_display.m =================================================================== --- trunk/octave-forge/main/control/devel/frd_display.m (rev 0) +++ trunk/octave-forge/main/control/devel/frd_display.m 2011-07-19 07:28:25 UTC (rev 8386) @@ -0,0 +1,10 @@ +page_screen_output (0) + +%sys = Boeing707; +%sys = frd (sys) + +%sys6 = frd ([1, 2; 3, 4], logspace (-1, 1, 10)) + +sys = Boeing707; +w = logspace (-1, 1, 10); +sys = frd (sys, w) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-07-31 19:51:25
|
Revision: 8425 http://octave.svn.sourceforge.net/octave/?rev=8425&view=rev Author: paramaniac Date: 2011-07-31 19:51:16 +0000 (Sun, 31 Jul 2011) Log Message: ----------- control: add ncfsyn (continuous-time case only) Added Paths: ----------- trunk/octave-forge/main/control/devel/MDSSystem.m trunk/octave-forge/main/control/devel/ncfsyn/ trunk/octave-forge/main/control/devel/ncfsyn/MA02AD.f trunk/octave-forge/main/control/devel/ncfsyn/MA02ED.f trunk/octave-forge/main/control/devel/ncfsyn/MA02GD.f trunk/octave-forge/main/control/devel/ncfsyn/MB01RU.f trunk/octave-forge/main/control/devel/ncfsyn/MB01RX.f trunk/octave-forge/main/control/devel/ncfsyn/MB01RY.f trunk/octave-forge/main/control/devel/ncfsyn/MB01SD.f trunk/octave-forge/main/control/devel/ncfsyn/MB01UD.f trunk/octave-forge/main/control/devel/ncfsyn/MB02PD.f trunk/octave-forge/main/control/devel/ncfsyn/MB02VD.f trunk/octave-forge/main/control/devel/ncfsyn/SB02MR.f trunk/octave-forge/main/control/devel/ncfsyn/SB02MS.f trunk/octave-forge/main/control/devel/ncfsyn/SB02MV.f trunk/octave-forge/main/control/devel/ncfsyn/SB02MW.f trunk/octave-forge/main/control/devel/ncfsyn/SB02QD.f trunk/octave-forge/main/control/devel/ncfsyn/SB02RD.f trunk/octave-forge/main/control/devel/ncfsyn/SB02RU.f trunk/octave-forge/main/control/devel/ncfsyn/SB02SD.f trunk/octave-forge/main/control/devel/ncfsyn/SB03MV.f trunk/octave-forge/main/control/devel/ncfsyn/SB03MW.f trunk/octave-forge/main/control/devel/ncfsyn/SB03MX.f trunk/octave-forge/main/control/devel/ncfsyn/SB03MY.f trunk/octave-forge/main/control/devel/ncfsyn/SB03QX.f trunk/octave-forge/main/control/devel/ncfsyn/SB03QY.f trunk/octave-forge/main/control/devel/ncfsyn/SB03SX.f trunk/octave-forge/main/control/devel/ncfsyn/SB03SY.f trunk/octave-forge/main/control/devel/ncfsyn/SB04PX.f trunk/octave-forge/main/control/devel/ncfsyn/SB10ID.f trunk/octave-forge/main/control/devel/ncfsyn/SB10JD.f trunk/octave-forge/main/control/devel/ncfsyn/common.cc trunk/octave-forge/main/control/devel/ncfsyn/makefile_ncfsyn.m trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m trunk/octave-forge/main/control/devel/ncfsyn/select.f trunk/octave-forge/main/control/devel/ncfsyn/slsb10id.cc Added: trunk/octave-forge/main/control/devel/MDSSystem.m =================================================================== --- trunk/octave-forge/main/control/devel/MDSSystem.m (rev 0) +++ trunk/octave-forge/main/control/devel/MDSSystem.m 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,123 @@ +% Tabula Rasa +clear all, close all, clc + +% Nominal Values +m_nom = 3; % Mass +c_nom = 1; % Damping Coefficient +k_nom = 2; % Spring Stiffness + +% Perturbations +p_m = 0.4; % 40% uncertainty in the mass +p_c = 0.2; % 20% uncertainty in the damping coefficient +p_k = 0.3; % 30% uncertainty in the spring stiffness + +% +---------------+ +% | d_m 0 0 | +% +-----| 0 d_c 0 |<----+ +% u_m | | 0 0 d_k | | y_m +% u_c | +---------------+ | y_c +% u_k | | y_k +% | +---------------+ | +% +---->| |-----+ +% | G_nom | +% u ----->| |-----> y +% +---------------+ + +% State-Space Representation +A = [ 0, 1 + -k_nom/m_nom, -c_nom/m_nom ]; + +B1 = [ 0, 0, 0 + -p_m, -p_c/m_nom, -p_k/m_nom ]; + +B2 = [ 0 + 1/m_nom ]; + +C1 = [ -k_nom/m_nom, -c_nom/m_nom + 0, c_nom + k_nom, 0 ]; + +C2 = [ 1, 0 ]; + +D11 = [ -p_m, -p_c/m_nom, -p_k/m_nom + 0, 0, 0 + 0, 0, 0 ]; + +D12 = [ 1/m_nom + 0 + 0 ]; + +D21 = [ 0, 0, 0 ]; + +D22 = [ 0 ]; + +inname = {"u_m", "u_c", "u_k", "u"}; % Input Names +outname = {"y_m", "y_c", "y_k", "y"}; % Output Names + +G_nom = ss (A, [B1, B2], [C1; C2], [D11, D12; D21, D22], \ + "inname", inname, "outname", outname); + +% +-------+ +% +--------------------->| W_p |----------> e_p +% | +-------+ +% | +-------+ +% | +---->| W_u |----------> e_u +% | | +-------+ +% | | +---------+ +% | | ->| |-> +% r + e | +-------+ u | | G_nom | +% ----->(+)---+-->| K |----+--->| |----+----> y +% ^ - +-------+ +---------+ | +% | | +% +-----------------------------------------+ + +% Weighting Functions +s = tf ("s"); +W_p = 0.95 * (s^2 + 1.8*s + 10) / (s^2 + 8.0*s + 0.01); +W_u = 10^-2; + +% Suboptimal H-infinity Controller Design +G = G_nom(4, 4); % Extract output y and input u +%K = mixsyn (G, W_p, W_u); +%[K, ~, gamma] = mixsyn (G, W_p, W_u) +[K, N, gamma] = mixsyn (G, W_p, W_u) +% g_max = 10; +% K = mixsyn (G, W_p, W_u, [], g_max) +% [K, ~, gamma] = mixsyn (G, W_p, W_u, [], g_max) + +% Open Loop +L = G * K; + +% Closed Loop +T = feedback (L); + +figure (1) +sigma (T) + +figure (2) +sigma (N) + +norm (N, inf) + +figure (3) +step (T) + + +figure (4) + +w = logspace (-1, 1, 100); + +% Uncertainties +% -1 <= delta_m, delta_c, delta_k <= 1 +[delta_m, delta_c, delta_k] = ndgrid ([-1, 0, 1], [-1, 0, 1], [-1, 0, 1]); + +for k = 1 : numel (delta_1) + Delta = diag ([delta_m(k), delta_c(k), delta_k(k)]); + G_per = lft (Delta, G_nom); + %figure (4) + bode (G_per, w) + subplot (2, 1, 1) + hold on + subplot (2, 1, 2) + hold on +endfor \ No newline at end of file Property changes on: trunk/octave-forge/main/control/devel/ncfsyn ___________________________________________________________________ Added: svn:ignore + *.oct Added: trunk/octave-forge/main/control/devel/ncfsyn/MA02AD.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MA02AD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MA02AD.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,108 @@ + SUBROUTINE MA02AD( JOB, M, N, A, LDA, B, LDB ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 transpose all or part of a two-dimensional matrix A into +C another matrix B. +C +C ARGUMENTS +C +C Mode Parameters +C +C JOB CHARACTER*1 +C Specifies the part of the matrix A to be transposed into B +C as follows: +C = 'U': Upper triangular part; +C = 'L': Lower triangular part; +C Otherwise: All of the matrix A. +C +C Input/Output Parameters +C +C M (input) INTEGER +C The number of rows of the matrix A. M >= 0. +C +C N (input) INTEGER +C The number of columns of the matrix A. N >= 0. +C +C A (input) DOUBLE PRECISION array, dimension (LDA,N) +C The m-by-n matrix A. If JOB = 'U', only the upper +C triangle or trapezoid is accessed; if JOB = 'L', only the +C lower triangle or trapezoid is accessed. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,M). +C +C B (output) DOUBLE PRECISION array, dimension (LDB,M) +C B = A' in the locations specified by JOB. +C +C LDB INTEGER +C The leading dimension of the array B. LDB >= max(1,N). +C +C CONTRIBUTOR +C +C A. Varga, German Aerospace Center, +C DLR Oberpfaffenhofen, March 1998. +C Based on the RASP routine DMTRA. +C +C REVISIONS +C +C - +C +C ****************************************************************** +C +C .. Scalar Arguments .. + CHARACTER JOB + INTEGER LDA, LDB, M, N +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), B(LDB,*) +C .. Local Scalars .. + INTEGER I, J +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. Intrinsic Functions .. + INTRINSIC MIN +C +C .. Executable Statements .. +C + IF( LSAME( JOB, 'U' ) ) THEN + DO 20 J = 1, N + DO 10 I = 1, MIN( J, M ) + B(J,I) = A(I,J) + 10 CONTINUE + 20 CONTINUE + ELSE IF( LSAME( JOB, 'L' ) ) THEN + DO 40 J = 1, N + DO 30 I = J, M + B(J,I) = A(I,J) + 30 CONTINUE + 40 CONTINUE + ELSE + DO 60 J = 1, N + DO 50 I = 1, M + B(J,I) = A(I,J) + 50 CONTINUE + 60 CONTINUE + END IF +C + RETURN +C *** Last line of MA02AD *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MA02AD.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MA02ED.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MA02ED.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MA02ED.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,99 @@ + SUBROUTINE MA02ED( UPLO, N, A, LDA ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 store by symmetry the upper or lower triangle of a symmetric +C matrix, given the other triangle. +C +C ARGUMENTS +C +C Mode Parameters +C +C UPLO CHARACTER*1 +C Specifies which part of the matrix is given as follows: +C = 'U': Upper triangular part; +C = 'L': Lower triangular part. +C For all other values, the array A is not referenced. +C +C Input/Output Parameters +C +C N (input) INTEGER +C The order of the matrix A. N >= 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the leading N-by-N upper triangular part +C (if UPLO = 'U'), or lower triangular part (if UPLO = 'L'), +C of this array must contain the corresponding upper or +C lower triangle of the symmetric matrix A. +C On exit, the leading N-by-N part of this array contains +C the symmetric matrix A with all elements stored. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,N). +C +C CONTRIBUTOR +C +C V. Sima, Research Institute for Informatics, Bucharest, Romania, +C Oct. 1998. +C +C REVISIONS +C +C - +C +C ****************************************************************** +C +C .. Scalar Arguments .. + CHARACTER UPLO + INTEGER LDA, N +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*) +C .. Local Scalars .. + INTEGER J +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DCOPY +C +C .. Executable Statements .. +C +C For efficiency reasons, the parameters are not checked for errors. +C + IF( LSAME( UPLO, 'L' ) ) THEN +C +C Construct the upper triangle of A. +C + DO 20 J = 2, N + CALL DCOPY( J-1, A(J,1), LDA, A(1,J), 1 ) + 20 CONTINUE +C + ELSE IF( LSAME( UPLO, 'U' ) ) THEN +C +C Construct the lower triangle of A. +C + DO 40 J = 2, N + CALL DCOPY( J-1, A(1,J), 1, A(J,1), LDA ) + 40 CONTINUE +C + END IF + RETURN +C *** Last line of MA02ED *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MA02ED.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MA02GD.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MA02GD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MA02GD.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,158 @@ + SUBROUTINE MA02GD( N, A, LDA, K1, K2, IPIV, INCX ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 perform a series of column interchanges on the matrix A. +C One column interchange is initiated for each of columns K1 through +C K2 of A. This is useful for solving linear systems X*A = B, when +C the matrix A has already been factored by LAPACK Library routine +C DGETRF. +C +C ARGUMENTS +C +C Input/Output Parameters +C +C N (input) INTEGER +C The number of rows of the matrix A. N >= 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,*) +C On entry, the leading N-by-M part of this array must +C contain the matrix A to which the column interchanges will +C be applied, where M is the largest element of IPIV(K), for +C K = K1, ..., K2. +C On exit, the leading N-by-M part of this array contains +C the permuted matrix. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= MAX(1,N). +C +C K1 (input) INTEGER +C The first element of IPIV for which a column interchange +C will be done. +C +C K2 (input) INTEGER +C The last element of IPIV for which a column interchange +C will be done. +C +C IPIV (input) INTEGER array, dimension (K1+(K2-K1)*abs(INCX)) +C The vector of interchanging (pivot) indices. Only the +C elements in positions K1 through K2 of IPIV are accessed. +C IPIV(K) = L implies columns K and L are to be +C interchanged. +C +C INCX (input) INTEGER +C The increment between successive values of IPIV. +C If INCX is negative, the interchanges are applied in +C reverse order. +C +C METHOD +C +C The columns IPIV(K) and K are swapped for K = K1, ..., K2, for +C INCX = 1 (and similarly, for INCX <> 1). +C +C FURTHER COMMENTS +C +C This routine is the column-oriented counterpart of the LAPACK +C Library routine DLASWP. The LAPACK Library routine DLAPMT cannot +C be used in this context. To solve the system X*A = B, where A and +C B are N-by-N and M-by-N, respectively, the following statements +C can be used: +C +C CALL DGETRF( N, N, A, LDA, IPIV, INFO ) +C CALL DTRSM( 'R', 'U', 'N', 'N', M, N, ONE, A, LDA, B, LDB ) +C CALL DTRSM( 'R', 'L', 'N', 'U', M, N, ONE, A, LDA, B, LDB ) +C CALL MA02GD( M, B, LDB, 1, N, IPIV, -1 ) +C +C CONTRIBUTOR +C +C V. Sima, Research Institute for Informatics, Bucharest, Mar. 2000. +C +C REVISIONS +C +C V. Sima, Research Institute for Informatics, Bucharest, Apr. 2008. +C +C KEYWORDS +C +C Elementary matrix operations, linear algebra. +C +C ****************************************************************** +C +C .. Scalar Arguments .. + INTEGER INCX, K1, K2, LDA, N +C .. +C .. Array Arguments .. + INTEGER IPIV( * ) + DOUBLE PRECISION A( LDA, * ) +C .. +C .. Local Scalars .. + INTEGER J, JP, JX +C .. +C .. External Subroutines .. + EXTERNAL DSWAP +C .. +C .. Executable Statements .. +C +C Quick return if possible. +C + IF( INCX.EQ.0 .OR. N.EQ.0 ) + $ RETURN +C +C Interchange column J with column IPIV(J) for each of columns K1 +C through K2. +C + IF( INCX.GT.0 ) THEN + JX = K1 + ELSE + JX = 1 + ( 1-K2 )*INCX + END IF +C + IF( INCX.EQ.1 ) THEN +C + DO 10 J = K1, K2 + JP = IPIV( J ) + IF( JP.NE.J ) + $ CALL DSWAP( N, A( 1, J ), 1, A( 1, JP ), 1 ) + 10 CONTINUE +C + ELSE IF( INCX.GT.1 ) THEN +C + DO 20 J = K1, K2 + JP = IPIV( JX ) + IF( JP.NE.J ) + $ CALL DSWAP( N, A( 1, J ), 1, A( 1, JP ), 1 ) + JX = JX + INCX + 20 CONTINUE +C + ELSE IF( INCX.LT.0 ) THEN +C + DO 30 J = K2, K1, -1 + JP = IPIV( JX ) + IF( JP.NE.J ) + $ CALL DSWAP( N, A( 1, J ), 1, A( 1, JP ), 1 ) + JX = JX + INCX + 30 CONTINUE +C + END IF +C + RETURN +C +C *** Last line of MA02GD *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MA02GD.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MB01RU.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MB01RU.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MB01RU.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,282 @@ + SUBROUTINE MB01RU( UPLO, TRANS, M, N, ALPHA, BETA, R, LDR, A, LDA, + $ X, LDX, DWORK, LDWORK, INFO ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 matrix formula +C _ +C R = alpha*R + beta*op( A )*X*op( A )', +C _ +C where alpha and beta are scalars, R, X, and R are symmetric +C matrices, A is a general matrix, and op( A ) is one of +C +C op( A ) = A or op( A ) = A'. +C +C The result is overwritten on R. +C +C ARGUMENTS +C +C Mode Parameters +C +C UPLO CHARACTER*1 +C Specifies which triangles of the symmetric matrices R +C and X are given as follows: +C = 'U': the upper triangular part is given; +C = 'L': the lower triangular part is given. +C +C TRANS CHARACTER*1 +C Specifies the form of op( A ) to be used in the matrix +C multiplication as follows: +C = 'N': op( A ) = A; +C = 'T': op( A ) = A'; +C = 'C': op( A ) = A'. +C +C Input/Output Parameters +C +C M (input) INTEGER _ +C The order of the matrices R and R and the number of rows +C of the matrix op( A ). M >= 0. +C +C N (input) INTEGER +C The order of the matrix X and the number of columns of the +C the matrix op( A ). N >= 0. +C +C ALPHA (input) DOUBLE PRECISION +C The scalar alpha. When alpha is zero then R need not be +C set before entry, except when R is identified with X in +C the call. +C +C BETA (input) DOUBLE PRECISION +C The scalar beta. When beta is zero then A and X are not +C referenced. +C +C R (input/output) DOUBLE PRECISION array, dimension (LDR,M) +C On entry with UPLO = 'U', the leading M-by-M upper +C triangular part of this array must contain the upper +C triangular part of the symmetric matrix R. +C On entry with UPLO = 'L', the leading M-by-M lower +C triangular part of this array must contain the lower +C triangular part of the symmetric matrix R. +C On exit, the leading M-by-M upper triangular part (if +C UPLO = 'U'), or lower triangular part (if UPLO = 'L'), of +C this array contains the corresponding triangular part of +C _ +C the computed matrix R. +C +C LDR INTEGER +C The leading dimension of array R. LDR >= MAX(1,M). +C +C A (input) DOUBLE PRECISION array, dimension (LDA,k) +C where k is N when TRANS = 'N' and is M when TRANS = 'T' or +C TRANS = 'C'. +C On entry with TRANS = 'N', the leading M-by-N part of this +C array must contain the matrix A. +C On entry with TRANS = 'T' or TRANS = 'C', the leading +C N-by-M part of this array must contain the matrix A. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= MAX(1,k), +C where k is M when TRANS = 'N' and is N when TRANS = 'T' or +C TRANS = 'C'. +C +C X (input) DOUBLE PRECISION array, dimension (LDX,N) +C On entry, if UPLO = 'U', the leading N-by-N upper +C triangular part of this array must contain the upper +C triangular part of the symmetric matrix X and the strictly +C lower triangular part of the array is not referenced. +C On entry, if UPLO = 'L', the leading N-by-N lower +C triangular part of this array must contain the lower +C triangular part of the symmetric matrix X and the strictly +C upper triangular part of the array is not referenced. +C The diagonal elements of this array are modified +C internally, but are restored on exit. +C +C LDX INTEGER +C The leading dimension of array X. LDX >= MAX(1,N). +C +C Workspace +C +C DWORK DOUBLE PRECISION array, dimension (LDWORK) +C This array is not referenced when beta = 0, or M*N = 0. +C +C LDWORK The length of the array DWORK. +C LDWORK >= M*N, if beta <> 0; +C LDWORK >= 0, if beta = 0. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -k, the k-th argument had an illegal +C value. +C +C METHOD +C +C The matrix expression is efficiently evaluated taking the symmetry +C into account. Specifically, let X = T + T', with T an upper or +C lower triangular matrix, defined by +C +C T = triu( X ) - (1/2)*diag( X ), if UPLO = 'U', +C T = tril( X ) - (1/2)*diag( X ), if UPLO = 'L', +C +C where triu, tril, and diag denote the upper triangular part, lower +C triangular part, and diagonal part of X, respectively. Then, +C +C A*X*A' = ( A*T )*A' + A*( A*T )', for TRANS = 'N', +C A'*X*A = A'*( T*A ) + ( T*A )'*A, for TRANS = 'T', or 'C', +C +C which involve BLAS 3 operations (DTRMM and DSYR2K). +C +C NUMERICAL ASPECTS +C +C The algorithm requires approximately +C +C 2 2 +C 3/2 x M x N + 1/2 x M +C +C operations. +C +C FURTHER COMMENTS +C +C This is a simpler version for MB01RD. +C +C CONTRIBUTORS +C +C V. Sima, Katholieke Univ. Leuven, Belgium, Jan. 1999. +C +C REVISIONS +C +C A. Varga, German Aerospace Center, Oberpfaffenhofen, March 2004. +C V. Sima, Research Institute for Informatics, Bucharest, Mar. 2004. +C +C KEYWORDS +C +C Elementary matrix operations, matrix algebra, matrix operations. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE, TWO, HALF + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0, + $ HALF = 0.5D0 ) +C .. Scalar Arguments .. + CHARACTER TRANS, UPLO + INTEGER INFO, LDA, LDR, LDWORK, LDX, M, N + DOUBLE PRECISION ALPHA, BETA +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), DWORK(*), R(LDR,*), X(LDX,*) +C .. Local Scalars .. + LOGICAL LTRANS, LUPLO +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DLACPY, DLASCL, DLASET, DSCAL, DSYR2K, DTRMM, + $ XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + INFO = 0 + LUPLO = LSAME( UPLO, 'U' ) + LTRANS = LSAME( TRANS, 'T' ) .OR. LSAME( TRANS, 'C' ) +C + IF( ( .NOT.LUPLO ).AND.( .NOT.LSAME( UPLO, 'L' ) ) )THEN + INFO = -1 + ELSE IF( ( .NOT.LTRANS ).AND.( .NOT.LSAME( TRANS, 'N' ) ) )THEN + INFO = -2 + ELSE IF( M.LT.0 ) THEN + INFO = -3 + ELSE IF( N.LT.0 ) THEN + INFO = -4 + ELSE IF( LDR.LT.MAX( 1, M ) ) THEN + INFO = -8 + ELSE IF( LDA.LT.1 .OR. ( LTRANS .AND. LDA.LT.N ) .OR. + $ ( .NOT.LTRANS .AND. LDA.LT.M ) ) THEN + INFO = -10 + ELSE IF( LDX.LT.MAX( 1, N ) ) THEN + INFO = -12 + ELSE IF( ( BETA.NE.ZERO .AND. LDWORK.LT.M*N ) + $ .OR.( BETA.EQ.ZERO .AND. LDWORK.LT.0 ) ) THEN + INFO = -14 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'MB01RU', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( M.EQ.0 ) + $ RETURN +C + IF ( BETA.EQ.ZERO .OR. N.EQ.0 ) THEN + IF ( ALPHA.EQ.ZERO ) THEN +C +C Special case alpha = 0. +C + CALL DLASET( UPLO, M, M, ZERO, ZERO, R, LDR ) + ELSE +C +C Special case beta = 0 or N = 0. +C + IF ( ALPHA.NE.ONE ) + $ CALL DLASCL( UPLO, 0, 0, ONE, ALPHA, M, M, R, LDR, INFO ) + END IF + RETURN + END IF +C +C General case: beta <> 0. +C Compute W = op( A )*T or W = T*op( A ) in DWORK, and apply the +C updating formula (see METHOD section). +C Workspace: need M*N. +C + CALL DSCAL( N, HALF, X, LDX+1 ) +C + IF( LTRANS ) THEN +C + CALL DLACPY( 'Full', N, M, A, LDA, DWORK, N ) + CALL DTRMM( 'Left', UPLO, 'NoTranspose', 'Non-unit', N, M, + $ ONE, X, LDX, DWORK, N ) + CALL DSYR2K( UPLO, TRANS, M, N, BETA, DWORK, N, A, LDA, ALPHA, + $ R, LDR ) +C + ELSE +C + CALL DLACPY( 'Full', M, N, A, LDA, DWORK, M ) + CALL DTRMM( 'Right', UPLO, 'NoTranspose', 'Non-unit', M, N, + $ ONE, X, LDX, DWORK, M ) + CALL DSYR2K( UPLO, TRANS, M, N, BETA, DWORK, M, A, LDA, ALPHA, + $ R, LDR ) +C + END IF +C + CALL DSCAL( N, TWO, X, LDX+1 ) +C + RETURN +C *** Last line of MB01RU *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MB01RU.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MB01RX.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MB01RX.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MB01RX.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,315 @@ + SUBROUTINE MB01RX( SIDE, UPLO, TRANS, M, N, ALPHA, BETA, R, LDR, + $ A, LDA, B, LDB, INFO ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 either the upper or lower triangular part of one of the +C matrix formulas +C _ +C R = alpha*R + beta*op( A )*B, (1) +C _ +C R = alpha*R + beta*B*op( A ), (2) +C _ +C where alpha and beta are scalars, R and R are m-by-m matrices, +C op( A ) and B are m-by-n and n-by-m matrices for (1), or n-by-m +C and m-by-n matrices for (2), respectively, and op( A ) is one of +C +C op( A ) = A or op( A ) = A', the transpose of A. +C +C The result is overwritten on R. +C +C ARGUMENTS +C +C Mode Parameters +C +C SIDE CHARACTER*1 +C Specifies whether the matrix A appears on the left or +C right in the matrix product as follows: +C _ +C = 'L': R = alpha*R + beta*op( A )*B; +C _ +C = 'R': R = alpha*R + beta*B*op( A ). +C +C UPLO CHARACTER*1 _ +C Specifies which triangles of the matrices R and R are +C computed and given, respectively, as follows: +C = 'U': the upper triangular part; +C = 'L': the lower triangular part. +C +C TRANS CHARACTER*1 +C Specifies the form of op( A ) to be used in the matrix +C multiplication as follows: +C = 'N': op( A ) = A; +C = 'T': op( A ) = A'; +C = 'C': op( A ) = A'. +C +C Input/Output Parameters +C +C M (input) INTEGER _ +C The order of the matrices R and R, the number of rows of +C the matrix op( A ) and the number of columns of the +C matrix B, for SIDE = 'L', or the number of rows of the +C matrix B and the number of columns of the matrix op( A ), +C for SIDE = 'R'. M >= 0. +C +C N (input) INTEGER +C The number of rows of the matrix B and the number of +C columns of the matrix op( A ), for SIDE = 'L', or the +C number of rows of the matrix op( A ) and the number of +C columns of the matrix B, for SIDE = 'R'. N >= 0. +C +C ALPHA (input) DOUBLE PRECISION +C The scalar alpha. When alpha is zero then R need not be +C set before entry. +C +C BETA (input) DOUBLE PRECISION +C The scalar beta. When beta is zero then A and B are not +C referenced. +C +C R (input/output) DOUBLE PRECISION array, dimension (LDR,M) +C On entry with UPLO = 'U', the leading M-by-M upper +C triangular part of this array must contain the upper +C triangular part of the matrix R; the strictly lower +C triangular part of the array is not referenced. +C On entry with UPLO = 'L', the leading M-by-M lower +C triangular part of this array must contain the lower +C triangular part of the matrix R; the strictly upper +C triangular part of the array is not referenced. +C On exit, the leading M-by-M upper triangular part (if +C UPLO = 'U'), or lower triangular part (if UPLO = 'L') of +C this array contains the corresponding triangular part of +C _ +C the computed matrix R. +C +C LDR INTEGER +C The leading dimension of array R. LDR >= MAX(1,M). +C +C A (input) DOUBLE PRECISION array, dimension (LDA,k), where +C k = N when SIDE = 'L', and TRANS = 'N', or +C SIDE = 'R', and TRANS = 'T'; +C k = M when SIDE = 'R', and TRANS = 'N', or +C SIDE = 'L', and TRANS = 'T'. +C On entry, if SIDE = 'L', and TRANS = 'N', or +C SIDE = 'R', and TRANS = 'T', +C the leading M-by-N part of this array must contain the +C matrix A. +C On entry, if SIDE = 'R', and TRANS = 'N', or +C SIDE = 'L', and TRANS = 'T', +C the leading N-by-M part of this array must contain the +C matrix A. +C +C LDA INTEGER +C The leading dimension of array A. LDA >= MAX(1,l), where +C l = M when SIDE = 'L', and TRANS = 'N', or +C SIDE = 'R', and TRANS = 'T'; +C l = N when SIDE = 'R', and TRANS = 'N', or +C SIDE = 'L', and TRANS = 'T'. +C +C B (input) DOUBLE PRECISION array, dimension (LDB,p), where +C p = M when SIDE = 'L'; +C p = N when SIDE = 'R'. +C On entry, the leading N-by-M part, if SIDE = 'L', or +C M-by-N part, if SIDE = 'R', of this array must contain the +C matrix B. +C +C LDB INTEGER +C The leading dimension of array B. +C LDB >= MAX(1,N), if SIDE = 'L'; +C LDB >= MAX(1,M), if SIDE = 'R'. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C The matrix expression is evaluated taking the triangular +C structure into account. BLAS 2 operations are used. A block +C algorithm can be easily constructed; it can use BLAS 3 GEMM +C operations for most computations, and calls of this BLAS 2 +C algorithm for computing the triangles. +C +C FURTHER COMMENTS +C +C The main application of this routine is when the result should +C be a symmetric matrix, e.g., when B = X*op( A )', for (1), or +C B = op( A )'*X, for (2), where B is already available and X = X'. +C +C CONTRIBUTORS +C +C V. Sima, Katholieke Univ. Leuven, Belgium, Feb. 1999. +C +C REVISIONS +C +C V. Sima, Research Institute for Informatics, Bucharest, Mar. 2004. +C +C KEYWORDS +C +C Elementary matrix operations, matrix algebra, matrix operations. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + CHARACTER SIDE, TRANS, UPLO + INTEGER INFO, LDA, LDB, LDR, M, N + DOUBLE PRECISION ALPHA, BETA +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), B(LDB,*), R(LDR,*) +C .. Local Scalars .. + LOGICAL LSIDE, LTRANS, LUPLO + INTEGER J +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. External Subroutines .. + EXTERNAL DGEMV, DLASCL, DLASET, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + INFO = 0 + LSIDE = LSAME( SIDE, 'L' ) + LUPLO = LSAME( UPLO, 'U' ) + LTRANS = LSAME( TRANS, 'T' ) .OR. LSAME( TRANS, 'C' ) +C + IF( ( .NOT.LSIDE ).AND.( .NOT.LSAME( SIDE, 'R' ) ) )THEN + INFO = -1 + ELSE IF( ( .NOT.LUPLO ).AND.( .NOT.LSAME( UPLO, 'L' ) ) )THEN + INFO = -2 + ELSE IF( ( .NOT.LTRANS ).AND.( .NOT.LSAME( TRANS, 'N' ) ) )THEN + INFO = -3 + ELSE IF( M.LT.0 ) THEN + INFO = -4 + ELSE IF( N.LT.0 ) THEN + INFO = -5 + ELSE IF( LDR.LT.MAX( 1, M ) ) THEN + INFO = -9 + ELSE IF( LDA.LT.1 .OR. + $ ( ( ( LSIDE .AND. .NOT.LTRANS ) .OR. + $ ( .NOT.LSIDE .AND. LTRANS ) ) .AND. LDA.LT.M ) .OR. + $ ( ( ( LSIDE .AND. LTRANS ) .OR. + $ ( .NOT.LSIDE .AND. .NOT.LTRANS ) ) .AND. LDA.LT.N ) ) THEN + INFO = -11 + ELSE IF( LDB.LT.1 .OR. + $ ( LSIDE .AND. LDB.LT.N ) .OR. + $ ( .NOT.LSIDE .AND. LDB.LT.M ) ) THEN + INFO = -13 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'MB01RX', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( M.EQ.0 ) + $ RETURN +C + IF ( BETA.EQ.ZERO .OR. N.EQ.0 ) THEN + IF ( ALPHA.EQ.ZERO ) THEN +C +C Special case alpha = 0. +C + CALL DLASET( UPLO, M, M, ZERO, ZERO, R, LDR ) + ELSE +C +C Special case beta = 0 or N = 0. +C + IF ( ALPHA.NE.ONE ) + $ CALL DLASCL( UPLO, 0, 0, ONE, ALPHA, M, M, R, LDR, INFO ) + END IF + RETURN + END IF +C +C General case: beta <> 0. +C Compute the required triangle of (1) or (2) using BLAS 2 +C operations. +C + IF( LSIDE ) THEN + IF( LUPLO ) THEN + IF ( LTRANS ) THEN + DO 10 J = 1, M + CALL DGEMV( TRANS, N, J, BETA, A, LDA, B(1,J), 1, + $ ALPHA, R(1,J), 1 ) + 10 CONTINUE + ELSE + DO 20 J = 1, M + CALL DGEMV( TRANS, J, N, BETA, A, LDA, B(1,J), 1, + $ ALPHA, R(1,J), 1 ) + 20 CONTINUE + END IF + ELSE + IF ( LTRANS ) THEN + DO 30 J = 1, M + CALL DGEMV( TRANS, N, M-J+1, BETA, A(1,J), LDA, + $ B(1,J), 1, ALPHA, R(J,J), 1 ) + 30 CONTINUE + ELSE + DO 40 J = 1, M + CALL DGEMV( TRANS, M-J+1, N, BETA, A(J,1), LDA, + $ B(1,J), 1, ALPHA, R(J,J), 1 ) + 40 CONTINUE + END IF + END IF +C + ELSE + IF( LUPLO ) THEN + IF( LTRANS ) THEN + DO 50 J = 1, M + CALL DGEMV( 'NoTranspose', J, N, BETA, B, LDB, A(J,1), + $ LDA, ALPHA, R(1,J), 1 ) + 50 CONTINUE + ELSE + DO 60 J = 1, M + CALL DGEMV( 'NoTranspose', J, N, BETA, B, LDB, A(1,J), + $ 1, ALPHA, R(1,J), 1 ) + 60 CONTINUE + END IF + ELSE + IF( LTRANS ) THEN + DO 70 J = 1, M + CALL DGEMV( 'NoTranspose', M-J+1, N, BETA, B(J,1), + $ LDB, A(J,1), LDA, ALPHA, R(J,J), 1 ) + 70 CONTINUE + ELSE + DO 80 J = 1, M + CALL DGEMV( 'NoTranspose', M-J+1, N, BETA, B(J,1), + $ LDB, A(1,J), 1, ALPHA, R(J,J), 1 ) + 80 CONTINUE + END IF + END IF + END IF +C + RETURN +C *** Last line of MB01RX *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MB01RX.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MB01RY.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MB01RY.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MB01RY.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,429 @@ + SUBROUTINE MB01RY( SIDE, UPLO, TRANS, M, ALPHA, BETA, R, LDR, H, + $ LDH, B, LDB, DWORK, INFO ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 either the upper or lower triangular part of one of the +C matrix formulas +C _ +C R = alpha*R + beta*op( H )*B, (1) +C _ +C R = alpha*R + beta*B*op( H ), (2) +C _ +C where alpha and beta are scalars, H, B, R, and R are m-by-m +C matrices, H is an upper Hessenberg matrix, and op( H ) is one of +C +C op( H ) = H or op( H ) = H', the transpose of H. +C +C The result is overwritten on R. +C +C ARGUMENTS +C +C Mode Parameters +C +C SIDE CHARACTER*1 +C Specifies whether the Hessenberg matrix H appears on the +C left or right in the matrix product as follows: +C _ +C = 'L': R = alpha*R + beta*op( H )*B; +C _ +C = 'R': R = alpha*R + beta*B*op( H ). +C +C UPLO CHARACTER*1 _ +C Specifies which triangles of the matrices R and R are +C computed and given, respectively, as follows: +C = 'U': the upper triangular part; +C = 'L': the lower triangular part. +C +C TRANS CHARACTER*1 +C Specifies the form of op( H ) to be used in the matrix +C multiplication as follows: +C = 'N': op( H ) = H; +C = 'T': op( H ) = H'; +C = 'C': op( H ) = H'. +C +C Input/Output Parameters +C +C M (input) INTEGER _ +C The order of the matrices R, R, H and B. M >= 0. +C +C ALPHA (input) DOUBLE PRECISION +C The scalar alpha. When alpha is zero then R need not be +C set before entry. +C +C BETA (input) DOUBLE PRECISION +C The scalar beta. When beta is zero then H and B are not +C referenced. +C +C R (input/output) DOUBLE PRECISION array, dimension (LDR,M) +C On entry with UPLO = 'U', the leading M-by-M upper +C triangular part of this array must contain the upper +C triangular part of the matrix R; the strictly lower +C triangular part of the array is not referenced. +C On entry with UPLO = 'L', the leading M-by-M lower +C triangular part of this array must contain the lower +C triangular part of the matrix R; the strictly upper +C triangular part of the array is not referenced. +C On exit, the leading M-by-M upper triangular part (if +C UPLO = 'U'), or lower triangular part (if UPLO = 'L') of +C this array contains the corresponding triangular part of +C _ +C the computed matrix R. +C +C LDR INTEGER +C The leading dimension of array R. LDR >= MAX(1,M). +C +C H (input) DOUBLE PRECISION array, dimension (LDH,M) +C On entry, the leading M-by-M upper Hessenberg part of +C this array must contain the upper Hessenberg part of the +C matrix H. +C The elements below the subdiagonal are not referenced, +C except possibly for those in the first column, which +C could be overwritten, but are restored on exit. +C +C LDH INTEGER +C The leading dimension of array H. LDH >= MAX(1,M). +C +C B (input) DOUBLE PRECISION array, dimension (LDB,M) +C On entry, the leading M-by-M part of this array must +C contain the matrix B. +C +C LDB INTEGER +C The leading dimension of array B. LDB >= MAX(1,M). +C +C Workspace +C +C DWORK DOUBLE PRECISION array, dimension (LDWORK) +C LDWORK >= M, if beta <> 0 and SIDE = 'L'; +C LDWORK >= 0, if beta = 0 or SIDE = 'R'. +C This array is not referenced when beta = 0 or SIDE = 'R'. +C +C Error Indicator +C +C INFO INTEGER +C = 0: successful exit; +C < 0: if INFO = -i, the i-th argument had an illegal +C value. +C +C METHOD +C +C The matrix expression is efficiently evaluated taking the +C Hessenberg/triangular structure into account. BLAS 2 operations +C are used. A block algorithm can be constructed; it can use BLAS 3 +C GEMM operations for most computations, and calls of this BLAS 2 +C algorithm for computing the triangles. +C +C FURTHER COMMENTS +C +C The main application of this routine is when the result should +C be a symmetric matrix, e.g., when B = X*op( H )', for (1), or +C B = op( H )'*X, for (2), where B is already available and X = X'. +C +C CONTRIBUTORS +C +C V. Sima, Katholieke Univ. Leuven, Belgium, Feb. 1999. +C +C REVISIONS +C +C - +C +C KEYWORDS +C +C Elementary matrix operations, matrix algebra, matrix operations. +C +C ****************************************************************** +C +C .. Parameters .. + DOUBLE PRECISION ZERO, ONE + PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) +C .. Scalar Arguments .. + CHARACTER SIDE, TRANS, UPLO + INTEGER INFO, LDB, LDH, LDR, M + DOUBLE PRECISION ALPHA, BETA +C .. Array Arguments .. + DOUBLE PRECISION B(LDB,*), DWORK(*), H(LDH,*), R(LDR,*) +C .. Local Scalars .. + LOGICAL LSIDE, LTRANS, LUPLO + INTEGER I, J +C .. External Functions .. + LOGICAL LSAME + DOUBLE PRECISION DDOT + EXTERNAL DDOT, LSAME +C .. External Subroutines .. + EXTERNAL DCOPY, DGEMV, DLASCL, DLASET, DSCAL, DSWAP, + $ DTRMV, XERBLA +C .. Intrinsic Functions .. + INTRINSIC MAX, MIN +C .. Executable Statements .. +C +C Test the input scalar arguments. +C + INFO = 0 + LSIDE = LSAME( SIDE, 'L' ) + LUPLO = LSAME( UPLO, 'U' ) + LTRANS = LSAME( TRANS, 'T' ) .OR. LSAME( TRANS, 'C' ) +C + IF( ( .NOT.LSIDE ).AND.( .NOT.LSAME( SIDE, 'R' ) ) )THEN + INFO = -1 + ELSE IF( ( .NOT.LUPLO ).AND.( .NOT.LSAME( UPLO, 'L' ) ) )THEN + INFO = -2 + ELSE IF( ( .NOT.LTRANS ).AND.( .NOT.LSAME( TRANS, 'N' ) ) )THEN + INFO = -3 + ELSE IF( M.LT.0 ) THEN + INFO = -4 + ELSE IF( LDR.LT.MAX( 1, M ) ) THEN + INFO = -8 + ELSE IF( LDH.LT.MAX( 1, M ) ) THEN + INFO = -10 + ELSE IF( LDB.LT.MAX( 1, M ) ) THEN + INFO = -12 + END IF +C + IF ( INFO.NE.0 ) THEN +C +C Error return. +C + CALL XERBLA( 'MB01RY', -INFO ) + RETURN + END IF +C +C Quick return if possible. +C + IF ( M.EQ.0 ) + $ RETURN +C + IF ( BETA.EQ.ZERO ) THEN + IF ( ALPHA.EQ.ZERO ) THEN +C +C Special case when both alpha = 0 and beta = 0. +C + CALL DLASET( UPLO, M, M, ZERO, ZERO, R, LDR ) + ELSE +C +C Special case beta = 0. +C + IF ( ALPHA.NE.ONE ) + $ CALL DLASCL( UPLO, 0, 0, ONE, ALPHA, M, M, R, LDR, INFO ) + END IF + RETURN + END IF +C +C General case: beta <> 0. +C Compute the required triangle of (1) or (2) using BLAS 2 +C operations. +C + IF( LSIDE ) THEN +C +C To avoid repeated references to the subdiagonal elements of H, +C these are swapped with the corresponding elements of H in the +C first column, and are finally restored. +C + IF( M.GT.2 ) + $ CALL DSWAP( M-2, H( 3, 2 ), LDH+1, H( 3, 1 ), 1 ) +C + IF( LUPLO ) THEN + IF ( LTRANS ) THEN +C + DO 20 J = 1, M +C +C Multiply the transposed upper triangle of the leading +C j-by-j submatrix of H by the leading part of the j-th +C column of B. +C + CALL DCOPY( J, B( 1, J ), 1, DWORK, 1 ) + CALL DTRMV( 'Upper', TRANS, 'Non-unit', J, H, LDH, + $ DWORK, 1 ) +C +C Add the contribution of the subdiagonal of H to +C the j-th column of the product. +C + DO 10 I = 1, MIN( J, M - 1 ) + R( I, J ) = ALPHA*R( I, J ) + BETA*( DWORK( I ) + + $ H( I+1, 1 )*B( I+1, J ) ) + 10 CONTINUE +C + 20 CONTINUE +C + R( M, M ) = ALPHA*R( M, M ) + BETA*DWORK( M ) +C + ELSE +C + DO 40 J = 1, M +C +C Multiply the upper triangle of the leading j-by-j +C submatrix of H by the leading part of the j-th column +C of B. +C + CALL DCOPY( J, B( 1, J ), 1, DWORK, 1 ) + CALL DTRMV( 'Upper', TRANS, 'Non-unit', J, H, LDH, + $ DWORK, 1 ) + IF( J.LT.M ) THEN +C +C Multiply the remaining right part of the leading +C j-by-M submatrix of H by the trailing part of the +C j-th column of B. +C + CALL DGEMV( TRANS, J, M-J, BETA, H( 1, J+1 ), LDH, + $ B( J+1, J ), 1, ALPHA, R( 1, J ), 1 ) + ELSE + CALL DSCAL( M, ALPHA, R( 1, M ), 1 ) + END IF +C +C Add the contribution of the subdiagonal of H to +C the j-th column of the product. +C + R( 1, J ) = R( 1, J ) + BETA*DWORK( 1 ) +C + DO 30 I = 2, J + R( I, J ) = R( I, J ) + BETA*( DWORK( I ) + + $ H( I, 1 )*B( I-1, J ) ) + 30 CONTINUE +C + 40 CONTINUE +C + END IF +C + ELSE +C + IF ( LTRANS ) THEN +C + DO 60 J = M, 1, -1 +C +C Multiply the transposed upper triangle of the trailing +C (M-j+1)-by-(M-j+1) submatrix of H by the trailing part +C of the j-th column of B. +C + CALL DCOPY( M-J+1, B( J, J ), 1, DWORK( J ), 1 ) + CALL DTRMV( 'Upper', TRANS, 'Non-unit', M-J+1, + $ H( J, J ), LDH, DWORK( J ), 1 ) + IF( J.GT.1 ) THEN +C +C Multiply the remaining left part of the trailing +C (M-j+1)-by-(j-1) submatrix of H' by the leading +C part of the j-th column of B. +C + CALL DGEMV( TRANS, J-1, M-J+1, BETA, H( 1, J ), + $ LDH, B( 1, J ), 1, ALPHA, R( J, J ), + $ 1 ) + ELSE + CALL DSCAL( M, ALPHA, R( 1, 1 ), 1 ) + END IF +C +C Add the contribution of the subdiagonal of H to +C the j-th column of the product. +C + DO 50 I = J, M - 1 + R( I, J ) = R( I, J ) + BETA*( DWORK( I ) + + $ H( I+1, 1 )*B( I+1, J ) ) + 50 CONTINUE +C + R( M, J ) = R( M, J ) + BETA*DWORK( M ) + 60 CONTINUE +C + ELSE +C + DO 80 J = M, 1, -1 +C +C Multiply the upper triangle of the trailing +C (M-j+1)-by-(M-j+1) submatrix of H by the trailing +C part of the j-th column of B. +C + CALL DCOPY( M-J+1, B( J, J ), 1, DWORK( J ), 1 ) + CALL DTRMV( 'Upper', TRANS, 'Non-unit', M-J+1, + $ H( J, J ), LDH, DWORK( J ), 1 ) +C +C Add the contribution of the subdiagonal of H to +C the j-th column of the product. +C + DO 70 I = MAX( J, 2 ), M + R( I, J ) = ALPHA*R( I, J ) + BETA*( DWORK( I ) + $ + H( I, 1 )*B( I-1, J ) ) + 70 CONTINUE +C + 80 CONTINUE +C + R( 1, 1 ) = ALPHA*R( 1, 1 ) + BETA*DWORK( 1 ) +C + END IF + END IF +C + IF( M.GT.2 ) + $ CALL DSWAP( M-2, H( 3, 2 ), LDH+1, H( 3, 1 ), 1 ) +C + ELSE +C +C Row-wise calculations are used for H, if SIDE = 'R' and +C TRANS = 'T'. +C + IF( LUPLO ) THEN + IF( LTRANS ) THEN + R( 1, 1 ) = ALPHA*R( 1, 1 ) + + $ BETA*DDOT( M, B, LDB, H, LDH ) +C + DO 90 J = 2, M + CALL DGEMV( 'NoTranspose', J, M-J+2, BETA, + $ B( 1, J-1 ), LDB, H( J, J-1 ), LDH, + $ ALPHA, R( 1, J ), 1 ) + 90 CONTINUE +C + ELSE +C + DO 100 J = 1, M - 1 + CALL DGEMV( 'NoTranspose', J, J+1, BETA, B, LDB, + $ H( 1, J ), 1, ALPHA, R( 1, J ), 1 ) + 100 CONTINUE +C + CALL DGEMV( 'NoTranspose', M, M, BETA, B, LDB, + $ H( 1, M ), 1, ALPHA, R( 1, M ), 1 ) +C + END IF +C + ELSE +C + IF( LTRANS ) THEN +C + CALL DGEMV( 'NoTranspose', M, M, BETA, B, LDB, H, LDH, + $ ALPHA, R( 1, 1 ), 1 ) +C + DO 110 J = 2, M + CALL DGEMV( 'NoTranspose', M-J+1, M-J+2, BETA, + $ B( J, J-1 ), LDB, H( J, J-1 ), LDH, ALPHA, + $ R( J, J ), 1 ) + 110 CONTINUE +C + ELSE +C + DO 120 J = 1, M - 1 + CALL DGEMV( 'NoTranspose', M-J+1, J+1, BETA, + $ B( J, 1 ), LDB, H( 1, J ), 1, ALPHA, + $ R( J, J ), 1 ) + 120 CONTINUE +C + R( M, M ) = ALPHA*R( M, M ) + + $ BETA*DDOT( M, B( M, 1 ), LDB, H( 1, M ), 1 ) +C + END IF + END IF + END IF +C + RETURN +C *** Last line of MB01RY *** + END Property changes on: trunk/octave-forge/main/control/devel/ncfsyn/MB01RY.f ___________________________________________________________________ Added: svn:executable + * Added: trunk/octave-forge/main/control/devel/ncfsyn/MB01SD.f =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/MB01SD.f (rev 0) +++ trunk/octave-forge/main/control/devel/ncfsyn/MB01SD.f 2011-07-31 19:51:16 UTC (rev 8425) @@ -0,0 +1,123 @@ + SUBROUTINE MB01SD( JOBS, M, N, A, LDA, R, C ) +C +C SLICOT RELEASE 5.0. +C +C Copyright (c) 2002-2010 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 scale a general M-by-N matrix A using the row and column +C scaling factors in the vectors R and C. +C +C ARGUMENTS +C +C Mode Parameters +C +C JOBS CHARACTER*1 +C Specifies the scaling operation to be done, as follows: +C = 'R': row scaling, i.e., A will be premultiplied +C by diag(R); +C = 'C': column scaling, i.e., A will be postmultiplied +C by diag(C); +C = 'B': both row and column scaling, i.e., A will be +C replaced by diag(R) * A * diag(C). +C +C Input/Output Parameters +C +C M (input) INTEGER +C The number of rows of the matrix A. M >= 0. +C +C N (input) INTEGER +C The number of columns of the matrix A. N >= 0. +C +C A (input/output) DOUBLE PRECISION array, dimension (LDA,N) +C On entry, the M-by-N matrix A. +C On exit, the scaled matrix. See JOBS for the form of the +C scaled matrix. +C +C LDA INTEGER +C The leading dimension of the array A. LDA >= max(1,M). +C +C R (input) DOUBLE PRECISION array, dimension (M) +C The row scale factors for A. +C R is not referenced if JOBS = 'C'. +C +C C (input) DOUBLE PRECISION array, dimension (N) +C The column scale factors for A. +C C is not referenced if JOBS = 'R'. +C +C +C CONTRIBUTOR +C +C A. Varga, German Aerospace Center, +C DLR Oberpfaffenhofen, April 1998. +C Based on the RASP routine DMSCAL. +C +C ****************************************************************** +C +C .. Scalar Arguments .. + CHARACTER JOBS + INTEGER LDA, M, N +C .. Array Arguments .. + DOUBLE PRECISION A(LDA,*), C(*), R(*) +C .. Local Scalars .. + INTEGER I, J + DOUBLE PRECISION CJ +C .. External Functions .. + LOGICAL LSAME + EXTERNAL LSAME +C .. Executable Statements .. +C +C Quick return if possible. +C + IF( M.EQ.0 .OR. N.EQ.0 ) + $ RETURN +C + IF( LSAME( JOBS, 'C' ) ) ... [truncated message content] |
From: <par...@us...> - 2011-08-02 15:28:26
|
Revision: 8429 http://octave.svn.sourceforge.net/octave/?rev=8429&view=rev Author: paramaniac Date: 2011-08-02 15:28:20 +0000 (Tue, 02 Aug 2011) Log Message: ----------- control: touch up ncfsyn and example Modified Paths: -------------- trunk/octave-forge/main/control/devel/MDSSystem.m trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m Modified: trunk/octave-forge/main/control/devel/MDSSystem.m =================================================================== --- trunk/octave-forge/main/control/devel/MDSSystem.m 2011-08-01 21:45:22 UTC (rev 8428) +++ trunk/octave-forge/main/control/devel/MDSSystem.m 2011-08-02 15:28:20 UTC (rev 8429) @@ -1,16 +1,16 @@ +% =============================================================================== +% Robust Control of a Mass-Damper-Spring System +% =============================================================================== +% Reference: Gu, D.W., Petkov, P.Hr. and Konstantinov, M.M. +% Robust Control Design with Matlab, Springer 2005 +% =============================================================================== + % Tabula Rasa clear all, close all, clc -% Nominal Values -m_nom = 3; % Mass -c_nom = 1; % Damping Coefficient -k_nom = 2; % Spring Stiffness - -% Perturbations -p_m = 0.4; % 40% uncertainty in the mass -p_c = 0.2; % 20% uncertainty in the damping coefficient -p_k = 0.3; % 30% uncertainty in the spring stiffness - +% =============================================================================== +% System Model +% =============================================================================== % +---------------+ % | d_m 0 0 | % +-----| 0 d_c 0 |<----+ @@ -23,6 +23,16 @@ % u ----->| |-----> y % +---------------+ +% Nominal Values +m_nom = 3; % Mass +c_nom = 1; % Damping Coefficient +k_nom = 2; % Spring Stiffness + +% Perturbations +p_m = 0.4; % 40% uncertainty in the mass +p_c = 0.2; % 20% uncertainty in the damping coefficient +p_k = 0.3; % 30% uncertainty in the spring stiffness + % State-Space Representation A = [ 0, 1 -k_nom/m_nom, -c_nom/m_nom ]; @@ -51,12 +61,36 @@ D22 = [ 0 ]; -inname = {"u_m", "u_c", "u_k", "u"}; % Input Names -outname = {"y_m", "y_c", "y_k", "y"}; % Output Names +inname = {'u_m', 'u_c', 'u_k', 'u'}; % Input Names +outname = {'y_m', 'y_c', 'y_k', 'y'}; % Output Names G_nom = ss (A, [B1, B2], [C1; C2], [D11, D12; D21, D22], \ - "inname", inname, "outname", outname); + 'inputname', inname, 'outputname', outname); + +% =============================================================================== +% Frequency Analysis of Uncertain System +% =============================================================================== + +% Uncertainties: -1 <= delta_m, delta_c, delta_k <= 1 +[delta_m, delta_c, delta_k] = ndgrid ([-1, 0, 1], [-1, 0, 1], [-1, 0, 1]); +w = logspace (-1, 1, 100); % Frequency Vector +figure (1) + +for k = 1 : numel (delta_m) + Delta = diag ([delta_m(k), delta_c(k), delta_k(k)]); + G_per = lft (Delta, G_nom); + bode (G_per, w) + subplot (2, 1, 1) + hold on + subplot (2, 1, 2) + hold on +endfor + + +% =============================================================================== +% Mixed Sensitivity H-infinity Controller Design +% =============================================================================== % +-------+ % +--------------------->| W_p |----------> e_p % | +-------+ @@ -72,11 +106,11 @@ % +-----------------------------------------+ % Weighting Functions -s = tf ("s"); +s = tf ('s'); W_p = 0.95 * (s^2 + 1.8*s + 10) / (s^2 + 8.0*s + 0.01); W_u = 10^-2; -% Suboptimal H-infinity Controller Design +% Mixed Sensitivity H-infinity Controller Design G = G_nom(4, 4); % Extract output y and input u %K = mixsyn (G, W_p, W_u); %[K, ~, gamma] = mixsyn (G, W_p, W_u) @@ -91,33 +125,38 @@ % Closed Loop T = feedback (L); -figure (1) +figure (2) sigma (T) -figure (2) +figure (3) sigma (N) norm (N, inf) -figure (3) +figure (4) step (T) -figure (4) +% =============================================================================== +% H-infinity Loop-Shaping Design +% =============================================================================== -w = logspace (-1, 1, 100); +W1 = 8 * (2*s + 1) / (0.9*s); % Precompensator +W2 = 1; % Postcompensator +factor = 1.1 % Suboptimal Controller -% Uncertainties -% -1 <= delta_m, delta_c, delta_k <= 1 -[delta_m, delta_c, delta_k] = ndgrid ([-1, 0, 1], [-1, 0, 1], [-1, 0, 1]); +% Compute the suboptimal positive feedback controller +K = ncfsyn (G, W1, W2, factor) -for k = 1 : numel (delta_1) - Delta = diag ([delta_m(k), delta_c(k), delta_k(k)]); - G_per = lft (Delta, G_nom); - %figure (4) - bode (G_per, w) - subplot (2, 1, 1) - hold on - subplot (2, 1, 2) - hold on -endfor \ No newline at end of file +K = -K; % negative feedback controller + +% Open Loop +L = G * K; + +% Closed Loop +T = feedback (L); + +figure (5) +step (T) + +% =============================================================================== Modified: trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-01 21:45:22 UTC (rev 8428) +++ trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-02 15:28:20 UTC (rev 8429) @@ -21,13 +21,42 @@ ## Compute positive feedback controller using the McFarlane/Glover Loop Shaping Design Procedure. ## Uses SLICOT SB10ID, SB10KD and SB10ZD by courtesy of ## @uref{http://www.slicot.org, NICONET e.V.} +## +## @strong{Inputs} +## @table @var +## @item G +## LTI model of plant. +## @item W1 +## LTI model of precompensator. Model must be SISO or of appropriate size. +## An identity matrix is taken if @var{W1} is not specified or if an empty model +## @code{[]} is passed. +## @item W2 +## LTI model of postcompensator. Model must be SISO or of appropriate size. +## An identity matrix is taken if @var{W2} is not specified or if an empty model +## @code{[]} is passed. +## @item factor +## @code{factor = 1} implies that an optimal controller is required. +## @code{factor > 1} implies that a suboptimal controller is required, +## achieving a performance taht is @var{factor} times less than optimal. +## Default value is 1. +## @end table +## +## @strong{Outputs} +## @table @var +## @item K +## State-space model of the H-infinity loop-shaping controller. +## @item N +## State-space model of the lower LFT of @var{P} and @var{K}. +## @item gamma +## L-infinity norm of @var{N}. +## @end table ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> ## Created: July 2011 ## Version: 0.1 -% function [K, N, gamma] = ncfsyn (G, W1 = [], W2 = [], factor = 1.0) +% function [K, N, gamma, info] = ncfsyn (G, W1 = [], W2 = [], factor = 1.0) function K = ncfsyn (G, W1 = [], W2 = [], factor = 1.0) if (nargin == 0 || nargin > 4) @@ -65,7 +94,7 @@ K = W1 * Ks * W2; - %struct ("Gs", Gs, "Ks", Ks); + %struct ("Gs", Gs, "Ks", Ks, "rcond", rcond); endfunction @@ -76,12 +105,12 @@ W = ss (eye (s)); else W = ss (W); - if (! isstable (W)) - error ("ncfsyn: %s must be stable", inputname (1)); - endif - if (! isminimumphase (W)) - error ("ncfsyn: %s must be minimum-phase", inputname (1)); - endif + %if (! isstable (W)) + % error ("ncfsyn: %s must be stable", inputname (1)); + %endif + %if (! isminimumphase (W)) + % error ("ncfsyn: %s must be minimum-phase", inputname (1)); + %endif [p, m] = size (W); if (m == s && p == s) # model is of correct size return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-08-04 21:10:36
|
Revision: 8432 http://octave.svn.sourceforge.net/octave/?rev=8432&view=rev Author: paramaniac Date: 2011-08-04 21:10:29 +0000 (Thu, 04 Aug 2011) Log Message: ----------- control: fix ncfsyn Modified Paths: -------------- trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m Added Paths: ----------- trunk/octave-forge/main/control/devel/test_pzmap.m Modified: trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-04 19:18:41 UTC (rev 8431) +++ trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-04 21:10:29 UTC (rev 8432) @@ -46,7 +46,7 @@ ## @item K ## State-space model of the H-infinity loop-shaping controller. ## @item N -## State-space model of closed loop. +## State-space model of the closed loop depicted below. ## @item gamma ## L-infinity norm of @var{N}. ## @item info @@ -60,6 +60,21 @@ ## @item info.rcond ## Estimates of the reciprocal condition numbers of the Riccati equations. ## @end table +## +## @strong{Block Diagram of N} +## @example +## @group +## +## ^ z1 ^ z2 +## | | +## w1 + | +--------+ | +--------+ +## ----->(+)---+-->| Ks |----+--->(+)---->| Gs |----+ +## ^ + +--------+ ^ +--------+ | +## | w2 | | +## | | +## +-------------------------------------------------+ +## @end group +## @end example ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> @@ -104,7 +119,7 @@ K = W1 * Ks * W2; if (nargout > 1) - N = append (eye (p), K, G); + N = append (eye (p), Ks, Gs); M = [zeros(p,p), zeros(p,m), eye(p); eye(p), zeros(p,m), zeros(p,p); zeros(m,p), eye(m), zeros(m,p)]; Added: trunk/octave-forge/main/control/devel/test_pzmap.m =================================================================== --- trunk/octave-forge/main/control/devel/test_pzmap.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_pzmap.m 2011-08-04 21:10:29 UTC (rev 8432) @@ -0,0 +1,5 @@ +pzmap2 (WestlandLynx, Boeing707, BMWengine) + + +%__next_line_color__ ("reset") +%__next_line_color__ \ 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...> - 2011-08-05 11:57:14
|
Revision: 8433 http://octave.svn.sourceforge.net/octave/?rev=8433&view=rev Author: paramaniac Date: 2011-08-05 11:57:01 +0000 (Fri, 05 Aug 2011) Log Message: ----------- control: polish ncfsyn stuff for release Modified Paths: -------------- trunk/octave-forge/main/control/devel/MDSSystem.m trunk/octave-forge/main/control/devel/ncfsyn/makefile_ncfsyn.m trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m Modified: trunk/octave-forge/main/control/devel/MDSSystem.m =================================================================== --- trunk/octave-forge/main/control/devel/MDSSystem.m 2011-08-04 21:10:29 UTC (rev 8432) +++ trunk/octave-forge/main/control/devel/MDSSystem.m 2011-08-05 11:57:01 UTC (rev 8433) @@ -1,5 +1,5 @@ % =============================================================================== -% Robust Control of a Mass-Damper-Spring System +% Robust Control of a Mass-Damper-Spring System Lukas Reichlin August 2011 % =============================================================================== % Reference: Gu, D.W., Petkov, P.Hr. and Konstantinov, M.M. % Robust Control Design with Matlab, Springer 2005 @@ -61,13 +61,15 @@ D22 = [ 0 ]; -inname = {'u_m', 'u_c', 'u_k', 'u'}; % input names -outname = {'y_m', 'y_c', 'y_k', 'y'}; % output names +inname = {'u_m', 'u_c', 'u_k', 'u'}; % input names +outname = {'y_m', 'y_c', 'y_k', 'y'}; % output names G_nom = ss (A, [B1, B2], [C1; C2], [D11, D12; D21, D22], ... 'inputname', inname, 'outputname', outname); +G = G_nom(4, 4); % extract output y and input u + % =============================================================================== % Frequency Analysis of Uncertain System % =============================================================================== @@ -76,7 +78,7 @@ [delta_m, delta_c, delta_k] = ndgrid ([-1, 0, 1], [-1, 0, 1], [-1, 0, 1]); % Bode Plots of Perturbed Plants -w = logspace (-1, 1, 100); % frequency vector +w = logspace (-1, 1, 100); % frequency vector figure (1) for k = 1 : numel (delta_m) @@ -91,7 +93,7 @@ % =============================================================================== -% Mixed Sensitivity H-infinity Controller Design +% Mixed Sensitivity H-infinity Controller Design (S over KS Method) % =============================================================================== % +-------+ % +--------------------->| W_p |----------> e_p @@ -108,47 +110,47 @@ % +-----------------------------------------+ % Weighting Functions -s = tf ('s'); % transfer function variable -W_p = 0.95 * (s^2 + 1.8*s + 10) / (s^2 + 8.0*s + 0.01); -W_u = 10^-2; +s = tf ('s'); % transfer function variable +W_p = 0.95 * (s^2 + 1.8*s + 10) / (s^2 + 8.0*s + 0.01); % performance weighting +W_u = 10^-2; % control weighting -% Mixed Sensitivity H-infinity Controller Design -G = G_nom(4, 4); % extract output y and input u +% Synthesis +K = mixsyn (G, W_p, W_u); % mixed-sensitivity H-infinity synthesis -[K, N, gamma] = mixsyn (G, W_p, W_u); +% Interconnections +L = G * K; % open loop +T = feedback (L); % closed loop -L = G * K; % open loop -T = feedback (L); % closed loop - +% Plotting figure (2) -sigma (T) +sigma (T) % singular values figure (3) -sigma (N) +step (T) % step response -norm (N, inf) -figure (4) -step (T) - - % =============================================================================== % H-infinity Loop-Shaping Design % =============================================================================== -W1 = 8 * (2*s + 1) / (0.9*s); % precompensator -W2 = 1; % postcompensator -factor = 1.1; % suboptimal controller +% Settings +W1 = 8 * (2*s + 1) / (0.9*s); % precompensator +W2 = 1; % postcompensator +factor = 1.1; % suboptimal controller -% Compute the suboptimal positive feedback controller -K = ncfsyn (G, W1, W2, factor); % positive feedback controller -[K, N, gamma, info] = ncfsyn (G, W1, W2, factor) +% Synthesis +K = ncfsyn (G, W1, W2, factor); % positive feedback controller -K = -K; % negative feedback controller -L = G * K; % open loop -T = feedback (L); % closed loop +% Interconnections +K = -K; % negative feedback controller +L = G * K; % open loop +T = feedback (L); % closed loop +% Plotting +figure (4) +sigma (T) % singular values + figure (5) -step (T) +step (T) % step response % =============================================================================== Modified: trunk/octave-forge/main/control/devel/ncfsyn/makefile_ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/makefile_ncfsyn.m 2011-08-04 21:10:29 UTC (rev 8432) +++ trunk/octave-forge/main/control/devel/ncfsyn/makefile_ncfsyn.m 2011-08-05 11:57:01 UTC (rev 8433) @@ -1,3 +1,4 @@ +## H-infinity loop shaping - continuous-time mkoctfile "-Wl,-framework" "-Wl,vecLib" \ slsb10id.cc \ SB10ID.f SB02RD.f select.f SB10JD.f MB02VD.f \ @@ -7,11 +8,13 @@ MB01RX.f SB03MX.f SB03SX.f MB01RY.f SB03QY.f \ SB03QX.f SB03MY.f SB04PX.f SB03MV.f SB03MW.f +## H-infinity loop shaping - discrete-time - strictly proper case mkoctfile "-Wl,-framework" "-Wl,vecLib" \ slsb10kd.cc \ SB10KD.f SB02OD.f select.f SB02OY.f SB02OW.f \ SB02OV.f SB02MV.f SB02OU.f SB02MR.f +## H-infinity loop shaping - discrete-time - proper case mkoctfile "-Wl,-framework" "-Wl,vecLib" \ slsb10zd.cc \ SB10ZD.f MA02AD.f SB02OD.f select.f MB01RX.f \ Modified: trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-04 21:10:29 UTC (rev 8432) +++ trunk/octave-forge/main/control/devel/ncfsyn/ncfsyn.m 2011-08-05 11:57:01 UTC (rev 8433) @@ -119,6 +119,7 @@ K = W1 * Ks * W2; if (nargout > 1) + ## FIXME: is this really the same thing as the dark side does? N = append (eye (p), Ks, Gs); M = [zeros(p,p), zeros(p,m), eye(p); eye(p), zeros(p,m), zeros(p,p); @@ -145,12 +146,12 @@ W = ss (eye (s)); else W = ss (W); - %if (! isstable (W)) - % error ("ncfsyn: %s must be stable", inputname (1)); - %endif - %if (! isminimumphase (W)) - % error ("ncfsyn: %s must be minimum-phase", inputname (1)); - %endif + ## if (! isstable (W)) + ## error ("ncfsyn: %s must be stable", inputname (1)); + ## endif + ## if (! isminimumphase (W)) + ## error ("ncfsyn: %s must be minimum-phase", inputname (1)); + ## endif [p, m] = size (W); if (m == s && p == s) # model is of correct size return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-08-05 16:25:58
|
Revision: 8436 http://octave.svn.sourceforge.net/octave/?rev=8436&view=rev Author: paramaniac Date: 2011-08-05 16:25:50 +0000 (Fri, 05 Aug 2011) Log Message: ----------- control: add stuff for pdf manual Added Paths: ----------- trunk/octave-forge/main/control/devel/pdfdoc/ trunk/octave-forge/main/control/devel/pdfdoc/doc.tex trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m trunk/octave-forge/main/control/devel/pdfdoc/functions.texi Added: trunk/octave-forge/main/control/devel/pdfdoc/doc.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/doc.tex (rev 0) +++ trunk/octave-forge/main/control/devel/pdfdoc/doc.tex 2011-08-05 16:25:50 UTC (rev 8436) @@ -0,0 +1,11 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename doc.info +@settitle Sample Manual 1.0 +@c %**end of header + +@contents +@chapter Function Reference +@include functions.texi + +@end Added: trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m (rev 0) +++ trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m 2011-08-05 16:25:50 UTC (rev 8436) @@ -0,0 +1,31 @@ +% pack_name = "generate_html" +pack_name = "control" + + +% Load Packages +pkg load "generate_html" +pkg ("load", pack_name); + +% Get list of functions +list = pkg ("describe", pack_name); + +%list + +% Open output file +fid = fopen ("functions.texi", "w"); + +for k = 1:numel (list {1}.provides) + + group = list {1}.provides{k}; + functions = group.functions; + + fprintf (fid, '@section %s\n', group.category); + + for k=1:numel(functions) + [TEXT, FORMAT] = get_help_text (functions(k)); + fprintf (fid,TEXT); + end + +end + +fclose(fid); \ No newline at end of file Added: trunk/octave-forge/main/control/devel/pdfdoc/functions.texi =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/functions.texi (rev 0) +++ trunk/octave-forge/main/control/devel/pdfdoc/functions.texi 2011-08-05 16:25:50 UTC (rev 8436) @@ -0,0 +1,2342 @@ +@section Examples and Demos + + @deftypefn{Function File} {@var{sys} =} BMWengine () + @deftypefnx{Function File} {@var{sys} =} BMWengine (@var{"scaled"}) + @deftypefnx{Function File} {@var{sys} =} BMWengine (@var{"unscaled"}) + Model of the BMW 4-cylinder engine at ETH Zurich's control laboratory. + @example + @group + OPERATING POINT + Drosselklappenstellung alpha_DK = 10.3 Grad + Saugrohrdruck p_s = 0.48 bar + Motordrehzahl n = 860 U/min + Lambda-Messwert lambda = 1.000 + Relativer Wandfilminhalt nu = 1 + + INPUTS + U_1 Sollsignal Drosselklappenstellung [Grad] + U_2 Relative Einspritzmenge [-] + U_3 Zuendzeitpunkt [Grad KW] + M_L Lastdrehmoment [Nm] + + STATES + X_1 Drosselklappenstellung [Grad] + X_2 Saugrohrdruck [bar] + X_3 Motordrehzahl [U/min] + X_4 Messwert Lamba-Sonde [-] + X_5 Relativer Wandfilminhalt [-] + + OUTPUTS + Y_1 Motordrehzahl [U/min] + Y_2 Messwert Lambda-Sonde [-] + + SCALING + U_1N, X_1N 1 Grad + U_2N, X_4N, X_5N, Y_2N 0.05 + U_3N 1.6 Grad KW + X_2N 0.05 bar + X_3N, Y_1N 200 U/min + @end group + @end example + @end deftypefn + + @deftypefn {Function File} {@var{sys} =} Boeing707 () + Creates a linearized state-space model of a Boeing 707-321 aircraft + at @var{v}=80 m/s + @iftex + @tex + ($M = 0.26$, $G_{a0} = -3^{circ}$, ${lpha}_0 = 4^{circ}$, ${kappa}= 50^{circ}$). + @end tex + @end iftex + @ifinfo + (@var{M} = 0.26, @var{Ga0} = -3 deg, @var{alpha0} = 4 deg, @var{kappa} = 50 deg). + @end ifinfo + + System inputs: (1) thrust and (2) elevator angle. + + System outputs: (1) airspeed and (2) pitch angle. + + @strong{Reference}: R. Brockhaus: @cite{Flugregelung} (Flight + Control), Springer, 1994. + @end deftypefn + =============================================================================== + optiPID Lukas Reichlin July 2009 + =============================================================================== + Numerical Optimization of an A/H PID Controller + Required OCTAVE Packages: control, optim (and its dependencies) + Required MATLAB Toolboxes: Control, Optimization + =============================================================================== + + @deftypefn{Function File} {@var{sys} =} WestlandLynx () + Model of the Westland Lynx Helicopter about hover. + @example + @group + INPUTS + main rotor collective + longitudinal cyclic + lateral cyclic + tail rotor collective + + STATES + pitch attitude theta [rad] + roll attitude phi [rad] + roll rate (body-axis) p [rad/s] + pitch rate (body-axis) q [rad/s] + yaw rate xi [rad/s] + forward velocity v_x [ft/s] + lateral velocity v_y [ft/s] + vertical velocity v_z [ft/s] + + OUTPUTS + heave velocity H_dot [ft/s] + pitch attitude theta [rad] + roll attitude phi [rad] + heading rate psi_dot [rad/s] + roll rate p [rad/s] + pitch rate q [rad/s] + + Reference: + Skogestad, S. and Postlethwaite I. + Multivariable Feedback Control: Analysis and Design + Second Edition + Wiley 2005 + http://www.nt.ntnu.no/users/skoge/book/2nd_edition/matlab_m/matfiles.html + @end group + @end example + @end deftypefn +@section Linear Time Invariant Models + + @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 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 + + @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. If second argument @var{w} is omitted, the interesting + frequency range is calculated by the zeros and poles of @var{sys}. + @item H + Frequency response array (p-by-m-by-lw). In the SISO case, + 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]. + @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 + + @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 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 + + @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 num + Numerator or cell of numerators. Each numerator must be a row vector + containing the exponents of the polynomial in descending order. + @item den + Denominator or cell of denominators. Each denominator must be a row vector + containing the exponents of the polynomial in descending 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 (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 + + 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 + octave:5> + @end group + @end example + + @seealso{ss, dss} + @end deftypefn +@section Model Data Access + + @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 + + @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). 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]. + @item tsam + Sampling time in seconds. If @var{sys} is a continuous-time model, + a zero is returned. + @end table + @end deftypefn + + @deftypefn {Function File} get (@var{sys}) + @deftypefnx {Function File} {@var{value} =} get (@var{sys}, @var{"property"}) + Access property values of LTI objects. + @end deftypefn + + @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 + + @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 + + @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{"tfpoly"}) + Access transfer function data. + @end deftypefn +@section Model Conversions + + @deftypefn {Function File} {@var{sys} =} c2d (@var{sys}, @var{tsam}) + @deftypefnx {Function File} {@var{sys} =} c2d (@var{sys}, @var{tsam}, @var{method}) + Convert the continuous lti model into its discrete time equivalent. + @end deftypefn + + @deftypefn {Function File} {[@var{scaledsys}, @var{info}] =} prescale (@var{sys}) + Prescale state-space model. + Uses SLICOT TB01ID and TG01AD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.}. + 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 + + For proper state-space models, Tl and Tr are inverse of each other. + @end group + @end example + @end deftypefn + + @deftypefn {Function File} {@var{sys} =} xperm (@var{sys}, @var{st_idx}) + Reorder states in state-space models. + @end deftypefn +@section Model Interconnections + + @deftypefn {Function File} {@var{sys} =} append (@var{sys1}, @var{sys2}) + Group LTI models by appending their inputs and outputs. + @end deftypefn + + @deftypefn {Function File} {@var{sys} =} blkdiag (@var{sys1}, @var{sys2}) + Block-diagonal concatenation of LTI models. + @end deftypefn + + @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 + + @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{Block Diagram} + @example + @group + u + +--------+ y + ------>(+)----->| sys1 |-------+-------> + ^ - +--------+ | + | | + | +--------+ | + +-------| sys2 |<------+ + +--------+ + @end group + @end example + @end deftypefn + + @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 |<----+ : + : +--------+ : + :............................: + + + .............sys.............. + : +--------+ : + : u +---->| sys1 |-----+ y : + : | +--------+ | : Upper LFT + : | | : + : | +--------+ | : lft (sys1, sys2) + : +-----| |<----+ : + : | sys2 | : + z2 <------------| |<------------ w2 + : +--------+ : + :............................: + + + .............sys.............. + : +--------+ : + w1 ------------>| |------------> z1 + : | sys1 | : + : u +---->| |-----+ y : + : | +--------+ | : + : | | : lft (sys1, sys2, nu, ny) + : | +--------+ | : + : +-----| |<----+ : + : | sys2 | : + z2 <------------| |<------------ w2 + : +--------+ : + :............................: + @end group + @end example + @end deftypefn + + @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 + + @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 + + @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) + + + ..................................... + : 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 +@section Model Characteristics + + @deftypefn {Function File} {@var{co} =} ctrb (@var{sys}) + @deftypefnx {Function File} {@var{co} =} ctrb (@var{a}, @var{b}) + Controllability matrix. + @end deftypefn + + @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 + + @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 + + @deftypefn{Function File} {@var{hsv} =} hsvd (@var{sys}) + @deftypefnx{Function File} {@var{hsv} =} hsvd (@var{sys}, @var{"offset"}, @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. + Uses SLICOT AB13AD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + @end deftypefn + + @deftypefn {Function File} {@var{bool} =} isct (@var{sys}) + Determine whether LTI model is a continuous-time system. + @end deftypefn + + @deftypefn {Function File} {@var{bool} =} isctrb (@var{sys}) + @deftypefnx {Function File} {@var{bool} =} isctrb (@var{sys}, @var{tol}) + @deftypefnx {Function File} {@var{bool} =} isctrb (@var{a}, @var{b}) + @deftypefnx {Function File} {@var{bool} =} isctrb (@var{a}, @var{b}, @var{e}) + @deftypefnx {Function File} {@var{bool} =} isctrb (@var{a}, @var{b}, @var{[]}, @var{tol}) + @deftypefnx {Function File} {@var{bool} =} isctrb (@var{a}, @var{b}, @var{e}, @var{tol}) + Logical check for system controllability. + Uses SLICOT AB01OD and TG01HD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + + @strong{Inputs} + @table @var + @item sys + LTI model. + @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. + @end table + + @seealso{isobsv} + @end deftypefn + + @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. + Uses SLICOT AB01OD and TG01HD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + + @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 + + See @command{isstabilizable} for description of computational method. + @seealso{isstabilizable, isstable, isctrb, isobsv} + @end deftypefn + + @deftypefn {Function File} {@var{bool} =} isdt (@var{sys}) + Determine whether LTI model is a discrete-time system. + @end deftypefn + + @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. + If a square system @var{P} is minimum-phase, its inverse @var{P^-1} is stable. + @end deftypefn + + @deftypefn {Function File} {@var{bool} =} isobsv (@var{sys}) + @deftypefnx {Function File} {@var{bool} =} isobsv (@var{sys}, @var{tol}) + @deftypefnx {Function File} {@var{bool} =} isobsv (@var{a}, @var{c}) + @deftypefnx {Function File} {@var{bool} =} isobsv (@var{a}, @var{c}, @var{e}) + @deftypefnx {Function File} {@var{bool} =} isobsv (@var{a}, @var{c}, @var{[]}, @var{tol}) + @deftypefnx {Function File} {@var{bool} =} isobsv (@var{a}, @var{c}, @var{e}, @var{tol}) + Logical check for system observability. + Uses SLICOT AB01OD and TG01HD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + + @strong{Inputs} + @table @var + @item sys + LTI model. + @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. + @end table + + @seealso{isctrb} + @end deftypefn + + @deftypefn {Function File} {@var{bool} =} issiso (@var{sys}) + Determine whether LTI model is single-input/single-output (SISO). + @end deftypefn + + @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. + Uses SLICOT AB01OD and TG01HD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + + @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{Method} + @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 + + @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 + + @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. + Uses SLICOT AB13BD and AB13DD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + @end deftypefn + + @deftypefn {Function File} {@var{ob} =} obsv (@var{sys}) + @deftypefnx {Function File} {@var{ob} =} obsv (@var{a}, @var{c}) + Observability matrix. + @end deftypefn + + @deftypefn {Function File} {@var{p} =} pole (@var{sys}) + Compute poles of LTI system. + @end deftypefn + + @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. + @end deftypefn + + @deftypefn {Function File} {@var{nvec} =} size (@var{ltisys}) + @deftypefnx {Function File} {@var{n} =} size (@var{ltisys}, @var{idx}) + @deftypefnx {Function File} {[@var{ny}, @var{nu}] =} size (@var{ltisys}) + LTI model size, i.e. number of outputs and inputs. + @end deftypefn + + @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. + @end deftypefn +@section Model Simplification + + @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 + + @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 +@section Time Domain Analysis + + @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 + + @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 + + @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 + + @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 + + @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 + + @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 +@section Frequency Domain Analysis + + @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. + @end table + + @strong{Outputs} + @table @var + @item mag + Vector of magnitude. Has length of frequency vector @var{w}. + @item pha + Vector of phase. Has length of frequency vector @var{w}. + @item w + Vector of frequency values used. + @end table + + @seealso{nichols, nyquist, sigma} + @end deftypefn + + @deftypefn {Function File} {[@var{mag}, @var{w}] =} bodemag (@var{sys}) + @deftypefnx {Function File} {[@var{mag}, @var{w}] =} bodemag (@var{sys}, @var{w}) + Bode magnitude 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. + @end table + + @strong{Outputs} + @table @var + @item mag + Vector of magnitude. Has length of frequency vector @var{w}. + @item w + Vector of frequency values used. + @end table + + @seealso{bode, nichols, nyquist, sigma} + @end deftypefn + + @deftypefn{Function File} {@var{H} =} freqresp (@var{sys}, @var{w}) + Evaluate frequency response at given frequencies. + + @strong{Inputs} + @table @var + @item sys + LTI system. + @item w + Vector of frequency values. + @end table + + @strong{Outputs} + @table @var + @item H + Array of frequency response. For a system with m inputs and p outputs, the array @var{H} + has dimensions [p, m, length (w)]. + The frequency response at the frequency w(k) is given by H(:,:,k). + @end table + + @seealso{dcgain} + @end deftypefn + + @deftypefn{Function File} {[@var{gamma}, @var{phi}, @var{w_gamma}, @var{w_phi}] =} margin (@var{sys}) + @deftypefnx{Function File} {[@var{gamma}, @var{phi}, @var{w_gamma}, @var{w_phi}] =} margin (@var{sys}, @var{tol}) + Gain and phase margin of a system. If no output arguments are given, both gain and phase margin + are plotted on a bode diagram. Otherwise, the margins and their corresponding frequencies are + computed and returned. + + @strong{Inputs} + @table @var + @item sys + LTI model. Must be a single-input and single-output (SISO) system. + @item tol + Imaginary parts below @var{tol} are assumed to be zero. + If not specified, default value @code{sqrt (eps)} is taken. + @end table + + @strong{Outputs} + @table @var + @item gamma + Gain margin (as gain, not dBs). + @item phi + Phase margin (in degrees). + @item w_gamma + Frequency for the gain margin (in rad/s). + @item w_phi + Frequency for the phase margin (in rad/s). + @end table + + @strong{Equations} + @example + @group + CONTINUOUS SYSTEMS + Gain Margin + _ _ + L(jw) = L(jw) BTW: L(jw) = L(-jw) = conj (L(jw)) + + num(jw) num(-jw) + ------- = -------- + den(jw) den(-jw) + + num(jw) den(-jw) = num(-jw) den(jw) + + imag (num(jw) den(-jw)) = 0 + imag (num(-jw) den(jw)) = 0 + + Phase Margin + |num(jw)| + |L(jw)| = |-------| = 1 + |den(jw)| + _ 2 2 + z z = Re z + Im z + + num(jw) num(-jw) + ------- * -------- = 1 + den(jw) den(-jw) + + num(jw) num(-jw) - den(jw) den(-jw) = 0 + + real (num(jw) num(-jw) - den(jw) den(-jw)) = 0 + + + DISCRETE SYSTEMS + Gain Margin + jwT log z + L(z) = L(1/z) BTW: z = e --> w = ----- + j T + num(z) num(1/z) + ------ = -------- + den(z) den(1/z) + + num(z) den(1/z) - num(1/z) den(z) = 0 + + Phase Margin + |num(z)| + |L(z)| = |------| = 1 + |den(z)| + + L(z) L(1/z) = 1 + + num(z) num(1/z) + ------ * -------- = 1 + den(z) den(1/z) + + num(z) num(1/z) - den(z) den(1/z) = 0 + + PS: How to get L(1/z) + 4 3 2 + p(z) = a z + b z + c z + d z + e + + -4 -3 -2 -1 + p(1/z) = a z + b z + c z + d z + e + + -4 2 3 4 + = z ( a + b z + c z + d z + e z ) + + 4 3 2 4 + = ( e z + d z + c z + b z + a ) / ( z ) + @end group + @end example + + @seealso{roots} + @end deftypefn + + @deftypefn {Function File} {[@var{mag}, @var{pha}, @var{w}] =} nichols (@var{sys}) + @deftypefnx {Function File} {[@var{mag}, @var{pha}, @var{w}] =} nichols (@var{sys}, @var{w}) + Nichols chart 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. + @end table + + @strong{Outputs} + @table @var + @item mag + Vector of magnitude. Has length of frequency vector @var{w}. + @item pha + Vector of phase. Has length of frequency vector @var{w}. + @item w + Vector of frequency values used. + @end table + + @seealso{bode, nyquist, sigma} + @end deftypefn + + @deftypefn {Function File} {[@var{re}, @var{im}, @var{w}] =} nyquist (@var{sys}) + @deftypefnx {Function File} {[@var{re}, @var{im}, @var{w}] =} nyquist (@var{sys}, @var{w}) + Nyquist 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. + @end table + + @strong{Outputs} + @table @var + @item re + Vector of real parts. Has length of frequency vector @var{w}. + @item im + Vector of imaginary parts. Has length of frequency vector @var{w}. + @item w + Vector of frequency values used. + @end table + + @seealso{bode, nichols, sigma} + @end deftypefn + + @deftypefn{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}) + @deftypefnx{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}, @var{w}) + @deftypefnx{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}, @var{[]}, @var{ptype}) + @deftypefnx{Function File} {[@var{sv}, @var{w}] =} sigma (@var{sys}, @var{w}, @var{ptype}) + Singular values of frequency response. If no output arguments are given, + the singular value plot is printed on the screen; + + @strong{Inputs} + @table @var + @item sys + LTI system. Multiple inputs and/or outputs (MIMO systems) make practical sense. + @item w + Optional vector of frequency values. If @var{w} is not specified, + it is calculated by the zeros and poles of the system. + @item ptype = 0 + Singular values of the frequency response @var{H} of system @var{sys}. Default Value. + @item ptype = 1 + Singular values of the frequency response @code{inv(H)}; i.e. inversed system. + @item ptype = 2 + Singular values of the frequency response @code{I + H}; i.e. inversed sensitivity + (or return difference) if @code{H = P * C}. + @item ptype = 3 + Singular values of the frequency response @code{I + inv(H)}; i.e. inversed complementary + sensitivity if @code{H = P * C}. + @end table + + @strong{Outputs} + @table @var + @item sv + Array of singular values. For a system with m inputs and p outputs, the array sv + has @code{min (m, p)} rows and as many columns as frequency points @code{length (w)}. + The singular values at the frequency @code{w(k)} are given by @code{sv(:,k)}. + @item w + Vector of frequency values used. + @end table + + @seealso{bodemag, svd} + @end deftypefn +@section Pole Placement + + @deftypefn {Function File} {@var{f} =} place (@var{sys}, @var{p}) + @deftypefnx {Function File} {@var{f} =} place (@var{a}, @var{b}, @var{p}) + @deftypefnx {Function File} {[@var{f}, @var{nfp}, @var{nap}, @var{nup}] =} place (@var{sys}, @var{p}, @var{alpha}) + @deftypefnx {Function File} {[@var{f}, @var{nfp}, @var{nap}, @var{nup}] =} place (@var{a}, @var{b}, @var{p}, @var{alpha}) + Pole assignment for a given matrix pair (@var{A},@var{B}) such that @code{p = eig (A-B*F)}. + If parameter @var{alpha} is specified, poles with real parts (continuous-time) + or moduli (discrete-time) below @var{alpha} are left untouched. + Uses SLICOT SB01BD by courtesy of + @uref{http://www.slicot.org, NICONET e.V.} + + @strong{Inputs} + @table @var + @item sys + LTI system. + @item a + State transition matrix (n-by-n) of a continuous-time system. + @item b + Input matrix (n-by-m) of a continuous-time system. + @item p + Desired eigenvalues of the closed-loop system state-matrix @var{A-B*F}. + @code{length (p) <= rows (A)}. + @item alpha + Specifies the maximum admissible value, either for real + parts or for moduli, of the eigenvalues of @var{A} which will + not be modified by the eigenvalue assignment algorithm. + @code{alpha >= 0} for discrete-time systems. + @end table + + @strong{Outputs} + @table @var + @item f + State feedback gain matrix. + @item nfp + The number of fixed poles, i.e. eigenvalues of @var{A} having + real parts less than @var{alpha}, or moduli less than @var{alpha}. + These eigenvalues are not modified by @command{place}. + @item nap + The number of assigned eigenvalues. @code{nap = n-nfp-nup}. + @item nup + The number of uncontrollable eigenvalues detected by the + eigenvalue assignment algorithm. + @end table + + @strong{Note} + @example + Place is also suitable to design estimator gains: + @group + L = place (A.', C.', p).' + L = place (sys.', p).' + @deftypefn {Function File} rlocus (@var{sys}) + @deftypefnx {Function File} {[@var{rldata}, @var{k}] =} rlocus (@var{sys}[, @var{increment}, @var{min_k}, @var{max_k}]) + Display root locus plot of the specified @acronym{SISO} system. + + @strong{Inputs} + @table @var + @item sys + LTI model. Must be a single-input and single-output (SISO) system. + @item min_k + Minimum value of @var{k}. + @item max_k + Maximum value of @var{k}. + @item increment + The increment used in computing gain values. + @end table + + @strong{Outputs} + @table @var + @item rldata + Data points plotted: in column 1 real values, in column 2 the imaginary values. + @item k + Gains for real axis break points. + @end table + + @strong{Block Diagram} + @example + @group + u + +---+ +------+ y + ------>(+)----->| k |----->| SISO |-------+-------> + ^ - +---+ +------+ | + | | + +---------------------------------+ + @end group + @end example + @end deftypefn +@section Linear-Quadratic Control + + @deftypefn {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{sys}, @var{q}, @var{r}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{sys}, @var{q}, @var{r}, @var{s}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{a}, @var{b}, @var{q}, @var{r}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{[]}, @var{e}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} dlqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}, @var{e}) + Linear-quadratic regulator for discrete-time systems. + + @strong{Inputs} + @table @var + @item sys + Continuous or discrete-time LTI model. + @item a + State transition matrix of discrete-time system. + @item b + Input matrix of discrete-time system. + @item q + State weighting matrix. + @item r + Input weighting matrix. + @item s + Optional cross term matrix. If @var{s} is not specified, a zero matrix is assumed. + @item e + Optional descriptor matrix. If @var{e} is not specified, an identity matrix is assumed. + @end table + + @strong{Outputs} + @table @var + @item g + State feedback matrix. + @item x + Unique stabilizing solution of the discrete-time Riccati equation. + @item l + Closed-loop poles. + @end table + + @strong{Equations} + @example + @group + x[k+1] = A x[k] + B u[k], x[0] = x0 + + inf + J(x0) = SUM (x' Q x + u' R u + 2 x' S u) + k=0 + + L = eig (A - B*G) + @end group + @end example + @seealso{dare, care, lqr} + @end deftypefn + + @deftypefn {Function File} {@var{est} =} estim (@var{sys}, @var{l}) + @deftypefnx {Function File} {@var{est} =} estim (@var{sys}, @var{l}, @var{sensors}, @var{known}) + Return state estimator for a given estimator gain. + + @strong{Inputs} + @table @var + @item sys + LTI model. + @item l + State feedback matrix. + @item sensors + Indices of measured output signals y from @var{sys}. If omitted, all outputs are measured. + @item known + Indices of known input signals u (deterministic) to @var{sys}. All other inputs to @var{sys} + are assumed stochastic. If argument @var{known} is omitted, no inputs u are known. + @end table + + @strong{Outputs} + @table @var + @item est + State-space model of estimator. + @end table + @seealso{kalman, place} + @end deftypefn + + @deftypefn {Function File} {[@var{est}, @var{g}, @var{x}] =} kalman (@var{sys}, @var{q}, @var{r}) + @deftypefnx {Function File} {[@var{est}, @var{g}, @var{x}] =} kalman (@var{sys}, @var{q}, @var{r}, @var{s}) + @deftypefnx {Function File} {[@var{est}, @var{g}, @var{x}] =} kalman (@var{sys}, @var{q}, @var{r}, @var{[]}, @var{sensors}, @var{known}) + @deftypefnx {Function File} {[@var{est}, @var{g}, @var{x}] =} kalman (@var{sys}, @var{q}, @var{r}, @var{s}, @var{sensors}, @var{known}) + Design Kalman estimator for LTI systems. + + @strong{Inputs} + @table @var + @item sys + Nominal plant model. + @item q + Covariance of white process noise. + @item r + Covariance of white measurement noise. + @item s + Optional cross term covariance. Default value is 0. + @item sensors + Indices of measured output signals y from @var{sys}. If omitted, all outputs are measured. + @item known + Indices of known input signals u (deterministic) to @var{sys}. All other inputs to @var{sys} + are assumed stochastic. If argument @var{known} is omitted, no inputs u are known. + @end table + + @strong{Outputs} + @table @var + @item est + State-space model of the Kalman estimator. + @item g + Estimator gain. + @item x + Solution of the Riccati equation. + @end table + + @strong{Block Diagram} + @example + @group + u +-------+ ^ + +---------------------------->| |-------> y + | +-------+ + y | est | ^ + u ----+--->| |----->(+)------>| |-------> x + | sys | ^ + +-------+ + w -------->| | | + +-------+ | v + + Q = cov (w, w') R = cov (v, v') S = cov (w, v') + @end group + @end example + + @seealso{care, dare, estim, lqr} + @end deftypefn + + @deftypefn {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{sys}, @var{q}, @var{r}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{sys}, @var{q}, @var{r}, @var{s}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{[]}, @var{e}) + @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}, @var{e}) + Linear-quadratic regulator. + + @strong{Inputs} + @table @var + @item sys + Continuous or discrete-time LTI model. + @item a + State transition matrix of continuous-time system. + @item b + Input matrix of continuous-time system. + @item q + State weighting matrix. + @item r + Input weighting matrix. + @item s + Optional cross term matrix. If @var{s} is not specified, a zero matrix is assumed. + @item e + Optional descriptor matrix. If @var{e} is not specified, an identity matrix is assumed. + @end table + + @strong{Outputs} + @table @var + @item g + State feedback matrix. + @item x + Unique stabilizing solution of the continuous-time Riccati equation. + @item l + Closed-loop poles. + @end table + + @strong{Equations} + @example + @group + . + x = A x + B u, x(0) = x0 + + inf + J(x0) = INT (x' Q x + u' R u + 2 x' S u) dt + 0 + + L = eig (A - B*G) + @end group + @end example + @seealso{care, dare, dlqr} + @end deftypefn +@section Robust Control + + @deftypefn{Function File} {@var{P} =} augw (@var{G}, @var{W1}, @var{W2}, @var{W3}) + Extend plant for stacked S/KS/T problem. Subsequently, the robust control problem + can be solved by h2syn or hinfsyn. + + @strong{Inputs} + @table @var + @item G + LTI model of plant. + @item W1 + LTI model of performance weight. Bounds the largest singular values of sensitivity @var{S}. + Model must be empty @code{[]}, SISO or of appropriate size. + @item W2 + LTI model to penalize large control inputs. Bounds the largest singular values of @var{KS}. + Model must be empty @code{[]}, SISO or of appropriate size. + @item W3 + LTI model of robustness and noise sensitivity weight. Bounds the largest singular values of + complementary sensitivity @var{T}. Model must be empty @code{[]}, SISO or of appropriate size. + @end table + + All inputs must be proper/realizable. + Scalars, vectors and matrices are possible instead of LTI models. + + @strong{Outputs} + @table @var + @item P + State-space model of augmented plant. + @end table + + @strong{Block Diagram} + @example + @group + + | W1 | -W1*G | z1 = W1 r - W1 G u + | 0 | W2 | z2 = W2 u + P = | 0 | W3*G | z3 = W3 G u + |----+-------| + | I | -G | e = r - G u + +------+ z1 + +---------------------------------------->| W1 |-----> + | +------+ + | +------+ z2 + | +---------------------->| W2 |-----> + | | +------+ + r + e | +--------+ u | +--------+ y +------+ z3 + ----->(+)---+-->| K(s) |----+-->| G(s) |----+---->| W3 |-----> + ^ - +--------+ +--------+ | +------+ + | | + +----------------------------------------+ + + +--------+ + | |-----> z1 (p1x1) z1 = W1 e + r (px1) ----->| P(s) |-----> z2 (p2x1) z2 = W2 u + | |-----> z3 (p3x1) z3... [truncated message content] |
From: <par...@us...> - 2011-08-10 11:32:23
|
Revision: 8455 http://octave.svn.sourceforge.net/octave/?rev=8455&view=rev Author: paramaniac Date: 2011-08-10 11:32:16 +0000 (Wed, 10 Aug 2011) Log Message: ----------- control: remove cruft Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_chol.m trunk/octave-forge/main/control/devel/makefile_h2syn.m trunk/octave-forge/main/control/devel/makefile_hankel.m trunk/octave-forge/main/control/devel/makefile_hinfsyn.m trunk/octave-forge/main/control/devel/makefile_lqr.m trunk/octave-forge/main/control/devel/makefile_lyap.m trunk/octave-forge/main/control/devel/makefile_minreal.m trunk/octave-forge/main/control/devel/makefile_ncfsyn.m trunk/octave-forge/main/control/devel/makefile_norm.m trunk/octave-forge/main/control/devel/makefile_place.m trunk/octave-forge/main/control/devel/makefile_scale.m trunk/octave-forge/main/control/devel/makefile_zero.m Modified: trunk/octave-forge/main/control/devel/makefile_chol.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_chol.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_chol.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,16 +11,14 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb03od.cc \ +mkoctfile slsb03od.cc \ SB03OD.f select.f SB03OU.f SB03OT.f MB04ND.f \ MB04OD.f SB03OR.f SB03OY.f SB04PX.f MB04NY.f \ MB04OY.f SB03OV.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg03bd.cc \ +mkoctfile slsg03bd.cc \ SG03BD.f SG03BV.f SG03BU.f SG03BW.f SG03BX.f \ SG03BY.f MB02UU.f MB02UV.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_h2syn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_h2syn.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10hd.cc \ +mkoctfile slsb10hd.cc \ 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 \ @@ -23,12 +19,11 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10ed.cc \ +mkoctfile slsb10ed.cc \ 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 -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_hankel.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,12 +11,11 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13ad.cc \ +mkoctfile slab13ad.cc \ AB13AD.f TB01ID.f TB01KD.f AB13AX.f MA02DD.f \ MB03UD.f TB01LD.f SB03OU.f MB03QX.f select.f \ SB03OT.f MB03QD.f MB04ND.f MB04OD.f MB03QY.f \ SB03OR.f SB03OY.f SB04PX.f MB04NY.f MB04OY.f \ SB03OV.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_hinfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_hinfsyn.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,8 +11,7 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10fd.cc \ +mkoctfile slsb10fd.cc \ 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 \ @@ -23,12 +19,11 @@ MB01RY.f SB03SX.f SB03SY.f select.f SB03MX.f \ SB03MY.f MB01UD.f SB03MV.f SB03MW.f SB04PX.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10dd.cc \ +mkoctfile slsb10dd.cc \ 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 -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_lqr.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_lqr.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,14 +11,12 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb02od.cc \ +mkoctfile slsb02od.cc \ SB02OD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ SB02MR.f SB02MV.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg02ad.cc \ +mkoctfile slsg02ad.cc \ SG02AD.f SB02OU.f SB02OV.f SB02OW.f SB02OY.f \ MB01SD.f MB02VD.f MB02PD.f MA02GD.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_lyap.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_lyap.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,26 +12,22 @@ cd (srcdir); ## Lypunov -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb03md.cc \ +mkoctfile slsb03md.cc \ SB03MD.f select.f SB03MX.f SB03MY.f MB01RD.f \ SB03MV.f SB03MW.f SB04PX.f ## Sylvester -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb04md.cc \ +mkoctfile slsb04md.cc \ SB04MD.f SB04MU.f SB04MY.f SB04MR.f SB04MW.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb04qd.cc \ +mkoctfile slsb04qd.cc \ SB04QD.f SB04QU.f SB04QY.f SB04MW.f SB04QR.f ## Generalized Lyapunov -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsg03ad.cc \ +mkoctfile slsg03ad.cc \ SG03AD.f MB01RW.f MB01RD.f SG03AX.f SG03AY.f \ MB02UU.f MB02UV.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_minreal.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,13 +11,11 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltb01pd.cc \ +mkoctfile sltb01pd.cc \ TB01PD.f TB01XD.f TB01ID.f AB07MD.f TB01UD.f \ MB03OY.f MB01PD.f MB01QD.f -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg01jd.cc \ +mkoctfile sltg01jd.cc \ TG01JD.f TG01AD.f TB01XD.f MA02CD.f TG01HX.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_ncfsyn.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_ncfsyn.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,8 +12,7 @@ cd (srcdir); ## H-infinity loop shaping - continuous-time -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10id.cc \ +mkoctfile slsb10id.cc \ SB10ID.f SB02RD.f select.f SB10JD.f MB02VD.f \ MA02GD.f SB02MS.f MA02ED.f SB02RU.f SB02SD.f \ MB01RU.f SB02QD.f SB02MV.f SB02MW.f SB02MR.f \ @@ -25,14 +21,12 @@ SB03QX.f SB03MY.f SB04PX.f SB03MV.f SB03MW.f ## H-infinity loop shaping - discrete-time - strictly proper case -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10kd.cc \ +mkoctfile slsb10kd.cc \ SB10KD.f SB02OD.f select.f SB02OY.f SB02OW.f \ SB02OV.f SB02MV.f SB02OU.f SB02MR.f ## H-infinity loop shaping - discrete-time - proper case -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb10zd.cc \ +mkoctfile slsb10zd.cc \ SB10ZD.f MA02AD.f SB02OD.f select.f MB01RX.f \ MB02VD.f SB02OY.f SB02OW.f SB02OV.f SB02OU.f \ SB02MR.f MA02GD.f SB02MV.f Modified: trunk/octave-forge/main/control/devel/makefile_norm.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_norm.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_norm.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,16 +12,14 @@ cd (srcdir); ## H-2 norm -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13bd.cc \ +mkoctfile slab13bd.cc \ 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 ## L-inf norm -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab13dd.cc \ +mkoctfile slab13dd.cc \ 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 \ @@ -32,4 +27,4 @@ MB04QF.f MB03YA.f MB03YD.f MB02RZ.f MB04QU.f \ MB02SZ.f MB03YT.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_place.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_place.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_place.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -14,9 +11,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slsb01bd.cc \ +mkoctfile slsb01bd.cc \ SB01BD.f MB03QD.f MB03QY.f SB01BX.f SB01BY.f \ select.f -cd (homedir); \ No newline at end of file +cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_scale.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_scale.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_scale.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -1,3 +1,11 @@ +## ============================================================================== +## Developer Makefile for OCT-files +## ============================================================================== +## USAGE: * fetch control from Octave-Forge by svn +## * add control/inst, control/src and control/devel to your Octave path +## * run makefile_* +## ============================================================================== + homedir = pwd (); develdir = fileparts (which ("makefile_scale")); srcdir = [develdir, "/../src"]; @@ -4,13 +12,11 @@ cd (srcdir); ## scaling of state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltb01id.cc \ +mkoctfile sltb01id.cc \ TB01ID.f ## scaling of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg01ad.cc \ +mkoctfile sltg01ad.cc \ TG01AD.f cd (homedir); Modified: trunk/octave-forge/main/control/devel/makefile_zero.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_zero.m 2011-08-10 09:03:19 UTC (rev 8454) +++ trunk/octave-forge/main/control/devel/makefile_zero.m 2011-08-10 11:32:16 UTC (rev 8455) @@ -4,9 +4,6 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* -## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' -## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option -## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -15,19 +12,16 @@ cd (srcdir); ## transmission zeros of state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slab08nd.cc \ +mkoctfile slab08nd.cc \ AB08ND.f AB08NX.f TB01ID.f MB03OY.f MB03PY.f ## transmission zeros of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - slag08bd.cc \ +mkoctfile slag08bd.cc \ AG08BD.f AG08BY.f TG01AD.f TB01XD.f MA02CD.f \ TG01FD.f MA02BD.f MB03OY.f ## gain of descriptor state-space models -mkoctfile "-Wl,-framework" "-Wl,vecLib" \ - sltg04bx.cc \ +mkoctfile sltg04bx.cc \ TG04BX.f MB02RD.f MB02SD.f -cd (homedir); \ No newline at end of file +cd (homedir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2011-08-15 18:23:46
|
Revision: 8462 http://octave.svn.sourceforge.net/octave/?rev=8462&view=rev Author: paramaniac Date: 2011-08-15 18:23:39 +0000 (Mon, 15 Aug 2011) Log Message: ----------- control: cleaning up Modified Paths: -------------- trunk/octave-forge/main/control/devel/makefile_hankel.m Added Paths: ----------- trunk/octave-forge/main/control/devel/test_2.m trunk/octave-forge/main/control/devel/test_ss2tf.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/ss2tf/ Modified: trunk/octave-forge/main/control/devel/makefile_hankel.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-08-15 18:06:43 UTC (rev 8461) +++ trunk/octave-forge/main/control/devel/makefile_hankel.m 2011-08-15 18:23:39 UTC (rev 8462) @@ -4,6 +4,9 @@ ## USAGE: * fetch control from Octave-Forge by svn ## * add control/inst, control/src and control/devel to your Octave path ## * run makefile_* +## NOTES: * The option "-Wl,-framework" "-Wl,vecLib" is needed for MacPorts' +## octave-devel @3.3.52_1+gcc44 on MacOS X 10.6.4. However, this option +## breaks other platforms. See MacPorts Ticket #26640. ## ============================================================================== homedir = pwd (); @@ -11,7 +14,8 @@ srcdir = [develdir, "/../src"]; cd (srcdir); -mkoctfile slab13ad.cc \ +mkoctfile "-Wl,-framework" "-Wl,vecLib" \ + slab13ad.cc \ AB13AD.f TB01ID.f TB01KD.f AB13AX.f MA02DD.f \ MB03UD.f TB01LD.f SB03OU.f MB03QX.f select.f \ SB03OT.f MB03QD.f MB04ND.f MB04OD.f MB03QY.f \ Added: trunk/octave-forge/main/control/devel/test_2.m =================================================================== --- trunk/octave-forge/main/control/devel/test_2.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_2.m 2011-08-15 18:23:39 UTC (rev 8462) @@ -0,0 +1,14 @@ +ss_sys = WestlandLynx; +tf_sys = tf (ss_sys); + +w = logspace (-4, 3, 500); + +figure (1) +sigma (ss_sys, w) + +figure (2) +sigma (tf_sys, w) + + +sys = ss (0, 1, 1, 0) +tf (sys) Copied: trunk/octave-forge/main/control/devel/test_ss2tf.m (from rev 8461, trunk/octave-forge/main/control/devel/ss2tf/test_ss2tf.m) =================================================================== --- trunk/octave-forge/main/control/devel/test_ss2tf.m (rev 0) +++ trunk/octave-forge/main/control/devel/test_ss2tf.m 2011-08-15 18:23:39 UTC (rev 8462) @@ -0,0 +1,83 @@ +a = [ -1.0 0.0 0.0 + 0.0 -2.0 0.0 + 0.0 0.0 -3.0 ]; + +b = [ 0.0 1.0 -1.0 + 1.0 1.0 0.0 ].'; + +c = [ 0.0 1.0 1.0 + 1.0 1.0 1.0 ]; + +d = [ 1.0 0.0 + 0.0 1.0 ]; + +[p, m] = size (d); +md = 4 + +[gn, gd, ign, igd] = sltb04bd (a, b, c, d) + +num = reshape (gn, md, p, m) +den = reshape (gd, md, p, m) + +numc = mat2cell (num, md, ones(1,p), ones(1,m)) +denc = mat2cell (den, md, ones(1,p), ones(1,m)) + +numc = squeeze (numc) +denc = squeeze (denc) + +ignc = mat2cell (ign, ones(1,p), ones(1,m)); +igdc = mat2cell (igd, ones(1,p), ones(1,m)); + +num = cellfun (@(x, y) x(1:y+1), numc, ignc, "uniformoutput", false); +den = cellfun (@(x, y) x(1:y+1), denc, igdc, "uniformoutput", false); + + +tf (num, den) + +%{ +numc{1,2,1} +denc{1,2,1} +numc{1,1,2} +denc{1,1,2} +%} + + +%num(:, 1, 1) +%den(:, 1, 1) +%num(:, 1, 2) +%den(:, 1, 2) + +%num = mat2cell (gn, p, m) +%den = mat2cell (gd, p, m) + +%num = gn(1:ign+1) +%den = gd(1:igd+1) +%{ +[gn, gd, ign, igd] = sltb04bd (-2, 3, 4, 5) + + +% for i = 1 : size (gn, 1) +% for j = 1 : size (gn, 2) +% gn(i, j, :) +% gd(i, j, :) +% endfor +% endfor + + +P = tf (1, [1 5 11 14 11 5 1]); + +S = ss (P); + +[num, den, ign, igd] = sltb04bd (S.a, S.b, S.c, S.d) + +P + + + +[num, den, ign, igd] = sltb04bd (0, 1, 1, 0) + + +sys = WestlandLynx; + +[num, den, ign, igd] = sltb04bd (sys.a, sys.b, sys.c, sys.d); +%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |