From: <par...@us...> - 2012-06-24 19:26:15
|
Revision: 10682 http://octave.svn.sourceforge.net/octave/?rev=10682&view=rev Author: paramaniac Date: 2012-06-24 19:26:09 +0000 (Sun, 24 Jun 2012) Log Message: ----------- control: prepare new release Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/RELEASE_PACKAGE trunk/octave-forge/main/control/devel/pdfdoc/control.tex Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-06-24 10:34:56 UTC (rev 10681) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-06-24 19:26:09 UTC (rev 10682) @@ -1,11 +1,11 @@ Name: Control -Version: 2.3.51 -Date: 2012-06-03 +Version: 2.3.52 +Date: 2012-06-24 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Description: Octave control systems package based on the proven SLICOT library Depends: octave (>= 3.6.0) Autoload: yes -License: GPL version 3 or later +License: GPLv3+ Url: http://octave.sf.net, http://www.slicot.org Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-06-24 10:34:56 UTC (rev 10681) +++ trunk/octave-forge/main/control/NEWS 2012-06-24 19:26:09 UTC (rev 10682) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.52 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.3.52 Release Date: 2012-06-24 Release Manager: Lukas Reichlin =============================================================================== ** Fixed a silly mistake in MIMO transfer function to state-space conversion. Modified: trunk/octave-forge/main/control/devel/RELEASE_PACKAGE =================================================================== --- trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-06-24 10:34:56 UTC (rev 10681) +++ trunk/octave-forge/main/control/devel/RELEASE_PACKAGE 2012-06-24 19:26:09 UTC (rev 10682) @@ -20,12 +20,12 @@ rm -R ~/octave/__TEMP__/control/devel cd ~/octave/__TEMP__ grep -i version control/DESCRIPTION -tar czf control-2.3.51.tar.gz control/ -md5 control-2.3.51.tar.gz -md5 control-2.3.51.tar.gz > md5_control_pkg.txt -uuencode control-2.3.51.tar.gz < control-2.3.51.tar.gz > control-2.3.51.tar.gz.uue +tar czf control-2.3.52.tar.gz control/ +md5 control-2.3.52.tar.gz +md5 control-2.3.52.tar.gz > md5_control_pkg.txt +uuencode control-2.3.52.tar.gz < control-2.3.52.tar.gz > control-2.3.52.tar.gz.uue octave -q --eval \ -"pkg install control-2.3.51.tar.gz" +"pkg install control-2.3.52.tar.gz" octave -q --eval \ "pkg load generate_html; generate_package_html ('control', 'control-html', 'octave-forge')" tar czf control-html.tar.gz control-html @@ -40,7 +40,7 @@ ===================================================================================== rm -R ~/octave/__TEMP__ -rm -R ~/octave/control-2.3.51 +rm -R ~/octave/control-2.3.52 ===================================================================================== Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-06-24 10:34:56 UTC (rev 10681) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-06-24 19:26:09 UTC (rev 10682) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.3.51 +@set VERSION 2.3.52 @finalout @c @afourwide @c %**end of header This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-25 07:51:52
|
Revision: 10686 http://octave.svn.sourceforge.net/octave/?rev=10686&view=rev Author: paramaniac Date: 2012-06-25 07:51:40 +0000 (Mon, 25 Jun 2012) Log Message: ----------- control: prepare release of control-2.3.52 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m trunk/octave-forge/main/control/doc/control.pdf Added Paths: ----------- trunk/octave-forge/main/control/devel/Makefile.ReferenceLapack trunk/octave-forge/main/control/doc/control.tex trunk/octave-forge/main/control/doc/functions.texi Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-06-24 21:40:15 UTC (rev 10685) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-06-25 07:51:40 UTC (rev 10686) @@ -1,6 +1,6 @@ Name: Control Version: 2.3.52 -Date: 2012-06-24 +Date: 2012-06-25 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-06-24 21:40:15 UTC (rev 10685) +++ trunk/octave-forge/main/control/NEWS 2012-06-25 07:51:40 UTC (rev 10686) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.52 Release Date: 2012-06-24 Release Manager: Lukas Reichlin +control-2.3.52 Release Date: 2012-06-25 Release Manager: Lukas Reichlin =============================================================================== ** Fixed a silly mistake in MIMO transfer function to state-space conversion. @@ -12,7 +12,16 @@ Added new functions for linear quadratic estimators. (Thanks to Megan Zagrobelny) +** Upon request of the Debian maintainers, the tex-files control.tex and + functions.texi for generating control.pdf are included in the doc folder, + next to control.pdf. Note that functions.texi is generated automatically + by the scripts in the control/devel folder and the package generate_html. + They are not included in the control package and can be found on the + OctaveForge SVN server. +** Minor improvements in various help texts. + + =============================================================================== control-2.3.51 Release Date: 2012-06-03 Release Manager: Lukas Reichlin =============================================================================== @@ -43,7 +52,10 @@ ** Makefile fixed to work with non-standard linker options e.g on Apple. +** The conversion to state-space of multi-input transfer functions with common + row denominators is now handled more efficiently. + =============================================================================== control-2.3.50 Release Date: 2012-03-06 Release Manager: Lukas Reichlin =============================================================================== Added: trunk/octave-forge/main/control/devel/Makefile.ReferenceLapack =================================================================== --- trunk/octave-forge/main/control/devel/Makefile.ReferenceLapack (rev 0) +++ trunk/octave-forge/main/control/devel/Makefile.ReferenceLapack 2012-06-25 07:51:40 UTC (rev 10686) @@ -0,0 +1,77 @@ +MKOCTFILE ?= mkoctfile + +ifndef LAPACK_LIBS +LAPACK_LIBS := $(shell $(MKOCTFILE) -p LAPACK_LIBS) +endif +ifndef BLAS_LIBS +BLAS_LIBS := $(shell $(MKOCTFILE) -p BLAS_LIBS) +endif +ifndef FLIBS +FLIBS := $(shell $(MKOCTFILE) -p FLIBS) +endif +MKOCTFILE ?= mkoctfile + +# LAPACK_LIBS := $(shell $(MKOCTFILE) -p LAPACK_LIBS) +# BLAS_LIBS := $(shell $(MKOCTFILE) -p BLAS_LIBS) +FLIBS := $(shell $(MKOCTFILE) -p FLIBS) + +all: control_slicot_functions.oct \ + is_real_scalar.oct \ + is_real_vector.oct \ + is_real_matrix.oct \ + is_real_square_matrix.oct + +# TODO: Private oct-files for control package. + +# unpack and compile SLICOT library +# Note that TG04BX is a custom routine. +# It has the extension .fortran such that +# it is not deleted by rm *.f when using +# the developer makefile makefile_control.m +slicotlibrary.a: slicot.tar.gz + tar -xzf slicot.tar.gz + mv slicot/src/*.f . + mv slicot/src_aux/*.f . + cp TG04BX.fortran TG04BX.f + $(MKOCTFILE) -c *.f + ar -rc slicotlibrary.a *.o + rm -rf *.o *.f slicot + +# reference lapack is just included for debugging purposes +# it will be removed again before an official release of the control package +lapacklibrary.a: lapack-3.4.1.tgz + tar -xzf lapack-3.4.1.tgz + mv lapack-3.4.1/BLAS/SRC/*.f . + mv lapack-3.4.1/INSTALL/*.f . + mv lapack-3.4.1/SRC/*.f . + $(MKOCTFILE) -c *.f + ar -rc lapacklibrary.a *.o + rm -rf *.o *.f lapack-3.4.1 + +# slicot functions +control_slicot_functions.oct: control_slicot_functions.cc slicotlibrary.a lapacklibrary.a + $(MKOCTFILE) control_slicot_functions.cc common.cc slicotlibrary.a lapacklibrary.a \ + ${FLIBS} +# slicot functions +#control_slicot_functions.oct: control_slicot_functions.cc slicotlibrary.a +# $(MKOCTFILE) control_slicot_functions.cc common.cc slicotlibrary.a \ +# ${LAPACK_LIBS} ${BLAS_LIBS} ${FLIBS} + +# helpers +is_real_scalar.oct: is_real_scalar.cc + $(MKOCTFILE) is_real_scalar.cc + +is_real_vector.oct: is_real_vector.cc + $(MKOCTFILE) is_real_vector.cc + +is_real_matrix.oct: is_real_matrix.cc + $(MKOCTFILE) is_real_matrix.cc + +is_real_square_matrix.oct: is_real_square_matrix.cc + $(MKOCTFILE) is_real_square_matrix.cc + +clean: + rm -rf *.o core octave-core *.oct *~ *.f slicot lapack-3.4.1 + +realclean: clean + rm -rf *.a \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m 2012-06-24 21:40:15 UTC (rev 10685) +++ trunk/octave-forge/main/control/devel/pdfdoc/function_doc.m 2012-06-25 07:51:40 UTC (rev 10686) @@ -14,6 +14,9 @@ % Open output file fid = fopen ("functions.texi", "w"); +fprintf (fid, '@c This file is generated automatically\n'); +fprintf (fid, '@c Do not edit\n\n'); + for k = 1:numel (list {1}.provides) group = list {1}.provides{k}; Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-06-24 21:40:15 UTC (rev 10685) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-06-25 07:51:40 UTC (rev 10686) @@ -42,7 +42,7 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<K\xC9\xD5SsU]6\xD5\xEB\xF7\xEA\xF4\x90#\x83\xA70"\x8Cd\x89+\xEDz\xB1\xA8\xEE\x8B%\xB3@\xD1D̖d j\x8C\x82\x83\xF4\xBE\xF8^$_F_"\xF9\xF0q8\xF6[\xA5QJ\xE3.\xCF\xDB.\xDFk\xC5,\xDBe_\x8B\xFDP\x8A\xE9\xCD<N\xDEv\xC76\xEB\xDE\xF3\xD5g\xF6ӷ\xD1\xB9\xDAfmO\xDA\xC5 |
From: <par...@us...> - 2012-07-28 07:34:54
|
Revision: 10779 http://octave.svn.sourceforge.net/octave/?rev=10779&view=rev Author: paramaniac Date: 2012-07-28 07:34:47 +0000 (Sat, 28 Jul 2012) Log Message: ----------- control: Fixed an argument check in feedback.m which caused false positive error messages. It was a copy-paste mistake affecting non-square systems. (Thanks to Tony Olivo) Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/@lti/feedback.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-07-28 00:40:20 UTC (rev 10778) +++ trunk/octave-forge/main/control/NEWS 2012-07-28 07:34:47 UTC (rev 10779) @@ -1,6 +1,16 @@ Summary of important user-visible changes for releases of the control package =============================================================================== +control-2.3.53 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +=============================================================================== + +** feedback + Fixed an argument check which caused false positive error messages. + It was a copy-paste mistake affecting non-square systems. + (Thanks to Tony Olivo) + + +=============================================================================== control-2.3.52 Release Date: 2012-06-25 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/inst/@lti/feedback.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/feedback.m 2012-07-28 00:40:20 UTC (rev 10778) +++ trunk/octave-forge/main/control/inst/@lti/feedback.m 2012-07-28 07:34:47 UTC (rev 10779) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011, 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -67,7 +67,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: October 2009 -## Version: 0.5 +## Version: 0.6 function sys = feedback (sys1, sys2, feedin, feedout, fbsign = -1) @@ -127,7 +127,7 @@ error ("feedback: range of feedin indices exceeds dimensions of sys1"); endif - if (any (feedin > p1 | feedin < 1)) + if (any (feedout > p1 | feedout < 1)) error ("feedback: range of feedout indices exceeds dimensions of sys1"); endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-14 20:11:28
|
Revision: 10867 http://octave.svn.sourceforge.net/octave/?rev=10867&view=rev Author: paramaniac Date: 2012-08-14 20:11:22 +0000 (Tue, 14 Aug 2012) Log Message: ----------- control: include system identification functions Modified Paths: -------------- trunk/octave-forge/main/control/INDEX trunk/octave-forge/main/control/inst/test_control.m trunk/octave-forge/main/control/src/Makefile trunk/octave-forge/main/control/src/control_slicot_functions.cc Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-08-14 20:01:58 UTC (rev 10866) +++ trunk/octave-forge/main/control/INDEX 2012-08-14 20:11:22 UTC (rev 10867) @@ -108,7 +108,27 @@ cfconred fwcfconred spaconred -Overloaded Operators +Experimental Data Handling + iddata + @iddata/cat + @iddata/detrend + @iddata/diff + @iddata/fft + @iddata/filter + @iddata/get + @iddata/ifft + @iddata/merge + @iddata/nkshift + @iddata/plot + @iddata/resample + @iddata/set + @iddata/size +System Identification + arx + moen4 + moesp + n4sid +Overloaded LTI Operators @lti/ctranspose @lti/horzcat @lti/inv @@ -124,6 +144,11 @@ @lti/uminus @lti/uplus @lti/vertcat +Overloaded IDDATA Operators + @iddata/horzcat + @iddata/subsasgn + @iddata/subsref + @iddata/vertcat Miscellaneous options strseq Modified: trunk/octave-forge/main/control/inst/test_control.m =================================================================== --- trunk/octave-forge/main/control/inst/test_control.m 2012-08-14 20:01:58 UTC (rev 10866) +++ trunk/octave-forge/main/control/inst/test_control.m 2012-08-14 20:11:22 UTC (rev 10867) @@ -103,3 +103,10 @@ test margin test obsv test sigma + +## identification +test @iddata/iddata +test @iddata/cat +test @iddata/detrend +test @iddata/fft +test moen4 Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2012-08-14 20:01:58 UTC (rev 10866) +++ trunk/octave-forge/main/control/src/Makefile 2012-08-14 20:11:22 UTC (rev 10867) @@ -15,7 +15,8 @@ is_real_scalar.oct \ is_real_vector.oct \ is_real_matrix.oct \ - is_real_square_matrix.oct + is_real_square_matrix.oct \ + is_matrix.oct # TODO: Private oct-files for control package. Modified: trunk/octave-forge/main/control/src/control_slicot_functions.cc =================================================================== --- trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-08-14 20:01:58 UTC (rev 10866) +++ trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-08-14 20:11:22 UTC (rev 10867) @@ -39,6 +39,9 @@ #include "slsb16bd.cc" // coprime factorization state-feedback controller reduction #include "slsb16cd.cc" // frequency-weighted coprime factorization state-feedback controller reduction #include "slsb10yd.cc" // fit state-space model to frequency response data +#include "slident.cc" // system identification +#include "slib01cd.cc" // compute initial state vector +#include "slib01ad.cc" // compute singular values // stub function to avoid gen_doc_cache warning upon package installation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-14 20:18:31
|
Revision: 10868 http://octave.svn.sourceforge.net/octave/?rev=10868&view=rev Author: paramaniac Date: 2012-08-14 20:18:25 +0000 (Tue, 14 Aug 2012) Log Message: ----------- control: update news and description Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-08-14 20:11:22 UTC (rev 10867) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-08-14 20:18:25 UTC (rev 10868) @@ -1,6 +1,6 @@ Name: Control -Version: 2.3.52 -Date: 2012-06-25 +Version: 2.3.52+ +Date: 2012-08-14 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-08-14 20:11:22 UTC (rev 10867) +++ trunk/octave-forge/main/control/NEWS 2012-08-14 20:18:25 UTC (rev 10868) @@ -4,6 +4,13 @@ control-2.3.53 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin =============================================================================== +** Added new functions for system identification, including: + + arx iddata ifft + moen4 detrend nkshift + moesp fft plot + n4sid filter resample + ** feedback Fixed an argument check which caused false positive error messages. It was a copy-paste mistake affecting non-square systems. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-18 14:16:58
|
Revision: 10885 http://octave.svn.sourceforge.net/octave/?rev=10885&view=rev Author: paramaniac Date: 2012-08-18 14:16:50 +0000 (Sat, 18 Aug 2012) Log Message: ----------- control: minor doc fixes Modified Paths: -------------- trunk/octave-forge/main/control/devel/PROJECTS trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/inst/arx.m Modified: trunk/octave-forge/main/control/devel/PROJECTS =================================================================== --- trunk/octave-forge/main/control/devel/PROJECTS 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/devel/PROJECTS 2012-08-18 14:16:50 UTC (rev 10885) @@ -15,7 +15,8 @@ * Improve @lti/subsasgn.m - * Improve @lti/parallel.m + * Improve @lti/parallel.m by implementing "complicated" case + sys = parallel (sys1, sys2, in1, in2, out1, out2) * n-th order approximation of time delay exp (tau*s) sys = pade (tau, n) @@ -48,7 +49,6 @@ -- Beware of indices not in ascending order. * Fix PDF manual. - -- @seealso comments -- Use TEX for formulas (iftex) * "horzcat" and "vertcat" are trivial operations for TF, FRD and ZPK models. Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-08-18 14:16:50 UTC (rev 10885) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.3.52 +@set VERSION 2.3.53 @finalout @c @afourwide @c %**end of header @@ -65,6 +65,7 @@ and @tex $ H_{\infty} $ @end tex synthesis methods. @item Frequency-weighted model and controller reduction. +@item System identification by subspace methods. @item Overloaded operators due to the use of classes introduced with Octave 3.2. @item Support for descriptor state-space models and non-proper transfer functions. @item Improved @acronym{MATLAB} compatibility. Modified: trunk/octave-forge/main/control/inst/arx.m =================================================================== --- trunk/octave-forge/main/control/inst/arx.m 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/inst/arx.m 2012-08-18 14:16:50 UTC (rev 10885) @@ -25,7 +25,7 @@ ## @strong{Inputs} ## @table @var ## @item dat -## iddata set containing the measurements, i.e. time-domain signals. +## iddata identification dataset containing the measurements, i.e. time-domain signals. ## @item n ## The desired order of the resulting model @var{sys}. ## @item @dots{} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 19:34:00
|
Revision: 10900 http://octave.svn.sourceforge.net/octave/?rev=10900&view=rev Author: paramaniac Date: 2012-08-23 19:33:48 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: finish function sensitivity Modified Paths: -------------- trunk/octave-forge/main/control/devel/sensitivity.m trunk/octave-forge/main/control/inst/sigma.m Modified: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 17:54:14 UTC (rev 10899) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:33:48 UTC (rev 10900) @@ -16,13 +16,15 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn{Function File} {@var{Ms} =} sensitivity (@var{L}) -## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C}) -## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) -## Return sensitivity margin @var{Ms}. The quantity @var{Ms} is -## simply the inverse of the shortest distance from the Nyquist -## curve to the critical point -1. Reasonable values of @var{Ms} -## are in the range from 1.3 to 2. +## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) +## Return sensitivity margin @var{Ms}. +## The quantity @var{Ms} is simply the inverse of the shortest +## distance from the Nyquist curve to the critical point -1. +## Reasonable values of @var{Ms} are in the range from 1.3 to 2. +## If no output arguments are given, the critical distance 1/Ms +## is plotted on a Nyquist diagram. ## ## @strong{Inputs} ## @table @var @@ -42,9 +44,15 @@ ## @strong{Outputs} ## @table @var ## @item Ms -## Sensitivity margin @var{Ms} as defined in [1]. Scalar value. +## Sensitivity margin @var{Ms} as defined in [1]. +## Scalar value. ## If several controllers are specified, @var{Ms} becomes -## a vector with as many entries as controllers. +## a row vector with as many entries as controllers. +## @item ws +## The frequency [rad/s] corresponding to the sensitivity peak. +## Scalar value. +## If several controllers are specified, @var{ws} becomes +## a row vector with as many entries as controllers. ## @end table ## ## @strong{Algorithm}@* @@ -64,7 +72,7 @@ ## Created: August 2012 ## Version: 0.1 -function Ms = sensitivity (G, varargin) +function [ret, ws] = sensitivity (G, varargin) ## TODO: show nyquist diagram of L with circle ## center (-1, 0) and radius equal to the @@ -74,14 +82,42 @@ if (nargin == 0) print_usage (); elseif (nargin == 1) # L := G - I = eye (size (G)); - S = feedback (I, G); # S = inv (I + G), S = feedback (I, G*-I, "+") - Ms = norm (S, inf); + L = G; + I = eye (size (L)); + S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") + [Ms, ws] = norm (S, inf); else # P := G, C := varargin L = cellfun (@(C) G*C, varargin, "uniformoutput", false); I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); S = cellfun (@feedback, I, L, "uniformoutput", false); - Ms = cellfun (@(S) norm (S, inf), S); + [Ms, ws] = cellfun (@(S) norm (S, inf), S); endif + if (nargout == 0) + ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot + if (length (Ms) > 1) + error ("sensitivity: plotting only works for a single controller"); + endif + if (iscell (L)) + L = L{1}; + endif + [H, w] = __frequency_response__ (L, [], false, 0, "ext"); + H = H(:); + re = real (H); + im = imag (H); + Hs = freqresp (L, ws); + res = real (Hs); + ims = imag (Hs); + plot (re, im, "b", [-1, res], [0, ims], "r") + axis ("equal") + xlim (__axis_margin__ (xlim)) + ylim (__axis_margin__ (ylim)) + grid ("on") + title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) + xlabel ("Real Axis") + ylabel ("Imaginary Axis") + else + ret = Ms; + endif + endfunction Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2012-08-23 17:54:14 UTC (rev 10899) +++ trunk/octave-forge/main/control/inst/sigma.m 2012-08-23 19:33:48 UTC (rev 10900) @@ -21,7 +21,7 @@ ## @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; +## the singular value plot is printed on the screen. ## ## @strong{Inputs} ## @table @var This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 19:35:56
|
Revision: 10901 http://octave.svn.sourceforge.net/octave/?rev=10901&view=rev Author: paramaniac Date: 2012-08-23 19:35:50 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: move sensitivity into place, update INDEX Modified Paths: -------------- trunk/octave-forge/main/control/INDEX Added Paths: ----------- trunk/octave-forge/main/control/inst/sensitivity.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/sensitivity.m Modified: trunk/octave-forge/main/control/INDEX =================================================================== --- trunk/octave-forge/main/control/INDEX 2012-08-23 19:33:48 UTC (rev 10900) +++ trunk/octave-forge/main/control/INDEX 2012-08-23 19:35:50 UTC (rev 10901) @@ -73,6 +73,7 @@ margin nichols nyquist + sensitivity sigma Pole Placement place Deleted: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:33:48 UTC (rev 10900) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 19:35:50 UTC (rev 10901) @@ -1,123 +0,0 @@ -## Copyright (C) 2012 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) -## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) -## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) -## Return sensitivity margin @var{Ms}. -## The quantity @var{Ms} is simply the inverse of the shortest -## distance from the Nyquist curve to the critical point -1. -## Reasonable values of @var{Ms} are in the range from 1.3 to 2. -## If no output arguments are given, the critical distance 1/Ms -## is plotted on a Nyquist diagram. -## -## @strong{Inputs} -## @table @var -## @item L -## Open loop transfer function. -## @var{L} can be any type of LTI system, but it must be square. -## @item P -## Plant model. Any type of LTI system. -## @item C -## Controller model. Any type of LTI system. -## @item C1, C2, @dots{} -## If several controllers are specified, command @command{sensitivity} -## computes the sensitivity @var{Ms} for each of them in combination -## with plant @var{P}. -## @end table -## -## @strong{Outputs} -## @table @var -## @item Ms -## Sensitivity margin @var{Ms} as defined in [1]. -## Scalar value. -## If several controllers are specified, @var{Ms} becomes -## a row vector with as many entries as controllers. -## @item ws -## The frequency [rad/s] corresponding to the sensitivity peak. -## Scalar value. -## If several controllers are specified, @var{ws} becomes -## a row vector with as many entries as controllers. -## @end table -## -## @strong{Algorithm}@* -## Uses SLICOT AB13DD by courtesy of -## @uref{http://www.slicot.org, NICONET e.V.} -## -## @strong{References}@* -## [1] Astr@"om, K. and H@"agglund, T. (1995) -## PID Controllers: -## Theory, Design and Tuning, -## Second Edition. -## Instrument Society of America. -## -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: August 2012 -## Version: 0.1 - -function [ret, ws] = sensitivity (G, varargin) - - ## TODO: show nyquist diagram of L with circle - ## center (-1, 0) and radius equal to the - ## shortest distance 1/Ms, frequency w is - ## [Ms, w] = norm (S, inf) - - if (nargin == 0) - print_usage (); - elseif (nargin == 1) # L := G - L = G; - I = eye (size (L)); - S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") - [Ms, ws] = norm (S, inf); - else # P := G, C := varargin - L = cellfun (@(C) G*C, varargin, "uniformoutput", false); - I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); - S = cellfun (@feedback, I, L, "uniformoutput", false); - [Ms, ws] = cellfun (@(S) norm (S, inf), S); - endif - - if (nargout == 0) - ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot - if (length (Ms) > 1) - error ("sensitivity: plotting only works for a single controller"); - endif - if (iscell (L)) - L = L{1}; - endif - [H, w] = __frequency_response__ (L, [], false, 0, "ext"); - H = H(:); - re = real (H); - im = imag (H); - Hs = freqresp (L, ws); - res = real (Hs); - ims = imag (Hs); - plot (re, im, "b", [-1, res], [0, ims], "r") - axis ("equal") - xlim (__axis_margin__ (xlim)) - ylim (__axis_margin__ (ylim)) - grid ("on") - title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) - xlabel ("Real Axis") - ylabel ("Imaginary Axis") - else - ret = Ms; - endif - -endfunction Copied: trunk/octave-forge/main/control/inst/sensitivity.m (from rev 10900, trunk/octave-forge/main/control/devel/sensitivity.m) =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m (rev 0) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-23 19:35:50 UTC (rev 10901) @@ -0,0 +1,123 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{L}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C}) +## @deftypefnx{Function File} {[@var{Ms}, @var{ws}] =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) +## Return sensitivity margin @var{Ms}. +## The quantity @var{Ms} is simply the inverse of the shortest +## distance from the Nyquist curve to the critical point -1. +## Reasonable values of @var{Ms} are in the range from 1.3 to 2. +## If no output arguments are given, the critical distance 1/Ms +## is plotted on a Nyquist diagram. +## +## @strong{Inputs} +## @table @var +## @item L +## Open loop transfer function. +## @var{L} can be any type of LTI system, but it must be square. +## @item P +## Plant model. Any type of LTI system. +## @item C +## Controller model. Any type of LTI system. +## @item C1, C2, @dots{} +## If several controllers are specified, command @command{sensitivity} +## computes the sensitivity @var{Ms} for each of them in combination +## with plant @var{P}. +## @end table +## +## @strong{Outputs} +## @table @var +## @item Ms +## Sensitivity margin @var{Ms} as defined in [1]. +## Scalar value. +## If several controllers are specified, @var{Ms} becomes +## a row vector with as many entries as controllers. +## @item ws +## The frequency [rad/s] corresponding to the sensitivity peak. +## Scalar value. +## If several controllers are specified, @var{ws} becomes +## a row vector with as many entries as controllers. +## @end table +## +## @strong{Algorithm}@* +## Uses SLICOT AB13DD by courtesy of +## @uref{http://www.slicot.org, NICONET e.V.} +## +## @strong{References}@* +## [1] Astr@"om, K. and H@"agglund, T. (1995) +## PID Controllers: +## Theory, Design and Tuning, +## Second Edition. +## Instrument Society of America. +## +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: August 2012 +## Version: 0.1 + +function [ret, ws] = sensitivity (G, varargin) + + ## TODO: show nyquist diagram of L with circle + ## center (-1, 0) and radius equal to the + ## shortest distance 1/Ms, frequency w is + ## [Ms, w] = norm (S, inf) + + if (nargin == 0) + print_usage (); + elseif (nargin == 1) # L := G + L = G; + I = eye (size (L)); + S = feedback (I, L); # S = inv (I + L), S = feedback (I, L*-I, "+") + [Ms, ws] = norm (S, inf); + else # P := G, C := varargin + L = cellfun (@(C) G*C, varargin, "uniformoutput", false); + I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); + S = cellfun (@feedback, I, L, "uniformoutput", false); + [Ms, ws] = cellfun (@(S) norm (S, inf), S); + endif + + if (nargout == 0) + ## TODO: don't show entire Nyquist curve if critical distance becomes small on plot + if (length (Ms) > 1) + error ("sensitivity: plotting only works for a single controller"); + endif + if (iscell (L)) + L = L{1}; + endif + [H, w] = __frequency_response__ (L, [], false, 0, "ext"); + H = H(:); + re = real (H); + im = imag (H); + Hs = freqresp (L, ws); + res = real (Hs); + ims = imag (Hs); + plot (re, im, "b", [-1, res], [0, ims], "r") + axis ("equal") + xlim (__axis_margin__ (xlim)) + ylim (__axis_margin__ (ylim)) + grid ("on") + title (sprintf ("Sensitivity Ms = %g (at %g rad/s)", Ms, ws)) + xlabel ("Real Axis") + ylabel ("Imaginary Axis") + else + ret = Ms; + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-30 06:02:49
|
Revision: 10932 http://octave.svn.sourceforge.net/octave/?rev=10932&view=rev Author: paramaniac Date: 2012-08-30 06:02:40 +0000 (Thu, 30 Aug 2012) Log Message: ----------- control: support the selection of certain experiments when plotting datasets Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/@iddata/plot.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-08-29 23:18:40 UTC (rev 10931) +++ trunk/octave-forge/main/control/NEWS 2012-08-30 06:02:40 UTC (rev 10932) @@ -1,6 +1,15 @@ Summary of important user-visible changes for releases of the control package =============================================================================== +control-2.3.54 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +=============================================================================== + +** plot + A selection of experiments from iddata identification datasets can be + plotted by plot (dat, exp) instead of plot (dat(:,:,:,exp)). + + +=============================================================================== control-2.3.53 Release Date: 2012-08-27 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/inst/@iddata/plot.m =================================================================== --- trunk/octave-forge/main/control/inst/@iddata/plot.m 2012-08-29 23:18:40 UTC (rev 10931) +++ trunk/octave-forge/main/control/inst/@iddata/plot.m 2012-08-30 06:02:40 UTC (rev 10932) @@ -17,23 +17,37 @@ ## -*- texinfo -*- ## @deftypefn {Function File} plot (@var{dat}) +## @deftypefnx {Function File} plot (@var{dat}, @var{exp}) ## Plot signals of iddata identification datasets on the screen. ## The signals are plotted experiment-wise, either in time- or ## frequency-domain. For multi-experiment datasets, ## press any key to switch to the next experiment. ## If the plot of a single experiment should be saved by the -## @command{print} command, use @code{plot(dat(:,:,:,exp))}, +## @command{print} command, use @code{plot(dat,exp)}, ## where @var{exp} denotes the desired experiment. ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> ## Created: February 2012 -## Version: 0.1 +## Version: 0.2 -function plot (dat) +function plot (dat, exp = ":") + if (nargin > 2) # nargin == 0 is handled by built-in plot + print_usage (); + endif + + if (nargin == 2 && ! is_real_vector (exp)) + error ("iddata: plot: second argument must be a vector of indices"); + endif + + expname = __labels__ (dat.expname, "exp"); + expname = expname(exp); + + idx = substruct ("()", {":", ":", ":", exp}); + dat = subsref (dat, idx); + [n, p, m, e] = size (dat); - expname = __labels__ (dat.expname, "exp"); if (dat.timedomain) if (m == 0) # time series This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-30 07:28:24
|
Revision: 10933 http://octave.svn.sourceforge.net/octave/?rev=10933&view=rev Author: paramaniac Date: 2012-08-30 07:28:18 +0000 (Thu, 30 Aug 2012) Log Message: ----------- control: fix a problem where an error was raised about an "undefined" function issiso Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/sensitivity.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-08-30 06:02:40 UTC (rev 10932) +++ trunk/octave-forge/main/control/NEWS 2012-08-30 07:28:18 UTC (rev 10933) @@ -7,6 +7,10 @@ ** plot A selection of experiments from iddata identification datasets can be plotted by plot (dat, exp) instead of plot (dat(:,:,:,exp)). + +** sensitivity + Fixed a problem where an error was raised about an undefined function + "issiso". =============================================================================== Modified: trunk/octave-forge/main/control/inst/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-30 06:02:40 UTC (rev 10932) +++ trunk/octave-forge/main/control/inst/sensitivity.m 2012-08-30 07:28:18 UTC (rev 10933) @@ -109,12 +109,12 @@ if (length (Ms) > 1) error ("sensitivity: plotting only works for a single controller"); endif + if (iscell (L)) + L = L{1}; + endif if (! issiso (L)) error ("sensitivity: Nyquist plot requires SISO systems"); endif - if (iscell (L)) - L = L{1}; - endif [H, w] = __frequency_response__ (L, [], false, 0, "ext"); H = H(:); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-04 09:09:58
|
Revision: 10959 http://octave.svn.sourceforge.net/octave/?rev=10959&view=rev Author: paramaniac Date: 2012-09-04 09:09:48 +0000 (Tue, 04 Sep 2012) Log Message: ----------- control: add underscores to slicot functions to emphasize their private nature Modified Paths: -------------- trunk/octave-forge/main/control/devel/bug_minreal.m trunk/octave-forge/main/control/devel/test_ss2tf.m trunk/octave-forge/main/control/devel/test_tf2ss.m trunk/octave-forge/main/control/inst/@lti/c2d.m trunk/octave-forge/main/control/inst/@lti/norm.m trunk/octave-forge/main/control/inst/@lti/prescale.m trunk/octave-forge/main/control/inst/@ss/__c2d__.m trunk/octave-forge/main/control/inst/@ss/__d2c__.m trunk/octave-forge/main/control/inst/@ss/__minreal__.m trunk/octave-forge/main/control/inst/@ss/__prescale__.m trunk/octave-forge/main/control/inst/@ss/__sys2tf__.m trunk/octave-forge/main/control/inst/@ss/__zero__.m trunk/octave-forge/main/control/inst/@tf/__sys2ss__.m trunk/octave-forge/main/control/inst/__conred_sb16ad__.m trunk/octave-forge/main/control/inst/__dss2ss__.m trunk/octave-forge/main/control/inst/__modred_ab09id__.m trunk/octave-forge/main/control/inst/__slicot_identification__.m trunk/octave-forge/main/control/inst/arx.m trunk/octave-forge/main/control/inst/bstmodred.m trunk/octave-forge/main/control/inst/care.m trunk/octave-forge/main/control/inst/cfconred.m trunk/octave-forge/main/control/inst/ctrbf.m trunk/octave-forge/main/control/inst/dare.m trunk/octave-forge/main/control/inst/dlyap.m trunk/octave-forge/main/control/inst/dlyapchol.m trunk/octave-forge/main/control/inst/fitfrd.m trunk/octave-forge/main/control/inst/fwcfconred.m trunk/octave-forge/main/control/inst/h2syn.m trunk/octave-forge/main/control/inst/hinfsyn.m trunk/octave-forge/main/control/inst/hnamodred.m trunk/octave-forge/main/control/inst/hsvd.m trunk/octave-forge/main/control/inst/isctrb.m trunk/octave-forge/main/control/inst/isstabilizable.m trunk/octave-forge/main/control/inst/ltimodels.m trunk/octave-forge/main/control/inst/lyap.m trunk/octave-forge/main/control/inst/lyapchol.m trunk/octave-forge/main/control/inst/ncfsyn.m trunk/octave-forge/main/control/inst/place.m trunk/octave-forge/main/control/src/Makefile trunk/octave-forge/main/control/src/slab01od.cc trunk/octave-forge/main/control/src/slab04md.cc trunk/octave-forge/main/control/src/slab08nd.cc trunk/octave-forge/main/control/src/slab09hd.cc trunk/octave-forge/main/control/src/slab09id.cc trunk/octave-forge/main/control/src/slab09jd.cc trunk/octave-forge/main/control/src/slab13ad.cc trunk/octave-forge/main/control/src/slab13bd.cc trunk/octave-forge/main/control/src/slab13dd.cc trunk/octave-forge/main/control/src/slag08bd.cc trunk/octave-forge/main/control/src/slib01ad.cc trunk/octave-forge/main/control/src/slib01cd.cc trunk/octave-forge/main/control/src/slident.cc trunk/octave-forge/main/control/src/slsb01bd.cc trunk/octave-forge/main/control/src/slsb02od.cc trunk/octave-forge/main/control/src/slsb03md.cc trunk/octave-forge/main/control/src/slsb03od.cc trunk/octave-forge/main/control/src/slsb04md.cc trunk/octave-forge/main/control/src/slsb04qd.cc trunk/octave-forge/main/control/src/slsb10dd.cc trunk/octave-forge/main/control/src/slsb10ed.cc trunk/octave-forge/main/control/src/slsb10fd.cc trunk/octave-forge/main/control/src/slsb10hd.cc trunk/octave-forge/main/control/src/slsb10id.cc trunk/octave-forge/main/control/src/slsb10jd.cc trunk/octave-forge/main/control/src/slsb10kd.cc trunk/octave-forge/main/control/src/slsb10yd.cc trunk/octave-forge/main/control/src/slsb10zd.cc trunk/octave-forge/main/control/src/slsb16ad.cc trunk/octave-forge/main/control/src/slsb16bd.cc trunk/octave-forge/main/control/src/slsb16cd.cc trunk/octave-forge/main/control/src/slsg02ad.cc trunk/octave-forge/main/control/src/slsg03ad.cc trunk/octave-forge/main/control/src/slsg03bd.cc trunk/octave-forge/main/control/src/sltb01id.cc trunk/octave-forge/main/control/src/sltb01pd.cc trunk/octave-forge/main/control/src/sltb01ud.cc trunk/octave-forge/main/control/src/sltb04bd.cc trunk/octave-forge/main/control/src/sltd04ad.cc trunk/octave-forge/main/control/src/sltg01ad.cc trunk/octave-forge/main/control/src/sltg01hd.cc trunk/octave-forge/main/control/src/sltg01id.cc trunk/octave-forge/main/control/src/sltg01jd.cc trunk/octave-forge/main/control/src/sltg04bx.cc Added Paths: ----------- trunk/octave-forge/main/control/src/__control_slicot_functions__.cc Removed Paths: ------------- trunk/octave-forge/main/control/src/control_slicot_functions.cc Modified: trunk/octave-forge/main/control/devel/bug_minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/bug_minreal.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/devel/bug_minreal.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -4,7 +4,7 @@ %{ ** On entry to TG01JD parameter number 20 had an illegal value -error: sltg01jd: exception encountered in Fortran subroutine tg01jd_ +error: __sl_tg01jd__: exception encountered in Fortran subroutine tg01jd_ error: called from: error: /Users/lukas/control/inst/@ss/__minreal__.m at line 39, column 19 error: /Users/lukas/control/inst/@lti/minreal.m at line 38, column 7 Modified: trunk/octave-forge/main/control/devel/test_ss2tf.m =================================================================== --- trunk/octave-forge/main/control/devel/test_ss2tf.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/devel/test_ss2tf.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -14,7 +14,7 @@ [p, m] = size (d); md = 4 -[gn, gd, ign, igd] = sltb04bd (a, b, c, d) +[gn, gd, ign, igd] = __sl_tb04bd__ (a, b, c, d) num = reshape (gn, md, p, m) den = reshape (gd, md, p, m) @@ -53,7 +53,7 @@ %num = gn(1:ign+1) %den = gd(1:igd+1) %{ -[gn, gd, ign, igd] = sltb04bd (-2, 3, 4, 5) +[gn, gd, ign, igd] = __sl_tb04bd__ (-2, 3, 4, 5) % for i = 1 : size (gn, 1) @@ -68,16 +68,16 @@ S = ss (P); -[num, den, ign, igd] = sltb04bd (S.a, S.b, S.c, S.d) +[num, den, ign, igd] = __sl_tb04bd__ (S.a, S.b, S.c, S.d) P -[num, den, ign, igd] = sltb04bd (0, 1, 1, 0) +[num, den, ign, igd] = __sl_tb04bd__ (0, 1, 1, 0) sys = WestlandLynx; -[num, den, ign, igd] = sltb04bd (sys.a, sys.b, sys.c, sys.d); +[num, den, ign, igd] = __sl_tb04bd__ (sys.a, sys.b, sys.c, sys.d); %} Modified: trunk/octave-forge/main/control/devel/test_tf2ss.m =================================================================== --- trunk/octave-forge/main/control/devel/test_tf2ss.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/devel/test_tf2ss.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -15,5 +15,5 @@ ucoeff(2,1,:) = u21; ucoeff(2,2,:) = u22; -[a, b, c, d] = sltd04ad (ucoeff, dcoeff, index, 0) +[a, b, c, d] = __sl_td04ad__ (ucoeff, dcoeff, index, 0) Modified: trunk/octave-forge/main/control/inst/@lti/c2d.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/c2d.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@lti/c2d.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -98,7 +98,7 @@ %! D = [ 1.0 0.0 %! 0.0 -1.0 ].'; %! -%! [Ao, Bo, Co, Do] = slab04md (A, B, C, D, 1.0, 1.0, false); +%! [Ao, Bo, Co, Do] = __sl_ab04md__ (A, B, C, D, 1.0, 1.0, false); %! %! Ae = [ -1.0000 -4.0000 %! -4.0000 -1.0000 ]; Modified: trunk/octave-forge/main/control/inst/@lti/norm.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/norm.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@lti/norm.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -72,7 +72,7 @@ if (! discrete && any (d(:))) # continuous and non-zero feedthrough gain = inf; else - gain = slab13bd (a, b, c, d, discrete); + gain = __sl_ab13bd__ (a, b, c, d, discrete); endif else gain = inf; @@ -88,14 +88,14 @@ tol = max (tol, 100*eps); if (isempty (e)) - [fpeak, gpeak] = slab13dd (a, a, b, c, d, discrete, false, tol, scaled); # TODO: avoid dummy argument + [fpeak, gpeak] = __sl_ab13dd__ (a, a, b, c, d, discrete, false, tol, scaled); # TODO: avoid dummy argument else if (rcond (e) < eps) gain = inf; wpeak = inf; return; else - [fpeak, gpeak] = slab13dd (a, e, b, c, d, discrete, true, tol, scaled); + [fpeak, gpeak] = __sl_ab13dd__ (a, e, b, c, d, discrete, true, tol, scaled); endif endif Modified: trunk/octave-forge/main/control/inst/@lti/prescale.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/prescale.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@lti/prescale.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -103,7 +103,7 @@ %! %! MAXRED = 0.0; %! -%! [Ao, Bo, Co, MAXREDo, SCALEo] = sltb01id (A, B, C, MAXRED); +%! [Ao, Bo, Co, MAXREDo, SCALEo] = __sl_tb01id__ (A, B, C, MAXRED); %! %! Ae = [ 0.0000000D+00 0.1000000D+05 0.0000000D+00 0.0000000D+00 0.0000000D+00 %! -0.1580000D+03 -0.1257000D+04 0.0000000D+00 0.0000000D+00 0.0000000D+00 @@ -156,7 +156,7 @@ %! %! TRESH = 0.0; %! -%! [Ao, Eo, Bo, Co, LSCALEo, RSCALEo] = sltg01ad (A, E, B, C, TRESH); +%! [Ao, Eo, Bo, Co, LSCALEo, RSCALEo] = __sl_tg01ad__ (A, E, B, C, TRESH); %! %! Ae = [ -1.0000 0.0000 0.0000 0.3000 %! 0.0000 0.0000 1.0000 2.0000 Modified: trunk/octave-forge/main/control/inst/@ss/__c2d__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__c2d__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__c2d__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -40,7 +40,7 @@ beta = 2/tsam; endif if (isempty (sys.e)) - [sys.a, sys.b, sys.c, sys.d] = slab04md (sys.a, sys.b, sys.c, sys.d, 1, beta, false); + [sys.a, sys.b, sys.c, sys.d] = __sl_ab04md__ (sys.a, sys.b, sys.c, sys.d, 1, beta, false); else [sys.a, sys.b, sys.c, sys.d, sys.e] = __dss_bilin__ (sys.a, sys.b, sys.c, sys.d, sys.e, beta, false); endif Modified: trunk/octave-forge/main/control/inst/@ss/__d2c__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__d2c__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__d2c__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -42,7 +42,7 @@ beta = 2/tsam; endif if (isempty (sys.e)) - [sys.a, sys.b, sys.c, sys.d] = slab04md (sys.a, sys.b, sys.c, sys.d, 1, beta, true); + [sys.a, sys.b, sys.c, sys.d] = __sl_ab04md__ (sys.a, sys.b, sys.c, sys.d, 1, beta, true); else [sys.a, sys.b, sys.c, sys.d, sys.e] = __dss_bilin__ (sys.a, sys.b, sys.c, sys.d, sys.e, beta, true); endif Modified: trunk/octave-forge/main/control/inst/@ss/__minreal__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__minreal__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__minreal__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -33,10 +33,10 @@ endif if (isempty (sys.e)) - [a, b, c] = sltb01pd (sys.a, sys.b, sys.c, tol, sys.scaled); + [a, b, c] = __sl_tb01pd__ (sys.a, sys.b, sys.c, tol, sys.scaled); retsys = ss (a, b, c, sys.d); else - [a, e, b, c] = sltg01jd (sys.a, sys.e, sys.b, sys.c, tol, sys.scaled, 0, 0); + [a, e, b, c] = __sl_tg01jd__ (sys.a, sys.e, sys.b, sys.c, tol, sys.scaled, 0, 0); retsys = dss (a, b, c, sys.d, e); endif Modified: trunk/octave-forge/main/control/inst/@ss/__prescale__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__prescale__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__prescale__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -27,12 +27,12 @@ function [retsys, lscale, rscale] = __prescale__ (sys, optarg = 0.0) if (isempty (sys.e)) - [a, b, c, ~, scale] = sltb01id (sys.a, sys.b, sys.c, optarg); + [a, b, c, ~, scale] = __sl_tb01id__ (sys.a, sys.b, sys.c, optarg); retsys = ss (a, b, c, sys.d); lscale = scale.^-1; rscale = scale; else - [a, e, b, c, lscale, rscale] = sltg01ad (sys.a, sys.e, sys.b, sys.c, optarg); + [a, e, b, c, lscale, rscale] = __sl_tg01ad__ (sys.a, sys.e, sys.b, sys.c, optarg); retsys = dss (a, b, c, sys.d, e); endif Modified: trunk/octave-forge/main/control/inst/@ss/__sys2tf__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__sys2tf__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__sys2tf__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -27,7 +27,7 @@ try [a, b, c, d, tsam, scaled] = ssdata (sys); # system could be a descriptor model - [num, den, ign, igd, md, p, m] = sltb04bd (a, b, c, d, scaled); + [num, den, ign, igd, md, p, m] = __sl_tb04bd__ (a, b, c, d, scaled); num = reshape (num, md, p, m); den = reshape (den, md, p, m); Modified: trunk/octave-forge/main/control/inst/@ss/__zero__.m =================================================================== --- trunk/octave-forge/main/control/inst/@ss/__zero__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@ss/__zero__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -27,12 +27,12 @@ function [zer, gain] = __zero__ (sys, argc) if (isempty (sys.e)) - [zer, gain] = slab08nd (sys.a, sys.b, sys.c, sys.d, sys.scaled); + [zer, gain] = __sl_ab08nd__ (sys.a, sys.b, sys.c, sys.d, sys.scaled); else - zer = slag08bd (sys.a, sys.e, sys.b, sys.c, sys.d, sys.scaled); + zer = __sl_ag08bd__ (sys.a, sys.e, sys.b, sys.c, sys.d, sys.scaled); if (argc > 1 && issiso (sys)) pol = pole (sys); - gain = sltg04bx (sys.a, sys.e, sys.b, sys.c, sys.d, \ + gain = __sl_tg04bx__ (sys.a, sys.e, sys.b, sys.c, sys.d, \ real (pol), imag (pol), real (zer), imag (zer)); else gain = []; Modified: trunk/octave-forge/main/control/inst/@tf/__sys2ss__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tf/__sys2ss__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/@tf/__sys2ss__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -123,7 +123,7 @@ endfor tol = min (sqrt (eps), eps*prod (index)); - [a, b, c, d] = sltd04ad (ucoeff, dcoeff, index, tol); + [a, b, c, d] = __sl_td04ad__ (ucoeff, dcoeff, index, tol); endfunction @@ -144,7 +144,7 @@ c2 = horzcat (zeros (p, p*(max_len_numq-1)), -eye (p)); ## remove uncontrollable part - [a2, e2, b2, c2] = sltg01jd (a2, e2, b2, c2, 0.0, true, 1, 2); + [a2, e2, b2, c2] = __sl_tg01jd__ (a2, e2, b2, c2, 0.0, true, 1, 2); endfunction Modified: trunk/octave-forge/main/control/inst/__conred_sb16ad__.m =================================================================== --- trunk/octave-forge/main/control/inst/__conred_sb16ad__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/__conred_sb16ad__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -169,9 +169,9 @@ ## perform model order reduction - [acr, bcr, ccr, dcr, ncr, hsvc, ncs] = slsb16ad (a, b, c, d, dt, equil, ncr, ordsel, alpha, jobmr, \ - ac, bc, cc, dc, \ - weight, jobc, jobo, tol1, tol2); + [acr, bcr, ccr, dcr, ncr, hsvc, ncs] = __sl_sb16ad__ (a, b, c, d, dt, equil, ncr, ordsel, alpha, jobmr, \ + ac, bc, cc, dc, \ + weight, jobc, jobo, tol1, tol2); ## assemble reduced order controller Kr = ss (acr, bcr, ccr, dcr, tsamc); Modified: trunk/octave-forge/main/control/inst/__dss2ss__.m =================================================================== --- trunk/octave-forge/main/control/inst/__dss2ss__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/__dss2ss__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -29,7 +29,7 @@ elseif (rcond (e) < eps) # check for singularity error ("ss: dss2ss: descriptor matrice 'e' singular"); else - [a, b, c, d] = slsb10jd (a, b, c, d, e); + [a, b, c, d] = __sl_sb10jd__ (a, b, c, d, e); e = []; endif Modified: trunk/octave-forge/main/control/inst/__modred_ab09id__.m =================================================================== --- trunk/octave-forge/main/control/inst/__modred_ab09id__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/__modred_ab09id__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -159,7 +159,7 @@ ## perform model order reduction - [ar, br, cr, dr, nr, hsv, ns] = slab09id (a, b, c, d, dt, equil, nr, ordsel, alpha, job, \ + [ar, br, cr, dr, nr, hsv, ns] = __sl_ab09id__ (a, b, c, d, dt, equil, nr, ordsel, alpha, job, \ av, bv, cv, dv, \ aw, bw, cw, dw, \ weight, jobc, jobo, alphac, alphao, \ Modified: trunk/octave-forge/main/control/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/main/control/inst/__slicot_identification__.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/__slicot_identification__.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -153,7 +153,7 @@ if (nout == 0) ## compute singular values - [sv, nrec] = slib01ad (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); + [sv, nrec] = __sl_ib01ad__ (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); ## there is no 'logbar' function svl = log10 (sv); @@ -170,7 +170,7 @@ grid on else ## perform system identification - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = __sl_ident__ (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); ## compute noise variance matrix factor L ## L L' = Ry, e = L v Modified: trunk/octave-forge/main/control/inst/arx.m =================================================================== --- trunk/octave-forge/main/control/inst/arx.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/arx.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -228,7 +228,7 @@ ## this makes only sense for state-space models, therefore convert TF to SS if (nargout > 1) sys = prescale (ss (sys(:,1:m))); - x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0); + x0 = __sl_ib01cd__ (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0); ## return x0 as vector for single-experiment data ## instead of a cell containing one vector if (numel (x0) == 1) Modified: trunk/octave-forge/main/control/inst/bstmodred.m =================================================================== --- trunk/octave-forge/main/control/inst/bstmodred.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/bstmodred.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -278,7 +278,7 @@ endfor ## perform model order reduction - [ar, br, cr, dr, nr, hsv, ns] = slab09hd (a, b, c, d, dt, scaled, job, nr, ordsel, alpha, beta, \ + [ar, br, cr, dr, nr, hsv, ns] = __sl_ab09hd__ (a, b, c, d, dt, scaled, job, nr, ordsel, alpha, beta, \ tol1, tol2); ## assemble reduced order model Modified: trunk/octave-forge/main/control/inst/care.m =================================================================== --- trunk/octave-forge/main/control/inst/care.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/care.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -159,18 +159,18 @@ ## solve the riccati equation if (isempty (e)) if (isempty (s)) - [x, l] = slsb02od (a, b, q, r, b, false, false); + [x, l] = __sl_sb02od__ (a, b, q, r, b, false, false); g = r \ (b.'*x); # gain matrix else - [x, l] = slsb02od (a, b, q, r, s, false, true); + [x, l] = __sl_sb02od__ (a, b, q, r, s, false, true); g = r \ (b.'*x + s.'); # gain matrix endif else if (isempty (s)) - [x, l] = slsg02ad (a, e, b, q, r, b, false, false); + [x, l] = __sl_sg02ad__ (a, e, b, q, r, b, false, false); g = r \ (b.'*x*e); # gain matrix else - [x, l] = slsg02ad (a, e, b, q, r, s, false, true); + [x, l] = __sl_sg02ad__ (a, e, b, q, r, s, false, true); g = r \ (b.'*x*e + s.'); # gain matrix endif endif Modified: trunk/octave-forge/main/control/inst/cfconred.m =================================================================== --- trunk/octave-forge/main/control/inst/cfconred.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/cfconred.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -260,8 +260,8 @@ endif ## perform model order reduction - [acr, bcr, ccr, dcr, ncr, hsv] = slsb16bd (a, b, c, d, dt, equil, ncr, ordsel, jobd, jobmr, \ - F, L, jobcf, tol1, tol2); + [acr, bcr, ccr, dcr, ncr, hsv] = __sl_sb16bd__ (a, b, c, d, dt, equil, ncr, ordsel, jobd, jobmr, \ + F, L, jobcf, tol1, tol2); ## assemble reduced order controller Kr = ss (acr, bcr, ccr, dcr, tsam); Modified: trunk/octave-forge/main/control/inst/ctrbf.m =================================================================== --- trunk/octave-forge/main/control/inst/ctrbf.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/ctrbf.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -80,7 +80,7 @@ error ("ctrbf: tol must be a real scalar"); endif - [ac, bc, cc, z, ncont] = sltb01ud (a, b, c, tol); + [ac, bc, cc, z, ncont] = __sl_tb01ud__ (a, b, c, tol); if (islti) ac = set (sys, "a", ac, "b", bc, "c", cc, "scaled", false); Modified: trunk/octave-forge/main/control/inst/dare.m =================================================================== --- trunk/octave-forge/main/control/inst/dare.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/dare.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -159,18 +159,18 @@ ## solve the riccati equation if (isempty (e)) if (isempty (s)) - [x, l] = slsb02od (a, b, q, r, b, true, false); + [x, l] = __sl_sb02od__ (a, b, q, r, b, true, false); g = (r + b.'*x*b) \ (b.'*x*a); # gain matrix else - [x, l] = slsb02od (a, b, q, r, s, true, true); + [x, l] = __sl_sb02od__ (a, b, q, r, s, true, true); g = (r + b.'*x*b) \ (b.'*x*a + s.'); # gain matrix endif else if (isempty (s)) - [x, l] = slsg02ad (a, e, b, q, r, b, true, false); + [x, l] = __sl_sg02ad__ (a, e, b, q, r, b, true, false); g = (r + b.'*x*b) \ (b.'*x*a); # gain matrix else - [x, l] = slsg02ad (a, e, b, q, r, s, true, true); + [x, l] = __sl_sg02ad__ (a, e, b, q, r, s, true, true); g = (r + b.'*x*b) \ (b.'*x*a + s.'); # gain matrix endif endif Modified: trunk/octave-forge/main/control/inst/dlyap.m =================================================================== --- trunk/octave-forge/main/control/inst/dlyap.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/dlyap.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -62,7 +62,7 @@ inputname (1), inputname (2)); endif - [x, scale] = slsb03md (a, -b, true); # AXA' - X = -B + [x, scale] = __sl_sb03md__ (a, -b, true); # AXA' - X = -B ## x /= scale; # 0 < scale <= 1 @@ -80,7 +80,7 @@ rows (a), columns (b), inputname (3)); endif - x = slsb04qd (-a, b, c); # AXB' - X = -C + x = __sl_sb04qd__ (-a, b, c); # AXB' - X = -C case 4 # generalized Lyapunov equation @@ -106,7 +106,7 @@ inputname (2)); endif - [x, scale] = slsg03ad (a, e, -b, true); # AXA' - EXE' = -B + [x, scale] = __sl_sg03ad__ (a, e, -b, true); # AXA' - EXE' = -B ## x /= scale; # 0 < scale <= 1 Modified: trunk/octave-forge/main/control/inst/dlyapchol.m =================================================================== --- trunk/octave-forge/main/control/inst/dlyapchol.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/dlyapchol.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -63,7 +63,7 @@ inputname (1), inputname (2)); endif - [u, scale] = slsb03od (a.', b.', true); + [u, scale] = __sl_sb03od__ (a.', b.', true); ## NOTE: TRANS = 'T' not suitable because we need U' U, not U U' @@ -87,7 +87,7 @@ inputname (1), inputname (2), inputname (3)); endif - [u, scale] = slsg03bd (a.', e.', b.', true); + [u, scale] = __sl_sg03bd__ (a.', e.', b.', true); ## NOTE: TRANS = 'T' not suitable because we need U' U, not U U' Modified: trunk/octave-forge/main/control/inst/fitfrd.m =================================================================== --- trunk/octave-forge/main/control/inst/fitfrd.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/fitfrd.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -81,7 +81,7 @@ error ("fitfrd: require n <= length (dat.w)"); endif - [a, b, c, d, n] = slsb10yd (real (H), imag (H), w, n, dt, logical (flag)); + [a, b, c, d, n] = __sl_sb10yd__ (real (H), imag (H), w, n, dt, logical (flag)); sys = ss (a, b, c, d, tsam); Modified: trunk/octave-forge/main/control/inst/fwcfconred.m =================================================================== --- trunk/octave-forge/main/control/inst/fwcfconred.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/fwcfconred.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -225,8 +225,8 @@ endif ## perform model order reduction - [acr, bcr, ccr, ncr, hsv] = slsb16cd (a, b, c, d, dt, ncr, ordsel, jobd, jobmr, \ - F, L, jobcf, tol1); + [acr, bcr, ccr, ncr, hsv] = __sl_sb16cd__ (a, b, c, d, dt, ncr, ordsel, jobd, jobmr, \ + F, L, jobcf, tol1); ## assemble reduced order controller Kr = ss (acr, bcr, ccr, [], tsam); Modified: trunk/octave-forge/main/control/inst/h2syn.m =================================================================== --- trunk/octave-forge/main/control/inst/h2syn.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/h2syn.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -129,9 +129,9 @@ ## H-2 synthesis if (isct (P)) # continuous plant - [ak, bk, ck, dk, rcond] = slsb10hd (a, b, c, d, ncon, nmeas); + [ak, bk, ck, dk, rcond] = __sl_sb10hd__ (a, b, c, d, ncon, nmeas); else # discrete plant - [ak, bk, ck, dk, rcond] = slsb10ed (a, b, c, d, ncon, nmeas); + [ak, bk, ck, dk, rcond] = __sl_sb10ed__ (a, b, c, d, ncon, nmeas); endif ## controller Modified: trunk/octave-forge/main/control/inst/hinfsyn.m =================================================================== --- trunk/octave-forge/main/control/inst/hinfsyn.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/hinfsyn.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -132,9 +132,9 @@ ## H-infinity synthesis if (isct (P)) # continuous plant - [ak, bk, ck, dk, rcond] = slsb10fd (a, b, c, d, ncon, nmeas, gmax); + [ak, bk, ck, dk, rcond] = __sl_sb10fd__ (a, b, c, d, ncon, nmeas, gmax); else # discrete plant - [ak, bk, ck, dk, rcond] = slsb10dd (a, b, c, d, ncon, nmeas, gmax); + [ak, bk, ck, dk, rcond] = __sl_sb10dd__ (a, b, c, d, ncon, nmeas, gmax); endif ## controller Modified: trunk/octave-forge/main/control/inst/hnamodred.m =================================================================== --- trunk/octave-forge/main/control/inst/hnamodred.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/hnamodred.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -394,7 +394,7 @@ ## perform model order reduction - [ar, br, cr, dr, nr, hsv, ns] = slab09jd (a, b, c, d, dt, scaled, nr, ordsel, alpha, \ + [ar, br, cr, dr, nr, hsv, ns] = __sl_ab09jd__ (a, b, c, d, dt, scaled, nr, ordsel, alpha, \ jobv, av, bv, cv, dv, \ jobw, aw, bw, cw, dw, \ jobinv, tol1, tol2); Modified: trunk/octave-forge/main/control/inst/hsvd.m =================================================================== --- trunk/octave-forge/main/control/inst/hsvd.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/hsvd.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -62,7 +62,7 @@ error ("hsvd: second argument invalid"); endswitch - [hsv, ns] = slab13ad (a, b, c, discrete, alpha, scaled); + [hsv, ns] = __sl_ab13ad__ (a, b, c, discrete, alpha, scaled); if (nargout) hsv_r = hsv; Modified: trunk/octave-forge/main/control/inst/isctrb.m =================================================================== --- trunk/octave-forge/main/control/inst/isctrb.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/isctrb.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -89,9 +89,9 @@ endif if (isempty (e)) - [~, ~, ~, ncont] = slab01od (a, b, tol); + [~, ~, ~, ncont] = __sl_ab01od__ (a, b, tol); else - [~, ~, ~, ~, ~, ~, ncont] = sltg01hd (a, e, b, zeros (1, columns (a)), tol); + [~, ~, ~, ~, ~, ~, ncont] = __sl_tg01hd__ (a, e, b, zeros (1, columns (a)), tol); endif bool = (ncont == rows (a)); Modified: trunk/octave-forge/main/control/inst/isstabilizable.m =================================================================== --- trunk/octave-forge/main/control/inst/isstabilizable.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/isstabilizable.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -103,7 +103,7 @@ if (isempty (e)) ## controllability staircase form - [ac, ~, ~, ncont] = slab01od (a, b, tol); + [ac, ~, ~, ncont] = __sl_ab01od__ (a, b, tol); ## extract uncontrollable part of staircase form uncont_idx = ncont+1 : rows (a); @@ -113,7 +113,7 @@ pol = eig (auncont); else ## controllability staircase form - output matrix c has no influence - [ac, ec, ~, ~, ~, ~, ncont] = sltg01hd (a, e, b, zeros (1, columns (a)), tol); + [ac, ec, ~, ~, ~, ~, ncont] = __sl_tg01hd__ (a, e, b, zeros (1, columns (a)), tol); ## extract uncontrollable part of staircase form uncont_idx = ncont+1 : rows (a); Modified: trunk/octave-forge/main/control/inst/ltimodels.m =================================================================== --- trunk/octave-forge/main/control/inst/ltimodels.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/ltimodels.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -128,7 +128,7 @@ %! A = A.'; # There's a little mistake in the example %! # program of routine AB01OD in SLICOT 5.0 %! -%! [Ac, Bc, U, ncont] = slab01od (A, B, tol); +%! [Ac, Bc, U, ncont] = __sl_ab01od__ (A, B, tol); %! %! Ace = [ 12.8848 3.2345 11.8211 3.3758 -0.8982 %! 4.4741 -12.5544 5.3509 5.9403 1.4360 @@ -178,7 +178,7 @@ %! %! tol = 0; %! -%! [ac, ec, bc, cc, q, z, ncont] = sltg01hd (a, e, b, c, tol); +%! [ac, ec, bc, cc, q, z, ncont] = __sl_tg01hd__ (a, e, b, c, tol); %! %! ncont_e = 3; %! @@ -267,7 +267,7 @@ %! %! tol = 0; %! -%! [ao, eo, bo, co, q, z, nobsv] = sltg01id (a, e, b, c, tol); +%! [ao, eo, bo, co, q, z, nobsv] = __sl_tg01id__ (a, e, b, c, tol); %! %! nobsv_e = 3; %! @@ -391,7 +391,7 @@ %! UCOEFF(2,1,:) = u21; %! UCOEFF(2,2,:) = u22; %! -%! [Ao, Bo, Co, Do] = sltd04ad (UCOEFF, DCOEFF, INDEX, 0); +%! [Ao, Bo, Co, Do] = __sl_td04ad__ (UCOEFF, DCOEFF, INDEX, 0); %! %! Ae = [ 0.5000 -0.8028 0.9387 %! 4.4047 -2.3380 2.5076 Modified: trunk/octave-forge/main/control/inst/lyap.m =================================================================== --- trunk/octave-forge/main/control/inst/lyap.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/lyap.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -63,7 +63,7 @@ endif - [x, scale] = slsb03md (a, -b, false); # AX + XA' = -B + [x, scale] = __sl_sb03md__ (a, -b, false); # AX + XA' = -B ## x /= scale; # 0 < scale <= 1 @@ -81,7 +81,7 @@ rows (a), columns (b), inputname (3)); endif - x = slsb04md (a, b, -c); # AX + XB = -C + x = __sl_sb04md__ (a, b, -c); # AX + XB = -C case 4 # generalized Lyapunov equation @@ -107,7 +107,7 @@ inputname (2)); endif - [x, scale] = slsg03ad (a, e, -b, false); # AXE' + EXA' = -B + [x, scale] = __sl_sg03ad__ (a, e, -b, false); # AXE' + EXA' = -B ## x /= scale; # 0 < scale <= 1 Modified: trunk/octave-forge/main/control/inst/lyapchol.m =================================================================== --- trunk/octave-forge/main/control/inst/lyapchol.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/lyapchol.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -63,7 +63,7 @@ inputname (1), inputname (2)); endif - [u, scale] = slsb03od (a.', b.', false); + [u, scale] = __sl_sb03od__ (a.', b.', false); ## NOTE: TRANS = 'T' not suitable because we need U' U, not U U' @@ -87,7 +87,7 @@ inputname (1), inputname (2), inputname (3)); endif - [u, scale] = slsg03bd (a.', e.', b.', false); + [u, scale] = __sl_sg03bd__ (a.', e.', b.', false); ## NOTE: TRANS = 'T' not suitable because we need U' U, not U U' Modified: trunk/octave-forge/main/control/inst/ncfsyn.m =================================================================== --- trunk/octave-forge/main/control/inst/ncfsyn.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/ncfsyn.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -110,11 +110,11 @@ ## synthesis if (isct (Gs)) # continuous-time - [ak, bk, ck, dk, rcond] = slsb10id (a, b, c, d, factor); + [ak, bk, ck, dk, rcond] = __sl_sb10id__ (a, b, c, d, factor); elseif (any (d(:))) # discrete-time, d != 0 - [ak, bk, ck, dk, rcond] = slsb10zd (a, b, c, d, factor, 0.0); + [ak, bk, ck, dk, rcond] = __sl_sb10zd__ (a, b, c, d, factor, 0.0); else # discrete-time, d == 0 - [ak, bk, ck, dk, rcond] = slsb10kd (a, b, c, factor); + [ak, bk, ck, dk, rcond] = __sl_sb10kd__ (a, b, c, factor); endif ## controller @@ -198,7 +198,7 @@ %! %! FACTOR = 1.0; %! -%! [AK, BK, CK, DK, RCOND] = slsb10id (A, B, C, D, FACTOR); +%! [AK, BK, CK, DK, RCOND] = __sl_sb10id__ (A, B, C, D, FACTOR); %! %! AKe = [ -39.0671 9.9293 22.2322 -27.4113 43.8655 %! -6.6117 3.0006 11.0878 -11.4130 15.4269 @@ -304,7 +304,7 @@ %! %! FACTOR = 1.1; %! -%! [AK, BK, CK, DK, RCOND] = slsb10kd (A, B, C, FACTOR); +%! [AK, BK, CK, DK, RCOND] = __sl_sb10kd__ (A, B, C, FACTOR); %! %! AKe = [ 0.0337 0.0222 0.0858 0.1264 -0.1872 0.1547 %! 0.4457 0.0668 -0.2255 -0.3204 -0.4548 -0.0691 @@ -414,7 +414,7 @@ %! %! FACTOR = 1.1; %! -%! [AK, BK, CK, DK, RCOND] = slsb10zd (A, B, C, D, FACTOR, 0.0); +%! [AK, BK, CK, DK, RCOND] = __sl_sb10zd__ (A, B, C, D, FACTOR, 0.0); %! %! AKe = [ 1.0128 0.5101 -0.1546 1.1300 3.3759 0.4911 %! -2.1257 -1.4517 -0.4486 0.3493 -1.5506 -1.4296 Modified: trunk/octave-forge/main/control/inst/place.m =================================================================== --- trunk/octave-forge/main/control/inst/place.m 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/inst/place.m 2012-09-04 09:09:48 UTC (rev 10959) @@ -136,7 +136,7 @@ tol = 0; endif - [f, nfp, nap, nup, z] = slsb01bd (a, b, wr, wi, discrete, alpha, tol); + [f, nfp, nap, nup, z] = __sl_sb01bd__ (a, b, wr, wi, discrete, alpha, tol); f = -f; # A + B*F --> A - B*F info = struct ("nfp", nfp, "nap", nap, "nup", nup, "z", z); Modified: trunk/octave-forge/main/control/src/Makefile =================================================================== --- trunk/octave-forge/main/control/src/Makefile 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/Makefile 2012-09-04 09:09:48 UTC (rev 10959) @@ -11,7 +11,7 @@ endif LFLAGS := $(shell $(MKOCTFILE) -p LFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -all: control_slicot_functions.oct \ +all: __control_slicot_functions__.oct \ is_real_scalar.oct \ is_real_vector.oct \ is_real_matrix.oct \ @@ -35,9 +35,9 @@ rm -rf *.o *.f slicot # slicot functions -control_slicot_functions.oct: control_slicot_functions.cc slicotlibrary.a +__control_slicot_functions__.oct: __control_slicot_functions__.cc slicotlibrary.a LFLAGS="$(LFLAGS)" \ - $(MKOCTFILE) control_slicot_functions.cc common.cc slicotlibrary.a + $(MKOCTFILE) __control_slicot_functions__.cc common.cc slicotlibrary.a # helpers is_real_scalar.oct: is_real_scalar.cc Copied: trunk/octave-forge/main/control/src/__control_slicot_functions__.cc (from rev 10958, trunk/octave-forge/main/control/src/control_slicot_functions.cc) =================================================================== --- trunk/octave-forge/main/control/src/__control_slicot_functions__.cc (rev 0) +++ trunk/octave-forge/main/control/src/__control_slicot_functions__.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -0,0 +1,58 @@ +#include "slab08nd.cc" // transmission zeros of state-space models +#include "slab13dd.cc" // L-infinity norm +#include "slsb10hd.cc" // H-2 controller synthesis - continuous-time +#include "slsb10ed.cc" // H-2 controller synthesis - discrete-time +#include "slab13bd.cc" // H-2 norm +#include "slsb01bd.cc" // Pole assignment +#include "slsb10fd.cc" // H-infinity controller synthesis - continuous-time +#include "slsb10dd.cc" // H-infinity controller synthesis - discrete-time +#include "slsb03md.cc" // Lyapunov equations +#include "slsb04md.cc" // Sylvester equations - continuous-time +#include "slsb04qd.cc" // Sylvester equations - discrete-time +#include "slsg03ad.cc" // generalized Lyapunov equations +#include "slsb02od.cc" // algebraic Riccati equations +#include "slab13ad.cc" // Hankel singular values +#include "slab01od.cc" // staircase form using orthogonal transformations +#include "sltb01pd.cc" // minimal realization of state-space models +#include "slsb03od.cc" // Cholesky factor of Lyapunov equations +#include "slsg03bd.cc" // Cholesky factor of generalized Lyapunov equations +#include "slag08bd.cc" // transmission zeros of descriptor state-space models +#include "sltg01jd.cc" // minimal realization of descriptor state-space models +#include "sltg01hd.cc" // controllability staircase form of descriptor state-space models +#include "sltg01id.cc" // observability staircase form of descriptor state-space models +#include "slsg02ad.cc" // solution of algebraic Riccati equations for descriptor systems +#include "sltg04bx.cc" // gain of descriptor state-space models +#include "sltb01id.cc" // scaling of state-space models +#include "sltg01ad.cc" // scaling of descriptor state-space models +#include "slsb10id.cc" // H-infinity loop shaping - continuous-time +#include "slsb10kd.cc" // H-infinity loop shaping - discrete-time - strictly proper case +#include "slsb10zd.cc" // H-infinity loop shaping - discrete-time - proper case +#include "sltb04bd.cc" // State-space to transfer function conversion +#include "slab04md.cc" // bilinear transformation +#include "slsb10jd.cc" // descriptor to regular state-space conversion +#include "sltd04ad.cc" // transfer function to state-space conversion +#include "sltb01ud.cc" // controllable block Hessenberg realization +#include "slab09hd.cc" // balanced stochastic truncation model reduction +#include "slab09id.cc" // balanced truncation & singular perturbation approximation model reduction +#include "slab09jd.cc" // hankel-norm approximation model reduction +#include "slsb16ad.cc" // balanced truncation & singular perturbation approximation controller reduction +#include "slsb16bd.cc" // coprime factorization state-feedback controller reduction +#include "slsb16cd.cc" // frequency-weighted coprime factorization state-feedback controller reduction +#include "slsb10yd.cc" // fit state-space model to frequency response data +#include "slident.cc" // system identification +#include "slib01cd.cc" // compute initial state vector +#include "slib01ad.cc" // compute singular values + + +// stub function to avoid gen_doc_cache warning upon package installation +DEFUN_DLD (__control_slicot_functions__, args, nargout, + "-*- texinfo -*-\n\ +Slicot Release 5.0\n\ +No argument checking.\n\ +For internal use only.") +{ + octave_value_list retval; + error ("__control_slicot_functions__: for internal use only"); + return retval; +} + Deleted: trunk/octave-forge/main/control/src/control_slicot_functions.cc =================================================================== --- trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/control_slicot_functions.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -1,58 +0,0 @@ -#include "slab08nd.cc" // transmission zeros of state-space models -#include "slab13dd.cc" // L-infinity norm -#include "slsb10hd.cc" // H-2 controller synthesis - continuous-time -#include "slsb10ed.cc" // H-2 controller synthesis - discrete-time -#include "slab13bd.cc" // H-2 norm -#include "slsb01bd.cc" // Pole assignment -#include "slsb10fd.cc" // H-infinity controller synthesis - continuous-time -#include "slsb10dd.cc" // H-infinity controller synthesis - discrete-time -#include "slsb03md.cc" // Lyapunov equations -#include "slsb04md.cc" // Sylvester equations - continuous-time -#include "slsb04qd.cc" // Sylvester equations - discrete-time -#include "slsg03ad.cc" // generalized Lyapunov equations -#include "slsb02od.cc" // algebraic Riccati equations -#include "slab13ad.cc" // Hankel singular values -#include "slab01od.cc" // staircase form using orthogonal transformations -#include "sltb01pd.cc" // minimal realization of state-space models -#include "slsb03od.cc" // Cholesky factor of Lyapunov equations -#include "slsg03bd.cc" // Cholesky factor of generalized Lyapunov equations -#include "slag08bd.cc" // transmission zeros of descriptor state-space models -#include "sltg01jd.cc" // minimal realization of descriptor state-space models -#include "sltg01hd.cc" // controllability staircase form of descriptor state-space models -#include "sltg01id.cc" // observability staircase form of descriptor state-space models -#include "slsg02ad.cc" // solution of algebraic Riccati equations for descriptor systems -#include "sltg04bx.cc" // gain of descriptor state-space models -#include "sltb01id.cc" // scaling of state-space models -#include "sltg01ad.cc" // scaling of descriptor state-space models -#include "slsb10id.cc" // H-infinity loop shaping - continuous-time -#include "slsb10kd.cc" // H-infinity loop shaping - discrete-time - strictly proper case -#include "slsb10zd.cc" // H-infinity loop shaping - discrete-time - proper case -#include "sltb04bd.cc" // State-space to transfer function conversion -#include "slab04md.cc" // bilinear transformation -#include "slsb10jd.cc" // descriptor to regular state-space conversion -#include "sltd04ad.cc" // transfer function to state-space conversion -#include "sltb01ud.cc" // controllable block Hessenberg realization -#include "slab09hd.cc" // balanced stochastic truncation model reduction -#include "slab09id.cc" // balanced truncation & singular perturbation approximation model reduction -#include "slab09jd.cc" // hankel-norm approximation model reduction -#include "slsb16ad.cc" // balanced truncation & singular perturbation approximation controller reduction -#include "slsb16bd.cc" // coprime factorization state-feedback controller reduction -#include "slsb16cd.cc" // frequency-weighted coprime factorization state-feedback controller reduction -#include "slsb10yd.cc" // fit state-space model to frequency response data -#include "slident.cc" // system identification -#include "slib01cd.cc" // compute initial state vector -#include "slib01ad.cc" // compute singular values - - -// stub function to avoid gen_doc_cache warning upon package installation -DEFUN_DLD (control_slicot_functions, args, nargout, - "-*- texinfo -*-\n\ -Slicot Release 5.0\n\ -No argument checking.\n\ -For internal use only.") -{ - octave_value_list retval; - error ("control_slicot_functions: for internal use only"); - return retval; -} - Modified: trunk/octave-forge/main/control/src/slab01od.cc =================================================================== --- trunk/octave-forge/main/control/src/slab01od.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab01od.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -49,8 +49,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab01od", "control_slicot_functions.oct"); -DEFUN_DLD (slab01od, args, nargout, +// PKG_ADD: autoload ("__sl_ab01od__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab01od__, args, nargout, "-*- texinfo -*-\n\ Slicot AB01OD Release 5.0\n\ No argument checking.\n\ @@ -118,10 +118,10 @@ info)); if (f77_exception_encountered) - error ("slab01od: exception in SLICOT subroutine AB01OD"); + error ("__sl_ab01od__: exception in SLICOT subroutine AB01OD"); if (info != 0) - error ("slab01od: AB01OD returned info = %d", info); + error ("__sl_ab01od__: AB01OD returned info = %d", info); // resize a.resize (n, n); Modified: trunk/octave-forge/main/control/src/slab04md.cc =================================================================== --- trunk/octave-forge/main/control/src/slab04md.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab04md.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -47,8 +47,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab04md", "control_slicot_functions.oct"); -DEFUN_DLD (slab04md, args, nargout, +// PKG_ADD: autoload ("__sl_ab04md__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab04md__, args, nargout, "-*- texinfo -*-\n\ Slicot AB04MD Release 5.0\n\ No argument checking.\n\ @@ -113,10 +113,10 @@ info)); if (f77_exception_encountered) - error ("slab04md: exception in SLICOT subroutine AB04MD"); + error ("__sl_ab04md__: exception in SLICOT subroutine AB04MD"); if (info != 0) - error ("slab04md: AB04MD returned info = %d", info); + error ("__sl_ab04md__: AB04MD returned info = %d", info); // return values retval(0) = a; Modified: trunk/octave-forge/main/control/src/slab08nd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab08nd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab08nd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -64,8 +64,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab08nd", "control_slicot_functions.oct"); -DEFUN_DLD (slab08nd, args, nargout, +// PKG_ADD: autoload ("__sl_ab08nd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab08nd__, args, nargout, "-*- texinfo -*-\n\ Slicot AB08ND Release 5.0\n\ No argument checking.\n\ @@ -151,10 +151,10 @@ info)); if (f77_exception_encountered) - error ("ss: zero: slab08nd: exception in SLICOT subroutine AB08ND"); + error ("ss: zero: __sl_ab08nd__: exception in SLICOT subroutine AB08ND"); if (info != 0) - error ("ss: zero: slab08nd: AB08ND returned info = %d", info); + error ("ss: zero: __sl_ab08nd__: AB08ND returned info = %d", info); // DGGEV Part @@ -188,10 +188,10 @@ info2)); if (f77_exception_encountered) - error ("ss: zero: slab08nd: exception in LAPACK subroutine DGGEV"); + error ("ss: zero: __sl_ab08nd__: exception in LAPACK subroutine DGGEV"); if (info2 != 0) - error ("ss: zero: slab08nd: DGGEV returned info = %d", info2); + error ("ss: zero: __sl_ab08nd__: DGGEV returned info = %d", info2); // calculate gain octave_value gain = Matrix (0, 0);; Modified: trunk/octave-forge/main/control/src/slab09hd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab09hd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab09hd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -51,8 +51,8 @@ int& IWARN, int& INFO); } -// PKG_ADD: autoload ("slab09hd", "control_slicot_functions.oct"); -DEFUN_DLD (slab09hd, args, nargout, +// PKG_ADD: autoload ("__sl_ab09hd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab09hd__, args, nargout, "-*- texinfo -*-\n\ Slicot AB09HD Release 5.0\n\ No argument checking.\n\ @@ -105,7 +105,7 @@ job = 'P'; break; default: - error ("slab09hd: argument job invalid"); + error ("__sl_ab09hd__: argument job invalid"); } if (idico == 0) Modified: trunk/octave-forge/main/control/src/slab09id.cc =================================================================== --- trunk/octave-forge/main/control/src/slab09id.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab09id.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -61,8 +61,8 @@ int& IWARN, int& INFO); } -// PKG_ADD: autoload ("slab09id", "control_slicot_functions.oct"); -DEFUN_DLD (slab09id, args, nargout, +// PKG_ADD: autoload ("__sl_ab09id__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab09id__, args, nargout, "-*- texinfo -*-\n\ Slicot AB09ID Release 5.0\n\ No argument checking.\n\ @@ -157,7 +157,7 @@ job = 'P'; break; default: - error ("slab09id: argument job invalid"); + error ("__sl_ab09id__: argument job invalid"); } switch (iweight) @@ -175,7 +175,7 @@ weight = 'B'; break; default: - error ("slab09id: argument weight invalid"); + error ("__sl_ab09id__: argument weight invalid"); } int n = a.rows (); // n: number of states Modified: trunk/octave-forge/main/control/src/slab09jd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab09jd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab09jd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -59,8 +59,8 @@ int& IWARN, int& INFO); } -// PKG_ADD: autoload ("slab09jd", "control_slicot_functions.oct"); -DEFUN_DLD (slab09jd, args, nargout, +// PKG_ADD: autoload ("__sl_ab09jd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab09jd__, args, nargout, "-*- texinfo -*-\n\ Slicot AB09JD Release 5.0\n\ No argument checking.\n\ @@ -128,7 +128,7 @@ jobv = 'R'; break; default: - error ("slab09jd: argument jobv invalid"); + error ("__sl_ab09jd__: argument jobv invalid"); } switch (ijobw) @@ -149,7 +149,7 @@ jobw = 'R'; break; default: - error ("slab09jd: argument jobw invalid"); + error ("__sl_ab09jd__: argument jobw invalid"); } switch (ijobinv) @@ -164,7 +164,7 @@ jobinv = 'A'; break; default: - error ("slab09jd: argument jobinv invalid"); + error ("__sl_ab09jd__: argument jobinv invalid"); } if (idico == 0) Modified: trunk/octave-forge/main/control/src/slab13ad.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13ad.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab13ad.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -46,8 +46,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab13ad", "control_slicot_functions.oct"); -DEFUN_DLD (slab13ad, args, nargout, +// PKG_ADD: autoload ("__sl_ab13ad__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab13ad__, args, nargout, "-*- texinfo -*-\n\ Slicot AB13AD Release 5.0\n\ No argument checking.\n\ @@ -120,10 +120,10 @@ info)); if (f77_exception_encountered) - error ("hsvd: slab13ad: exception in SLICOT subroutine AB13AD"); + error ("hsvd: __sl_ab13ad__: exception in SLICOT subroutine AB13AD"); if (info != 0) - error ("hsvd: slab13ad: AB13AD returned info = %d", info); + error ("hsvd: __sl_ab13ad__: AB13AD returned info = %d", info); // resize hsv.resize (ns); Modified: trunk/octave-forge/main/control/src/slab13bd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13bd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab13bd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -47,8 +47,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab13bd", "control_slicot_functions.oct"); -DEFUN_DLD (slab13bd, args, nargout, +// PKG_ADD: autoload ("__sl_ab13bd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab13bd__, args, nargout, "-*- texinfo -*-\n\ Slicot AB13BD Release 5.\n\ No argument checking.\n\ @@ -120,13 +120,13 @@ info); if (f77_exception_encountered) - error ("lti: norm: slab13bd: exception in SLICOT subroutine AB13BD"); + error ("lti: norm: __sl_ab13bd__: exception in SLICOT subroutine AB13BD"); if (info != 0) - error ("lti: norm: slab13bd: AB13BD returned info = %d", info); + error ("lti: norm: __sl_ab13bd__: AB13BD returned info = %d", info); if (iwarn != 0) - warning ("lti: norm: slab13bd: AB13BD returned iwarn = %d", iwarn); + warning ("lti: norm: __sl_ab13bd__: AB13BD returned iwarn = %d", iwarn); // return value retval(0) = octave_value (norm); Modified: trunk/octave-forge/main/control/src/slab13dd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13dd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slab13dd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -51,8 +51,8 @@ int& INFO); } -// PKG_ADD: autoload ("slab13dd", "control_slicot_functions.oct"); -DEFUN_DLD (slab13dd, args, nargout, +// PKG_ADD: autoload ("__sl_ab13dd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ab13dd__, args, nargout, "-*- texinfo -*-\n\ Slicot AB13DD Release 5.0\n\ No argument checking.\n\ @@ -145,10 +145,10 @@ info)); if (f77_exception_encountered) - error ("lti: norm: slab13dd: exception in SLICOT subroutine AB13DD"); + error ("lti: norm: __sl_ab13dd__: exception in SLICOT subroutine AB13DD"); if (info != 0) - error ("lti: norm: slab13dd: AB13DD returned info = %d", info); + error ("lti: norm: __sl_ab13dd__: AB13DD returned info = %d", info); // return values retval(0) = fpeak; Modified: trunk/octave-forge/main/control/src/slag08bd.cc =================================================================== --- trunk/octave-forge/main/control/src/slag08bd.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slag08bd.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -64,8 +64,8 @@ int& INFO); } -// PKG_ADD: autoload ("slag08bd", "control_slicot_functions.oct"); -DEFUN_DLD (slag08bd, args, nargout, +// PKG_ADD: autoload ("__sl_ag08bd__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ag08bd__, args, nargout, "-*- texinfo -*-\n\ Slicot AG08BD Release 5.0\n\ No argument checking.\n\ @@ -154,10 +154,10 @@ info)); if (f77_exception_encountered) - error ("dss: zero: slag08bd: exception in SLICOT subroutine AG08BD"); + error ("dss: zero: __sl_ag08bd__: exception in SLICOT subroutine AG08BD"); if (info != 0) - error ("dss: zero: slag08bd: AG08BD returned info = %d", info); + error ("dss: zero: __sl_ag08bd__: AG08BD returned info = %d", info); // DGGEV Part @@ -197,10 +197,10 @@ info2)); if (f77_exception_encountered) - error ("dss: zero: slag08bd: exception in LAPACK subroutine DGGEV"); + error ("dss: zero: __sl_ag08bd__: exception in LAPACK subroutine DGGEV"); if (info2 != 0) - error ("dss: zero: slag08bd: DGGEV returned info = %d", info2); + error ("dss: zero: __sl_ag08bd__: DGGEV returned info = %d", info2); // assemble complex vector - adapted from DEFUN complex in data.cc // LAPACK DGGEV.f says: Modified: trunk/octave-forge/main/control/src/slib01ad.cc =================================================================== --- trunk/octave-forge/main/control/src/slib01ad.cc 2012-09-04 01:58:03 UTC (rev 10958) +++ trunk/octave-forge/main/control/src/slib01ad.cc 2012-09-04 09:09:48 UTC (rev 10959) @@ -50,8 +50,8 @@ int& IWARN, int& INFO); } -// PKG_ADD: autoload ("slib01ad", "control_slicot_functions.oct"); -DEFUN_DLD (slib01ad, args, nargout, +// PKG_ADD: autoload ("__sl_ib01ad__", "__control_slicot_functions__.oct"); +DEFUN_DLD (__sl_ib01ad__, args, nargout, "-*- texinfo -*-\n\ Slicot IB01AD Release 5.0\n\ No argument checking.\n\ @@ -111,7 +111,7 @@ meth_b = 'C'; break; default: - error ("slib01ad: argument 'meth' invalid"); + error ("__sl_ib01ad__: argument 'meth' invalid"); } switch (ialg) @@ -126,7 +126,7 @@ alg = 'Q'; break; default: - error ("slib01ad: argument 'alg' invalid"); + error ("__sl_ib01ad__: argument 'alg' invalid"); } if (meth_a == 'M') @@ -159,7 +159,7 @@ else if (meth_a == 'N' || (meth_a == 'M' && jobd == 'N')) ldr = 2*(m+l)*nobr; else - ... [truncated message content] |
From: <par...@us...> - 2012-09-13 17:51:09
|
Revision: 11004 http://octave.svn.sourceforge.net/octave/?rev=11004&view=rev Author: paramaniac Date: 2012-09-13 17:50:58 +0000 (Thu, 13 Sep 2012) Log Message: ----------- control: first draft code for multiplot nyquist Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/bode2.m trunk/octave-forge/main/control/devel/multiplot.m Added Paths: ----------- trunk/octave-forge/main/control/devel/nyquist2.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-09-13 16:47:24 UTC (rev 11003) +++ trunk/octave-forge/main/control/NEWS 2012-09-13 17:50:58 UTC (rev 11004) @@ -11,8 +11,11 @@ ** sensitivity Fixed a problem where an error was raised about an undefined function "issiso". - +** All SLICOT function names have now leading and trailing underscores to + emphasize their private nature. + + =============================================================================== control-2.3.53 Release Date: 2012-08-27 Release Manager: Lukas Reichlin =============================================================================== Modified: trunk/octave-forge/main/control/devel/bode2.m =================================================================== --- trunk/octave-forge/main/control/devel/bode2.m 2012-09-13 16:47:24 UTC (rev 11003) +++ trunk/octave-forge/main/control/devel/bode2.m 2012-09-13 17:50:58 UTC (rev 11004) @@ -94,7 +94,7 @@ else mag_r = mag{1}; pha_r = pha{1}; - w_r = w; + w_r = w{1}; endif endfunction \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/multiplot.m =================================================================== --- trunk/octave-forge/main/control/devel/multiplot.m 2012-09-13 16:47:24 UTC (rev 11003) +++ trunk/octave-forge/main/control/devel/multiplot.m 2012-09-13 17:50:58 UTC (rev 11004) @@ -9,4 +9,8 @@ % bode2 (5*C_AH, frd (C_AH, 1:10), frd (C_opt, 11:20)) figure (3) -bode2 (5*C_AH, '*r', C_AH, ':b', C_opt, '-.k') \ No newline at end of file +bode2 (5*C_AH, '*r', C_AH, 'xb', C_opt, 'ok') + + +figure (4) +nyquist2 (C_AH, C_opt) \ No newline at end of file Added: trunk/octave-forge/main/control/devel/nyquist2.m =================================================================== --- trunk/octave-forge/main/control/devel/nyquist2.m (rev 0) +++ trunk/octave-forge/main/control/devel/nyquist2.m 2012-09-13 17:50:58 UTC (rev 11004) @@ -0,0 +1,85 @@ +## Copyright (C) 2009, 2010, 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{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. +## Alternatively, the cell @code{@{wmin, wmax@}} specifies a frequency range, +## where @var{wmin} and @var{wmax} denote minimum and maximum frequencies +## in rad/s. +## @end table +## +## @strong{Outputs} +## @table @var +## @item 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 + +## Author: Lukas Reichlin <luk...@gm...> +## Created: November 2009 +## Version: 0.4 + +function [re_r, im_r, w_r] = nyquist2 (varargin) + + if (nargin == 0) + print_usage (); + endif + + [H, w] = __frequency_response_2__ (varargin, false, 0, "ext"); + + H = cellfun (@reshape, H, {[]}, {1}, "uniformoutput", false); + re = cellfun (@real, H, "uniformoutput", false); + im = cellfun (@imag, H, "uniformoutput", false); + + if (! nargout) + args = {}; + for k = 1 : numel (H) + args = cat (2, args, re{k}, im{k}, "-", re{k}, -im{k}, "-."); + endfor + + plot (args{:}) + axis ("tight") + xlim (__axis_margin__ (xlim)) + ylim (__axis_margin__ (ylim)) + grid ("on") + title ("Nyquist Diagram") + xlabel ("Real Axis") + ylabel ("Imaginary Axis") + else + re_r = re{1}; + im_r = im{1}; + w_r = w{1}; + endif + +endfunction \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-14 11:40:49
|
Revision: 11011 http://octave.svn.sourceforge.net/octave/?rev=11011&view=rev Author: paramaniac Date: 2012-09-14 11:40:39 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: move multiplot functions into place Modified Paths: -------------- trunk/octave-forge/main/control/devel/bode2.m trunk/octave-forge/main/control/inst/__frequency_response__.m trunk/octave-forge/main/control/inst/__frequency_vector__.m trunk/octave-forge/main/control/inst/bode.m trunk/octave-forge/main/control/inst/nyquist.m Modified: trunk/octave-forge/main/control/devel/bode2.m =================================================================== --- trunk/octave-forge/main/control/devel/bode2.m 2012-09-14 11:33:41 UTC (rev 11010) +++ trunk/octave-forge/main/control/devel/bode2.m 2012-09-14 11:40:39 UTC (rev 11011) @@ -109,4 +109,4 @@ w_r = w{1}; endif -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/inst/__frequency_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 11:33:41 UTC (rev 11010) +++ trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 11:40:39 UTC (rev 11011) @@ -21,35 +21,47 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.4 +## Version: 0.5 -function [H, w] = __frequency_response__ (sys, w = [], mimoflag = 0, resptype = 0, wbounds = "std", cellflag = false) +function [H, w] = __frequency_response__ (args, mimoflag = 0, resptype = 0, wbounds = "std", cellflag = false) + %if (! iscell (args)) + % args = {args}; + %endif + + sys_idx = cellfun (@isa, args, {"lti"}); # look for LTI models + w_idx = cellfun (@is_real_vector, args); # look for frequency vectors + r_idx = cellfun (@iscell, args); # look for frequency ranges {wmin, wmax} + + sys_cell = args(sys_idx); # extract LTI models + frd_idx = cellfun (@isa, sys_cell, {"frd"}); # look for FRD models + ## check arguments - if(! isa (sys, "lti")) - error ("frequency_response: first argument sys must be an LTI system"); + if (! mimoflag && ! all (cellfun (@issiso, sys_cell))) + error ("frequency_response: require SISO systems"); endif - if (! mimoflag && ! issiso (sys)) - error ("frequency_response: require SISO system"); - endif - - if (isa (sys, "frd")) - if (! isempty (w)) - warning ("frequency_response: second argument w is ignored"); + ## determine frequencies + if (any (r_idx)) # if there are frequency ranges + r = args(r_idx){end}; # take the last one + if (numel (r) == 2 && issample (r{1}) && issample (r{2})) + w = __frequency_vector__ (sys_cell, wbounds, r{1}, r{2}); + else + error ("frequency_response: invalid cell"); endif - w = get (sys, "w"); - H = __freqresp__ (sys, [], resptype, cellflag); - elseif (isempty (w)) # find interesting frequency range w if not specified - w = __frequency_vector__ (sys, wbounds); - H = __freqresp__ (sys, w, resptype, cellflag); - elseif (iscell (w) && numel (w) == 2 && issample (w{1}) && issample (w{2})) - w = __frequency_vector__ (sys, wbounds, w{1}, w{2}); - H = __freqresp__ (sys, w, resptype, cellflag); - elseif (! is_real_vector (w)) - error ("frequency_response: second argument w must be a vector of frequencies"); - else - H = __freqresp__ (sys, w, resptype, cellflag); + elseif (any (w_idx)) # are there any frequency vectors? + w = args(w_idx){end}; + else # there are neither frequency ranges nor vectors + w = __frequency_vector__ (sys_cell, wbounds); endif + w_frd = w(frd_idx); # temporarily save frequency vectors of FRD models + w(frd_idx) = {[]}; # freqresp returns all frequencies of FRD models for w=[] + + ## compute frequency response H for all LTI models + H = cellfun (@__freqresp__, sys_cell, w, {resptype}, {cellflag}, "uniformoutput", false); + + ## restore frequency vectors of FRD models in w + w(frd_idx) = w_frd; + endfunction Modified: trunk/octave-forge/main/control/inst/__frequency_vector__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_vector__.m 2012-09-14 11:33:41 UTC (rev 11010) +++ trunk/octave-forge/main/control/inst/__frequency_vector__.m 2012-09-14 11:40:39 UTC (rev 11011) @@ -1,7 +1,7 @@ ## Copyright (C) 1996, 2000, 2004, 2005, 2006, 2007 ## Auburn University. All rights reserved. +## Copyright (C) 2009 - 2012 Lukas F. Reichlin ## -## ## 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 @@ -35,14 +35,85 @@ ## Adapted-By: Lukas Reichlin <luk...@gm...> ## Date: October 2009 -## Version: 0.3 +## Version: 0.4 -function w = __frequency_vector__ (sys, wbounds = "std", wmin, wmax) +function w = __frequency_vector__ (sys_cell, wbounds = "std", wmin, wmax) + isc = iscell (sys_cell); + + if (! isc) # __sys2frd__ methods pass LTI models not in cells + sys_cell = {sys_cell} + endif + + idx = cellfun (@(x) isa (x, "lti"), sys_cell); + sys_cell = sys_cell(idx); + len = numel (sys_cell); + + [dec_min, dec_max, zp] = cellfun (@__frequency_range__, sys_cell, {wbounds}, "uniformoutput", false); + + if (strcmpi (wbounds, "std")) # plots with explicit frequencies + + if (nargin == 2) + dec_min = min (cell2mat (dec_min)); + dec_max = max (cell2mat (dec_max)); + elseif (nargin == 4) # w = {wmin, wmax} + dec_min = log10 (wmin); + dec_max = log10 (wmax); + else + print_usage (); + endif + + zp = horzcat (zp{:}); + + ## include zeros and poles for nice peaks in plots + 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 + + w = repmat ({w}, 1, len); # return cell of frequency vectors + + elseif (strcmpi (wbounds, "ext")) # plots with implicit frequencies + + if (nargin == 4) + dec_min = repmat ({log10 (wmin)}, 1, len); + dec_max = repmat ({log10 (wmax)}, 1, len); + endif + + idx = cellfun (@(zp, dec_min, dec_max) find (zp > 10^dec_min & zp < 10^dec_max), \ + zp, dec_min, dec_max, "uniformoutput", false); + zp = cellfun (@(zp, idx) zp(idx), zp, idx, "uniformoutput", false); + + w = cellfun (@logspace, dec_min, dec_max, {500}, "uniformoutput", false); + w = cellfun (@(w, zp) unique ([w, zp]), w, zp, "uniformoutput", false); + ## unique also sorts frequency vector + + else + error ("frequency_vector: invalid argument 'wbounds'"); + endif + + if (! isc) # for __sys2frd__ methods + w = w{1}; + endif + +endfunction + + +function [dec_min, dec_max, zp] = __frequency_range__ (sys, wbounds = "std") + + if (isa (sys, "frd")) + w = get (sys, "w"); + dec_min = log10 (w(1)); + dec_max = log10 (w(end)); + zp = []; + return; + endif + 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 + 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, 1, []); @@ -85,8 +156,8 @@ if (isempty (iip) && isempty (iiz)) ## no poles/zeros away from omega = 0; pick defaults - dec_min = 0; # -1 - dec_max = 2; # 3 + 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])))); @@ -94,7 +165,7 @@ ## expand to show the entirety of the "interesting" portion of the plot switch (wbounds) - case "std" # standard + case "std" # standard if (dec_min == dec_max) dec_min -= 2; dec_max += 2; @@ -102,8 +173,8 @@ dec_min--; dec_max++; endif - case "ext" # extended (for nyquist) - if (any (abs (pol) < sqrt (eps))) # look for integrators + case "ext" # extended (for nyquist) + if (any (abs (pol) < sqrt (eps))) # look for integrators ## dec_min -= 0.5; dec_max += 2; else @@ -119,17 +190,7 @@ dec_max = log10 (pi/tsam); endif - if (nargin == 4) # w = {wmin, wmax} - dec_min = log10 (wmin); - dec_max = log10 (wmax); - endif - - ## create frequency vector + ## include zeros and poles for nice peaks in plots 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 Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2012-09-14 11:33:41 UTC (rev 11010) +++ trunk/octave-forge/main/control/inst/bode.m 2012-09-14 11:40:39 UTC (rev 11011) @@ -48,50 +48,65 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.4 +## Version: 0.5 -function [mag_r, pha_r, w_r] = bode (sys, w = []) +function [mag_r, pha_r, w_r] = bode (varargin) - ## TODO: multiplot feature: bode (sys1, "b", sys2, "r", ...) - - if (nargin == 0 || nargin > 2) + if (nargin == 0) print_usage (); endif - [H, w] = __frequency_response__ (sys, w, false, 0, "std"); + [H, w] = __frequency_response__ (varargin, false, 0, "std", false); + + H = cellfun (@reshape, H, {[]}, {1}, "uniformoutput", false); + mag = cellfun (@abs, H, "uniformoutput", false); + pha = cellfun (@(H) unwrap (arg (H)) * 180 / pi, H, "uniformoutput", false); - H = reshape (H, [], 1); - mag = abs (H); - pha = unwrap (arg (H)) * 180 / pi; - if (! nargout) - mag_db = 20 * log10 (mag); + mag_db = cellfun (@(mag) 20 * log10 (mag), mag, "uniformoutput", false); - if (isct (sys)) - xl_str = "Frequency [rad/s]"; - else - xl_str = sprintf ("Frequency [rad/s] w_N = %g", pi / get (sys, "tsam")); - endif + tmp = cellfun (@isa, varargin, {"lti"}); + sys_idx = find (tmp); + tmp = cellfun (@ischar, varargin); + style_idx = find (tmp); + len = numel (H); + mag_args = {}; + pha_args = {}; + legend_args = cell (len, 1); + + for k = 1:len + if (k == len) + lim = nargin; + else + lim = sys_idx(k+1); + endif + style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); + mag_args = cat (2, mag_args, w(k), mag_db(k), style); + pha_args = cat (2, pha_args, w(k), pha(k), style); + legend_args{k} = inputname(sys_idx(k)); + endfor + subplot (2, 1, 1) - semilogx (w, mag_db) + semilogx (mag_args{:}) axis ("tight") ylim (__axis_margin__ (ylim)) grid ("on") - title (["Bode Diagram of ", inputname(1)]) + title ("Bode Diagram") ylabel ("Magnitude [dB]") subplot (2, 1, 2) - semilogx (w, pha) + semilogx (pha_args{:}) axis ("tight") ylim (__axis_margin__ (ylim)) grid ("on") - xlabel (xl_str) + xlabel ("Frequency [rad/s]") ylabel ("Phase [deg]") + legend (legend_args) else - mag_r = mag; - pha_r = pha; - w_r = w; + mag_r = mag{1}; + pha_r = pha{1}; + w_r = w{1}; endif -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/inst/nyquist.m =================================================================== --- trunk/octave-forge/main/control/inst/nyquist.m 2012-09-14 11:33:41 UTC (rev 11010) +++ trunk/octave-forge/main/control/inst/nyquist.m 2012-09-14 11:40:39 UTC (rev 11011) @@ -48,35 +48,68 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.3 +## Version: 0.4 -function [re_r, im_r, w_r] = nyquist (sys, w = []) +function [re_r, im_r, w_r] = nyquist2 (varargin) - ## TODO: multiplot feature: nyquist (sys1, "b", sys2, "r", ...) - - if (nargin == 0 || nargin > 2) + if (nargin == 0) print_usage (); endif - [H, w] = __frequency_response__ (sys, w, false, 0, "ext"); + [H, w] = __frequency_response__ (varargin, false, 0, "ext"); - H = reshape (H, [], 1); - re = real (H); - im = imag (H); + H = cellfun (@reshape, H, {[]}, {1}, "uniformoutput", false); + re = cellfun (@real, H, "uniformoutput", false); + im = cellfun (@imag, H, "uniformoutput", false); if (! nargout) - plot (re, im, "b", re, -im, "r") + tmp = cellfun (@isa, varargin, {"lti"}); + sys_idx = find (tmp); + tmp = cellfun (@ischar, varargin); + style_idx = find (tmp); + + len = numel (H); + pos_args = {}; + neg_args = {}; + legend_args = cell (len, 1); + colororder = get (gca, "colororder"); + rc = rows (colororder); + + for k = 1:len + col = colororder(1+rem (k-1, rc), :); + if (k == len) + lim = nargin; + else + lim = sys_idx(k+1); + endif + style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); + if (isempty (style)) + pos_args = cat (2, pos_args, re{k}, im{k}, {"-", "color", col}); + neg_args = cat (2, neg_args, re{k}, -im{k}, {"-.", "color", col}); + else + pos_args = cat (2, pos_args, re{k}, im{k}, style); + neg_args = cat (2, neg_args, re{k}, -im{k}, style); + endif + legend_args{k} = inputname(sys_idx(k)); + endfor + + ## FIXME: pos_args = cat (2, pos_args, re{k}, im{k}, {"-", "color", col}, style); + ## doesn't work! it would be nice to have default arguments that can be + ## (partially) overwritten by user-specified plot styles. + + h = plot (pos_args{:}, neg_args{:}); axis ("tight") xlim (__axis_margin__ (xlim)) ylim (__axis_margin__ (ylim)) grid ("on") - title (["Nyquist Diagram of ", inputname(1)]) + title ("Nyquist Diagram") xlabel ("Real Axis") ylabel ("Imaginary Axis") + legend (h(1:len), legend_args) else - re_r = re; - im_r = im; - w_r = w; + re_r = re{1}; + im_r = im{1}; + w_r = w{1}; endif -endfunction \ No newline at end of file +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-14 14:31:31
|
Revision: 11015 http://octave.svn.sourceforge.net/octave/?rev=11015&view=rev Author: paramaniac Date: 2012-09-14 14:31:20 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: quicksave work on further multiplot features Modified Paths: -------------- trunk/octave-forge/main/control/inst/__frequency_response__.m trunk/octave-forge/main/control/inst/bode.m trunk/octave-forge/main/control/inst/sigma.m Added Paths: ----------- trunk/octave-forge/main/control/devel/MDSSystem2.m Added: trunk/octave-forge/main/control/devel/MDSSystem2.m =================================================================== --- trunk/octave-forge/main/control/devel/MDSSystem2.m (rev 0) +++ trunk/octave-forge/main/control/devel/MDSSystem2.m 2012-09-14 14:31:20 UTC (rev 11015) @@ -0,0 +1,154 @@ +%% -*- texinfo -*- +%% Robust control of a mass-damper-spring system. +%% Type @code{which MDSSystem} to locate, +%% @code{edit MDSSystem} to open and simply +%% @code{MDSSystem} to run the example file. + +% =============================================================================== +% 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 +% =============================================================================== + +% Tabula Rasa +clear all, close all, clc + +% =============================================================================== +% System Model +% =============================================================================== +% +---------------+ +% | 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 +% +---------------+ + +% 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 ]; + +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], ... + 'inputname', inname, 'outputname', outname); + +G = G_nom(4, 4); % extract output y and input u + + +% =============================================================================== +% 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]); + +% Bode Plots of Perturbed Plants +w = logspace (-1, 1, 100); % frequency vector +Delta = arrayfun (@(m, c, k) diag ([m, c, k]), delta_m(:), delta_c(:), delta_k(:), 'uniformoutput', false); +G_per = cellfun (@lft, Delta, {G_nom}, 'uniformoutput', false); + +figure (1) +bode (G_per{:}, w); + + +% =============================================================================== +% Mixed Sensitivity H-infinity Controller Design (S over KS Method) +% =============================================================================== +% +-------+ +% +--------------------->| W_p |----------> e_p +% | +-------+ +% | +-------+ +% | +---->| W_u |----------> e_u +% | | +-------+ +% | | +---------+ +% | | ->| |-> +% r + e | +-------+ u | | G_nom | +% ----->(+)---+-->| K |----+--->| |----+----> y +% ^ - +-------+ +---------+ | +% | | +% +-----------------------------------------+ + +% 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); % performance weighting +W_u = 10^-2; % control weighting + +% Synthesis +K_mix = mixsyn (G, W_p, W_u); % mixed-sensitivity H-infinity synthesis + +% Interconnections +L_mix = G * K_mix; % open loop +T_mix = feedback (L_mix); % closed loop + + +% =============================================================================== +% H-infinity Loop-Shaping Design (Normalized Coprime Factor Perturbations) +% =============================================================================== + +% Settings +W1 = 8 * (2*s + 1) / (0.9*s); % precompensator +W2 = 1; % postcompensator +factor = 1.1; % suboptimal controller + +% Synthesis +K_ncf = ncfsyn (G, W1, W2, factor); % positive feedback controller + +% Interconnections +K_ncf = -K_ncf; % negative feedback controller +L_ncf = G * K_ncf; % open loop +T_ncf = feedback (L_ncf); % closed loop + +% =============================================================================== + +% Plotting +figure (2) +bode (K_mix, K_ncf) % bode plot + +figure (3) +step (T_mix, 10) % step response for 10 seconds + +figure (4) +step (T_ncf, 10) % step response for 10 seconds + +% =============================================================================== Modified: trunk/octave-forge/main/control/inst/__frequency_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 12:02:15 UTC (rev 11014) +++ trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 14:31:20 UTC (rev 11015) @@ -30,7 +30,7 @@ %endif sys_idx = cellfun (@isa, args, {"lti"}); # look for LTI models - w_idx = cellfun (@is_real_vector, args); # look for frequency vectors + w_idx = cellfun (@(x) is_real_vector (x) && length (x) > 1, args); # look for frequency vectors r_idx = cellfun (@iscell, args); # look for frequency ranges {wmin, wmax} sys_cell = args(sys_idx); # extract LTI models @@ -50,7 +50,8 @@ error ("frequency_response: invalid cell"); endif elseif (any (w_idx)) # are there any frequency vectors? - w = args(w_idx)(end); + w = args(w_idx){end}; + w = repmat ({w}, 1, numel (sys_cell)); else # there are neither frequency ranges nor vectors w = __frequency_vector__ (sys_cell, wbounds); endif Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2012-09-14 12:02:15 UTC (rev 11014) +++ trunk/octave-forge/main/control/inst/bode.m 2012-09-14 14:31:20 UTC (rev 11015) @@ -84,7 +84,7 @@ style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); mag_args = cat (2, mag_args, w(k), mag_db(k), style); pha_args = cat (2, pha_args, w(k), pha(k), style); - legend_args{k} = inputname(sys_idx(k)); + legend_args{k} = inputname(sys_idx(k)); # watch out for bode (lticell{:}) endfor subplot (2, 1, 1) Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2012-09-14 12:02:15 UTC (rev 11014) +++ trunk/octave-forge/main/control/inst/sigma.m 2012-09-14 14:31:20 UTC (rev 11015) @@ -60,44 +60,56 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: May 2009 -## Version: 0.6 +## Version: 0.7 -function [sv_r, w_r] = sigma (sys, w = [], resptype = 0) +function [sv_r, w_r] = sigma (varargin) - ## TODO: multiplot feature: sigma (sys1, "b", sys2, "r", ...) - - if (nargin == 0 || nargin > 3) + if (nargin == 0) print_usage (); endif +resptype = 0; + [H, w] = __frequency_response__ (varargin, true, resptype, "std", true); - [H, w] = __frequency_response__ (sys, w, true, resptype, "std", true); + sv = cellfun (@(H) cellfun (@svd, H, "uniformoutput", false), H, "uniformoutput", false); + sv = cellfun (@(sv) horzcat (sv{:}), sv, "uniformoutput", false); - sv = cellfun (@svd, H, "uniformoutput", false); - sv = horzcat (sv{:}); - if (! nargout) # plot the information ## convert to dB for plotting - sv_db = 20 * log10 (sv); + sv_db = cellfun (@(sv) 20 * log10 (sv), sv, "uniformoutput", false); - ## determine xlabel - if (isct (sys)) - xl_str = "Frequency [rad/s]"; - else - xl_str = sprintf ("Frequency [rad/s] w_N = %g", pi / get (sys, "tsam")); - endif + tmp = cellfun (@isa, varargin, {"lti"}); + sys_idx = find (tmp); + tmp = cellfun (@ischar, varargin); + style_idx = find (tmp); + len = numel (H); + plot_args = {}; + legend_args = cell (len, 1); + + for k = 1:len + if (k == len) + lim = nargin; + else + lim = sys_idx(k+1); + endif + style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); + plot_args = cat (2, plot_args, w(k), sv_db(k), style); + legend_args{k} = inputname(sys_idx(k)); # watch out for sigma (lticell{:}) + endfor + ## plot results - semilogx (w, sv_db, "b") + semilogx (plot_args{:}) axis ("tight") ylim (__axis_margin__ (ylim)) grid ("on") - title (["Singular Values of ", inputname(1)]) - xlabel (xl_str) + title ("Singular Values") + xlabel ("Frequency [rad/s]") ylabel ("Singular Values [dB]") + legend (legend_args) else # return values - sv_r = sv; - w_r = reshape (w, [], 1); + sv_r = sv{1}; + w_r = reshape (w{1}, [], 1); endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-14 18:54:41
|
Revision: 11020 http://octave.svn.sourceforge.net/octave/?rev=11020&view=rev Author: paramaniac Date: 2012-09-14 18:54:35 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: finish pzmap Modified Paths: -------------- trunk/octave-forge/main/control/devel/test_pzmap.m trunk/octave-forge/main/control/inst/pzmap.m Removed Paths: ------------- trunk/octave-forge/main/control/devel/pzmap2.m Deleted: trunk/octave-forge/main/control/devel/pzmap2.m =================================================================== --- trunk/octave-forge/main/control/devel/pzmap2.m 2012-09-14 18:38:01 UTC (rev 11019) +++ trunk/octave-forge/main/control/devel/pzmap2.m 2012-09-14 18:54:35 UTC (rev 11020) @@ -1,86 +0,0 @@ -## Copyright (C) 2009, 2011 Lukas F. Reichlin -## -## This file is part of LTI Syncope. -## -## LTI Syncope is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## LTI Syncope is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} pzmap (@var{sys}) -## @deftypefnx {Function File} {[@var{p}, @var{z}] =} pzmap (@var{sys}) -## Plot the poles and zeros of an LTI system in the complex plane. -## If no output arguments are given, the result is plotted on the screen. -## Otherwise, the poles and zeros are computed and returned. -## -## @strong{Inputs} -## @table @var -## @item sys -## LTI model. -## @end table -## -## @strong{Outputs} -## @table @var -## @item p -## Poles of @var{sys}. -## @item z -## Transmission zeros of @var{sys}. -## @end table -## @end deftypefn - -## Author: Lukas Reichlin <luk...@gm...> -## Created: November 2009 -## Version: 0.1 - -function [pol_r, zer_r] = pzmap2 (varargin) - - ## TODO: multiplot feature: pzmap (sys1, "b", sys2, "r", ...) - - if (nargin == 0) - print_usage (); - endif - - % if (! isa (sys, "lti")) - % error ("pzmap: argument must be an LTI system"); - % endif - - pol = cellfun ("@lti/pole", varargin, "uniformoutput", false); - zer = cellfun ("@lti/zero", varargin, "uniformoutput", false); - - if (! nargout) - pol_re = cellfun (@real, pol, "uniformoutput", false); - pol_im = cellfun (@imag, pol, "uniformoutput", false); - zer_re = cellfun (@real, zer, "uniformoutput", false); - zer_im = cellfun (@imag, zer, "uniformoutput", false); - - len = numel (pol); - plot_args = {}; - legend_args = cell (len, 1); - colororder = get (gca, "colororder"); - for k = 1 : len - plot_args = cat (2, plot_args, pol_re(k), pol_im(k), {"x", "color", colororder(k,:)}, \ - zer_re(k), zer_im(k), {"o", "color", colororder(k,:)}); - legend_args{k} = inputname(k); - endfor - - h = plot (plot_args{:}); - grid ("on") - title ("Pole-Zero Map") - xlabel ("Real Axis") - ylabel ("Imaginary Axis") - legend (h(1:2:2*len), legend_args) - else - pol_r = pol{1}; - zer_r = zer{1}; - endif - -endfunction Modified: trunk/octave-forge/main/control/devel/test_pzmap.m =================================================================== --- trunk/octave-forge/main/control/devel/test_pzmap.m 2012-09-14 18:38:01 UTC (rev 11019) +++ trunk/octave-forge/main/control/devel/test_pzmap.m 2012-09-14 18:54:35 UTC (rev 11020) @@ -1,4 +1,4 @@ -pzmap2 (WestlandLynx, Boeing707, BMWengine) +pzmap (WestlandLynx, Boeing707, BMWengine) %__next_line_color__ ("reset") Modified: trunk/octave-forge/main/control/inst/pzmap.m =================================================================== --- trunk/octave-forge/main/control/inst/pzmap.m 2012-09-14 18:38:01 UTC (rev 11019) +++ trunk/octave-forge/main/control/inst/pzmap.m 2012-09-14 18:54:35 UTC (rev 11020) @@ -1,4 +1,4 @@ -## Copyright (C) 2009 Lukas F. Reichlin +## Copyright (C) 2009, 2011, 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -39,37 +39,66 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: November 2009 -## Version: 0.1 +## Version: 0.2 -function [pol_r, zer_r] = pzmap (sys) +function [pol_r, zer_r] = pzmap (varargin) - ## TODO: multiplot feature: pzmap (sys1, "b", sys2, "r", ...) - - if (nargin != 1) + if (nargin == 0) print_usage (); endif - if (! isa (sys, "lti")) - error ("pzmap: argument must be an LTI system"); - endif + sys_idx = cellfun (@isa, varargin, {"lti"}); # look for LTI models - pol = pole (sys); - zer = zero (sys); + pol = cellfun (@pole, varargin(sys_idx), "uniformoutput", false); + zer = cellfun (@zero, varargin(sys_idx), "uniformoutput", false); if (! nargout) - pol_re = real (pol); - pol_im = imag (pol); - zer_re = real (zer); - zer_im = imag (zer); + pol_re = cellfun (@real, pol, "uniformoutput", false); + pol_im = cellfun (@imag, pol, "uniformoutput", false); + zer_re = cellfun (@real, zer, "uniformoutput", false); + zer_im = cellfun (@imag, zer, "uniformoutput", false); + + sys_idx = find (sys_idx); + tmp = cellfun (@ischar, varargin); + style_idx = find (tmp); - plot (pol_re, pol_im, "xb", zer_re, zer_im, "or") + len = numel (pol); + pol_args = {}; + zer_args = {}; + legend_args = cell (len, 1); + colororder = get (gca, "colororder"); + rc = rows (colororder); + + for k = 1 : len + col = colororder(1+rem (k-1, rc), :); + if (k == len) + lim = nargin; + else + lim = sys_idx(k+1); + endif + style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); + if (isempty (style)) + pol_args = cat (2, pol_args, pol_re{k}, pol_im{k}, {"x", "color", col}); + zer_args = cat (2, zer_args, zer_re{k}, zer_im{k}, {"o", "color", col}); + else + pol_args = cat (2, pol_args, pol_re{k}, pol_im{k}, style); + zer_args = cat (2, zer_args, zer_re{k}, zer_im{k}, style); + endif + + ## FIXME: try to combine "x", "o" and style for custom colors + + legend_args{k} = inputname(sys_idx(k)); + endfor + + h = plot (pol_args{:}, zer_args{:}); grid ("on") - title (["Pole-Zero Map of ", inputname(1)]) + title ("Pole-Zero Map") xlabel ("Real Axis") ylabel ("Imaginary Axis") + legend (h(1:len), legend_args) else - pol_r = pol; - zer_r = zer; + pol_r = pol{1}; + zer_r = zer{1}; endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-14 19:23:09
|
Revision: 11021 http://octave.svn.sourceforge.net/octave/?rev=11021&view=rev Author: paramaniac Date: 2012-09-14 19:23:03 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: finish sigma (almost) Modified Paths: -------------- trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/inst/sigma.m Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-09-14 18:54:35 UTC (rev 11020) +++ trunk/octave-forge/main/control/NEWS 2012-09-14 19:23:03 UTC (rev 11021) @@ -4,6 +4,11 @@ control-2.3.54 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin =============================================================================== +** Multiplot feature for frequency-domain plotting: + + bode nichols pzmap + bodemag nyquist sigma + ** plot A selection of experiments from iddata identification datasets can be plotted by plot (dat, exp) instead of plot (dat(:,:,:,exp)). Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2012-09-14 18:54:35 UTC (rev 11020) +++ trunk/octave-forge/main/control/inst/sigma.m 2012-09-14 19:23:03 UTC (rev 11021) @@ -86,18 +86,28 @@ len = numel (H); plot_args = {}; legend_args = cell (len, 1); + colororder = get (gca, "colororder"); + rc = rows (colororder); for k = 1:len + col = colororder(1+rem (k-1, rc), :); if (k == len) lim = nargin; else lim = sys_idx(k+1); endif style = varargin(style_idx(style_idx > sys_idx(k) & style_idx <= lim)); - plot_args = cat (2, plot_args, w(k), sv_db(k), style); + if (isempty (style)) + plot_args = cat (2, plot_args, w(k), sv_db(k), {"-", "color", col}); + else + plot_args = cat (2, plot_args, w(k), sv_db(k), style); + endif legend_args{k} = inputname(sys_idx(k)); # watch out for sigma (lticell{:}) endfor + ## FIXME: legend color is mostly blue if the first system is MIMO + ## maybe we can plot each line of sv individually + ## plot results semilogx (plot_args{:}) axis ("tight") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-09-15 18:22:01
|
Revision: 11030 http://octave.svn.sourceforge.net/octave/?rev=11030&view=rev Author: paramaniac Date: 2012-09-15 18:21:52 +0000 (Sat, 15 Sep 2012) Log Message: ----------- control: prepare release of control-2.3.54 Modified Paths: -------------- trunk/octave-forge/main/control/DESCRIPTION trunk/octave-forge/main/control/NEWS trunk/octave-forge/main/control/devel/PROJECTS trunk/octave-forge/main/control/devel/__time_response_2__.m trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/devel/step2.m trunk/octave-forge/main/control/doc/control.pdf trunk/octave-forge/main/control/doc/control.tex trunk/octave-forge/main/control/doc/functions.texi Modified: trunk/octave-forge/main/control/DESCRIPTION =================================================================== --- trunk/octave-forge/main/control/DESCRIPTION 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/DESCRIPTION 2012-09-15 18:21:52 UTC (rev 11030) @@ -1,6 +1,6 @@ Name: Control -Version: 2.3.53 -Date: 2012-08-27 +Version: 2.3.54 +Date: 2012-09-15 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Modified: trunk/octave-forge/main/control/NEWS =================================================================== --- trunk/octave-forge/main/control/NEWS 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/NEWS 2012-09-15 18:21:52 UTC (rev 11030) @@ -1,7 +1,7 @@ Summary of important user-visible changes for releases of the control package =============================================================================== -control-2.3.54 Release Date: 2012-xx-yy Release Manager: Lukas Reichlin +control-2.3.54 Release Date: 2012-09-15 Release Manager: Lukas Reichlin =============================================================================== ** Multiplot feature for frequency-domain plotting: @@ -9,6 +9,12 @@ bode nichols pzmap bodemag nyquist sigma + The functions above support calls like + sigma (sys1, sys2, ...), nyquist (sys1, 'b', sys2, 'r', ...), + bode (sys1, '-k', sys2, '-.k', sys3, ':k', {wmin, wmax}). + Time domain functions are not yet multiplot ready, but they will follow in + control-2.4.0. + ** plot A selection of experiments from iddata identification datasets can be plotted by plot (dat, exp) instead of plot (dat(:,:,:,exp)). Modified: trunk/octave-forge/main/control/devel/PROJECTS =================================================================== --- trunk/octave-forge/main/control/devel/PROJECTS 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/devel/PROJECTS 2012-09-15 18:21:52 UTC (rev 11030) @@ -10,8 +10,8 @@ General: ------- - * Multiplot feature for time and frequency response functions. - sigma (sys1, sys2, ...), step (sys1, "b", sys2, "r", ...) + * Multiplot feature for time response functions and lsim. + impulse (sys1, sys2, ...), step (sys1, "b", sys2, "r", ...) * Improve @lti/subsasgn.m @@ -27,7 +27,8 @@ * Implement zpk models and @zpset similar to @tfpoly. - * SLICOT system identification. Under construction in extra/control-devel + * SLICOT non-linear system identification. + idnlmodel class and simulation of Wiener models with SLICOT. * Descriptor support for pole placement command "place". @@ -56,6 +57,8 @@ which override the generic commands (@lti/horzcat, @lti/vertcat) could make practical sense. + * Support more than two arguments in __sys_group__. + * Display individual warnings/errors for iwarn/info in oct-files. * Airtight argument checking for oct-files. Currently there are no checks Modified: trunk/octave-forge/main/control/devel/__time_response_2__.m =================================================================== --- trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-15 18:21:52 UTC (rev 11030) @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -20,7 +20,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: October 2009 -## Version: 0.2 +## Version: 0.3 % function [y, t, x_arr] = __time_response_2__ (sys, resptype, plotflag, tfinal, dt, x0, sysname) function [y, t, x_arr] = __time_response_2__ (resptype, args) Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-09-15 18:21:52 UTC (rev 11030) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.3.53 +@set VERSION 2.3.54 @finalout @c @afourwide @c %**end of header Modified: trunk/octave-forge/main/control/devel/step2.m =================================================================== --- trunk/octave-forge/main/control/devel/step2.m 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/devel/step2.m 2012-09-15 18:21:52 UTC (rev 11030) @@ -1,4 +1,4 @@ -## Copyright (C) 2009 Lukas F. Reichlin +## Copyright (C) 2009, 2012 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -54,7 +54,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: October 2009 -## Version: 0.1 +## Version: 0.2 % function [y_r, t_r, x_r] = step2 (sys, tfinal = [], dt = []) function [y_r, t_r, x_r] = step2 (varargin) @@ -72,9 +72,9 @@ [y, t, x] = __time_response__ ("step", varargin, ! nargout); if (nargout) - y_r = y; - t_r = t; - x_r = x; + y_r = y{1}; + t_r = t{1}; + x_r = x{1}; endif endfunction Modified: trunk/octave-forge/main/control/doc/control.pdf =================================================================== --- trunk/octave-forge/main/control/doc/control.pdf 2012-09-15 16:02:57 UTC (rev 11029) +++ trunk/octave-forge/main/control/doc/control.pdf 2012-09-15 18:21:52 UTC (rev 11030) @@ -42,7 +42,8 @@ >> stream xڅ\x90MK1\x86\xEF\xFB+rL3\x99\xCC&\xB9*\xB6 \xE2Gݞ\xC4ònk\xE9n\xAB\xE0\xBF7i\/\x8A\xC3̛y\x9F\xBC(L:(\xBC>\xF2\xA2\xDBV\xE6\xD4\x96\xA2\xB3i\x85_:\xC7\xEC(\xD5\xCA\xF4\xA8\xD3H\xDD?Kur\x8Eb\x9E7\xD5\xD9ij\xB0j,\x9AEƫ -\x817A4\xCF\xE2Qv\xFB\x9D"\x94\xC7a\xBFQ\x9A<Kɏ\xD4SsU]6\xD5\xEB\xF7\xEA\xF4\x90#\x83\xA70"\x8Cd\x89+\xEDz\xB1\xA8\xEE\x8B%\xB3@\xD1D̖d j\x8C\x82\x83\xF4\xBE\xF8^$_F_"\xF9\xF0q8\xF6[\xA5QJ\xE3.\xCF\xDB.\xDFk\xC5,\xDBe_\x8B\xFDP\x8A\xE9\xCD<N\xDEv\xC76\xEB\xDE\xF3\xD5g\xF6ӷ\xD1\xB9\xDAfmO\xDA\xC5 |
From: <par...@us...> - 2012-09-23 08:38:20
|
Revision: 11087 http://octave.svn.sourceforge.net/octave/?rev=11087&view=rev Author: paramaniac Date: 2012-09-23 08:38:14 +0000 (Sun, 23 Sep 2012) Log Message: ----------- control: style fix in time response code Modified Paths: -------------- trunk/octave-forge/main/control/devel/multiplot2.m trunk/octave-forge/main/control/inst/__time_response__.m Modified: trunk/octave-forge/main/control/devel/multiplot2.m =================================================================== --- trunk/octave-forge/main/control/devel/multiplot2.m 2012-09-22 22:03:02 UTC (rev 11086) +++ trunk/octave-forge/main/control/devel/multiplot2.m 2012-09-23 08:38:14 UTC (rev 11087) @@ -94,7 +94,7 @@ % Step Response of Closed Loop figure (2) -step2 (T, Tr4, Tr2) +step (T, Tr4, Tr2) %{ % Step Response of Closed Loop Modified: trunk/octave-forge/main/control/inst/__time_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__time_response__.m 2012-09-22 22:03:02 UTC (rev 11086) +++ trunk/octave-forge/main/control/inst/__time_response__.m 2012-09-23 08:38:14 UTC (rev 11087) @@ -166,16 +166,15 @@ color = colororder(1+rem (k-1, rc), :); style = {"color", color}; endif - discrete = ! ct_idx(k); - if (discrete) # discrete-time system + if (ct_idx(k)) # continuous-time system for i = 1 : p # for every output for j = 1 : cols # for every input (except for initial where cols=1) subplot (p, cols, (i-1)*cols+j); - stairs (t{k}, y{k}(:, i, j), style{:}); + plot (t{k}, y{k}(:, i, j), style{:}); hold on; grid on; if (k == n_sys) - axis tight; + axis tight ylim (__axis_margin__ (ylim)) if (j == 1) ylabel (outname{i}); @@ -186,20 +185,15 @@ endif endfor endfor - else # continuous-time system + else # discrete-time system for i = 1 : p # for every output for j = 1 : cols # for every input (except for initial where cols=1) subplot (p, cols, (i-1)*cols+j); - ##if (n_sys == 1 && isstable (sys_cell{1})) - ## plot (t{k}, y{k}(:, i, j), style{:}, [t{k}(1), t{k}(end)], repmat (yfinal(i,j), 1, 2)); - ## ## TODO: plot final value first such that its line doesn't overprint the response - ##else - plot (t{k}, y{k}(:, i, j), style{:}); - ##endif + stairs (t{k}, y{k}(:, i, j), style{:}); hold on; grid on; if (k == n_sys) - axis tight + axis tight; ylim (__axis_margin__ (ylim)) if (j == 1) ylabel (outname{i}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |