You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(19) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(11) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
|
Feb
(113) |
Mar
(12) |
Apr
(27) |
May
(2) |
Jun
(16) |
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(3) |
Nov
(9) |
Dec
(2) |
2012 |
Jan
(5) |
Feb
(11) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(18) |
Nov
(18) |
Dec
|
2013 |
Jan
(4) |
Feb
(1) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(33) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
|
Mar
(8) |
Apr
|
May
(3) |
Jun
(3) |
Jul
(9) |
Aug
(5) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: Richard M. <mu...@cd...> - 2014-03-27 15:29:54
|
Thanks, Roberto. Great that you have made use of the python-control toolbox and yottalab to implement some controllers in the lab. Very cool! I'll take a look at the alternative versions of c2d, dare and place/MIMO in yottalab and see if we can incorporate those. -richard On 24 Mar 2014, at 1:54 , Roberto Bucher <rob...@su...> wrote: > Thanks Richard for the great job!!! > > In the past weeks I did a presentation of your toolbox to the control > teachers of the Swiss universities: for this presentation I used your > toolbox and yottalab to design the controllers for different plants in > my lab: in particular I controlled a DC motor, the classical inverted > pendulum and a a "double disks and spring" system. The RT code was > direcly generated from Python for a Linux machine with the preempt_rt > patch. > In my opinion the toolbox is now enough mature to be used a good > alternative to other system, like Scilab, Scicoslab, Octave and > (partially) Matlab, not only for educational purposes! > > In my tests I did a double check: In a first phase I look if the results > of the code can be used for controlling the real plant, in a second > phase I compare the results of the functions with the ones of Matlab. > > In particular I found some problems with the implementation of "c2d", > "dare" (-> dlqr) and "place (MIMO systems!). I've implemented some > alternatives to these commands. > > Best regards > > Roberto > |
From: Roberto B. <rob...@su...> - 2014-03-24 09:54:31
|
Thanks Richard for the great job!!! In the past weeks I did a presentation of your toolbox to the control teachers of the Swiss universities: for this presentation I used your toolbox and yottalab to design the controllers for different plants in my lab: in particular I controlled a DC motor, the classical inverted pendulum and a a "double disks and spring" system. The RT code was direcly generated from Python for a Linux machine with the preempt_rt patch. In my opinion the toolbox is now enough mature to be used a good alternative to other system, like Scilab, Scicoslab, Octave and (partially) Matlab, not only for educational purposes! In my tests I did a double check: In a first phase I look if the results of the code can be used for controlling the real plant, in a second phase I compare the results of the functions with the ones of Matlab. In particular I found some problems with the implementation of "c2d", "dare" (-> dlqr) and "place (MIMO systems!). I've implemented some alternatives to these commands. Best regards Roberto On Sat, 2014-03-22 at 19:43 +0000, mur...@us... wrote: > Revision: 297 > http://sourceforge.net/p/python-control/code/297 > Author: murrayrm > Date: 2014-03-22 19:42:52 +0000 (Sat, 22 Mar 2014) > Log Message: > ----------- > tagged v0.6d and updated version to 0.6e > > Modified Paths: > -------------- > trunk/doc/conf.py > trunk/setup.py > > Added Paths: > ----------- > tags/control-0.6d/ > tags/control-0.6d/ChangeLog > tags/control-0.6d/external/yottalab.py > tags/control-0.6d/src/bdalg.py > tags/control-0.6d/src/dtime.py > tags/control-0.6d/src/frdata.py > tags/control-0.6d/src/matlab.py > tags/control-0.6d/tests/discrete_test.py > tags/control-0.6d/tests/frd_test.py > > Removed Paths: > ------------- > tags/control-0.6d/ChangeLog > tags/control-0.6d/external/yottalab.py > tags/control-0.6d/src/bdalg.py > tags/control-0.6d/src/dtime.py > tags/control-0.6d/src/frdata.py > tags/control-0.6d/src/matlab.py > tags/control-0.6d/tests/discrete_test.py > tags/control-0.6d/tests/frd_test.py > > Deleted: tags/control-0.6d/ChangeLog > =================================================================== > --- trunk/ChangeLog 2013-07-16 14:59:20 UTC (rev 293) > +++ tags/control-0.6d/ChangeLog 2014-03-22 19:42:52 UTC (rev 297) > @@ -1,1075 +0,0 @@ > -2013-07-15 Richard Murray <murray@altura-2.local> > - > - * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and > - __rtruediv__ for compatibility with python3 > - > -2013-07-14 Richard Murray <murray@altura-2.local> > - > - * src/dtime.py (sample_system): added check to make sure > - cont2discrete is available in scipy.signal > - (sample_system): added docstring > - > -2013-06-24 Richard Murray <murray@altura-2.local> > - > - * tests/minreal_test.py (TestMinreal.testMinrealBrute), > - src/xferfcn.py (_convertToTransferFunction), src/statesp.py > - (StateSpace.__rmul__), src/margins.py (stability_margins): changed > - exception syntax to be python3 compatibile (works for python2.6+) > - > -2013-06-10 Richard Murray <murray@altura-2.local> > - > - * src/xferfcn.py (TransferFunction.horner): small fix to docstring > - > - * src/freqplot.py (nyquist_plot): small fix to docstring > - > -2013-06-09 Richard Murray <murray@altura-2.local> > - > - * tests/bdalg_test.py (TestFeedback.testScalarSS) > - (TestFeedback.testScalarTF): added simple test of default argument > - to feedback() for state space and transfer function systems > - > - * tests/frd_test.py (TestFRD.testFeedback): added test of default > - argument to feedback() for FRD type > - > - * src/bdalg.py (feedback): > - * src/frdata.py (FRD.feedback): > - * src/statesp.py (StateSpace.feedback): > - patched in default value of 1 for other system in feedback(). > - Contributed by Ryan Krauss <rk...@si...> > - > - * tests/xferfcn_test.py (TestXferFcn.testEvalFrMIMO) > - (TestXferFcn.testEvalFrSISO): added tests of __call__ version of > - evalfr. > - > - * src/xferfcn.py (TransferFunction.__call__): patched in new > - __call__ functionality from Ryan Krauss <rk...@si...>, but > - modified to use evalfr (works with MIMO). SISO transfer functions > - return a single complex number, MIMO transfer functions return a > - matrix of complex numbers. > - > -2013-05-23 Rene van Paassen <ren...@gm...> > - > - * src/margin.py: re-vamped stability_margins function. Now > - uses analytical method for TF and state-space, works on FRD > - objects too, and can optionally return all margins found for > - the analytical method. > - > - * src/xferfcn.py and src/frdata.py: Now return array result > - for fresp when called with an iterable frequency vector > - > - * src/xferfcn.py and src/statesp.py: added minreal functions > - > - * src/bdalg.py: implemented append and connect functions (old > - version, with indexes, not with names) > - > - * src/matlab.py: added connect, append, minreal > - > - * src/xferfcn.py and src/statesp.py: added/corrected > - __rmul__. In most cases a gain matrix (np.matrix) may now be > - used in combination with ss or tf systems. > - > -2012-11-10 Richard Murray <murray@altura.local> > - > - * src/canonical.py: new module implementing conversions to selected > - canonical forms: canonical_form(), reachable_form() implemented > - > - * src/lti.py (issiso): new function to quickly check if a system is > - single input, single output or not > - > -2012-11-04 Richard Murray <murray@altura.local> > - > - * src/__init__.py: added action item to separate out matlab module > - functionality (eventually) > - > - * src/matlab.py: added code for setting up MATLAB defaults if matlab > - submodule is imported instead of main (control) module. See > - comments in __init.py__ for what needs to be done to implement. > - > - * src/freqplot.py (bode_plot): moved default values of plotting > - options to config module to allow easier use override > - > - * src/config.py: new module to help set package defaults > - > - * src/xferfcn.py (_convertToTransferFunction): removed extraneous > - print statements if slycot is not installed > - > - * src/statesp.py (StateSpace.__str__): fixed error in printing > - timebase when dt is None (python 3) > - > ----- control-0.6c released ----- > - > -2012-11-03 Richard Murray <murray@altura.local> > - > - * doc/modules.rst: updated documentation format so that items are > - broken down by functionality and not internal module name. Still > - not complete, but most functions should now show up in documentation. > - > - * doc/index.rst: got rid of todos from documentation (not formatted > - correctly and shouldn't show up in user documentation) > - > - * src/lti.py: added missing docstrings > - > - * doc/intro.rst: small tweaks to text, including adding a link to FBS > - > -2012-11-03 Richard Murray <murray@altura.local> > - > - * src/rlocus.py (_RLSortRoots): convert output of range() to > - explicit list for python 3 compatability > - > - * tests/modelsimp_test.py, tests/slycot_convert_test.py, > - tests/mateqn_test.py, tests/statefbk_test.py: updated test suites to > - skip specific tests that require slycot if it is not installed > - > - * src/exception.py (slycot_check): added a function to check if > - slycot is installed > - > - * README: updated readme to include information about running > - nosetests, which works in python3 (unlike the test_all.py script) > - > - * tests/test_control_matlab.py, tests/test_all.py: set to executable > - so that nosetests does not run this file (it already runs all unit > - tests in this directory). Add comments at top talking about tests. > - > - * tests/discrete_test.py (TestDiscrete.test_discrete_bode): > - explicitly create a list from map() output for python 3 > - > - * src/frdata.py: removed long data type from comparisons for > - constant systems (not supported in python3) > - > - * src/xferfcn.py (TransferFunction.freqresp): force frequencies to > - be a list (map returns iterator in python3) > - > - * src/lti.py (isdtime, isctime): updated timebase checking since > - python3 won't allow dt to be compared to integer > - > - * src/__init__.py: updated frdata import to python3 compatible form > - > - * src/statesp.py (_convertToStateSpace): fixed exception syntax to > - be python3 compatible > - > - * examples/pvtol-nested.py: converted print statements to be python3 > - compatible > - > - * doc/class_strings.rst: added FRD class to list of classes that > - show up in the user documentation > - > - * examples/rss-balred.py: fixed error in output argument order for > - call to matlab.impulse > - > - * ../README: updated readme file as a test of post-commit hook > - > -2012-11-02 Richard Murray <murray@altura.local> > - > - * doc/conf.py, setup.py: updated version number to 0.6c > - > - * tests/frd_test.py: unit tests for FRD data type > - (suite): added suite() function to allow test_all.py to work > - > - * tests/xferfcn_test.py (TestXferFcn.testMinreal): new unit test > - > - * src/xferfcn.py (TransferFunction.minreal): new function for > - removing cancelling pole/zero pairs, contributed by M.M. (Rene) van > - Paassen > - > - * src/statesp.py (_convertToStateSpace): new functionality for > - converting a matrix to a constant system > - > - * src/modelsimp.py (minreal): removed extraneous code (moved to > - xferfcn.py) > - > - * src/frdata.py: new file implementing FRD data type, contributed by > - M.M. (Rene) van Paassen > - > - * src/xferfcn.py: resolved conflict between versions > - > ----- control-0.6b released ----- > - > -2012-11-02 Richard Murray <murray@altura.local> > - > - * src/xferfcn.py, src/statesp.py, src/lti.py, src/bdalg.py: > - constants must now be of type 'int' rather than 'long' (for python 3 > - compatibility) > - > - * tests/statefbk_test.py, tests/slycot_convert_test.py, > - tests/convert_test.py: added import __future__ calls for python 3 > - compatibility; updated print calls > - > - * src/modelsimp.py, src/xferfcn.py, src/delay.py, src/phaseplot.py, > - src/margins.py, src/statesp.py, src/mateqn.py: added import > - __future__ calls for python 3 compatibility > - > -2012-11-02 Richard Murray <murray@altura.local> > - > - * src/xferfcn.py, src/timeresp.py, src/statesp.py, src/statefbk.py, > - src/robust.py, src/rlocus.py, src/pzmap.py, src/phaseplot.py, > - src/nichols.py, src/modelsimp.py, src/matlab.py, src/margins.py, > - src/freqplot.py, src/ctrlutil.py, src/bdalg.py: globally referenced > - import commands for python 3.x > - > - * src/__init__.py: changed import commands to be global instead of > - local ('from control.bdalg ...' instead of 'from bdalg ...') > - > -2012-10-31 Richard Murray <murray@altura.local> > - > - * src/xferfcn.py (TransferFunction._common_den): converted print > - statements to python 3 compatible form and included > - __future__.print_function > - > - * src/phaseplot.py: converted print statements to python 3 > - compatible form and included __future__.print_function > - > - * src/mateqn.py (lyap, dlyap): converted except T, E to except T(E) > - > - * src/margins.py: converted print statements to python 3 > - compatible form and included __future__.print_function > - > - * src/xferfcn.py (TransferFunction.__add__, __mul__, __div__, > - feedback): converted raise T, E to raise T(E) for python 3 > - > - * src/xferfcn.py (TransferFunction.returnScipySignalLti): fixed > - raise(T(E)) bug > - > - * src/statesp.py (_rss_generate): fixed raise(T(E)) bug > - > - * src/statefbk.py (acker, gram): converted raise T, E to raise T(E) for > - python 3 > - > - * src/modelsimp.py (hsvd, modred, balred): fixed raise(T(E)) bug and > - converted raise T, E to raise T(E) for python 3 > - > - * src/margins.py (stability_margins): fixed raise(T(E)) bug > - > - * src/statesp.py: converted raise T, E to raise T(E) for python 3 > - > - * tests/test_all.py: converted print statements to python 3 > - compatible form and included __future__.print_function > - > - * tests/statefbk_test.py (TestStatefbk.setUp): turned off debugging > - flag (accidently left on) > - > ----- control-0.6a released ----- > - > -2012-10-27 Richard Murray <murray@altura.local> > - > - * src/statefbk.py (acker): small updates to docstring > - > - * src/bdalg.py (feedback): fixed up docstring formatting (for sphinx) > - > - * tests/statefbk_test.py (TestStatefbk.testAcker): skip > - ill-conditioned systems and loosened tolerances on acker() testing > - > - * src/lti.py (timebaseEqual): replaced "type(sys.dt) == NoneType" > - with "sys.dt is None", based on feedback from Luke Peterson that > - NoneType is deprecated in python 3. > - > -2012-10-22 Richard Murray <murray@altura.local> > - > - * examples/genswitch.py (genswitch): updated calls to legend, fixing > - problem pointed out by Scott Livingston > - > -2012-10-19 Richard Murray <mu...@dn...net> > - > - * src/matlab.py (rlocus): reverted change in default argument > - processing for klist. This has some negative consequences: > - http://www.deadlybloodyserious.com/2008/05/default-argument-blunders/ > - > -2012-10-18 Richard Murray <mu...@dn...net> > - > - * src/freqplot.py (gangof4_plot, nyquist_plot): discrete time > - systems supported (through fresp) > - > - * src/statesp.py (StateSpace.evalfr): added warning if discrete time > - evaluation is above Nyquist frequency > - > - * src/xferfcn.py (TransferFunction.evalfr, freqresp): : added > - warning if discrete time evaluation is above Nyquist frequency > - > - * tests/discrete_test.py (TestDiscrete.test_discrete_bode): > - rudimentary unit test for discrete bode plot > - > - * src/freqplot.py (bode_plot): fixed bug where input frequency list > - was being overwritten by default frequency range > - > - * src/xferfcn.py (TransferFunction.evalfr, freqresp): handles dtime > - > - * src/statesp.py (StateSpace.evalfr): handles dtime > - > - * src/lti.py (timebaseEqual): converted function to take systems as > - inputs instead of dt as input (also affected functions in statesp.py > - and xferfcn.py) > - > - * src/lti.py (timebase): timebase now returns dt instead of > - 'ctime'/'dtime' > - > -2012-10-13 Richard Murray <mu...@dn...net> > - > - * src/lti.py (timebase): new function to return timebase. Doesn't > - yet handle the case where dt == None. > - > -2012-10-07 Richard Murray <murray@altura.local> > - > - * src/matlab.py (c2d): MATLAB compatible function (just calls > - sample_system) > - > - * tests/discrete_test.py (TestDiscrete.test_sample_system): unit > - test for sampling > - > - * src/dtime.py (sample_system, _c2dmatched): new functions, based on > - contributiosn from Benjamin White > - > - * src/dtime.py: added back this file, this time with sampling routes > - to convert from continuous to discrete time > - > - * src/timeresp.py (forced_response): added discrete time simulator, > - using dlsim from scipy.signal > - > -2012-10-07 Richard Murray <murray@altura.local> > - > - * doc/conf.py: fixed release number (0.6a instead of 0.6c) > - > - * src/__init__.py: moved timebase functions from dtime to lti > - > - * src/lti.py: moved isdtime, isctime, timebase, and timebaseEqual > - from dtime.py to lti.py. Moved initialization of dt to > - Lti.__init__(). > - > - * src/statesp.py (StateSpace.__init__): Moved dt > - initialization to Lti object initialization > - > - * src/xferfcn.py (TransferFunction.__init__): Moved dt > - initialization to Lti object initialization > - > -2012-10-06 Richard Murray <murray@altura.local> > - > - * tests/discrete_test.py: added additional tests for dt = True cases > - > - * src/statesp.py (StateSpace.__str__): show sampling time as > - 'unspecified' if dt is a boolean and equal to True > - > - * src/xferfcn.py (TransferFunction.__str__): don't print sampling > - time (dt) if dt = True (discrete time with unspecified time base) > - > - * src/dtime.py: added code to support dt = True for unspecified > - sampling time for a discrete time system > - > - * src/bdalg.py: much -> must in docstrings > - > -2012-10-06 Richard Murray <murray@altura.local> > - > - * src/dtime.py: new module with functions for operating on discrete > - time systems > - > - * src/modelsimp.py: added NotImplementedError for discrete time > - * src/freqplot.py: added NotImplementedError for discrete time > - > - * src/bdalg.py: added documentation about timebases (discrete versus > - continuous) > - > - * src/statesp.py (_mimo2siso): include sampling time > - > - * src/xferfcn.py (TransferFunction.__str__): added optional var > - keyword to allow any symbol to be used > - > - * src/matlab.py (tf2ss): added code required to keep track of dt > - > - * src/xferfcn.py (TransferFunction.__str__): added additional string for > - discrete time system, plus use 'z' for polynomial variable > - (TransferFunction.__neg__): set sampling time for negation > - (TransferFunction.__add__): added test for same sampling time > - (TransferFunction.__mul__): added test for same sampling time > - (TransferFunction.__div__): added test for same sampling time > - (TransferFunction.feedback): added test for same sampling time > - > - * src/statesp.py (StateSpace.__str__): added additional string for > - discrete time system > - (StateSpace.__add__): added test for same sampling time > - (StateSpace.__mul__): added test for same sampling time > - (StateSpace.__rmul__): set sampling time for product > - (StateSpace.__neg__): set sampling time for negation > - (StateSpace.feedback): added test for same sampling time > - > - * tests/discrete_test.py (TestDiscrete): unit tests for discrete > - time systems > - > - * src/xferfcn.py (TransferFunction.__init__): added dt class > - variable for discrete time systems > - > - * src/statesp.py (StateSpace.__init__): added dt class variable for > - discrete time systems > - > ----- control-0.5c released ----- > - > -2012-10-03 Richard Murray <murray@altura.local> > - > - * tests/matlab_test.py (TestMatlab.testSsdata): unit test > - > - * src/matlab.py (ssdata, tfdata): new functions to return state > - space and transfer function object data. For transfer functions, > - currenly requires SISO system > - > - * src/freqplot.py (bode_plot): Adding np.atleast_1d to the > - np.squeeze calculations makes it possible to use a single value > - frequency list (contributed by Benjamin White) > - > -2012-09-09 Richard Murray <murray@altura.local> > - > - * tests/statefbk_test.py (TestStatefbk.testAcker): unit test > - > - * src/statefbk.py (acker): added acker() from Roberto Bucher. > - > -2012-08-29 Richard Murray <murray@altura.local> > - > - * src/xferfcn.py (TransferFunction._common_den): fixed up code for > - case where poles have multiplicity > 1. Set end limits of check to > - avoid overruning the list + combine complex conjugate pole pairs > - from the outside in to prevent small errors from growing. > - > -2012-08-26 Richard Murray <murray@altura.local> > - > - * tests/convert_test.py (TestConvert.testConvert): replaced previous > - test of transfer function coefficients with a frequency response > - test. This is necessary because various degenerate conditions will > - generate a situation where the transfer functions are of different > - forms but still equal. Eg 0/1 = 1e-17 s + 1e-16 / (s^2 + s + 1). > - Still getting errors, but looks like actual problem in conversion. > - > - * src/statesp.py (_mimo2siso): set default value for warn_conversion > - to False > - > - * tests/convert_test.py (TestConvert.testConvert): Added check to > - make sure that we don't create problems with uncontrollable or > - unobservable systems. > - > -2012-08-25 Richard Murray <murray@altura.local> > - > - * src/xferfcn.py (TransferFunction._common_den): identified bug in > - the way that common denominators are computed; see comments in code > - regarding complex conjugate pairs. > - > - * src/statefbk.py (place): repalced nd.size(placed_eigs) with > - len(placed_eigs) to fix intermittent problems pointed out by Roberto > - Bucher in control-0.3c. > - > - * tests/rlocus_test.py (TestRootLocus.testRootLocus): added sort() > - to test to get rid of problems in which ordering was generating an > - error. > - > - * src/freqplot.py (nyquist_plot): added code from Kevin Davies to > - label frequency points in Nyquist plot > - > - * src/__init__.py: import non-conflicting MATLAB functions by default > - > - * src/freqplot.py (bode_plot, nyquist_plot): simplified code and > - removed unneeded options. To set color, linestyle, etc use keywords > - and pass to matplotlib. > - > -2012-08-24 Richard Murray <murray@altura.local> > - > - * src/freqplot.py: added in plot enhancements from Kevin Davies > - (bode_plot): pass optional arguments and keywords to matplotlib > - (get_pow1000): new function for determinine engineering exponent > - (gen_prefix): new function to get SI prefix for power of 1000 > - > - * src/freqplot.py (bode_plot): removed extraneous phase_deg calculation > - > -2012-01-07 Richard Murray <murray@malabar.local> > - > - * doc/modules.rst: added new sections for analysis, synthesis, > - frequency plots and time response. > - > - * doc/index.rst (Contents): added modules and examples. > - > - * src/xferfcn.py (_convertToTransferFunction): added check for > - slycot import error. If not present, use signal.lti to perform the > - conversion. Only works for SISO. > - > - * src/statesp.py (_convertToStateSpace): added check for slycot > - import error, to allow basic functionality without the presence of > - slycot (contributed by Ryan Krauss). > - > - * tests/slycot_convert_test.py (TestSlycot.testTF): moved slycot > - import into test function, so that test script still works even if > - time response is not present. > - > -2011-08-09 Richard Murray <murray@malabar.local> > - > - * src/timeresp.py: fixed doc reference to time-series-convention > - > -2011-08-08 Richard Murray <murray@malabar.local> > - > - * doc/index.rst, doc/modules.rst: Moved MATLAB section into > - python-control modules file > - > -2011-08-07 Richard Murray <murray@malabar.local> > - > - * doc/conf.py: added autosummary extension > - > - * doc/timeresp.rst: New file containing listing of functions for > - time responses (step, initial, etc) > - > - * doc/freqplot.rst: New file listing functions for frequency > - plots (bode, nyquist, etc) > - > - * doc/modules.rst: New file that contains a listing of the major > - modules in the toolbox > - > - * doc/index.rst (Contents): Rearranged contents to put modules > - documentation in a separate section. Also added examples section > - (not quite ready yet). > - > -2011-08-07 Richard Murray <murray@malabar.local> > - > - * examples/rss-balred.py: reordered outputs from call to matlab.step > - (missed this the first time around) > - > - * doc/matlab_strings.rst: Matlab -> MATLAB (proper spelling) > - > - * setup.py, doc/conf.py: updated version to 0.5b > - > -2011-08-07 Richard Murray <murray@malabar.local> > - > - * doc/conf.py: Updated version numbers to 0.5a, regenerated > - documentation and reposted on web (note that 0.5a tag and source > - distribution have this wrong) > - > ----- control-0.5a released ----- > - > -2011-08-07 Richard Murray <murray@malabar.local> > - > - * setup.py: updated version number; next release will be 0.5a since > - the changes in function names and argument/return value order (for > - time reponses) require small updates in code > - > - * examples/secord-matlab.py, examples/pvtol-nested-ss.py, > - examples/test-response.py, examples/pvtol-nested.py: fixed small bug > - in order of output arguments for step command > - > -2011-08-06 Richard Murray <murray@malabar.local> > - > - * src/matlab.py (ngrid): copy documentation from nichols_grid > - > - * src/__init__.py: changed import commands to import specific > - functions rather than '*' (better modularity) > - > - * src/freqplot.py: default function names are now bode_plot, > - nyquist_plot and gangof4_plot (still with aliases to non-"_plot" > - versions) > - > - * src/nichols.py (nichols_plot): updated nichols to nichols_plot for > - consistency with other python-control plotting functions. Set up > - alias for original name > - > - * src/margins.py: StabilityMargins, PhaseCrossoverFrequencies -> > - stability_margins, phase_crossover_frequencies > - > - * src/phaseplot.py: changed PhasePlot and boxgrid to phase_plot, > - box_grid > - > - * src/timeresp.py: changed ForcedReponse, InitialReponse, > - ImpulseReponse and StepResponse to forced_response, > - initial_response, impulse_response and step_response. > - > - * src/rlocus.py: changed RootLocus to root_locus for better > - compatability with PEP 8. Also updated unit tests and examples. > - > -2011-07-25 Richard Murray <murray@malabar.local> > - > - * tests/phaseplot_test.py: updated unit tests to use new call > - signatures > - > - * examples/phaseplots.py: updated calls to PhasePlot to use new > - argument structure > - > - * src/phaseplot.py (PhasePlot): Updated call signature to be > - more pythonic and fixed up documentation. > - > - * examples/genswitch.py (genswitch): added new example showing > - PhasePlot functionality > - > - * src/phaseplot.py (boxgrid): added function to compute initial > - conditions around the edges of a box > - > -2011-07-24 Richard Murray <murray@malabar.local> > - > - * tests/margin_test.py: added simple unit tests for margin functions > - (initial versions just call functions; some comparisons missing) > - > - * examples/README: added missing README file > - > - * examples/phaseplots.py: FBS examples for phaseplot > - > - * tests/phaseplot_test.py: unit tests for phaseplot > - > - * src/phaseplot.py: initial cut at phase portrait function, built > - from amphaseplot (Feeback Systems [FBS], Astrom and Murray, 2008) > - > -2011-07-15 Richard Murray <murray@malabar.local> > - > - * tests/matlab_test.py (TestMatlab): added unittest for margin() > - commands (calling format only) > - > - * src/statesp.py (StateSpace): updated comments > - > - * tests/margin_test.py: set up unit tests for StabilityMargins() and > - PhaseCrossoverFrequencies() > - > - * src/__init__.py: added margins.py to __init__ > - > -2011-07-14 Richard Murray <murray@malabar.local> > - > - * src/margins.py (GainPhaseMargin): moved freqplot.MarginPlot to > - margin.StabilityMargins (MarginPlot didn't actually plot anything) > - > - * src/margins.py (PhaseCrossoverFrequencies): added new function to > - compute frequencies that we cross real axis. Contributed by Steffen > - Waldherr <wal...@is...> > - > -2011-07-11 Richard Murray <murray@malabar.local> > - > - * src/rlocus.py: added real() and imag() to list of functions > - imported from numpy > - > - * src/freqplot.py: renamed plotting functions to BodePlot, > - NyquistPlot, GangOf4Plot and MarginPlot. Set up aliases to the more > - common names (bode, nyquest, gangof4, margin). Mainly playing > - around with idea for the eventual interface to use. > - > - * tests/matlab_test.py: updated timeresp outputs to match MATLAB > - > - * src/matlab.py (impulse, initial, lsim, step): switched outputs > - from step, impulse, initial, lsim to match MATLAB standard > - > -2011-07-01 Richard Murray <murray@malabar.local> > - > - * src/rlocus.py: modified scipy import to only import those > - functions that we actually use. This fixes a problem pointed out by > - Carsten Knoll (TU Dresden) where control.place could be overwritten > - by numpy.place (because of an "from scipy import *" in rlocus.py > - > - * doc/intro.rst: Added link to scipy web page talking about the > - differences between numpy and MATLAB (contributed by Shuo Han). > - > -2011-06-25 Richard Murray <murray@malabar.local> > - > - * src/xferfcn.py (TransferFunction._common_den): changed tolerance > - for detecting complex valued poles to a user-settable parameter, > - with default value 1e-8. This was an attempt to fix errors in the > - convert_test.py unittest script (conversion routine was > - misclassifying some poles as imaginary when they weren't). > - > - * src/xferfcn.py (_convertToTransferFunction): converted arguments > - to tb04ad to numpy arrays; fixes a unit test error in convert_test.py. > - > - * src/statefbk.py (gram): convert system matrix passed to sb03md to > - numpy array; this fixes a unit test error in modelsimp_test.py. > - > - * src/matlab.py (impulse): got rid of X0 argument for impulse > - response (not implemented in MATLAB). > - > - * doc/intro.rst: added some quick start information > - > - * src/matlab.py: added documentation for step, impulse, initial, lsim > - > - * src/timeresp.py: fixed some MATLAB specific function names in > - function doc strings > - > -2011-06-22 Richard Murray <murray@malabar.local> > - > - * doc/intro.rst: fixed some small types > - > - * doc/control.tex: removed (no longer needed) > - > -2011-06-22 Richard Murray <murray@malabar.local> > - > - * doc/intro.rst: Added a slightly more general introduction, with a > - pointer to the python-control wiki (on sf.net) > - > - * doc/Makefile: Changed path to sphinx-build to assume it is in the > - users path (as opposed to an explicit path) > - > - * doc/conf.py: Added release information into documentation file > - > -2011-06-21 Richard Murray <murray@malabar.local> > - > - * src/statesp.py (_mimo2siso): Moved function from matlab.py. > - > - * src/timeresp.py: added file documentation + split out and updated > - copyright info. Small corrections to documentation. > - (InitialResponse): Added missing transpose argument in call to > - ForcedResponse > - > - * src/matlab.py: minor changes to documentation to avoid line wraps > - on standard (80 col) terminal window > - > - * src/matlab.py: removed time-series convention documentation from > - matlab.py since current MATLAB version uses standard conventions. > - This documentation is currently in timeresp.py. > - > - * src/*, doc/*: added Eike Welk's documentation modifications > - > -2011-06-18 Richard Murray <murray@malabar.local> > - > - * src/timeresp.py, src/matlab.py: moved documentation about time > - series convention from matlab.py to timeresp.py > - > - * examples/pvtol-nested-ss.py: Fixed bug in call to step (wrong > - second argument) > - > - * tests/matlab_test.py: Updated tests to use MATLAB time response > - conventions. > - > - * tests/timeresp_test.py: Created unit tests for timeresp module, > - based on matlab_test.py > - > -2011-06-17 Richard Murray <murray@malabar.local> > - > - * src/timeresp.py (ForcedResponse): swapped order of input and time > - arguments for linear response, following Eike's comment "T must > - always be supplied by the user, but U has a useful default value of > - 0." > - > - * src/matlab.py: moved code for lsim, initial, step, and impulse to > - timeresp.py and put in new routes that call timeresp.* versions of > - the functions with transposeData set to True. > - > - * src/timesim.py (_check_convert_array): added transpose argument > - that will transpose input data before processing it. > - > - * src/timesim.py: renamed lsim, initial, step, and impulse functions > - to ForcedResponse, InitialResponse, StepResponse and > - ImpulseResponse. These versions use Eike Welk's input ordering. > - > - * examples/pvtol-nested.py: calls to step() had screwed up inputs. > - Fixed. > - > -2011-06-17 Richard Murray <murray@malabar.local> > - > - * src/matlab.py: added MIMO extensions from Eike Welk on 12 Jun > - 2011: adds MIMO capabilities for ``lsim``, ``step``, ``impulse``, > - ``initial`` > - > - * src/matlab.py: added changes from Eike Welk on 12 May 2011: > - > - - An implementation of the four simulation functions ``lsim``, > - ``step``, ``initial``, and ``impulse`` of the module ``matlab``. > - > - - Adds a function ``dcgain`` to the ``matlab`` module, which > - computes the gain of a linear system for steady state and > - constant input. > - > - - The patch contains a bug fix for class ``StateSpace``, which > - enables it to work properly together with Scipy's ``signal`` > - module. > - > - - The simulation functions' return values are changed (back?) to > - arrays, because matrices confuse Matplotlib. > - > - - New times series convention: see _time-series-convention section > - of matlab documentation > - > - - SISO simulation data are squeezed on output. To turn this off, > - pass the option squeeze=False > - > ----- control-0.4c released ----- > - > -2011-06-17 Richard Murray <mu...@dh...> > - > - * examples/tfvis.py: Added tfvis, Simple GUI application for > - visualizing how the poles/zeros of the transfer function effects the > - bode, nyquist and step response of a SISO system. Contributed by > - Vanessa Romero Segovia, Ola Johnsson, Jerker Nordh. > - > -2011-06-16 Richard Murray <murray@malabar.local> > - > - * src/matlab.py: import mateqn functions > - > - * src/__init__.py: import mateqn functions > - > - * tests/test_all.py: added unit tests for matrix solvers, converting > - to standard format along the way. Seems to work even if slycot > - routines are not in place, but I'm not sure if this is for the right > - reasons... > - > - * src/mateqn.py: added matrix solvers from LTH (Ola Johnsson, Jerker > - Nordh, Bjorn Olofsson, Vanessa Romero). Moved slycot function > - checks to the portion of the code where they are used, so that > - missing slycot doesn't mess up initialization if proper version of > - slycot is not available. > - > -2011-04-02 Richard Murray <murray@malabar.local> > - > - * src/xferfcn.py (TransferFunction.__add__): fixed bug when adding a > - transfer function to state space system; _convertToTransferFunction > - was being called with input/output keywords. Picked up in unit test. > - > - * tests/matlab_test.py: added calls to all of the functions that are > - currently implemented in the library, to make sure there are no > - hidden issues. These calls do *not* test functionality, they just > - make sure that MATLAB compatibility functions accept the right types > - of arguments. > - > - * examples/secord-matlab.py: added root locus plot to list of > - figures that are produced > - > - * src/__init__.py: added rlocus to list of modules that are imported > - by control module > - > - * src/exception.py (ControlMIMONotImplemented): added exception for > - functions that are not yet implemented for MIMO systems > - > - * src/xferfcn.py (TransferFunction.__init__): convert integer > - numerator and denominator objects to floats to eliminate errors when > - creating common denominator (also used on pole command). This fixes > - and error were tf([1], [1, 2, 1]).pole() would generate an error. > - > - * src/freqplot.py (bode): Tweaked documentation string to remove 'h' > - from mag and phase return arguments > - > - * src/rlocus.py (RootLocus): removed commands that set figure number > - inside of RootLocus command, for consistency with other frequency > - plot routines. Added Plot=True argument and updated documentation. > - > - * src/matlab.py: added rlocus() command (calls RootLocus) > - > - * MANIFEST.in: Added MANIFEST.in file to include examples and tests > - in source distribution > - > - * README: Updated to include information on how to run unit tests. > - > - * setup.py: updated version number to 0.4c > - > ----- control-0.4b released ----- > - > -2011-04-02 Richard Murray <murray@malabar.local> > - > - * src/__init__.py: removed import of tests module (moved to tests/) > - > - * src/matlab.py: Added hsvd, balred, modred to list of functions > - that are imported for use as is. Updated documentation string to > - indicate that these are implemented, along with a few other > - functions (zero, lqr) that weren't properly listed. > - > - * src/modelsimp.py (balred): Removed extraneous print statements > - (modred): Set method to be 'matchdc' by default (to match MATLAB) > - > - * src/__init__.py: added missing import of modelsimp functions > - > - * tests/slycot_convert_test.py (TestSlycot.testTF): turned off print > - statements in unit test to make it easier to see results. Use > - verbose=True to turn back on. > - > - * tests/convert_test.py (TestConvert.testConvert): got rid of print > - statements in unittest; clutters the output so that you can't see > - the errors clearly. Use verbose=True to turn back on. > - > - * src/statesp.py (_convertToStateSpace): removed "buggy" print > - statements > - > - * src/xferfcn.py (_convertToTransferFunction): removed "buggy" print > - statements > - > - * tests/nichols_test.py (TestStateSpace.testNgrid): updated testcode > - to turn off grid in initial Nichols chart plot. > - > - * src/freqplot.py: updated comments at top of file to reflect > - nichols chart move > - > - * src/nichols.py: transferred over changes from v0.3d > - > - * src/matlab.py (ngrid): moved import to function > - > -2011-03-31 Richard Murray <murray@malabar.local> > - > - * examples/pvtol-nested.py: updated stability margin plot to use > - proper calling format for bode(). > - > - * src/statesp.py (_convertToStateSpace): moved slycot import > - to the location where it is actually needed (allows running some > - commands without slycot installed) > - > - * src/xferfcn.py (_convertToTransferFunction): moved slycot import > - to the location where it is actually needed (allows running some > - commands without slycot installed) > - > - * src/nichols.py: new file for Nichols plot routines; move > - nichols(), nichols_grid(), closed_loop_contours(), m_circles(), > - n_circles() > - > - * src/__init__.py, src/freqresp.py, src/matlab.py: updated to match > - new file structure for Nichols charts > - > - * src/nichols.py (nichols): updated processing of freqresp to take > - into account the fact that return arguments are now a matrix of > - results (even for a SISO system) > - > -2011-03-30 Richard Murray <murray@malabar.local> > - > - * tests/: added top level subdirectory, to be used for unit tests. > - The idea in putting the code here is that you can do 'setup.py test' > - during installation to make sure everything is working correctly. > - The test code would normally *not* be callable from the installed > - module. > - > - * tests/*_test.py: moved from src/Test*.py > - > - * setup.py: updated version number. > - > -2011-02-13 Richard Murray <murray@sumatra.local> > - > - * src/*.py: added svn:keywords Id properly > - > - * src/matlab.py (ngrid): added ngrid() from v0.3d > - > - * src/freqplot.py (nichols_grid, closed_loop_contours, m_circles, > - n_circles): copied over changes from Allan McInnes in v0.3d; ngrid() > - functiality + split out some of the nichols chart code into separate > - functions > - > -2011-02-12 Richard Murray <murray@sumatra.local> > - > - * setup.py: updated version number to 0.4a > - > -2010-11-05 Richard Murray <murray@sumatra.local> > - > - * external/yottalab.py: New file containing Roberto Bucher's control > - library functions. OK to start pulling these into the main library, > - with attribution, but note that they use modifications of the > - default library => some rewrites will be needed. > - > -2010-09-11 Richard Murray <murray@sumatra.local> > - > - * src/matlab.py (step): Added local step response function that uses > - lsim2() instead of signal.step (which can't handle integrators). > - This function may not be needed when new scipy step2() function is > - available. > - (impulse): Added local impulse response function that sets the > - initial condition based on the input matrix and then uses the > - lsim2() function to compute the response. > - > - * examples/test-response.py: Added test script for making sure that > - time repsonse functions are working as desired > - > - * src/matlab.py (lsim): Added local version of lsim that calls > - signal.lsim2 (actual ODE integrator) > - > -2010-09-06 Richard Murray <murray@sumatra.local> > - > - * src/statefbk.py (ctrb): new function for testing controllability > - * src/statefbk.py (obsv): new function for testing observabiilty > - > -2010-09-02 Richard Murray <murray@sumatra.local> > - > - * src/statefbk.py (place): Use np.size() instead of len() for > - finding length of placed_eigs for better compatability with > - different python versions [courtesy of Roberto Bucher] > - > - * src/delay.py (pade): New file for delay-based computations + > - initial implementation of pade() [courtesy Sawyer Fuller] > - > -2010-06-17 Richard Murray <murray@sumatra.local> > - > - * src/rlocus.py: changed num, den to nump, denp for clarity > - * src/rlocus.py: new file with Ryan Krauss's root locus code > - > -2010-06-06 Richard Murray <murray@sumatra.local> > - > - * examples/pvtol-lqr.py: Added example to test out LQR routines > - > - * src/matlab.py (bode): created a wrapper that allows MATLAB style > - arguments for bode (eg, bode(sys1, sys2)) > - > - * src/ctrlutil.py (issys): added new function to check if an object > - is a system (state space or transfer function). Will generalize > - this latter to look for other compatible classes. > - > - * src/freqplot.py (bode): Compute frequency range of bode plot based > - on poles and zeros > - (bode): Allow bode plot to be passed a list (or tuple) as the first > - argument, in which case multiple bode plots are generated > - > - * src/statesp.py (StateSpace.zeros): new function to compute zeros > - for a state space system > - (StateSpace): defined new functions to compute poles of a state > - space system > - > - * src/xferfcn.py (TransferFunction): defined new functions to > - compute poles and zeros of a transfer function. > - > -2010-05-31 Richard Murray <murray@sumatra.local> > - > - * src/exception.py (ControlNotImplemented): added new exception, to > - be used for functions that are not yet implemented > - > - * src/statefbk.py (lqr): added lqr function (using slycot). Still > - needs to be verified to make sure calculations are correct. > - > - * ChangeLog: converted to standard GNU formation (old style below) > - * setup.py: updated package number to v0.3, changed URL to > - sourceforge wiki > - > ------------------- > -31 May 2010, RMM: added place() function using slycot > - * New module: statefbk - functions to design state feedback controllers > - * Uses Enrico Avventi slycot wrappers (http://github.com/avventi/Slycot) > - * Also added some exception types: ControlSlycot and ControlDimension > - * Added new example to test slycot interface (directly) > - > -29 May 2010, RMM: updated function documentation > - * Added __doc__ strings for all current functions > - * Added __doc__ string to matlab module, listing control toolbox functions > - > -22 May 2010, RMM: tweaked comments and released v0.3a > - * Changed copyright information on modified files to 2010 > - * Updated "to do" comments to use "#! TODO:" as prefix > - > -11 Feb 2010, GR: implemented and tested state space feedback > -15 Jan 2010, GR: added new example, improved bode > - > -4 Jan 2010, GR: updated bode plots > - * made bode plot more like matlab > - * added options for plotting in dB, Hz > - > -27 Dec 2009, GR: important bug fix: feedback TFs were being divided by two > - > -10 Oct 09, RMM: reset matplotlib import in secord-matlab > - * Using 'from matplotlib import *' causes error with figures > - * On my other computer, got error when trying to import 'matplotlib.pyplot' > - * Need to sort out versions and figure out proper import structure > - > -13 Sep 09, RMM: added basic state space functionality > - * Updated StateSpace routines to allow BD algebra with constants > - * Updated pvtol-nested example to try to use state space representation > - (not completely working yet) > - > -12 Sep 09, RMM: code restructuring for transfer functions > - * Implemented feedback() method in bldalg; partially working > - for mixture of TF, SS and numbers (not thoroughly tested yet) > - * New feedback method for TransferFunctions > - * Updated gangof4 to use new feedback function > - > -9 Sep 09, RMM: updated pzmap to generate a plot (turn off with Plot=False) > - > -8 Sep 09, RMM: rewrite of xferfcn to handle type casting better > - * Appropriate functions now call convertToTransferFunction > - * Restricted transfer function to SISO only > - > -7 Sep 09, RMM: additional fixes > - * Implemented block diagram operations for SISO transfer functions > - * Modified frequency response functions for transfer functions > - * Added rudimentary pole/zero computations > - * Added comments on things that need to be fixed (search for !) > - > -5 Sep 09, RMM: updates to get standard examples working > - * Copied and converted pvtol_nested.py from AM08, Chapter 11 > - * Updated freqresp to use poly1d for computing values > - * Added outputs to bode plot - return mag and phase subplot handles > - > -2009-05-24 Richard Murray <murray@kona-2.local> > - * ./ Initial creation of package files and ChangeLog > - * Using simpler text format since emacs python mode doesn't support > - ChangeLog entries anyway > - > - > -Local Variables: > -mode:text > -End: > > Copied: tags/control-0.6d/ChangeLog (from rev 296, trunk/ChangeLog) > =================================================================== > --- tags/control-0.6d/ChangeLog (rev 0) > +++ tags/control-0.6d/ChangeLog 2014-03-22 19:42:52 UTC (rev 297) > @@ -0,0 +1,1098 @@ > +2014-03-22 Richard Murray <murray@sidamo.local> > + > + * src/matlab.py (ss): allow five arguments to create a discrete time > + system. From Roberto Bucher, 12 Jan 2014 > + > +2014-03-22 Richard Murray <murray@sidamo.local> > + > + * src/bdalg.py (feedback): allow FRD for feedback() > + > +2014-03-22 Richard Murray <murray@sidamo.local> > + > + * tests/discrete_test.py (TestDiscrete.test_sample_system): added > + conversions using tustin and zoh to catch 'dt' bug #5 > + > + * src/dtime.py (sample_system): Changed 'dt' to 'Ts' to fix bug #4 > + > + * tests/frd_test.py (TestFRD.testbdalg): added unit tests for bdalg > + functions operating on FRD data > + > + * src/bdalg.py (series, parallel, negate, feedback): updated > + documentation to note that FRD ovjects work. > + (feedback): updated conversions to allow for FRD > + > +2013-07-15 Richard Murray <murray@altura-2.local> > + > + * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and > + __rtruediv__ for compatibility with python3 > + > +2013-07-14 Richard Murray <murray@altura-2.local> > + > + * src/dtime.py (sample_system): added check to make sure > + cont2discrete is available in scipy.signal > + (sample_system): added docstring > + > +2013-06-24 Richard Murray <murray@altura-2.local> > + > + * tests/minreal_test.py (TestMinreal.testMinrealBrute), > + src/xferfcn.py (_convertToTransferFunction), src/statesp.py > + (StateSpace.__rmul__), src/margins.py (stability_margins): changed > + exception syntax to be python3 compatibile (works for python2.6+) > + > +2013-06-10 Richard Murray <murray@altura-2.local> > + > + * src/xferfcn.py (TransferFunction.horner): small fix to docstring > + > + * src/freqplot.py (nyquist_plot): small fix to docstring > + > +2013-06-09 Richard Murray <murray@altura-2.local> > + > + * tests/bdalg_test.py (TestFeedback.testScalarSS) > + (TestFeedback.testScalarTF): added simple test of default argument > + to feedback() for state space and transfer function systems > + > + * tests/frd_test.py (TestFRD.testFeedback): added test of default > + argument to feedback() for FRD type > + > + * src/bdalg.py (feedback): > + * src/frdata.py (FRD.feedback): > + * src/statesp.py (StateSpace.feedback): > + patched in default value of 1 for other system in feedback(). > + Contributed by Ryan Krauss <rk...@si...> > + > + * tests/xferfcn_test.py (TestXferFcn.testEvalFrMIMO) > + (TestXferFcn.testEvalFrSISO): added tests of __call__ version of > + evalfr. > + > + * src/xferfcn.py (TransferFunction.__call__): patched in new > + __call__ functionality from Ryan Krauss <rk...@si...>, but > + modified to use evalfr (works with MIMO). SISO transfer functions > + return a single complex number, MIMO transfer functions return a > + matrix of complex numbers. > + > +2013-05-23 Rene van Paassen <ren...@gm...> > + > + * src/margin.py: re-vamped stability_margins function. Now > + uses analytical method for TF and state-space, works on FRD > + objects too, and can optionally return all margins found for > + the analytical method. > + > + * src/xferfcn.py and src/frdata.py: Now return array result > + for fresp when called with an iterable frequency vector > + > + * src/xferfcn.py and src/statesp.py: added minreal functions > + > + * src/bdalg.py: implemented append and connect functions (old > + version, with indexes, not with names) > + > + * src/matlab.py: added connect, append, minreal > + > + * src/xferfcn.py and src/statesp.py: added/corrected > + __rmul__. In most cases a gain matrix (np.matrix) may now be > + used in combination with ss or tf systems. > + > +2012-11-10 Richard Murray <murray@altura.local> > + > + * src/canonical.py: new module implementing conversions to selected > + canonical forms: canonical_form(), reachable_form() implemented > + > + * src/lti.py (issiso): new function to quickly check if a system is > + single input, single output or not > + > +2012-11-04 Richard Murray <murray@altura.local> > + > + * src/__init__.py: added action item to separate out matlab module > + functionality (eventually) > + > + * src/matlab.py: added code for setting up MATLAB defaults if matlab > + submodule is imported instead of main (control) module. See > + comments in __init.py__ for what needs to be done to implement. > + > + * src/freqplot.py (bode_plot): moved default values of plotting > + options to config module to allow easier use override > + > + * src/config.py: new module to help set package defaults > + > + * src/xferfcn.py (_convertToTransferFunction): removed extraneous > + print statements if slycot is not installed > + > + * src/statesp.py (StateSpace.__str__): fixed error in printing > + timebase when dt is None (python 3) > + > +---- control-0.6c released ----- > + > +2012-11-03 Richard Murray <murray@altura.local> > + > + * doc/modules.rst: updated documentation format so that items are > + broken down by functionality and not internal module name. Still > + not complete, but most functions should now show up in documentation. > + > + * doc/index.rst: got rid of todos from documentation (not formatted > + correctly and shouldn't show up in user documentation) > + > + * src/lti.py: added missing docstrings > + > + * doc/intro.rst: small tweaks to text, including adding a link to FBS > + > +2012-11-03 Richard Murray <murray@altura.local> > + > + * src/rlocus.py (_RLSortRoots): convert output of range() to > + explicit list for python 3 compatability > + > + * tests/modelsimp_test.py, tests/slycot_convert_test.py, > + tests/mateqn_test.py, tests/statefbk_test.py: updated test suites to > + skip specific tests that require slycot if it is not installed > + > + * src/exception.py (slycot_check): added a function to check if > + slycot is installed > + > + * README: updated readme to include information about running > + nosetests, which works in python3 (unlike the test_all.py script) > + > + * tests/test_control_matlab.py, tests/test_all.py: set to executable > + so that nosetests does not run this file (it already runs all unit > + tests in this directory). Add comments at top talking about tests. > + > + * tests/discrete_test.py (TestDiscrete.test_discrete_bode): > + explicitly create a list from map() output for python 3 > + > + * src/frdata.py: removed long data type from comparisons for > + constant systems (not supported in python3) > + > + * src/xferfcn.py (TransferFunction.freqresp): force frequencies to > + be a list (map returns iterator in python3) > + > + * src/lti.py (isdtime, isctime): updated timebase checking since > + python3 won't allow dt to be compared to integer > + > + * src/__init__.py: updated frdata import to python3 compatible form > + > + * src/statesp.py (_convertToStateSpace): fixed exception syntax to > + be python3 compatible > + > + * examples/pvtol-nested.py: converted print statements to be python3 > + compatible > + > + * doc/class_strings.rst: added FRD class to list of classes that > + show up in the user documentation > + > + * examples/rss-balred.py: fixed error in output argument order for > + call to matlab.impulse > + > + * ../README: updated readme file as a test of post-commit hook > + > +2012-11-02 Richard Murray <murray@altura.local> > + > + * doc/conf.py, setup.py: updated version number to 0.6c > + > + * tests/frd_test.py: unit tests for FRD data type > + (suite): added suite() function to allow test_all.py to work > + > + * tests/xferfcn_test.py (TestXferFcn.testMinreal): new unit test > + > + * src/xferfcn.py (TransferFunction.minreal): new function for > + removing cancelling pole/zero pairs, contributed by M.M. (Rene) van > + Paassen > + > + * src/statesp.py (_convertToStateSpace): new functionality for > + converting a matrix to a constant system > + > + * src/modelsimp.py (minreal): removed extraneous code (moved to > + xferfcn.py) > + > + * src/frdata.py: new file implementing FRD data type, contributed by > + M.M. (Rene) van Paassen > + > + * src/xferfcn.py: resolved conflict between versions > + > +---- control-0.6b released ----- > + > +2012-11-02 Richard Murray <murray@altura.local> > + > + * src/xferfcn.py, src/statesp.py, src/lti.py, src/bdalg.py: > + constants must now be of type 'int' rather than 'long' (for python 3 > + compatibility) > + > + * tests/statefbk_test.py, tests/slycot_convert_test.py, > + tests/convert_test.py: added import __future__ calls for python 3 > + compatibility; updated print calls > + > + * src/modelsimp.py, src/xferfcn.py, src/delay.py, src/phaseplot.py, > + src/margins.py, src/statesp.py, src/mateqn.py: added import > + __future__ calls for python 3 compatibility > + > +2012-11-02 Richard Murray <murray@altura.local> > + > + * src/xferfcn.py, src/timeresp.py, src/statesp.py, src/statefbk.py, > + src/robust.py, src/rlocus.py, src/pzmap.py, src/phaseplot.py, > + src/nichols.py, src/modelsimp.py, src/matlab.py, src/margins.py, > + src/freqplot.py, src/ctrlutil.py, src/bdalg.py: globally referenced > + import commands for python 3.x > + > + * src/__init__.py: changed import commands to be global instead of > + local ('from control.bdalg ...' instead of 'from bdalg ...') > + > +2012-10-31 Richard Murray <murray@altura.local> > + > + * src/xferfcn.py (TransferFunction._common_den): converted print > + statements to python 3 compatible form and included > + __future__.print_function > + > + * src/phaseplot.py: converted print statements to python 3 > + compatible form and included __future__.print_function > + > + * src/mateqn.py (lyap, dlyap): converted except T, E to except T(E) > + > + * src/margins.py: converted print statements to python 3 > + compatible form and included __future__.print_function > + > + * src/xferfcn.py (TransferFunction.__add__, __mul__, __div__, > + feedback): converted raise T, E to raise T(E) for python 3 > + > + * src/xferfcn.py (TransferFunction.returnScipySignalLti): fixed > + raise(T(E)) bug > + > + * src/statesp.py (_rss_generate): fixed raise(T(E)) bug > + > + * src/statefbk.py (acker, gram): converted raise T, E to raise T(E) for > + python 3 > + > + * src/modelsimp.py (hsvd, modred, balred): fixed raise(T(E)) bug and > + converted raise T, E to raise T(E) for python 3 > + > + * src/margins.py (stability_margins): fixed raise(T(E)) bug > + > + * src/statesp.py: converted raise T, E to raise T(E) for python 3 > + > + * tests/test_all.py: converted print statements to python 3 > + compatible form and included __future__.print_function > + > + * tests/statefbk_test.py (TestStatefbk.setUp): turned off debugging > + flag (accidently left on) > + > +---- control-0.6a released ----- > + > +2012-10-27 Richard Murray <murray@altura.local> > + > + * src/statefbk.py (acker): small updates to docstring > + > + * src/bdalg.py (feedback): fixed up docstring formatting (for sphinx) > + > + * tests/statefbk_test.py (TestStatefbk.testAcker): skip > + ill-conditioned systems and loosened tolerances on acker() testing > + > + * src/lti.py (timebaseEqual): replaced "type(sys.dt) == NoneType" > + with "sys.dt is None", based on feedback from Luke Peterson that > + NoneType is deprecated in python 3. > + > +2012-10-22 Richard Murray <murray@altura.local> > + > + * examples/genswitch.py (genswitch): updated calls to legend, fixing > + problem pointed out by Scott Livingston > + > +2012-10-19 Richard Murray <mu...@dn...net> > + > + * src/matlab.py (rlocus): reverted change in default argument > + processing for klist. This has some negative consequences: > + http://www.deadlybloodyserious.com/2008/05/default-argument-blunders/ > + > +2012-10-18 Richard Murray <mu...@dn...net> > + > + * src/freqplot.py (gangof4_plot, nyquist_plot): discrete time > + systems supported (through fresp) > + > + * src/statesp.py (StateSpace.evalfr): added warning if discrete time > + evaluation is above Nyquist frequency > + > + * src/xferfcn.py (TransferFunction.evalfr, freqresp): : added > + warning if discrete time evaluation is above Nyquist frequency > + > + * tests/discrete_test.py (TestDiscrete.test_discrete_bode): > + rudimentary unit test for discrete bode plot > + > + * src/freqplot.py (bode_plot): fixed bug where input frequency list > + was being overwritten by default frequency range > + > + * src/xferfcn.py (TransferFunction.evalfr, freqresp): handles dtime > + > + * src/statesp.py (StateSpace.evalfr): handles dtime > + > + * src/lti.py (timebaseEqual): converted function to take systems as > + inputs instead of dt as input (also affected functions in statesp.py > + and xferfcn.py) > + > + * src/lti.py (timebase): timebase now returns dt instead of > + 'ctime'/'dtime' > + > +2012-10-13 Richard Murray <mu...@dn...net> > + > + * src/lti.py (timebase): new function to return timebase. Doesn't > + yet handle the case where dt == None. > + > +2012-10-07 Richard Murray <murray@altura.local> > + > + * src/matlab.py (c2d): MATLAB compatible function (just calls > + sample_system) > + > + * tests/discrete_test.py (TestDiscrete.test_sample_system): unit > + test for sampling > + > + * src/dtime.py (sample_system, _c2dmatched): new functions, based on > + contributiosn from Benjamin White > + > + * src/dtime.py: added back this file, this time with sampling routes > + to convert from continuous to discrete time > + > + * src/timeresp.py (forced_response): added discrete time simulator, > + using dlsim from scipy.signal > + > +2012-10-07 Richard Murray <murray@altura.local> > + > + * doc/conf.py: fixed release number (0.6a instead of 0.6c) > + > + * src/__init__.py: moved timebase functions from dtime to lti > + > + * src/lti.py: moved isdtime, isctime, timebase, and timebaseEqual > + from dtime.py to lti.py. Moved initialization of dt to > + Lti.__init__(). > + > + * src/statesp.py (StateSpace.__init__): Moved dt > + initialization to Lti object initialization > + > + * src/xferfcn.py (TransferFunction.__init__): Moved dt > + initialization to Lti object initialization > + > +2012-10-06 Richard Murray <murray@altura.local> > + > + * tests/discrete_test.py: added additional tests for dt = True cases > + > + * src/statesp.py (StateSpace.__str__): show sampling time as > + 'unspecified' if dt is a boolean and equal to True > + > + * src/xferfcn.py (TransferFunction.__str__): don't print sampling > + time (dt) if dt = True (discrete time with unspecified time base) > + > + * src/dtime.py: added code to support dt = True for unspecified > + sampling time for a discrete time system > + > + * src/bdalg.py: much -> must in docstrings > + > +2012-10-06 Richard Murray <murray@altura.local> > + > + * src/dtime.py: new module with functions for operating on discrete > + time systems > + > + * src/modelsimp.py: added NotImplementedError for discrete time > + * src/freqplot.py: added NotImplementedError for discrete time > + > + * src/bdalg.py: added documentation about t... [truncated message content] |
From: Erik F. <er...@er...> - 2014-03-24 08:29:12
|
Hi Everyone, while designing a controller based on measured frequency response data I noticed some strange results by in control.nyquist_plot(). Looking at the code I noticed that it first calculates the magnitude and the phase of the system response and then converts it back to the x and y components. I have modified control.nyquist_plot() to directly use the complex frequency response for plotting: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index: src/freqplot.py =================================================================== --- src/freqplot.py (revision 293) +++ src/freqplot.py (working copy) @@ -227,14 +227,12 @@ #TODO: Add MIMO nyquist plots. raise NotImplementedError("Nyquist is currently only implemented for SISO systems.") else: - # Get the magnitude and phase of the system - mag_tmp, phase_tmp, omega = sys.freqresp(omega) - mag = np.squeeze(mag_tmp) - phase = np.squeeze(phase_tmp) + # Get the system response as complex numbers + z = sys.evalfr(omega)[0,0,:] # Compute the primary curve - x = sp.multiply(mag, sp.cos(phase)); - y = sp.multiply(mag, sp.sin(phase)); + x = np.real(z) + y = np.imag(z) if (Plot): # Plot the primary curve and mirror image ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ With this patch my nyquist plots look ok. What do you think of this change? Best regards Erik Fleischer -- Andrew Lewis: "Wenn Sie für einen Dienst nichts bezahlen, sind Sie offenbar nicht Kundin oder Kunde, sondern die Ware, die verkauft wird." |
From: <mur...@us...> - 2014-03-23 20:39:55
|
Revision: 298 http://sourceforge.net/p/python-control/code/298 Author: murrayrm Date: 2014-03-23 20:39:48 +0000 (Sun, 23 Mar 2014) Log Message: ----------- Timestampled 0.6d release in ChangeLog Modified Paths: -------------- trunk/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2014-03-22 19:42:52 UTC (rev 297) +++ trunk/ChangeLog 2014-03-23 20:39:48 UTC (rev 298) @@ -1,3 +1,5 @@ +---- control-0.6d released ----- + 2014-03-22 Richard Murray <murray@sidamo.local> * src/matlab.py (ss): allow five arguments to create a discrete time |
From: <mur...@us...> - 2014-03-22 19:43:06
|
Revision: 297 http://sourceforge.net/p/python-control/code/297 Author: murrayrm Date: 2014-03-22 19:42:52 +0000 (Sat, 22 Mar 2014) Log Message: ----------- tagged v0.6d and updated version to 0.6e Modified Paths: -------------- trunk/doc/conf.py trunk/setup.py Added Paths: ----------- tags/control-0.6d/ tags/control-0.6d/ChangeLog tags/control-0.6d/external/yottalab.py tags/control-0.6d/src/bdalg.py tags/control-0.6d/src/dtime.py tags/control-0.6d/src/frdata.py tags/control-0.6d/src/matlab.py tags/control-0.6d/tests/discrete_test.py tags/control-0.6d/tests/frd_test.py Removed Paths: ------------- tags/control-0.6d/ChangeLog tags/control-0.6d/external/yottalab.py tags/control-0.6d/src/bdalg.py tags/control-0.6d/src/dtime.py tags/control-0.6d/src/frdata.py tags/control-0.6d/src/matlab.py tags/control-0.6d/tests/discrete_test.py tags/control-0.6d/tests/frd_test.py Deleted: tags/control-0.6d/ChangeLog =================================================================== --- trunk/ChangeLog 2013-07-16 14:59:20 UTC (rev 293) +++ tags/control-0.6d/ChangeLog 2014-03-22 19:42:52 UTC (rev 297) @@ -1,1075 +0,0 @@ -2013-07-15 Richard Murray <murray@altura-2.local> - - * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and - __rtruediv__ for compatibility with python3 - -2013-07-14 Richard Murray <murray@altura-2.local> - - * src/dtime.py (sample_system): added check to make sure - cont2discrete is available in scipy.signal - (sample_system): added docstring - -2013-06-24 Richard Murray <murray@altura-2.local> - - * tests/minreal_test.py (TestMinreal.testMinrealBrute), - src/xferfcn.py (_convertToTransferFunction), src/statesp.py - (StateSpace.__rmul__), src/margins.py (stability_margins): changed - exception syntax to be python3 compatibile (works for python2.6+) - -2013-06-10 Richard Murray <murray@altura-2.local> - - * src/xferfcn.py (TransferFunction.horner): small fix to docstring - - * src/freqplot.py (nyquist_plot): small fix to docstring - -2013-06-09 Richard Murray <murray@altura-2.local> - - * tests/bdalg_test.py (TestFeedback.testScalarSS) - (TestFeedback.testScalarTF): added simple test of default argument - to feedback() for state space and transfer function systems - - * tests/frd_test.py (TestFRD.testFeedback): added test of default - argument to feedback() for FRD type - - * src/bdalg.py (feedback): - * src/frdata.py (FRD.feedback): - * src/statesp.py (StateSpace.feedback): - patched in default value of 1 for other system in feedback(). - Contributed by Ryan Krauss <rk...@si...> - - * tests/xferfcn_test.py (TestXferFcn.testEvalFrMIMO) - (TestXferFcn.testEvalFrSISO): added tests of __call__ version of - evalfr. - - * src/xferfcn.py (TransferFunction.__call__): patched in new - __call__ functionality from Ryan Krauss <rk...@si...>, but - modified to use evalfr (works with MIMO). SISO transfer functions - return a single complex number, MIMO transfer functions return a - matrix of complex numbers. - -2013-05-23 Rene van Paassen <ren...@gm...> - - * src/margin.py: re-vamped stability_margins function. Now - uses analytical method for TF and state-space, works on FRD - objects too, and can optionally return all margins found for - the analytical method. - - * src/xferfcn.py and src/frdata.py: Now return array result - for fresp when called with an iterable frequency vector - - * src/xferfcn.py and src/statesp.py: added minreal functions - - * src/bdalg.py: implemented append and connect functions (old - version, with indexes, not with names) - - * src/matlab.py: added connect, append, minreal - - * src/xferfcn.py and src/statesp.py: added/corrected - __rmul__. In most cases a gain matrix (np.matrix) may now be - used in combination with ss or tf systems. - -2012-11-10 Richard Murray <murray@altura.local> - - * src/canonical.py: new module implementing conversions to selected - canonical forms: canonical_form(), reachable_form() implemented - - * src/lti.py (issiso): new function to quickly check if a system is - single input, single output or not - -2012-11-04 Richard Murray <murray@altura.local> - - * src/__init__.py: added action item to separate out matlab module - functionality (eventually) - - * src/matlab.py: added code for setting up MATLAB defaults if matlab - submodule is imported instead of main (control) module. See - comments in __init.py__ for what needs to be done to implement. - - * src/freqplot.py (bode_plot): moved default values of plotting - options to config module to allow easier use override - - * src/config.py: new module to help set package defaults - - * src/xferfcn.py (_convertToTransferFunction): removed extraneous - print statements if slycot is not installed - - * src/statesp.py (StateSpace.__str__): fixed error in printing - timebase when dt is None (python 3) - ----- control-0.6c released ----- - -2012-11-03 Richard Murray <murray@altura.local> - - * doc/modules.rst: updated documentation format so that items are - broken down by functionality and not internal module name. Still - not complete, but most functions should now show up in documentation. - - * doc/index.rst: got rid of todos from documentation (not formatted - correctly and shouldn't show up in user documentation) - - * src/lti.py: added missing docstrings - - * doc/intro.rst: small tweaks to text, including adding a link to FBS - -2012-11-03 Richard Murray <murray@altura.local> - - * src/rlocus.py (_RLSortRoots): convert output of range() to - explicit list for python 3 compatability - - * tests/modelsimp_test.py, tests/slycot_convert_test.py, - tests/mateqn_test.py, tests/statefbk_test.py: updated test suites to - skip specific tests that require slycot if it is not installed - - * src/exception.py (slycot_check): added a function to check if - slycot is installed - - * README: updated readme to include information about running - nosetests, which works in python3 (unlike the test_all.py script) - - * tests/test_control_matlab.py, tests/test_all.py: set to executable - so that nosetests does not run this file (it already runs all unit - tests in this directory). Add comments at top talking about tests. - - * tests/discrete_test.py (TestDiscrete.test_discrete_bode): - explicitly create a list from map() output for python 3 - - * src/frdata.py: removed long data type from comparisons for - constant systems (not supported in python3) - - * src/xferfcn.py (TransferFunction.freqresp): force frequencies to - be a list (map returns iterator in python3) - - * src/lti.py (isdtime, isctime): updated timebase checking since - python3 won't allow dt to be compared to integer - - * src/__init__.py: updated frdata import to python3 compatible form - - * src/statesp.py (_convertToStateSpace): fixed exception syntax to - be python3 compatible - - * examples/pvtol-nested.py: converted print statements to be python3 - compatible - - * doc/class_strings.rst: added FRD class to list of classes that - show up in the user documentation - - * examples/rss-balred.py: fixed error in output argument order for - call to matlab.impulse - - * ../README: updated readme file as a test of post-commit hook - -2012-11-02 Richard Murray <murray@altura.local> - - * doc/conf.py, setup.py: updated version number to 0.6c - - * tests/frd_test.py: unit tests for FRD data type - (suite): added suite() function to allow test_all.py to work - - * tests/xferfcn_test.py (TestXferFcn.testMinreal): new unit test - - * src/xferfcn.py (TransferFunction.minreal): new function for - removing cancelling pole/zero pairs, contributed by M.M. (Rene) van - Paassen - - * src/statesp.py (_convertToStateSpace): new functionality for - converting a matrix to a constant system - - * src/modelsimp.py (minreal): removed extraneous code (moved to - xferfcn.py) - - * src/frdata.py: new file implementing FRD data type, contributed by - M.M. (Rene) van Paassen - - * src/xferfcn.py: resolved conflict between versions - ----- control-0.6b released ----- - -2012-11-02 Richard Murray <murray@altura.local> - - * src/xferfcn.py, src/statesp.py, src/lti.py, src/bdalg.py: - constants must now be of type 'int' rather than 'long' (for python 3 - compatibility) - - * tests/statefbk_test.py, tests/slycot_convert_test.py, - tests/convert_test.py: added import __future__ calls for python 3 - compatibility; updated print calls - - * src/modelsimp.py, src/xferfcn.py, src/delay.py, src/phaseplot.py, - src/margins.py, src/statesp.py, src/mateqn.py: added import - __future__ calls for python 3 compatibility - -2012-11-02 Richard Murray <murray@altura.local> - - * src/xferfcn.py, src/timeresp.py, src/statesp.py, src/statefbk.py, - src/robust.py, src/rlocus.py, src/pzmap.py, src/phaseplot.py, - src/nichols.py, src/modelsimp.py, src/matlab.py, src/margins.py, - src/freqplot.py, src/ctrlutil.py, src/bdalg.py: globally referenced - import commands for python 3.x - - * src/__init__.py: changed import commands to be global instead of - local ('from control.bdalg ...' instead of 'from bdalg ...') - -2012-10-31 Richard Murray <murray@altura.local> - - * src/xferfcn.py (TransferFunction._common_den): converted print - statements to python 3 compatible form and included - __future__.print_function - - * src/phaseplot.py: converted print statements to python 3 - compatible form and included __future__.print_function - - * src/mateqn.py (lyap, dlyap): converted except T, E to except T(E) - - * src/margins.py: converted print statements to python 3 - compatible form and included __future__.print_function - - * src/xferfcn.py (TransferFunction.__add__, __mul__, __div__, - feedback): converted raise T, E to raise T(E) for python 3 - - * src/xferfcn.py (TransferFunction.returnScipySignalLti): fixed - raise(T(E)) bug - - * src/statesp.py (_rss_generate): fixed raise(T(E)) bug - - * src/statefbk.py (acker, gram): converted raise T, E to raise T(E) for - python 3 - - * src/modelsimp.py (hsvd, modred, balred): fixed raise(T(E)) bug and - converted raise T, E to raise T(E) for python 3 - - * src/margins.py (stability_margins): fixed raise(T(E)) bug - - * src/statesp.py: converted raise T, E to raise T(E) for python 3 - - * tests/test_all.py: converted print statements to python 3 - compatible form and included __future__.print_function - - * tests/statefbk_test.py (TestStatefbk.setUp): turned off debugging - flag (accidently left on) - ----- control-0.6a released ----- - -2012-10-27 Richard Murray <murray@altura.local> - - * src/statefbk.py (acker): small updates to docstring - - * src/bdalg.py (feedback): fixed up docstring formatting (for sphinx) - - * tests/statefbk_test.py (TestStatefbk.testAcker): skip - ill-conditioned systems and loosened tolerances on acker() testing - - * src/lti.py (timebaseEqual): replaced "type(sys.dt) == NoneType" - with "sys.dt is None", based on feedback from Luke Peterson that - NoneType is deprecated in python 3. - -2012-10-22 Richard Murray <murray@altura.local> - - * examples/genswitch.py (genswitch): updated calls to legend, fixing - problem pointed out by Scott Livingston - -2012-10-19 Richard Murray <mu...@dn...net> - - * src/matlab.py (rlocus): reverted change in default argument - processing for klist. This has some negative consequences: - http://www.deadlybloodyserious.com/2008/05/default-argument-blunders/ - -2012-10-18 Richard Murray <mu...@dn...net> - - * src/freqplot.py (gangof4_plot, nyquist_plot): discrete time - systems supported (through fresp) - - * src/statesp.py (StateSpace.evalfr): added warning if discrete time - evaluation is above Nyquist frequency - - * src/xferfcn.py (TransferFunction.evalfr, freqresp): : added - warning if discrete time evaluation is above Nyquist frequency - - * tests/discrete_test.py (TestDiscrete.test_discrete_bode): - rudimentary unit test for discrete bode plot - - * src/freqplot.py (bode_plot): fixed bug where input frequency list - was being overwritten by default frequency range - - * src/xferfcn.py (TransferFunction.evalfr, freqresp): handles dtime - - * src/statesp.py (StateSpace.evalfr): handles dtime - - * src/lti.py (timebaseEqual): converted function to take systems as - inputs instead of dt as input (also affected functions in statesp.py - and xferfcn.py) - - * src/lti.py (timebase): timebase now returns dt instead of - 'ctime'/'dtime' - -2012-10-13 Richard Murray <mu...@dn...net> - - * src/lti.py (timebase): new function to return timebase. Doesn't - yet handle the case where dt == None. - -2012-10-07 Richard Murray <murray@altura.local> - - * src/matlab.py (c2d): MATLAB compatible function (just calls - sample_system) - - * tests/discrete_test.py (TestDiscrete.test_sample_system): unit - test for sampling - - * src/dtime.py (sample_system, _c2dmatched): new functions, based on - contributiosn from Benjamin White - - * src/dtime.py: added back this file, this time with sampling routes - to convert from continuous to discrete time - - * src/timeresp.py (forced_response): added discrete time simulator, - using dlsim from scipy.signal - -2012-10-07 Richard Murray <murray@altura.local> - - * doc/conf.py: fixed release number (0.6a instead of 0.6c) - - * src/__init__.py: moved timebase functions from dtime to lti - - * src/lti.py: moved isdtime, isctime, timebase, and timebaseEqual - from dtime.py to lti.py. Moved initialization of dt to - Lti.__init__(). - - * src/statesp.py (StateSpace.__init__): Moved dt - initialization to Lti object initialization - - * src/xferfcn.py (TransferFunction.__init__): Moved dt - initialization to Lti object initialization - -2012-10-06 Richard Murray <murray@altura.local> - - * tests/discrete_test.py: added additional tests for dt = True cases - - * src/statesp.py (StateSpace.__str__): show sampling time as - 'unspecified' if dt is a boolean and equal to True - - * src/xferfcn.py (TransferFunction.__str__): don't print sampling - time (dt) if dt = True (discrete time with unspecified time base) - - * src/dtime.py: added code to support dt = True for unspecified - sampling time for a discrete time system - - * src/bdalg.py: much -> must in docstrings - -2012-10-06 Richard Murray <murray@altura.local> - - * src/dtime.py: new module with functions for operating on discrete - time systems - - * src/modelsimp.py: added NotImplementedError for discrete time - * src/freqplot.py: added NotImplementedError for discrete time - - * src/bdalg.py: added documentation about timebases (discrete versus - continuous) - - * src/statesp.py (_mimo2siso): include sampling time - - * src/xferfcn.py (TransferFunction.__str__): added optional var - keyword to allow any symbol to be used - - * src/matlab.py (tf2ss): added code required to keep track of dt - - * src/xferfcn.py (TransferFunction.__str__): added additional string for - discrete time system, plus use 'z' for polynomial variable - (TransferFunction.__neg__): set sampling time for negation - (TransferFunction.__add__): added test for same sampling time - (TransferFunction.__mul__): added test for same sampling time - (TransferFunction.__div__): added test for same sampling time - (TransferFunction.feedback): added test for same sampling time - - * src/statesp.py (StateSpace.__str__): added additional string for - discrete time system - (StateSpace.__add__): added test for same sampling time - (StateSpace.__mul__): added test for same sampling time - (StateSpace.__rmul__): set sampling time for product - (StateSpace.__neg__): set sampling time for negation - (StateSpace.feedback): added test for same sampling time - - * tests/discrete_test.py (TestDiscrete): unit tests for discrete - time systems - - * src/xferfcn.py (TransferFunction.__init__): added dt class - variable for discrete time systems - - * src/statesp.py (StateSpace.__init__): added dt class variable for - discrete time systems - ----- control-0.5c released ----- - -2012-10-03 Richard Murray <murray@altura.local> - - * tests/matlab_test.py (TestMatlab.testSsdata): unit test - - * src/matlab.py (ssdata, tfdata): new functions to return state - space and transfer function object data. For transfer functions, - currenly requires SISO system - - * src/freqplot.py (bode_plot): Adding np.atleast_1d to the - np.squeeze calculations makes it possible to use a single value - frequency list (contributed by Benjamin White) - -2012-09-09 Richard Murray <murray@altura.local> - - * tests/statefbk_test.py (TestStatefbk.testAcker): unit test - - * src/statefbk.py (acker): added acker() from Roberto Bucher. - -2012-08-29 Richard Murray <murray@altura.local> - - * src/xferfcn.py (TransferFunction._common_den): fixed up code for - case where poles have multiplicity > 1. Set end limits of check to - avoid overruning the list + combine complex conjugate pole pairs - from the outside in to prevent small errors from growing. - -2012-08-26 Richard Murray <murray@altura.local> - - * tests/convert_test.py (TestConvert.testConvert): replaced previous - test of transfer function coefficients with a frequency response - test. This is necessary because various degenerate conditions will - generate a situation where the transfer functions are of different - forms but still equal. Eg 0/1 = 1e-17 s + 1e-16 / (s^2 + s + 1). - Still getting errors, but looks like actual problem in conversion. - - * src/statesp.py (_mimo2siso): set default value for warn_conversion - to False - - * tests/convert_test.py (TestConvert.testConvert): Added check to - make sure that we don't create problems with uncontrollable or - unobservable systems. - -2012-08-25 Richard Murray <murray@altura.local> - - * src/xferfcn.py (TransferFunction._common_den): identified bug in - the way that common denominators are computed; see comments in code - regarding complex conjugate pairs. - - * src/statefbk.py (place): repalced nd.size(placed_eigs) with - len(placed_eigs) to fix intermittent problems pointed out by Roberto - Bucher in control-0.3c. - - * tests/rlocus_test.py (TestRootLocus.testRootLocus): added sort() - to test to get rid of problems in which ordering was generating an - error. - - * src/freqplot.py (nyquist_plot): added code from Kevin Davies to - label frequency points in Nyquist plot - - * src/__init__.py: import non-conflicting MATLAB functions by default - - * src/freqplot.py (bode_plot, nyquist_plot): simplified code and - removed unneeded options. To set color, linestyle, etc use keywords - and pass to matplotlib. - -2012-08-24 Richard Murray <murray@altura.local> - - * src/freqplot.py: added in plot enhancements from Kevin Davies - (bode_plot): pass optional arguments and keywords to matplotlib - (get_pow1000): new function for determinine engineering exponent - (gen_prefix): new function to get SI prefix for power of 1000 - - * src/freqplot.py (bode_plot): removed extraneous phase_deg calculation - -2012-01-07 Richard Murray <murray@malabar.local> - - * doc/modules.rst: added new sections for analysis, synthesis, - frequency plots and time response. - - * doc/index.rst (Contents): added modules and examples. - - * src/xferfcn.py (_convertToTransferFunction): added check for - slycot import error. If not present, use signal.lti to perform the - conversion. Only works for SISO. - - * src/statesp.py (_convertToStateSpace): added check for slycot - import error, to allow basic functionality without the presence of - slycot (contributed by Ryan Krauss). - - * tests/slycot_convert_test.py (TestSlycot.testTF): moved slycot - import into test function, so that test script still works even if - time response is not present. - -2011-08-09 Richard Murray <murray@malabar.local> - - * src/timeresp.py: fixed doc reference to time-series-convention - -2011-08-08 Richard Murray <murray@malabar.local> - - * doc/index.rst, doc/modules.rst: Moved MATLAB section into - python-control modules file - -2011-08-07 Richard Murray <murray@malabar.local> - - * doc/conf.py: added autosummary extension - - * doc/timeresp.rst: New file containing listing of functions for - time responses (step, initial, etc) - - * doc/freqplot.rst: New file listing functions for frequency - plots (bode, nyquist, etc) - - * doc/modules.rst: New file that contains a listing of the major - modules in the toolbox - - * doc/index.rst (Contents): Rearranged contents to put modules - documentation in a separate section. Also added examples section - (not quite ready yet). - -2011-08-07 Richard Murray <murray@malabar.local> - - * examples/rss-balred.py: reordered outputs from call to matlab.step - (missed this the first time around) - - * doc/matlab_strings.rst: Matlab -> MATLAB (proper spelling) - - * setup.py, doc/conf.py: updated version to 0.5b - -2011-08-07 Richard Murray <murray@malabar.local> - - * doc/conf.py: Updated version numbers to 0.5a, regenerated - documentation and reposted on web (note that 0.5a tag and source - distribution have this wrong) - ----- control-0.5a released ----- - -2011-08-07 Richard Murray <murray@malabar.local> - - * setup.py: updated version number; next release will be 0.5a since - the changes in function names and argument/return value order (for - time reponses) require small updates in code - - * examples/secord-matlab.py, examples/pvtol-nested-ss.py, - examples/test-response.py, examples/pvtol-nested.py: fixed small bug - in order of output arguments for step command - -2011-08-06 Richard Murray <murray@malabar.local> - - * src/matlab.py (ngrid): copy documentation from nichols_grid - - * src/__init__.py: changed import commands to import specific - functions rather than '*' (better modularity) - - * src/freqplot.py: default function names are now bode_plot, - nyquist_plot and gangof4_plot (still with aliases to non-"_plot" - versions) - - * src/nichols.py (nichols_plot): updated nichols to nichols_plot for - consistency with other python-control plotting functions. Set up - alias for original name - - * src/margins.py: StabilityMargins, PhaseCrossoverFrequencies -> - stability_margins, phase_crossover_frequencies - - * src/phaseplot.py: changed PhasePlot and boxgrid to phase_plot, - box_grid - - * src/timeresp.py: changed ForcedReponse, InitialReponse, - ImpulseReponse and StepResponse to forced_response, - initial_response, impulse_response and step_response. - - * src/rlocus.py: changed RootLocus to root_locus for better - compatability with PEP 8. Also updated unit tests and examples. - -2011-07-25 Richard Murray <murray@malabar.local> - - * tests/phaseplot_test.py: updated unit tests to use new call - signatures - - * examples/phaseplots.py: updated calls to PhasePlot to use new - argument structure - - * src/phaseplot.py (PhasePlot): Updated call signature to be - more pythonic and fixed up documentation. - - * examples/genswitch.py (genswitch): added new example showing - PhasePlot functionality - - * src/phaseplot.py (boxgrid): added function to compute initial - conditions around the edges of a box - -2011-07-24 Richard Murray <murray@malabar.local> - - * tests/margin_test.py: added simple unit tests for margin functions - (initial versions just call functions; some comparisons missing) - - * examples/README: added missing README file - - * examples/phaseplots.py: FBS examples for phaseplot - - * tests/phaseplot_test.py: unit tests for phaseplot - - * src/phaseplot.py: initial cut at phase portrait function, built - from amphaseplot (Feeback Systems [FBS], Astrom and Murray, 2008) - -2011-07-15 Richard Murray <murray@malabar.local> - - * tests/matlab_test.py (TestMatlab): added unittest for margin() - commands (calling format only) - - * src/statesp.py (StateSpace): updated comments - - * tests/margin_test.py: set up unit tests for StabilityMargins() and - PhaseCrossoverFrequencies() - - * src/__init__.py: added margins.py to __init__ - -2011-07-14 Richard Murray <murray@malabar.local> - - * src/margins.py (GainPhaseMargin): moved freqplot.MarginPlot to - margin.StabilityMargins (MarginPlot didn't actually plot anything) - - * src/margins.py (PhaseCrossoverFrequencies): added new function to - compute frequencies that we cross real axis. Contributed by Steffen - Waldherr <wal...@is...> - -2011-07-11 Richard Murray <murray@malabar.local> - - * src/rlocus.py: added real() and imag() to list of functions - imported from numpy - - * src/freqplot.py: renamed plotting functions to BodePlot, - NyquistPlot, GangOf4Plot and MarginPlot. Set up aliases to the more - common names (bode, nyquest, gangof4, margin). Mainly playing - around with idea for the eventual interface to use. - - * tests/matlab_test.py: updated timeresp outputs to match MATLAB - - * src/matlab.py (impulse, initial, lsim, step): switched outputs - from step, impulse, initial, lsim to match MATLAB standard - -2011-07-01 Richard Murray <murray@malabar.local> - - * src/rlocus.py: modified scipy import to only import those - functions that we actually use. This fixes a problem pointed out by - Carsten Knoll (TU Dresden) where control.place could be overwritten - by numpy.place (because of an "from scipy import *" in rlocus.py - - * doc/intro.rst: Added link to scipy web page talking about the - differences between numpy and MATLAB (contributed by Shuo Han). - -2011-06-25 Richard Murray <murray@malabar.local> - - * src/xferfcn.py (TransferFunction._common_den): changed tolerance - for detecting complex valued poles to a user-settable parameter, - with default value 1e-8. This was an attempt to fix errors in the - convert_test.py unittest script (conversion routine was - misclassifying some poles as imaginary when they weren't). - - * src/xferfcn.py (_convertToTransferFunction): converted arguments - to tb04ad to numpy arrays; fixes a unit test error in convert_test.py. - - * src/statefbk.py (gram): convert system matrix passed to sb03md to - numpy array; this fixes a unit test error in modelsimp_test.py. - - * src/matlab.py (impulse): got rid of X0 argument for impulse - response (not implemented in MATLAB). - - * doc/intro.rst: added some quick start information - - * src/matlab.py: added documentation for step, impulse, initial, lsim - - * src/timeresp.py: fixed some MATLAB specific function names in - function doc strings - -2011-06-22 Richard Murray <murray@malabar.local> - - * doc/intro.rst: fixed some small types - - * doc/control.tex: removed (no longer needed) - -2011-06-22 Richard Murray <murray@malabar.local> - - * doc/intro.rst: Added a slightly more general introduction, with a - pointer to the python-control wiki (on sf.net) - - * doc/Makefile: Changed path to sphinx-build to assume it is in the - users path (as opposed to an explicit path) - - * doc/conf.py: Added release information into documentation file - -2011-06-21 Richard Murray <murray@malabar.local> - - * src/statesp.py (_mimo2siso): Moved function from matlab.py. - - * src/timeresp.py: added file documentation + split out and updated - copyright info. Small corrections to documentation. - (InitialResponse): Added missing transpose argument in call to - ForcedResponse - - * src/matlab.py: minor changes to documentation to avoid line wraps - on standard (80 col) terminal window - - * src/matlab.py: removed time-series convention documentation from - matlab.py since current MATLAB version uses standard conventions. - This documentation is currently in timeresp.py. - - * src/*, doc/*: added Eike Welk's documentation modifications - -2011-06-18 Richard Murray <murray@malabar.local> - - * src/timeresp.py, src/matlab.py: moved documentation about time - series convention from matlab.py to timeresp.py - - * examples/pvtol-nested-ss.py: Fixed bug in call to step (wrong - second argument) - - * tests/matlab_test.py: Updated tests to use MATLAB time response - conventions. - - * tests/timeresp_test.py: Created unit tests for timeresp module, - based on matlab_test.py - -2011-06-17 Richard Murray <murray@malabar.local> - - * src/timeresp.py (ForcedResponse): swapped order of input and time - arguments for linear response, following Eike's comment "T must - always be supplied by the user, but U has a useful default value of - 0." - - * src/matlab.py: moved code for lsim, initial, step, and impulse to - timeresp.py and put in new routes that call timeresp.* versions of - the functions with transposeData set to True. - - * src/timesim.py (_check_convert_array): added transpose argument - that will transpose input data before processing it. - - * src/timesim.py: renamed lsim, initial, step, and impulse functions - to ForcedResponse, InitialResponse, StepResponse and - ImpulseResponse. These versions use Eike Welk's input ordering. - - * examples/pvtol-nested.py: calls to step() had screwed up inputs. - Fixed. - -2011-06-17 Richard Murray <murray@malabar.local> - - * src/matlab.py: added MIMO extensions from Eike Welk on 12 Jun - 2011: adds MIMO capabilities for ``lsim``, ``step``, ``impulse``, - ``initial`` - - * src/matlab.py: added changes from Eike Welk on 12 May 2011: - - - An implementation of the four simulation functions ``lsim``, - ``step``, ``initial``, and ``impulse`` of the module ``matlab``. - - - Adds a function ``dcgain`` to the ``matlab`` module, which - computes the gain of a linear system for steady state and - constant input. - - - The patch contains a bug fix for class ``StateSpace``, which - enables it to work properly together with Scipy's ``signal`` - module. - - - The simulation functions' return values are changed (back?) to - arrays, because matrices confuse Matplotlib. - - - New times series convention: see _time-series-convention section - of matlab documentation - - - SISO simulation data are squeezed on output. To turn this off, - pass the option squeeze=False - ----- control-0.4c released ----- - -2011-06-17 Richard Murray <mu...@dh...> - - * examples/tfvis.py: Added tfvis, Simple GUI application for - visualizing how the poles/zeros of the transfer function effects the - bode, nyquist and step response of a SISO system. Contributed by - Vanessa Romero Segovia, Ola Johnsson, Jerker Nordh. - -2011-06-16 Richard Murray <murray@malabar.local> - - * src/matlab.py: import mateqn functions - - * src/__init__.py: import mateqn functions - - * tests/test_all.py: added unit tests for matrix solvers, converting - to standard format along the way. Seems to work even if slycot - routines are not in place, but I'm not sure if this is for the right - reasons... - - * src/mateqn.py: added matrix solvers from LTH (Ola Johnsson, Jerker - Nordh, Bjorn Olofsson, Vanessa Romero). Moved slycot function - checks to the portion of the code where they are used, so that - missing slycot doesn't mess up initialization if proper version of - slycot is not available. - -2011-04-02 Richard Murray <murray@malabar.local> - - * src/xferfcn.py (TransferFunction.__add__): fixed bug when adding a - transfer function to state space system; _convertToTransferFunction - was being called with input/output keywords. Picked up in unit test. - - * tests/matlab_test.py: added calls to all of the functions that are - currently implemented in the library, to make sure there are no - hidden issues. These calls do *not* test functionality, they just - make sure that MATLAB compatibility functions accept the right types - of arguments. - - * examples/secord-matlab.py: added root locus plot to list of - figures that are produced - - * src/__init__.py: added rlocus to list of modules that are imported - by control module - - * src/exception.py (ControlMIMONotImplemented): added exception for - functions that are not yet implemented for MIMO systems - - * src/xferfcn.py (TransferFunction.__init__): convert integer - numerator and denominator objects to floats to eliminate errors when - creating common denominator (also used on pole command). This fixes - and error were tf([1], [1, 2, 1]).pole() would generate an error. - - * src/freqplot.py (bode): Tweaked documentation string to remove 'h' - from mag and phase return arguments - - * src/rlocus.py (RootLocus): removed commands that set figure number - inside of RootLocus command, for consistency with other frequency - plot routines. Added Plot=True argument and updated documentation. - - * src/matlab.py: added rlocus() command (calls RootLocus) - - * MANIFEST.in: Added MANIFEST.in file to include examples and tests - in source distribution - - * README: Updated to include information on how to run unit tests. - - * setup.py: updated version number to 0.4c - ----- control-0.4b released ----- - -2011-04-02 Richard Murray <murray@malabar.local> - - * src/__init__.py: removed import of tests module (moved to tests/) - - * src/matlab.py: Added hsvd, balred, modred to list of functions - that are imported for use as is. Updated documentation string to - indicate that these are implemented, along with a few other - functions (zero, lqr) that weren't properly listed. - - * src/modelsimp.py (balred): Removed extraneous print statements - (modred): Set method to be 'matchdc' by default (to match MATLAB) - - * src/__init__.py: added missing import of modelsimp functions - - * tests/slycot_convert_test.py (TestSlycot.testTF): turned off print - statements in unit test to make it easier to see results. Use - verbose=True to turn back on. - - * tests/convert_test.py (TestConvert.testConvert): got rid of print - statements in unittest; clutters the output so that you can't see - the errors clearly. Use verbose=True to turn back on. - - * src/statesp.py (_convertToStateSpace): removed "buggy" print - statements - - * src/xferfcn.py (_convertToTransferFunction): removed "buggy" print - statements - - * tests/nichols_test.py (TestStateSpace.testNgrid): updated testcode - to turn off grid in initial Nichols chart plot. - - * src/freqplot.py: updated comments at top of file to reflect - nichols chart move - - * src/nichols.py: transferred over changes from v0.3d - - * src/matlab.py (ngrid): moved import to function - -2011-03-31 Richard Murray <murray@malabar.local> - - * examples/pvtol-nested.py: updated stability margin plot to use - proper calling format for bode(). - - * src/statesp.py (_convertToStateSpace): moved slycot import - to the location where it is actually needed (allows running some - commands without slycot installed) - - * src/xferfcn.py (_convertToTransferFunction): moved slycot import - to the location where it is actually needed (allows running some - commands without slycot installed) - - * src/nichols.py: new file for Nichols plot routines; move - nichols(), nichols_grid(), closed_loop_contours(), m_circles(), - n_circles() - - * src/__init__.py, src/freqresp.py, src/matlab.py: updated to match - new file structure for Nichols charts - - * src/nichols.py (nichols): updated processing of freqresp to take - into account the fact that return arguments are now a matrix of - results (even for a SISO system) - -2011-03-30 Richard Murray <murray@malabar.local> - - * tests/: added top level subdirectory, to be used for unit tests. - The idea in putting the code here is that you can do 'setup.py test' - during installation to make sure everything is working correctly. - The test code would normally *not* be callable from the installed - module. - - * tests/*_test.py: moved from src/Test*.py - - * setup.py: updated version number. - -2011-02-13 Richard Murray <murray@sumatra.local> - - * src/*.py: added svn:keywords Id properly - - * src/matlab.py (ngrid): added ngrid() from v0.3d - - * src/freqplot.py (nichols_grid, closed_loop_contours, m_circles, - n_circles): copied over changes from Allan McInnes in v0.3d; ngrid() - functiality + split out some of the nichols chart code into separate - functions - -2011-02-12 Richard Murray <murray@sumatra.local> - - * setup.py: updated version number to 0.4a - -2010-11-05 Richard Murray <murray@sumatra.local> - - * external/yottalab.py: New file containing Roberto Bucher's control - library functions. OK to start pulling these into the main library, - with attribution, but note that they use modifications of the - default library => some rewrites will be needed. - -2010-09-11 Richard Murray <murray@sumatra.local> - - * src/matlab.py (step): Added local step response function that uses - lsim2() instead of signal.step (which can't handle integrators). - This function may not be needed when new scipy step2() function is - available. - (impulse): Added local impulse response function that sets the - initial condition based on the input matrix and then uses the - lsim2() function to compute the response. - - * examples/test-response.py: Added test script for making sure that - time repsonse functions are working as desired - - * src/matlab.py (lsim): Added local version of lsim that calls - signal.lsim2 (actual ODE integrator) - -2010-09-06 Richard Murray <murray@sumatra.local> - - * src/statefbk.py (ctrb): new function for testing controllability - * src/statefbk.py (obsv): new function for testing observabiilty - -2010-09-02 Richard Murray <murray@sumatra.local> - - * src/statefbk.py (place): Use np.size() instead of len() for - finding length of placed_eigs for better compatability with - different python versions [courtesy of Roberto Bucher] - - * src/delay.py (pade): New file for delay-based computations + - initial implementation of pade() [courtesy Sawyer Fuller] - -2010-06-17 Richard Murray <murray@sumatra.local> - - * src/rlocus.py: changed num, den to nump, denp for clarity - * src/rlocus.py: new file with Ryan Krauss's root locus code - -2010-06-06 Richard Murray <murray@sumatra.local> - - * examples/pvtol-lqr.py: Added example to test out LQR routines - - * src/matlab.py (bode): created a wrapper that allows MATLAB style - arguments for bode (eg, bode(sys1, sys2)) - - * src/ctrlutil.py (issys): added new function to check if an object - is a system (state space or transfer function). Will generalize - this latter to look for other compatible classes. - - * src/freqplot.py (bode): Compute frequency range of bode plot based - on poles and zeros - (bode): Allow bode plot to be passed a list (or tuple) as the first - argument, in which case multiple bode plots are generated - - * src/statesp.py (StateSpace.zeros): new function to compute zeros - for a state space system - (StateSpace): defined new functions to compute poles of a state - space system - - * src/xferfcn.py (TransferFunction): defined new functions to - compute poles and zeros of a transfer function. - -2010-05-31 Richard Murray <murray@sumatra.local> - - * src/exception.py (ControlNotImplemented): added new exception, to - be used for functions that are not yet implemented - - * src/statefbk.py (lqr): added lqr function (using slycot). Still - needs to be verified to make sure calculations are correct. - - * ChangeLog: converted to standard GNU formation (old style below) - * setup.py: updated package number to v0.3, changed URL to - sourceforge wiki - ------------------- -31 May 2010, RMM: added place() function using slycot - * New module: statefbk - functions to design state feedback controllers - * Uses Enrico Avventi slycot wrappers (http://github.com/avventi/Slycot) - * Also added some exception types: ControlSlycot and ControlDimension - * Added new example to test slycot interface (directly) - -29 May 2010, RMM: updated function documentation - * Added __doc__ strings for all current functions - * Added __doc__ string to matlab module, listing control toolbox functions - -22 May 2010, RMM: tweaked comments and released v0.3a - * Changed copyright information on modified files to 2010 - * Updated "to do" comments to use "#! TODO:" as prefix - -11 Feb 2010, GR: implemented and tested state space feedback -15 Jan 2010, GR: added new example, improved bode - -4 Jan 2010, GR: updated bode plots - * made bode plot more like matlab - * added options for plotting in dB, Hz - -27 Dec 2009, GR: important bug fix: feedback TFs were being divided by two - -10 Oct 09, RMM: reset matplotlib import in secord-matlab - * Using 'from matplotlib import *' causes error with figures - * On my other computer, got error when trying to import 'matplotlib.pyplot' - * Need to sort out versions and figure out proper import structure - -13 Sep 09, RMM: added basic state space functionality - * Updated StateSpace routines to allow BD algebra with constants - * Updated pvtol-nested example to try to use state space representation - (not completely working yet) - -12 Sep 09, RMM: code restructuring for transfer functions - * Implemented feedback() method in bldalg; partially working - for mixture of TF, SS and numbers (not thoroughly tested yet) - * New feedback method for TransferFunctions - * Updated gangof4 to use new feedback function - -9 Sep 09, RMM: updated pzmap to generate a plot (turn off with Plot=False) - -8 Sep 09, RMM: rewrite of xferfcn to handle type casting better - * Appropriate functions now call convertToTransferFunction - * Restricted transfer function to SISO only - -7 Sep 09, RMM: additional fixes - * Implemented block diagram operations for SISO transfer functions - * Modified frequency response functions for transfer functions - * Added rudimentary pole/zero computations - * Added comments on things that need to be fixed (search for !) - -5 Sep 09, RMM: updates to get standard examples working - * Copied and converted pvtol_nested.py from AM08, Chapter 11 - * Updated freqresp to use poly1d for computing values - * Added outputs to bode plot - return mag and phase subplot handles - -2009-05-24 Richard Murray <murray@kona-2.local> - * ./ Initial creation of package files and ChangeLog - * Using simpler text format since emacs python mode doesn't support - ChangeLog entries anyway - - -Local Variables: -mode:text -End: Copied: tags/control-0.6d/ChangeLog (from rev 296, trunk/ChangeLog) =================================================================== --- tags/control-0.6d/ChangeLog (rev 0) +++ tags/control-0.6d/ChangeLog 2014-03-22 19:42:52 UTC (rev 297) @@ -0,0 +1,1098 @@ +2014-03-22 Richard Murray <murray@sidamo.local> + + * src/matlab.py (ss): allow five arguments to create a discrete time + system. From Roberto Bucher, 12 Jan 2014 + +2014-03-22 Richard Murray <murray@sidamo.local> + + * src/bdalg.py (feedback): allow FRD for feedback() + +2014-03-22 Richard Murray <murray@sidamo.local> + + * tests/discrete_test.py (TestDiscrete.test_sample_system): added + conversions using tustin and zoh to catch 'dt' bug #5 + + * src/dtime.py (sample_system): Changed 'dt' to 'Ts' to fix bug #4 + + * tests/frd_test.py (TestFRD.testbdalg): added unit tests for bdalg + functions operating on FRD data + + * src/bdalg.py (series, parallel, negate, feedback): updated + documentation to note that FRD ovjects work. + (feedback): updated conversions to allow for FRD + +2013-07-15 Richard Murray <murray@altura-2.local> + + * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and + __rtruediv__ for compatibility with python3 + +2013-07-14 Richard Murray <murray@altura-2.local> + + * src/dtime.py (sample_system): added check to make sure + cont2discrete is available in scipy.signal + (sample_system): added docstring + +2013-06-24 Richard Murray <murray@altura-2.local> + + * tests/minreal_test.py (TestMinreal.testMinrealBrute), + src/xferfcn.py (_convertToTransferFunction), src/statesp.py + (StateSpace.__rmul__), src/margins.py (stability_margins): changed + exception syntax to be python3 compatibile (works for python2.6+) + +2013-06-10 Richard Murray <murray@altura-2.local> + + * src/xferfcn.py (TransferFunction.horner): small fix to docstring + + * src/freqplot.py (nyquist_plot): small fix to docstring + +2013-06-09 Richard Murray <murray@altura-2.local> + + * tests/bdalg_test.py (TestFeedback.testScalarSS) + (TestFeedback.testScalarTF): added simple test of default argument + to feedback() for state space and transfer function systems + + * tests/frd_test.py (TestFRD.testFeedback): added test of default + argument to feedback() for FRD type + + * src/bdalg.py (feedback): + * src/frdata.py (FRD.feedback): + * src/statesp.py (StateSpace.feedback): + patched in default value of 1 for other system in feedback(). + Contributed by Ryan Krauss <rk...@si...> + + * tests/xferfcn_test.py (TestXferFcn.testEvalFrMIMO) + (TestXferFcn.testEvalFrSISO): added tests of __call__ version of + evalfr. + + * src/xferfcn.py (TransferFunction.__call__): patched in new + __call__ functionality from Ryan Krauss <rk...@si...>, but + modified to use evalfr (works with MIMO). SISO transfer functions + return a single complex number, MIMO transfer functions return a + matrix of complex numbers. + +2013-05-23 Rene van Paassen <ren...@gm...> + + * src/margin.py: re-vamped stability_margins function. Now + uses analytical method for TF and state-space, works on FRD + objects too, and can optionally return all margins found for + the analytical method. + + * src/xferfcn.py and src/frdata.py: Now return array result + for fresp when called with an iterable frequency vector + + * src/xferfcn.py and src/statesp.py: added minreal functions + + * src/bdalg.py: implemented append and connect functions (old + version, with indexes, not with names) + + * src/matlab.py: added connect, append, minreal + + * src/xferfcn.py and src/statesp.py: added/corrected + __rmul__. In most cases a gain matrix (np.matrix) may now be + used in combination with ss or tf systems. + +2012-11-10 Richard Murray <murray@altura.local> + + * src/canonical.py: new module implementing conversions to selected + canonical forms: canonical_form(), reachable_form() implemented + + * src/lti.py (issiso): new function to quickly check if a system is + single input, single output or not + +2012-11-04 Richard Murray <murray@altura.local> + + * src/__init__.py: added action item to separate out matlab module + functionality (eventually) + + * src/matlab.py: added code for setting up MATLAB defaults if matlab + submodule is imported instead of main (control) module. See + comments in __init.py__ for what needs to be done to implement. + + * src/freqplot.py (bode_plot): moved default values of plotting + options to config module to allow easier use override + + * src/config.py: new module to help set package defaults + + * src/xferfcn.py (_convertToTransferFunction): removed extraneous + print statements if slycot is not installed + + * src/statesp.py (StateSpace.__str__): fixed error in printing + timebase when dt is None (python 3) + +---- control-0.6c released ----- + +2012-11-03 Richard Murray <murray@altura.local> + + * doc/modules.rst: updated documentation format so that items are + broken down by functionality and not internal module name. Still + not complete, but most functions should now show up in documentation. + + * doc/index.rst: got rid of todos from documentation (not formatted + correctly and shouldn't show up in user documentation) + + * src/lti.py: added missing docstrings + + * doc/intro.rst: small tweaks to text, including adding a link to FBS + +2012-11-03 Richard Murray <murray@altura.local> + + * src/rlocus.py (_RLSortRoots): convert output of range() to + explicit list for python 3 compatability + + * tests/modelsimp_test.py, tests/slycot_convert_test.py, + tests/mateqn_test.py, tests/statefbk_test.py: updated test suites to + skip specific tests that require slycot if it is not installed + + * src/exception.py (slycot_check): added a function to check if + slycot is installed + + * README: updated readme to include information about running + nosetests, which works in python3 (unlike the test_all.py script) + + * tests/test_control_matlab.py, tests/test_all.py: set to executable + so that nosetests does not run this file (it already runs all unit + tests in this directory). Add comments at top talking about tests. + + * tests/discrete_test.py (TestDiscrete.test_discrete_bode): + explicitly create a list from map() output for python 3 + + * src/frdata.py: removed long data type from comparisons for + constant systems (not supported in python3) + + * src/xferfcn.py (TransferFunction.freqresp): force frequencies to + be a list (map returns iterator in python3) + + * src/lti.py (isdtime, isctime): updated timebase checking since + python3 won't allow dt to be compared to integer + + * src/__init__.py: updated frdata import to python3 compatible form + + * src/statesp.py (_convertToStateSpace): fixed exception syntax to + be python3 compatible + + * examples/pvtol-nested.py: converted print statements to be python3 + compatible + + * doc/class_strings.rst: added FRD class to list of classes that + show up in the user documentation + + * examples/rss-balred.py: fixed error in output argument order for + call to matlab.impulse + + * ../README: updated readme file as a test of post-commit hook + +2012-11-02 Richard Murray <murray@altura.local> + + * doc/conf.py, setup.py: updated version number to 0.6c + + * tests/frd_test.py: unit tests for FRD data type + (suite): added suite() function to allow test_all.py to work + + * tests/xferfcn_test.py (TestXferFcn.testMinreal): new unit test + + * src/xferfcn.py (TransferFunction.minreal): new function for + removing cancelling pole/zero pairs, contributed by M.M. (Rene) van + Paassen + + * src/statesp.py (_convertToStateSpace): new functionality for + converting a matrix to a constant system + + * src/modelsimp.py (minreal): removed extraneous code (moved to + xferfcn.py) + + * src/frdata.py: new file implementing FRD data type, contributed by + M.M. (Rene) van Paassen + + * src/xferfcn.py: resolved conflict between versions + +---- control-0.6b released ----- + +2012-11-02 Richard Murray <murray@altura.local> + + * src/xferfcn.py, src/statesp.py, src/lti.py, src/bdalg.py: + constants must now be of type 'int' rather than 'long' (for python 3 + compatibility) + + * tests/statefbk_test.py, tests/slycot_convert_test.py, + tests/convert_test.py: added import __future__ calls for python 3 + compatibility; updated print calls + + * src/modelsimp.py, src/xferfcn.py, src/delay.py, src/phaseplot.py, + src/margins.py, src/statesp.py, src/mateqn.py: added import + __future__ calls for python 3 compatibility + +2012-11-02 Richard Murray <murray@altura.local> + + * src/xferfcn.py, src/timeresp.py, src/statesp.py, src/statefbk.py, + src/robust.py, src/rlocus.py, src/pzmap.py, src/phaseplot.py, + src/nichols.py, src/modelsimp.py, src/matlab.py, src/margins.py, + src/freqplot.py, src/ctrlutil.py, src/bdalg.py: globally referenced + import commands for python 3.x + + * src/__init__.py: changed import commands to be global instead of + local ('from control.bdalg ...' instead of 'from bdalg ...') + +2012-10-31 Richard Murray <murray@altura.local> + + * src/xferfcn.py (TransferFunction._common_den): converted print + statements to python 3 compatible form and included + __future__.print_function + + * src/phaseplot.py: converted print statements to python 3 + compatible form and included __future__.print_function + + * src/mateqn.py (lyap, dlyap): converted except T, E to except T(E) + + * src/margins.py: converted print statements to python 3 + compatible form and included __future__.print_function + + * src/xferfcn.py (TransferFunction.__add__, __mul__, __div__, + feedback): converted raise T, E to raise T(E) for python 3 + + * src/xferfcn.py (TransferFunction.returnScipySignalLti): fixed + raise(T(E)) bug + + * src/statesp.py (_rss_generate): fixed raise(T(E)) bug + + * src/statefbk.py (acker, gram): converted raise T, E to raise T(E) for + python 3 + + * src/modelsimp.py (hsvd, modred, balred): fixed raise(T(E)) bug and + converted raise T, E to raise T(E) for python 3 + + * src/margins.py (stability_margins): fixed raise(T(E)) bug + + * src/statesp.py: converted raise T, E to raise T(E) for python 3 + + * tests/test_all.py: converted print statements to python 3 + compatible form and included __future__.print_function + + * tests/statefbk_test.py (TestStatefbk.setUp): turned off debugging + flag (accidently left on) + +---- control-0.6a released ----- + +2012-10-27 Richard Murray <murray@altura.local> + + * src/statefbk.py (acker): small updates to docstring + + * src/bdalg.py (feedback): fixed up docstring formatting (for sphinx) + + * tests/statefbk_test.py (TestStatefbk.testAcker): skip + ill-conditioned systems and loosened tolerances on acker() testing + + * src/lti.py (timebaseEqual): replaced "type(sys.dt) == NoneType" + with "sys.dt is None", based on feedback from Luke Peterson that + NoneType is deprecated in python 3. + +2012-10-22 Richard Murray <murray@altura.local> + + * examples/genswitch.py (genswitch): updated calls to legend, fixing + problem pointed out by Scott Livingston + +2012-10-19 Richard Murray <mu...@dn...net> + + * src/matlab.py (rlocus): reverted change in default argument + processing for klist. This has some negative consequences: + http://www.deadlybloodyserious.com/2008/05/default-argument-blunders/ + +2012-10-18 Richard Murray <mu...@dn...net> + + * src/freqplot.py (gangof4_plot, nyquist_plot): discrete time + systems supported (through fresp) + + * src/statesp.py (StateSpace.evalfr): added warning if discrete time + evaluation is above Nyquist frequency + + * src/xferfcn.py (TransferFunction.evalfr, freqresp): : added + warning if discrete time evaluation is above Nyquist frequency + + * tests/discrete_test.py (TestDiscrete.test_discrete_bode): + rudimentary unit test for discrete bode plot + + * src/freqplot.py (bode_plot): fixed bug where input frequency list + was being overwritten by default frequency range + + * src/xferfcn.py (TransferFunction.evalfr, freqresp): handles dtime + + * src/statesp.py (StateSpace.evalfr): handles dtime + + * src/lti.py (timebaseEqual): converted function to take systems as + inputs instead of dt as input (also affected functions in statesp.py + and xferfcn.py) + + * src/lti.py (timebase): timebase now returns dt instead of + 'ctime'/'dtime' + +2012-10-13 Richard Murray <mu...@dn...net> + + * src/lti.py (timebase): new function to return timebase. Doesn't + yet handle the case where dt == None. + +2012-10-07 Richard Murray <murray@altura.local> + + * src/matlab.py (c2d): MATLAB compatible function (just calls + sample_system) + + * tests/discrete_test.py (TestDiscrete.test_sample_system): unit + test for sampling + + * src/dtime.py (sample_system, _c2dmatched): new functions, based on + contributiosn from Benjamin White + + * src/dtime.py: added back this file, this time with sampling routes + to convert from continuous to discrete time + + * src/timeresp.py (forced_response): added discrete time simulator, + using dlsim from scipy.signal + +2012-10-07 Richard Murray <murray@altura.local> + + * doc/conf.py: fixed release number (0.6a instead of 0.6c) + + * src/__init__.py: moved timebase functions from dtime to lti + + * src/lti.py: moved isdtime, isctime, timebase, and timebaseEqual + from dtime.py to lti.py. Moved initialization of dt to + Lti.__init__(). + + * src/statesp.py (StateSpace.__init__): Moved dt + initialization to Lti object initialization + + * src/xferfcn.py (TransferFunction.__init__): Moved dt + initialization to Lti object initialization + +2012-10-06 Richard Murray <murray@altura.local> + + * tests/discrete_test.py: added additional tests for dt = True cases + + * src/statesp.py (StateSpace.__str__): show sampling time as + 'unspecified' if dt is a boolean and equal to True + + * src/xferfcn.py (TransferFunction.__str__): don't print sampling + time (dt) if dt = True (discrete time with unspecified time base) + + * src/dtime.py: added code to support dt = True for unspecified + sampling time for a discrete time system + + * src/bdalg.py: much -> must in docstrings + +2012-10-06 Richard Murray <murray@altura.local> + + * src/dtime.py: new module with functions for operating on discrete + time systems + + * src/modelsimp.py: added NotImplementedError for discrete time + * src/freqplot.py: added NotImplementedError for discrete time + + * src/bdalg.py: added documentation about timebases (discrete versus + continuous) + + * src/statesp.py (_mimo2siso): include sampling time + + * src/xferfcn.py (TransferFunction.__str__): added optional var + keyword to allow any symbol to be used + + * src/matlab.py (tf2ss): added code required to keep track of dt + + * src/xferfcn.py (TransferFunction.__str__): added additional string for + discrete time system, plus use 'z' for polynomial variable + (TransferFunction.__neg__): set sampling time for negation + (TransferFunction.__add__): added test for same sampling time + (TransferFunction.__mul__): added test for same sampling time + (TransferFunction.__div__): added test for same sampling time + (TransferFunction.feedback): added test for same sampling time + + * src/statesp.py (StateSpace.__str__): added additional string for + discrete time system + (StateSpace.__add__): added test for same sampling time + (StateSpace.__mul__): added test for same sampling time + (StateSpace.__rmul__): set sampling time for product + (StateSpace.__neg__): set sampling time for negation + (StateSpace.feedback): added test for same sampling time + + * tests/discrete_test.py (TestDiscrete): unit tests for discrete + time systems + + * src/xferfcn.py (TransferFunction.__init__): added dt class + variable for discrete time systems + + * src/statesp.py (StateSpace.__init__): added dt class variable for + discrete time systems + +---- control-0.5c released ----- + +2012-10-03 Richard Murray <murray@altura.local> + + * tests/matlab_test.py (TestMatlab.testSsdata): unit test + + * src/matlab.py (ssdata, tfdata): new functions to return state + space and transfer function object data. For transfer functions, + currenly requires SISO system + + * src/freqplot.py (bode_plot): Adding np.atleast_1d to the + np.squeeze calculations makes it possible to use a single value + frequency list (contributed by Benjamin White) + +2012-09-09 Richard Murray <murray@altura.local> + + * tests/statefbk_test.py (TestStatefbk.testAcker): unit test + + * src/statefbk.py (acker): added acker() from Roberto Bucher. + +2012-08-29 Richard Murray <murray@altura.local> + + * src/xferfcn.py (TransferFunction._common_den): fixed up code for + case where poles have multiplicity > 1. Set end limits of check to + avoid overruning the list + combine complex conjugate pole pairs + from the outside in to prevent small errors from growing. + +2012-08-26 Richard Murray <murray@altura.local> + + * tests/convert_test.py (TestConvert.testConvert): replaced previous + test of transfer function coefficients with a frequency response + test. This is necessary because various degenerate conditions will + generate a situation where the transfer functions are of different + forms but still equal. Eg 0/1 = 1e-17 s + 1e-16 / (s^2 + s + 1). + Still getting errors, but looks like actual problem in conversion. + + * src/statesp.py (_mimo2siso): set default value for warn_conversion + to False + + * tests/convert_test.py (TestConvert.testConvert): Added check to + make sure that we don't create problems with uncontrollable or + unobservable systems. + +2012-08-25 Richard Murray <murray@altura.local> + + * src/xferfcn.py (TransferFunction._common_den): identified bug in + the way that common denominators are computed; see comments in code + regarding complex conjugate pairs. + + * src/statefbk.py (place): repalced nd.size(placed_eigs) with + len(placed_eigs) to fix intermittent problems pointed out by Roberto + Bucher in control-0.3c. + + * tests/rlocus_test.py (TestRootLocus.testRootLocus): added sort() + to test to get rid of problems in which ordering was generating an + error. + + * src/freqplot.py (nyquist_plot): added code from Kevin Davies to + label frequency points in Nyquist plot + + * src/__init__.py: import non-conflicting MATLAB functions by default + + * src/freqplot.py (bode_plot, nyquist_plot): simplified code and + removed unneeded options. To set color, linestyle, etc use keywords + and pass to matplotlib. + +2012-08-24 Richard Murray <murray@altura.local> + + * src/freqplot.py: added in plot enhancements from Kevin Davies + (bode_plot): ... [truncated message content] |
From: <mur...@us...> - 2014-03-22 19:31:47
|
Revision: 296 http://sourceforge.net/p/python-control/code/296 Author: murrayrm Date: 2014-03-22 19:31:36 +0000 (Sat, 22 Mar 2014) Log Message: ----------- allow 5 arguments for matlab.ss() command to create discrete time system Modified Paths: -------------- trunk/ChangeLog trunk/external/yottalab.py trunk/src/matlab.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2014-03-22 18:30:41 UTC (rev 295) +++ trunk/ChangeLog 2014-03-22 19:31:36 UTC (rev 296) @@ -1,5 +1,10 @@ 2014-03-22 Richard Murray <murray@sidamo.local> + * src/matlab.py (ss): allow five arguments to create a discrete time + system. From Roberto Bucher, 12 Jan 2014 + +2014-03-22 Richard Murray <murray@sidamo.local> + * src/bdalg.py (feedback): allow FRD for feedback() 2014-03-22 Richard Murray <murray@sidamo.local> Modified: trunk/external/yottalab.py =================================================================== --- trunk/external/yottalab.py 2014-03-22 18:30:41 UTC (rev 295) +++ trunk/external/yottalab.py 2014-03-22 19:31:36 UTC (rev 296) @@ -1,5 +1,3 @@ -# yottalab.py - Roberto Bucher's yottalab library - """ This is a procedural interface to the yttalab library @@ -8,104 +6,314 @@ The following commands are provided: Design and plot commands - acker - pole placement using Ackermann method - c2d - contimous to discrete time conversion + bb_c2d - contimous to discrete time conversion + d2c - discrete to continous time conversion + bb_dare - Solve Riccati equation for discrete time systems + bb_dlqr - discrete linear quadratic regulator + dsimul - simulate discrete time systems + dstep - step response (plot) of discrete time systems + dimpulse - imoulse response (plot) of discrete time systems + bb_step - step response (plot) of continous time systems + full_obs - full order observer red_obs - reduced order observer comp_form - state feedback controller+observer in compact form comp_form_i - state feedback controller+observer+integ in compact form - dsimul - simulate discrete time systems - dstep - step response (plot) of discrete time systems - dimpulse - imoulse response (plot) of discrete time systems - bb_step - step response (plot) of continous time systems sysctr - system+controller+observer+feedback - care - Solve Riccati equation for contimous time systems - dare - Solve Riccati equation for discrete time systems - dlqr - discrete linear quadratic regulator - minreal - minimal state space representation - + set_aw - introduce anti-windup into controller + bb_dcgain - return the steady state value of the step response + """ from matplotlib.pylab import * -from control.matlab import * +from control import * from numpy import hstack,vstack,pi from scipy import zeros,ones,eye,mat,shape,size,size, \ arange,real,poly,array,diag -from scipy.linalg import det,inv,expm,eig,eigvals +from scipy.linalg import det,inv,expm,eig,eigvals,logm import numpy as np import scipy as sp -from slycot import sb02od, tb03ad +from slycot import sb02od +# from scipy.signal import BadCoefficients +# import warnings +# warnings.filterwarnings('ignore',category=BadCoefficients) -def acker(A,B,poles): - """Pole placemenmt using Ackermann method +def bb_c2d(sys,Ts,method='zoh'): + """Continous to discrete conversion with ZOH method Call: - k=acker(A,B,poles) + sysd=c2d(sys,Ts,method='zoh') Parameters ---------- - A, B : State and input matrix of the system - poles: desired poles + sys : System in statespace or Tf form + Ts: Sampling Time + method: 'zoh', 'bi' or 'matched' Returns ------- - k: matrix - State feedback gains + sysd: ss or Tf system + Discrete system """ - a=mat(A) - b=mat(B) - p=real(poly(poles)) - ct=ctrb(A,B) - if det(ct)==0: - k=0 - print "Pole placement invalid" + flag = 0 + if isinstance(sys, TransferFunction): + sys=tf2ss(sys) + flag=1 + + a=sys.A + b=sys.B + c=sys.C + d=sys.D + n=shape(a)[0] + nb=shape(b)[1] + nc=shape(c)[0] + + if method=='zoh': + ztmp=zeros((nb,n+nb)) + tmp=hstack((a,b)) + tmp=vstack((tmp,ztmp)) + tmp=expm(tmp*Ts) + A=tmp[0:n,0:n] + B=tmp[0:n,n:n+nb] + C=c + D=d + elif method=='bi': + a=mat(a) + b=mat(b) + c=mat(c) + d=mat(d) + IT=mat(2/Ts*eye(n,n)) + A=(IT+a)*inv(IT-a) + iab=inv(IT-a)*b + tk=2/sqrt(Ts) + B=tk*iab + C=tk*(c*inv(IT-a)) + D=d+c*iab + elif method=='matched': + if nb!=1 and nc!=1: + print "System is not SISO" + return + p=exp(sys.poles*Ts) + z=exp(sys.zeros*Ts) + infinite_zeros = len(sys.poles) - len(sys.zeros) - 1 + for i in range(0,infinite_zeros): + z=hstack((z,-1)) + [A,B,C,D]=zpk2ss(z,p,1) + sysd=StateSpace(A,B,C,D,Ts) + cg = dcgain(sys) + dg = dcgain(sysd) + [A,B,C,D]=zpk2ss(z,p,cg/dg) else: - n=size(p) - pmat=p[n-1]*a**0 - for i in arange(1,n): - pmat=pmat+p[n-i-1]*a**i - k=inv(ct)*pmat - k=k[-1][:] - return k + print "Method not supported" + return + + sysd=StateSpace(A,B,C,D,Ts) + if flag==1: + sysd=ss2tf(sysd) + return sysd -def c2d(sys,Ts): +def d2c(sys,method='zoh'): """Continous to discrete conversion with ZOH method Call: - sysd=c2d(sys,Ts) + sysc=c2d(sys,method='log') Parameters ---------- - sys : System in statespace or Tf form - Ts: Sampling Time + sys : System in statespace or Tf form + method: 'zoh' or 'bi' Returns ------- - sysd: ss or Tf system - Discrete system + sysc: continous system ss or tf + """ flag = 0 - if type(sys).__name__=='TransferFunction': + if isinstance(sys, TransferFunction): sys=tf2ss(sys) flag=1 + a=sys.A b=sys.B c=sys.C d=sys.D + Ts=sys.dt n=shape(a)[0] nb=shape(b)[1] - ztmp=zeros((nb,n+nb)) - tmp=hstack((a,b)) - tmp=vstack((tmp,ztmp)) - tmp=expm(tmp*Ts) - a=tmp[0:n,0:n] - b=tmp[0:n,n:n+nb] - sysd=ss(a,b,c,d,Ts) + nc=shape(c)[0] + tol=1e-12 + + if method=='zoh': + if n==1: + if b[0,0]==1: + A=0 + B=b/sys.dt + C=c + D=d + else: + tmp1=hstack((a,b)) + tmp2=hstack((zeros((nb,n)),eye(nb))) + tmp=vstack((tmp1,tmp2)) + s=logm(tmp) + s=s/Ts + if norm(imag(s),inf) > sqrt(sp.finfo(float).eps): + print "Warning: accuracy may be poor" + s=real(s) + A=s[0:n,0:n] + B=s[0:n,n:n+nb] + C=c + D=d + elif method=='bi': + a=mat(a) + b=mat(b) + c=mat(c) + d=mat(d) + poles=eigvals(a) + if any(abs(poles-1)<200*sp.finfo(float).eps): + print "d2c: some poles very close to one. May get bad results." + + I=mat(eye(n,n)) + tk = 2 / sqrt (Ts) + A = (2/Ts)*(a-I)*inv(a+I) + iab = inv(I+a)*b + B = tk*iab + C = tk*(c*inv(I+a)) + D = d- (c*iab) + else: + print "Method not supported" + return + + sysc=StateSpace(A,B,C,D) if flag==1: - sysd=ss2tf(sysd) - return sysd + sysc=ss2tf(sysc) + return sysc +def dsimul(sys,u): + """Simulate the discrete system sys + Only for discrete systems!!! + + Call: + y=dsimul(sys,u) + + Parameters + ---------- + sys : Discrete System in State Space form + u : input vector + Returns + ------- + y: ndarray + Simulation results + + """ + a=mat(sys.A) + b=mat(sys.B) + c=mat(sys.C) + d=mat(sys.D) + nx=shape(a)[0] + ns=shape(u)[1] + xk=zeros((nx,1)) + for i in arange(0,ns): + uk=u[:,i] + xk_1=a*xk+b*uk + yk=c*xk+d*uk + xk=xk_1 + if i==0: + y=yk + else: + y=hstack((y,yk)) + y=array(y).T + return y + +def dstep(sys,Tf=10.0): + """Plot the step response of the discrete system sys + Only for discrete systems!!! + + Call: + y=dstep(sys, [,Tf=final time])) + + Parameters + ---------- + sys : Discrete System in State Space form + Tf : Final simulation time + + Returns + ------- + Nothing + + """ + Ts=sys.dt + if Ts==0.0: + "Only discrete systems allowed!" + return + + ns=int(Tf/Ts+1) + u=ones((1,ns)) + y=dsimul(sys,u) + T=arange(0,Tf+Ts/2,Ts) + plot(T,y) + grid() + show() + +def dimpulse(sys,Tf=10.0): + """Plot the impulse response of the discrete system sys + Only for discrete systems!!! + + Call: + y=dimpulse(sys,[,Tf=final time])) + + Parameters + ---------- + sys : Discrete System in State Space form + Tf : Final simulation time + + Returns + ------- + Nothing + + """ + Ts=sys.dt + if Ts==0.0: + "Only discrete systems allowed!" + return + + ns=int(Tf/Ts+1) + u=zeros((1,ns)) + u[0,0]=1/Ts + y=dsimul(sys,u) + T=arange(0,Tf+Ts/2,Ts) + plot(T,y) + grid() + show() + +# Step response (plot) +def bb_step(sys,X0=None,Tf=None,Ts=0.001): + """Plot the step response of the continous system sys + + Call: + y=bb_step(sys [,Tf=final time] [,Ts=time step]) + + Parameters + ---------- + sys : Continous System in State Space form + X0: Initial state vector (not used yet) + Ts : sympling time + Tf : Final simulation time + + Returns + ------- + Nothing + + """ + if Tf==None: + vals = eigvals(sys.A) + r = min(abs(real(vals))) + if r < 1e-10: + r = 0.1 + Tf = 7.0 / r + sysd=c2d(sys,Ts) + dstep(sysd,Tf=Tf) + def full_obs(sys,poles): """Full order observer of the system sys @@ -123,14 +331,13 @@ Observer """ - if type(sys).__name__=='TransferFunction': + if isinstance(sys, TransferFunction): "System must be in state space form" return a=mat(sys.A) b=mat(sys.B) c=mat(sys.C) d=mat(sys.D) - poles=mat(poles) L=place(a.T,c.T,poles) L=mat(L).T Ao=a-L*c @@ -139,7 +346,7 @@ m=shape(Bo) Co=eye(n[0],n[1]) Do=zeros((n[0],m[1])) - obs=ss(Ao,Bo,Co,Do,sys.Tsamp) + obs=StateSpace(Ao,Bo,Co,Do,sys.dt) return obs def red_obs(sys,T,poles): @@ -160,7 +367,7 @@ Reduced order Observer """ - if type(sys).__name__=='TransferFunction': + if isinstance(sys, TransferFunction): "System must be in state space form" return a=mat(sys.A) @@ -169,7 +376,7 @@ d=mat(sys.D) T=mat(T) P=mat(vstack((c,T))) - poles=mat(poles) + # poles=mat(poles) invP=inv(P) AA=P*a*invP ny=shape(c)[0] @@ -205,7 +412,7 @@ tmp5=mat(vstack((tmp5,tmp6))) Dr=invP*tmp5*tmp4 - obs=ss(Ar,Br,Cr,Dr,sys.Tsamp) + obs=StateSpace(Ar,Br,Cr,Dr,sys.dt) return obs def comp_form(sys,obs,K): @@ -242,7 +449,7 @@ Bc = hstack((Bu*X,By-Bu*X*K*Dy)) Cc = -X*K*mat(obs.C); Dc = hstack((X,-X*K*Dy)) - contr = ss(Ac,Bc,Cc,Dc,sys.Tsamp) + contr = StateSpace(Ac,Bc,Cc,Dc,sys.dt) return contr def comp_form_i(sys,obs,K,Ts,Cy=[[1]]): @@ -266,7 +473,7 @@ Controller """ - if sys.Tsamp==0.0: + if sys.dt==0.0: print "contr_form_i works only with discrete systems!" return @@ -274,7 +481,7 @@ nu=shape(sys.B)[1] nx=shape(sys.A)[0] no=shape(obs.A)[0] - ni=shape(Cy)[0] + ni=shape(mat(Cy))[0] B_obsu = mat(obs.B[:,0:nu]) B_obsy = mat(obs.B[:,nu:nu+ny]) @@ -303,134 +510,9 @@ C_ctr=hstack((-X*K*c,-X*Ke)) D_ctr=hstack((zeros((nu,ni)),-X*K*D_obsy)) - contr=ss(A_ctr,B_ctr,C_ctr,D_ctr,sys.Tsamp) + contr=StateSpace(A_ctr,B_ctr,C_ctr,D_ctr,sys.dt) return contr -def dsimul(sys,u): - """Simulate the discrete system sys - Only for discrete systems!!! - - Call: - y=dsimul(sys,u) - - Parameters - ---------- - sys : Discrete System in State Space form - u : input vector - Returns - ------- - y: ndarray - Simulation results - - """ - a=mat(sys.A) - b=mat(sys.B) - c=mat(sys.C) - d=mat(sys.D) - nx=shape(a)[0] - ns=shape(u)[1] - xk=zeros((nx,1)) - for i in arange(0,ns): - uk=u[:,i] - xk_1=a*xk+b*uk - yk=c*xk+d*uk - xk=xk_1 - if i==0: - y=yk - else: - y=hstack((y,yk)) - y=array(y).T - return y - -def dstep(sys,Tf=10.0): - """Plot the step response of the discrete system sys - Only for discrete systems!!! - - Call: - y=dstep(sys, [,Tf=final time])) - - Parameters - ---------- - sys : Discrete System in State Space form - Tf : Final simulation time - - Returns - ------- - Nothing - - """ - Ts=sys.Tsamp - if Ts==0.0: - "Only discrete systems allowed!" - return - - ns=int(Tf/Ts+1) - u=ones((1,ns)) - y=dsimul(sys,u) - T=arange(0,Tf+Ts/2,Ts) - plot(T,y) - grid() - show() - -def dimpulse(sys,Tf=10.0): - """Plot the impulse response of the discrete system sys - Only for discrete systems!!! - - Call: - y=dimpulse(sys,[,Tf=final time])) - - Parameters - ---------- - sys : Discrete System in State Space form - Tf : Final simulation time - - Returns - ------- - Nothing - - """ - Ts=sys.Tsamp - if Ts==0.0: - "Only discrete systems allowed!" - return - - ns=int(Tf/Ts+1) - u=zeros((1,ns)) - u[0,0]=1/Ts - y=dsimul(sys,u) - T=arange(0,Tf+Ts/2,Ts) - plot(T,y) - grid() - show() - -# Step response (plot) -def bb_step(sys,X0=None,Tf=None,Ts=0.001): - """Plot the step response of the continous system sys - - Call: - y=bb_step(sys [,Tf=final time] [,Ts=time step]) - - Parameters - ---------- - sys : Continous System in State Space form - X0: Initial state vector (not used yet) - Ts : sympling time - Tf : Final simulation time - - Returns - ------- - Nothing - - """ - if Tf==None: - vals = eigvals(sys.A) - r = min(abs(real(vals))) - if r == 0.0: - r = 1.0 - Tf = 7.0 / r - sysd=c2d(sys,Ts) - dstep(sysd,Tf=Tf) - def sysctr(sys,contr): """Build the discrete system controller+plant+output feedback @@ -449,10 +531,10 @@ as output """ - if contr.Tsamp!=sys.Tsamp: + if contr.dt!=sys.dt: print "Systems with different sampling time!!!" return - sysf=contr*sys + sysf=sys*contr nu=shape(sysf.B)[1] b1=mat(sysf.B[:,0]) @@ -470,44 +552,42 @@ Cf=X*mat(sysf.C) Df=X*d1 - sysc=ss(Af,Bf,Cf,Df,sys.Tsamp) + sysc=StateSpace(Af,Bf,Cf,Df,sys.dt) return sysc -def care(A,B,Q,R): - """Solve Riccati equation for discrete time systems +def set_aw(sys,poles): + """Divide in controller in input and feedback part + for anti-windup Usage ===== - [K, S, E] = care(A, B, Q, R) + [sys_in,sys_fbk]=set_aw(sys,poles) Inputs ------ - A, B: 2-d arrays with dynamics and input matrices - sys: linear I/O system - Q, R: 2-d array with state and input weight matrices + sys: controller + poles : poles for the anti-windup filter + Outputs ------- - X: solution of the Riccati eq. + sys_in, sys_fbk: controller in input and feedback part """ +# sys=StateSpace(sys); + sys=ss(sys); + den_old=poly(eigvals(sys.A)) + den = poly(poles) + tmp= tf(den_old,den,sys.dt) + tmpss=tf2ss(tmp) +# sys_in=StateSpace(tmp*sys) + sys_in=ss(tmp*sys) + sys_in.dt=sys.dt +# sys_fbk=StateSpace(1-tmp) + sys_fbk=ss(1-tmp) + sys_fbk.dt=sys.dt + return sys_in, sys_fbk - # Check dimensions for consistency - nstates = B.shape[0]; - ninputs = B.shape[1]; - if (A.shape[0] != nstates or A.shape[1] != nstates): - raise ControlDimension("inconsistent system dimensions") - - elif (Q.shape[0] != nstates or Q.shape[1] != nstates or - R.shape[0] != ninputs or R.shape[1] != ninputs) : - raise ControlDimension("incorrect weighting matrix dimensions") - - rcond,X,w,S,T = \ - sb02od(nstates, ninputs, A, B, Q, R, 'C'); - - return X - - -def dare(A,B,Q,R): +def bb_dare(A,B,Q,R): """Solve Riccati equation for discrete time systems Usage @@ -535,13 +615,13 @@ R.shape[0] != ninputs or R.shape[1] != ninputs) : raise ControlDimension("incorrect weighting matrix dimensions") - rcond,X,w,S,T = \ + X,rcond,w,S,T = \ sb02od(nstates, ninputs, A, B, Q, R, 'D'); return X -def dlqr(*args, **keywords): +def bb_dlqr(*args, **keywords): """Linear quadratic regulator design for discrete systems Usage @@ -581,7 +661,7 @@ A = array(args[0].A, ndmin=2, dtype=float); B = array(args[0].B, ndmin=2, dtype=float); index = 1; - if args[0].Tsamp==0.0: + if args[0].dt==0.0: print "dlqr works only for discrete systems!" return else: @@ -595,8 +675,10 @@ R = array(args[index+1], ndmin=2, dtype=float); if (len(args) > index + 2): N = array(args[index+2], ndmin=2, dtype=float); + Nflag = 1; else: N = zeros((Q.shape[0], R.shape[1])); + Nflag = 0; # Check dimensions for consistency nstates = B.shape[0]; @@ -609,46 +691,154 @@ N.shape[0] != nstates or N.shape[1] != ninputs): raise ControlDimension("incorrect weighting matrix dimensions") + if Nflag==1: + Ao=A-B*inv(R)*N.T + Qo=Q-N*inv(R)*N.T + else: + Ao=A + Qo=Q + #Solve the riccati equation - X = dare(A,B,Q,R) + # (X,L,G) = dare(Ao,B,Qo,R) + X = bb_dare(Ao,B,Qo,R) # Now compute the return value Phi=mat(A) H=mat(B) - K=inv(H.T*X*H+R)*(H.T*X*Phi) + K=inv(H.T*X*H+R)*(H.T*X*Phi+N.T) L=eig(Phi-H*K) return K,X,L -def minreal(sys): - """Minimal representation for state space systems +def dlqr(*args, **keywords): + """Linear quadratic regulator design + + The lqr() function computes the optimal state feedback controller + that minimizes the quadratic cost + + .. math:: J = \int_0^\infty x' Q x + u' R u + 2 x' N u + + The function can be called with either 3, 4, or 5 arguments: + + * ``lqr(sys, Q, R)`` + * ``lqr(sys, Q, R, N)`` + * ``lqr(A, B, Q, R)`` + * ``lqr(A, B, Q, R, N)`` + + Parameters + ---------- + A, B: 2-d array + Dynamics and input matrices + sys: Lti (StateSpace or TransferFunction) + Linear I/O system + Q, R: 2-d array + State and input weight matrices + N: 2-d array, optional + Cross weight matrix + + Returns + ------- + K: 2-d array + State feedback gains + S: 2-d array + Solution to Riccati equation + E: 1-d array + Eigenvalues of the closed loop system + + Examples + -------- + >>> K, S, E = lqr(sys, Q, R, [N]) + >>> K, S, E = lqr(A, B, Q, R, [N]) + + """ + + # Make sure that SLICOT is installed + try: + from slycot import sb02md + from slycot import sb02mt + except ImportError: + raise ControlSlycot("can't find slycot module 'sb02md' or 'sb02nt'") + + # + # Process the arguments and figure out what inputs we received + # + + # Get the system description + if (len(args) < 4): + raise ControlArgument("not enough input arguments") + + elif (ctrlutil.issys(args[0])): + # We were passed a system as the first argument; extract A and B + #! TODO: really just need to check for A and B attributes + A = np.array(args[0].A, ndmin=2, dtype=float); + B = np.array(args[0].B, ndmin=2, dtype=float); + index = 1; + else: + # Arguments should be A and B matrices + A = np.array(args[0], ndmin=2, dtype=float); + B = np.array(args[1], ndmin=2, dtype=float); + index = 2; + + # Get the weighting matrices (converting to matrices, if needed) + Q = np.array(args[index], ndmin=2, dtype=float); + R = np.array(args[index+1], ndmin=2, dtype=float); + if (len(args) > index + 2): + N = np.array(args[index+2], ndmin=2, dtype=float); + else: + N = np.zeros((Q.shape[0], R.shape[1])); + + # Check dimensions for consistency + nstates = B.shape[0]; + ninputs = B.shape[1]; + if (A.shape[0] != nstates or A.shape[1] != nstates): + raise ControlDimension("inconsistent system dimensions") + + elif (Q.shape[0] != nstates or Q.shape[1] != nstates or + R.shape[0] != ninputs or R.shape[1] != ninputs or + N.shape[0] != nstates or N.shape[1] != ninputs): + raise ControlDimension("incorrect weighting matrix dimensions") + + # Compute the G matrix required by SB02MD + A_b,B_b,Q_b,R_b,L_b,ipiv,oufact,G = \ + sb02mt(nstates, ninputs, B, R, A, Q, N, jobl='N'); + + # Call the SLICOT function + X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'D') + + # Now compute the return value + K = np.dot(np.linalg.inv(R), (np.dot(B.T, X) + N.T)); + S = X; + E = w[0:nstates]; + + return K, S, E + +def bb_dcgain(sys): + """Return the steady state value of the step response os sys + Usage ===== - [sysmin]=minreal[sys] + dcgain=dcgain(sys) Inputs ------ - sys: system in ss or tf form + sys: system Outputs ------- - sysfin: system in state space form + dcgain : steady state value """ + a=mat(sys.A) b=mat(sys.B) c=mat(sys.C) d=mat(sys.D) nx=shape(a)[0] - ni=shape(b)[1] - no=shape(c)[0] - - out=tb03ad(nx,no,ni,a,b,c,d,'R') - - nr=out[3] - A=out[0][:nr,:nr] - B=out[1][:nr,:ni] - C=out[2][:no,:nr] - sysf=ss(A,B,C,sys.D,sys.Tsamp) - return sysf - + if sys.dt!=0.0: + a=a-eye(nx,nx) + r=rank(a) + if r<nx: + gm=[] + else: + gm=-c*inv(a)*b+d + return array(gm) Modified: trunk/src/matlab.py =================================================================== --- trunk/src/matlab.py 2014-03-22 18:30:41 UTC (rev 295) +++ trunk/src/matlab.py 2014-03-22 19:31:36 UTC (rev 296) @@ -398,7 +398,7 @@ """ Create a state space system. - The function accepts either 1 or 4 parameters: + The function accepts either 1, 4 or 5 parameters: ``ss(sys)`` Convert a linear system into space system form. Always creates a @@ -412,7 +412,16 @@ \dot x = A \cdot x + B \cdot u y = C \cdot x + D \cdot u + + ``ss(A, B, C, D, dt)`` + Create a discrete-time state space system from the matrices of + its state and output equations: + + .. math:: + x[k+1] = A \cdot x[k] + B \cdot u[k] + y[k] = C \cdot x[k] + D \cdot u[ki] + The matrices can be given as *array like* data types or strings. Everything that the constructor of :class:`numpy.matrix` accepts is permissible here too. @@ -429,6 +438,8 @@ Output matrix D: array_like or string Feed forward matrix + dt: If present, specifies the sampling period and a discrete time + system is created Returns ------- @@ -457,8 +468,8 @@ """ - if len(args) == 4: - return StateSpace(args[0], args[1], args[2], args[3]) + if len(args) == 4 or len(args) == 5: + return StateSpace(*args) elif len(args) == 1: sys = args[0] if isinstance(sys, StateSpace): @@ -635,7 +646,7 @@ C: array_like or string Output matrix D: array_like or string - Feed forward matrix + Feedthrough matrix Returns ------- |
From: <mur...@us...> - 2014-03-22 18:31:04
|
Revision: 295 http://sourceforge.net/p/python-control/code/295 Author: murrayrm Date: 2014-03-22 18:30:41 +0000 (Sat, 22 Mar 2014) Log Message: ----------- allow FRD for feedback() Modified Paths: -------------- trunk/ChangeLog trunk/src/bdalg.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2014-03-22 18:09:48 UTC (rev 294) +++ trunk/ChangeLog 2014-03-22 18:30:41 UTC (rev 295) @@ -1,5 +1,9 @@ 2014-03-22 Richard Murray <murray@sidamo.local> + * src/bdalg.py (feedback): allow FRD for feedback() + +2014-03-22 Richard Murray <murray@sidamo.local> + * tests/discrete_test.py (TestDiscrete.test_sample_system): added conversions using tustin and zoh to catch 'dt' bug #5 Modified: trunk/src/bdalg.py =================================================================== --- trunk/src/bdalg.py 2014-03-22 18:09:48 UTC (rev 294) +++ trunk/src/bdalg.py 2014-03-22 18:30:41 UTC (rev 295) @@ -220,13 +220,13 @@ # Check for correct input types. if not isinstance(sys1, (int, float, complex, tf.TransferFunction, - ss.StateSpace)): - raise TypeError("sys1 must be a TransferFunction or StateSpace " + - "object, or a scalar.") + ss.StateSpace, frd.FRD)): + raise TypeError("sys1 must be a TransferFunction, StateSpace " + + "or FRD object, or a scalar.") if not isinstance(sys2, (int, float, complex, tf.TransferFunction, - ss.StateSpace)): - raise TypeError("sys2 must be a TransferFunction or StateSpace " + - "object, or a scalar.") + ss.StateSpace, frd.FRD)): + raise TypeError("sys2 must be a TransferFunction, StateSpace " + + "or FRD object, or a scalar.") # If sys1 is a scalar, convert it to the appropriate LTI type so that we can # its feedback member function. |
From: <mur...@us...> - 2014-03-22 18:09:56
|
Revision: 294 http://sourceforge.net/p/python-control/code/294 Author: murrayrm Date: 2014-03-22 18:09:48 +0000 (Sat, 22 Mar 2014) Log Message: ----------- Fixed bug #5 ('dt' instead of 'Ts' in dtime.py) and added some unit tests for dtime and FRD bdalg. Modified Paths: -------------- trunk/ChangeLog trunk/src/bdalg.py trunk/src/dtime.py trunk/src/frdata.py trunk/tests/discrete_test.py trunk/tests/frd_test.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/ChangeLog 2014-03-22 18:09:48 UTC (rev 294) @@ -1,3 +1,17 @@ +2014-03-22 Richard Murray <murray@sidamo.local> + + * tests/discrete_test.py (TestDiscrete.test_sample_system): added + conversions using tustin and zoh to catch 'dt' bug #5 + + * src/dtime.py (sample_system): Changed 'dt' to 'Ts' to fix bug #4 + + * tests/frd_test.py (TestFRD.testbdalg): added unit tests for bdalg + functions operating on FRD data + + * src/bdalg.py (series, parallel, negate, feedback): updated + documentation to note that FRD ovjects work. + (feedback): updated conversions to allow for FRD + 2013-07-15 Richard Murray <murray@altura-2.local> * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and Modified: trunk/src/bdalg.py =================================================================== --- trunk/src/bdalg.py 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/src/bdalg.py 2014-03-22 18:09:48 UTC (rev 294) @@ -56,14 +56,15 @@ import scipy as sp import control.xferfcn as tf import control.statesp as ss +import control.frdata as frd def series(sys1, sys2): """Return the series connection sys2 * sys1 for --> sys1 --> sys2 -->. Parameters ---------- - sys1: scalar, StateSpace, or TransferFunction - sys2: scalar, StateSpace, or TransferFunction + sys1: scalar, StateSpace, TransferFunction, or FRD + sys2: scalar, StateSpace, TransferFunction, or FRD Returns ------- @@ -105,8 +106,8 @@ Parameters ---------- - sys1: scalar, StateSpace, or TransferFunction - sys2: scalar, StateSpace, or TransferFunction + sys1: scalar, StateSpace, TransferFunction, or FRD + sys2: scalar, StateSpace, TransferFunction, or FRD Returns ------- @@ -148,7 +149,7 @@ Parameters ---------- - sys: StateSpace or TransferFunction + sys: StateSpace, TransferFunction or FRD Returns ------- @@ -179,9 +180,9 @@ Parameters ---------- - sys1: scalar, StateSpace, or TransferFunction + sys1: scalar, StateSpace, TransferFunction, FRD The primary plant. - sys2: scalar, StateSpace, or TransferFunction + sys2: scalar, StateSpace, TransferFunction, FRD The feedback plant (often a feedback controller). sign: scalar The sign of feedback. `sign` = -1 indicates negative feedback, and @@ -219,13 +220,13 @@ # Check for correct input types. if not isinstance(sys1, (int, float, complex, tf.TransferFunction, - ss.StateSpace)): - raise TypeError("sys1 must be a TransferFunction or StateSpace object, \ -or a scalar.") + ss.StateSpace)): + raise TypeError("sys1 must be a TransferFunction or StateSpace " + + "object, or a scalar.") if not isinstance(sys2, (int, float, complex, tf.TransferFunction, - ss.StateSpace)): - raise TypeError("sys2 must be a TransferFunction or StateSpace object, \ -or a scalar.") + ss.StateSpace)): + raise TypeError("sys2 must be a TransferFunction or StateSpace " + + "object, or a scalar.") # If sys1 is a scalar, convert it to the appropriate LTI type so that we can # its feedback member function. @@ -234,6 +235,8 @@ sys1 = tf._convertToTransferFunction(sys1) elif isinstance(sys2, ss.StateSpace): sys1 = ss._convertToStateSpace(sys1) + elif isinstance(sys2, frd.FRD): + sys1 = ss._convertToFRD(sys1) else: # sys2 is a scalar. sys1 = tf._convertToTransferFunction(sys1) sys2 = tf._convertToTransferFunction(sys2) Modified: trunk/src/dtime.py =================================================================== --- trunk/src/dtime.py 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/src/dtime.py 2014-03-22 18:09:48 UTC (rev 294) @@ -112,7 +112,7 @@ from scipy.signal import cont2discrete sys = [sysc.num[0][0], sysc.den[0][0]] scipySysD = cont2discrete(sys, Ts, method='bilinear') - sysd = TransferFunction(scipySysD[0][0], scipySysD[1], dt) + sysd = TransferFunction(scipySysD[0][0], scipySysD[1], Ts) except ImportError: raise TypeError("cont2discrete not found in scipy.signal; upgrade to v0.10.0+") @@ -121,7 +121,7 @@ from scipy.signal import cont2discrete sys = [sysc.num[0][0], sysc.den[0][0]] scipySysD = cont2discrete(sys, Ts, method='zoh') - sysd = TransferFunction(scipySysD[0][0],scipySysD[1], dt) + sysd = TransferFunction(scipySysD[0][0],scipySysD[1], Ts) except ImportError: raise TypeError("cont2discrete not found in scipy.signal; upgrade to v0.10.0+") Modified: trunk/src/frdata.py =================================================================== --- trunk/src/frdata.py 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/src/frdata.py 2014-03-22 18:09:48 UTC (rev 294) @@ -451,7 +451,6 @@ """ if isinstance(sys, FRD): - omega.sort() if (abs(omega - sys.omega) < FRD.epsw).all(): # frequencies match, and system was already frd; simply use Modified: trunk/tests/discrete_test.py =================================================================== --- trunk/tests/discrete_test.py 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/tests/discrete_test.py 2014-03-22 18:09:48 UTC (rev 294) @@ -264,6 +264,12 @@ for sysc in (self.siso_ss1, self.siso_ss1c, self.siso_tf1c): sysd = sample_system(sysc, 1, method='matched') self.assertEqual(sysd.dt, 1) + + sysd = sample_system(sysc, 1, method='tustin') + self.assertEqual(sysd.dt, 1) + + sysd = sample_system(sysc, 1, method='zoh') + self.assertEqual(sysd.dt, 1) # TODO: put in other generic checks # TODO: check results of converstion Modified: trunk/tests/frd_test.py =================================================================== --- trunk/tests/frd_test.py 2013-07-16 14:59:20 UTC (rev 293) +++ trunk/tests/frd_test.py 2014-03-22 18:09:48 UTC (rev 294) @@ -10,6 +10,7 @@ from control.xferfcn import TransferFunction from control.frdata import FRD, _convertToFRD from control.matlab import bode +import control.bdalg as bdalg import control.freqplot import matplotlib.pyplot as plt @@ -106,7 +107,43 @@ (f1 / h2).freqresp([0.1, 1.0, 10])[1], (h1 / h2).freqresp([0.1, 1.0, 10])[1]) # the reverse does not work - + + def testbdalg(self): + # get two SISO transfer functions + h1 = TransferFunction([1], [1, 2, 2]) + h2 = TransferFunction([1], [0.1, 1]) + omega = np.logspace(-1, 2, 10) + f1 = FRD(h1, omega) + f2 = FRD(h2, omega) + + np.testing.assert_array_almost_equal( + (bdalg.series(f1, f2)).freqresp([0.1, 1.0, 10])[0], + (bdalg.series(h1, h2)).freqresp([0.1, 1.0, 10])[0]) + + np.testing.assert_array_almost_equal( + (bdalg.parallel(f1, f2)).freqresp([0.1, 1.0, 10])[0], + (bdalg.parallel(h1, h2)).freqresp([0.1, 1.0, 10])[0]) + + np.testing.assert_array_almost_equal( + (bdalg.feedback(f1, f2)).freqresp([0.1, 1.0, 10])[0], + (bdalg.feedback(h1, h2)).freqresp([0.1, 1.0, 10])[0]) + + np.testing.assert_array_almost_equal( + (bdalg.negate(f1)).freqresp([0.1, 1.0, 10])[0], + (bdalg.negate(h1)).freqresp([0.1, 1.0, 10])[0]) + +# append() and connect() not implemented for FRD objects +# np.testing.assert_array_almost_equal( +# (bdalg.append(f1, f2)).freqresp([0.1, 1.0, 10])[0], +# (bdalg.append(h1, h2)).freqresp([0.1, 1.0, 10])[0]) +# +# f3 = bdalg.append(f1, f2, f2) +# h3 = bdalg.append(h1, h2, h2) +# Q = np.mat([ [1, 2], [2, -1] ]) +# np.testing.assert_array_almost_equal( +# (bdalg.connect(f3, Q, [2], [1])).freqresp([0.1, 1.0, 10])[0], +# (bdalg.connect(h3, Q, [2], [1])).freqresp([0.1, 1.0, 10])[0]) + def testFeedback(self): h1 = TransferFunction([1], [1, 2, 2]) omega = np.logspace(-1, 2, 10) |
From: Roberto B. <rob...@su...> - 2014-01-19 13:30:34
|
Hi all I finally reach to generate RT code for a Linux PREEMPT RT target in order to perform Rapid Controller Prototyping from Python. The controller is developed under Python and standard C code is generated. For example we compiled and charged such generated code directly into dsPIC uController too. Hybrid simulation is also possible starting from a verbal description of the diagram schema. Examples are available as pdf documents at my homepage under http://robertobucher.dti.supsi.ch/python/python-examples/ At present there are some problems and improvements to be solved: 1) Graphical Block diagram editor: I have to generate the block Diagram by hand. A tool (pyBlockEd) allows to create the strings for the diagram description, but it is important to get a graphical editor in the future 2) Some functions from the slycot library give bad results: in particular the calculation of pole placement (through SB01BD) by MIMO systems gives very bad results. Of course the solution in MIMO case is not unique, but the results in this case are very bad conditioned: does somebody have already programmed, better algorithms for this calculation? For example the place algorithm in Matlab gives by MIMO systems good results... The development is still in an initial phase but the results are promising. Feedbacks are welcome Best regards Roberto |
From: Roberto B. <rob...@su...> - 2013-12-17 10:25:33
|
Hi all I'm testing the last control-0.6c toolbox in order to actualize my yottalab package and I found some differences between the results of a couple of functions: 1) the c2d function should maintain the form of the state-space function. It seems that the system is first transformed into a transfer function and then discretized. In my opinion it is important that the state-space form of the discrete system is exactly the same (same states) that I have in the continuous representation. 2) The dare functions gives some wrong results, and I'll check the lqr function asap. Using the delivered "dare" function (mateqn.py) I have wrong values of the feedback gains (compared with the values given by matlab dlqr and scilab) 3) the lqr function doesn't accept a call like lqr(sys,Q,R) -> only 3 parameters! In the next time I'll check the gains returned by the lqr function, compared with matlab and scilab. Best regards Roberto |
From: Richard M. <mu...@cd...> - 2013-08-30 20:58:04
|
Thanks, Ryan. I'll look through this and try to put the patch into the repository soon (hopefully this weekend). -richard On 28 Aug 2013, at 9:33 , Ryan Krauss <rk...@si...> wrote: > I left the original code intact for cases when s is a 1D array, but that isn't really necessary. My second patch eliminates this unnecessary case in the if statement: > > def horner(self, s): > """Evaluate the systems's transfer function for a complex variable > > Returns a matrix of values evaluated at complex variable s. > """ > > # Preallocate the output. > if getattr(s, '__iter__', False): > dim = [self.outputs, self.inputs] > dim.extend(shape(s)) > out = empty(dim, dtype=complex) > else: > out = empty((self.outputs, self.inputs), dtype=complex) > > for i in range(self.outputs): > for j in range(self.inputs): > out[i][j] = (polyval(self.num[i][j], s) / > polyval(self.den[i][j], s)) > > return out > > A second patch is attached. > > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > > > On Wed, Aug 28, 2013 at 11:28 AM, Ryan Krauss <rk...@si...> wrote: > This might be slightly hackish, but I think it solves the problem. The core issue is the size of the out matrix created at the beginning of the horner method. out needs to be 4D is s is a 2D array. I think this works for any dimension of s. > > def horner(self, s): > """Evaluate the systems's transfer function for a complex variable > > Returns a matrix of values evaluated at complex variable s. > """ > > # Preallocate the output. > if getattr(s, '__iter__', False): > if len(shape(s)) == 1: > out = empty((self.outputs, self.inputs, len(s)), dtype=complex) > else: > dim = [self.outputs, self.inputs] > dim.extend(shape(s)) > out = empty(dim, dtype=complex) > else: > out = empty((self.outputs, self.inputs), dtype=complex) > > for i in range(self.outputs): > for j in range(self.inputs): > out[i][j] = (polyval(self.num[i][j], s) / > polyval(self.den[i][j], s)) > > return out > > I am attaching a patch of my hack. > > > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > > > On Wed, Aug 28, 2013 at 11:06 AM, Ryan Krauss <rk...@si...> wrote: > I need to calculate 3D bode plots (contour plots) for my work. I am getting this error: > > /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in __call__(self, s) > 245 else: > 246 # SISO transfer function, return a scalar > --> 247 return self.horner(s)[0][0] > 248 > 249 def _truncatecoeff(self): > > /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in horner(self, s) > 560 for j in range(self.inputs): > 561 out[i][j] = (polyval(self.num[i][j], s) / > --> 562 polyval(self.den[i][j], s)) > 563 > 564 return out > > ValueError: could not broadcast input array from shape (2,2) into shape (2) > > > Here is code that recreates the problem: > > import control > test = control.TransferFunction(1,[1,1]) > s_mat = array([[2j*pi, 3j*pi],[-0.1+2j*pi, -0.1+3j*pi]]) > > > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > > > <krauss_horner_patch_2.diff>------------------------------------------------------------------------------ > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! > Discover the easy way to master current and previous Microsoft technologies > and advance your career. Get an incredible 1,500+ hours of step-by-step > tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |
From: Ryan K. <rk...@si...> - 2013-08-28 16:06:36
|
I need to calculate 3D bode plots (contour plots) for my work. I am getting this error: /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in __call__(self, s) 245 else: 246 # SISO transfer function, return a scalar --> 247 return self.horner(s)[0][0] 248 249 def _truncatecoeff(self): /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/xferfcn.pyc in horner(self, s) 560 for j in range(self.inputs): 561 out[i][j] = (polyval(self.num[i][j], s) / --> 562 polyval(self.den[i][j], s)) 563 564 return out ValueError: could not broadcast input array from shape (2,2) into shape (2) Here is code that recreates the problem: import control test = control.TransferFunction(1,[1,1]) s_mat = array([[2j*pi, 3j*pi],[-0.1+2j*pi, -0.1+3j*pi]]) -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville |
From: Ryan K. <rk...@si...> - 2013-08-08 16:10:18
|
This is not specifically a python-control question; I am taking advantage of the community of controls minds. I have a continuous system (a robot with one flexible link - basically a slewing beam) that uses accelerometer feedback for vibration suppression (admittedly, accel. feedback is a bit risky). I have designed a control system using a continuous approach and now I want to compare that to a state-space design based on a reduced order model. The accelerometer makes the system susceptible to higher modes being driven unstable. In my continuous design, I solve this by making sure the accelerometer feedback loop has a lowpass filter. My question is this: is there a way to do an LQG design that requires the final design to include a lowpass filter? I want the filter design to also be some how optimized as part of the LQG design (i.e. I don't want to pick the filter corner frequency myself first). As a hack/work around, I was thinking of setting it up as a numeric optimization problem where the lowpass corner frequency is the thing to be optimized. For each choice of corner frequency, an LQG design would be conducted and the settling time or some other measure would be used in the cost function. Any thoughts? Thanks, Ryan -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville |
From: <mur...@us...> - 2013-07-16 05:14:26
|
Revision: 290 http://sourceforge.net/p/python-control/code/290 Author: murrayrm Date: 2013-07-16 05:14:17 +0000 (Tue, 16 Jul 2013) Log Message: ----------- updated division operators for FRD and TransferFunction to be python3 compatible Modified Paths: -------------- trunk/ChangeLog trunk/src/frdata.py trunk/src/xferfcn.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2013-07-15 04:39:59 UTC (rev 289) +++ trunk/ChangeLog 2013-07-16 05:14:17 UTC (rev 290) @@ -1,3 +1,8 @@ +2013-07-15 Richard Murray <murray@altura-2.local> + + * src/frdata.py, src/xferfcn.py: updated to use __truediv__ and + __rtruediv__ for compatibility with python3 + 2013-07-14 Richard Murray <murray@altura-2.local> * src/dtime.py (sample_system): added check to make sure Modified: trunk/src/frdata.py =================================================================== --- trunk/src/frdata.py 2013-07-15 04:39:59 UTC (rev 289) +++ trunk/src/frdata.py 2013-07-16 05:14:17 UTC (rev 290) @@ -1,3 +1,4 @@ +from __future__ import division """frdata.py Frequency response data representation and functions. @@ -17,8 +18,8 @@ FRD.__rsub__ FRD.__mul__ FRD.__rmul__ -FRD.__div__ -FRD.__rdiv__ +FRD.__truediv__ +FRD.__rtruediv__ FRD.evalfr FRD.freqresp FRD.pole @@ -289,7 +290,7 @@ return FRD(fresp, self.omega) # TODO: Division of MIMO transfer function objects is not written yet. - def __div__(self, other): + def __truediv__(self, other): """Divide two LTI objects.""" if isinstance(other, (int, float, complex)): @@ -301,12 +302,12 @@ if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): raise NotImplementedError( - "FRD.__div__ is currently implemented only for SISO systems.") + "FRD.__truediv__ is currently implemented only for SISO systems.") return FRD(self.fresp/other.fresp, self.omega) # TODO: Division of MIMO transfer function objects is not written yet. - def __rdiv__(self, other): + def __rtruediv__(self, other): """Right divide two LTI objects.""" if isinstance(other, (int, float, complex)): return FRD(other / self.fresp, self.omega) @@ -316,7 +317,7 @@ if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): raise NotImplementedError( - "FRD.__rdiv__ is currently implemented only for SISO systems.") + "FRD.__rtruediv__ is currently implemented only for SISO systems.") return other / self Modified: trunk/src/xferfcn.py =================================================================== --- trunk/src/xferfcn.py 2013-07-15 04:39:59 UTC (rev 289) +++ trunk/src/xferfcn.py 2013-07-16 05:14:17 UTC (rev 290) @@ -37,6 +37,7 @@ # Python 3 compatability (needs to go here) from __future__ import print_function +from __future__ import division """Copyright (c) 2010 by California Institute of Technology All rights reserved. @@ -470,7 +471,7 @@ return TransferFunction(num, den, dt) # TODO: Division of MIMO transfer function objects is not written yet. - def __div__(self, other): + def __truediv__(self, other): """Divide two LTI objects.""" if isinstance(other, (int, float, complex)): @@ -482,7 +483,7 @@ if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): - raise NotImplementedError("TransferFunction.__div__ is currently \ + raise NotImplementedError("TransferFunction.__truediv__ is currently \ implemented only for SISO systems.") # Figure out the sampling time to use @@ -499,7 +500,7 @@ return TransferFunction(num, den, dt) # TODO: Division of MIMO transfer function objects is not written yet. - def __rdiv__(self, other): + def __rtruediv__(self, other): """Right divide two LTI objects.""" if isinstance(other, (int, float, complex)): other = _convertToTransferFunction(other, inputs=self.inputs, @@ -509,7 +510,7 @@ if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): - raise NotImplementedError("TransferFunction.__rdiv__ is currently \ + raise NotImplementedError("TransferFunction.__rtruediv__ is currently \ implemented only for SISO systems.") return other / self |
From: <mur...@us...> - 2013-07-15 04:40:20
|
Revision: 289 http://sourceforge.net/p/python-control/code/289 Author: murrayrm Date: 2013-07-15 04:39:59 +0000 (Mon, 15 Jul 2013) Log Message: ----------- Updated sample_system() function to check for proper version of SciPy. If cont2discrete is not avialable (requires scipy 0.10.0+), generate a warning. Modified Paths: -------------- trunk/ChangeLog trunk/src/dtime.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2013-06-25 06:07:45 UTC (rev 288) +++ trunk/ChangeLog 2013-07-15 04:39:59 UTC (rev 289) @@ -1,3 +1,9 @@ +2013-07-14 Richard Murray <murray@altura-2.local> + + * src/dtime.py (sample_system): added check to make sure + cont2discrete is available in scipy.signal + (sample_system): added docstring + 2013-06-24 Richard Murray <murray@altura-2.local> * tests/minreal_test.py (TestMinreal.testMinrealBrute), Modified: trunk/src/dtime.py =================================================================== --- trunk/src/dtime.py 2013-06-25 06:07:45 UTC (rev 288) +++ trunk/src/dtime.py 2013-07-15 04:39:59 UTC (rev 289) @@ -47,7 +47,7 @@ """ -from scipy.signal import zpk2tf, tf2zpk, cont2discrete +from scipy.signal import zpk2tf, tf2zpk import numpy as np from cmath import exp from warnings import warn @@ -57,8 +57,39 @@ # Sample a continuous time system def sample_system(sysc, Ts, method='matched'): - # TODO: add docstring + """Convert a continuous time system to discrete time + Creates a discrete time system from a continuous time system by + sampling. Multiple methods of conversion are supported. + + Parameters + ---------- + sysc : linsys + Continuous time system to be converted + Ts : real + Sampling period + method : string + Method to use for conversion: 'matched' (default), 'tustin', 'zoh' + + Returns + ------- + sysd : linsys + Discrete time system, with sampling rate Ts + + Notes + ----- + 1. The conversion methods 'tustin' and 'zoh' require the + cont2discrete() function, including in SciPy 0.10.0 and above. + + 2. Additional methods 'foh' and 'impulse' are planned for future + implementation. + + Examples + -------- + >>> sysc = TransferFunction([1], [1, 2, 1]) + >>> sysd = sample_system(sysc, 1, method='matched') + """ + # Make sure we have a continuous time system if not isctime(sysc): raise ValueError("First argument must be continuous time system") @@ -77,14 +108,22 @@ sysd = _c2dmatched(sysc, Ts) elif method == 'tustin': - sys = [sysc.num[0][0], sysc.den[0][0]] - scipySysD = cont2discrete(sys, Ts, method='bilinear') - sysd = TransferFunction(scipySysD[0][0], scipySysD[1], dt) - + try: + from scipy.signal import cont2discrete + sys = [sysc.num[0][0], sysc.den[0][0]] + scipySysD = cont2discrete(sys, Ts, method='bilinear') + sysd = TransferFunction(scipySysD[0][0], scipySysD[1], dt) + except ImportError: + raise TypeError("cont2discrete not found in scipy.signal; upgrade to v0.10.0+") + elif method == 'zoh': - sys = [sysc.num[0][0], sysc.den[0][0]] - scipySysD = cont2discrete(sys, Ts, method='zoh') - sysd = TransferFunction(scipySysD[0][0],scipySysD[1], dt) + try: + from scipy.signal import cont2discrete + sys = [sysc.num[0][0], sysc.den[0][0]] + scipySysD = cont2discrete(sys, Ts, method='zoh') + sysd = TransferFunction(scipySysD[0][0],scipySysD[1], dt) + except ImportError: + raise TypeError("cont2discrete not found in scipy.signal; upgrade to v0.10.0+") elif method == 'foh' or method == 'impulse': raise ValueError("Method not developed yet") |
From: <mur...@us...> - 2013-06-25 06:07:53
|
Revision: 288 http://sourceforge.net/p/python-control/code/288 Author: murrayrm Date: 2013-06-25 06:07:45 +0000 (Tue, 25 Jun 2013) Log Message: ----------- updated exception handling to be python2.6+ and python3 compatible Modified Paths: -------------- trunk/ChangeLog trunk/src/margins.py trunk/src/statesp.py trunk/src/xferfcn.py trunk/tests/minreal_test.py Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2013-06-19 01:50:10 UTC (rev 287) +++ trunk/ChangeLog 2013-06-25 06:07:45 UTC (rev 288) @@ -1,3 +1,10 @@ +2013-06-24 Richard Murray <murray@altura-2.local> + + * tests/minreal_test.py (TestMinreal.testMinrealBrute), + src/xferfcn.py (_convertToTransferFunction), src/statesp.py + (StateSpace.__rmul__), src/margins.py (stability_margins): changed + exception syntax to be python3 compatibile (works for python2.6+) + 2013-06-10 Richard Murray <murray@altura-2.local> * src/xferfcn.py (TransferFunction.horner): small fix to docstring Modified: trunk/src/margins.py =================================================================== --- trunk/src/margins.py 2013-06-19 01:50:10 UTC (rev 287) +++ trunk/src/margins.py 2013-06-25 06:07:45 UTC (rev 288) @@ -127,7 +127,7 @@ sys = frdata.FRD(mag*np.exp((1j/360.)*phase), omega, smooth=True) else: sys = xferfcn._convertToTransferFunction(sysdata) - except Exception, e: + except Exception as e: print (e) raise ValueError("Margin sysdata must be either a linear system or " "a 3-sequence of mag, phase, omega.") Modified: trunk/src/statesp.py =================================================================== --- trunk/src/statesp.py 2013-06-19 01:50:10 UTC (rev 287) +++ trunk/src/statesp.py 2013-06-25 06:07:45 UTC (rev 288) @@ -351,7 +351,7 @@ D = X * self.D return StateSpace(self.A, self.B, C, D, self.dt) - except Exception, e: + except Exception as e: print(e) pass raise TypeError("can't interconnect systems") Modified: trunk/src/xferfcn.py =================================================================== --- trunk/src/xferfcn.py 2013-06-19 01:50:10 UTC (rev 287) +++ trunk/src/xferfcn.py 2013-06-25 06:07:45 UTC (rev 288) @@ -1053,7 +1053,7 @@ num = [[[D[i,j]] for j in range(inputs)] for i in range(outputs)] den = [[[1] for j in range(inputs)] for i in range(outputs)] return TransferFunction(num, den) - except Exception, e: + except Exception as e: print("Failure to assume argument is matrix-like in" " _convertToTransferFunction, result %s" % e) Modified: trunk/tests/minreal_test.py =================================================================== --- trunk/tests/minreal_test.py 2013-06-19 01:50:10 UTC (rev 287) +++ trunk/tests/minreal_test.py 2013-06-25 06:07:45 UTC (rev 288) @@ -53,7 +53,7 @@ self.assert_numden_almost_equal( ht1.num[0][0], ht2.num[0][0], ht1.den[0][0], ht2.den[0][0]) - except Exception, e: + except Exception as e: # for larger systems, the tf minreal's # the original rss, but not the balanced one if n < 6: |
From: Ryan K. <rk...@si...> - 2013-06-15 14:19:31
|
Thanks. That makes sense. Basically, I fit a transfer function model to an infinite dimensional model and then found the CCF model from the transfer function coefficients. So, I just took whatever the TF --> CCF conversion gave me and ran with it. In the end, I need to get back to a compensator/transfer function form to re-integrate it with my infinite dimensional model. So, as long as the observer and controller use the same states, I don't really need the original ones. It is kind of ridiculous that I have been working in controls for over a decade and know so little about practical implementation of state-space control. My work has all been transfer function SISO stuff and infinite dimensional (transfer matrix method) modeling. I have done very little practical/experimental stuff involving state-space. So, thanks for the tips to get me going. -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Sat, Jun 15, 2013 at 3:09 AM, Rene van Paassen <ren...@gm... > wrote: > > > On 15 June 2013 05:36, Ryan Krauss <rk...@si...> wrote: > >> That seems to work, but I am trying to wrap my head around the validity >> of it. It seems to rescale the matrices to improve numeric conditioning. >> If the relationship between the input and outputs is not affected, do I >> just replace my old state-space model with this? >> >> Yes, no problem. The only thing is that you no longer have your original > states; so if you needed those, make sure you send them out in in the C > matrix before conditioning. > > You had a controllable canonical form of your state-space system. From > somewhere near order 8 and up, this almost never works out right > numerically. > > It also depends on the (time) scaling of your state variables. If you have > a slow system, your 1st derivative is going to be a small number compared > to the output state, the 2nd is even smaller, and by the time you get to > the 5th or 6th derivative, it is going to be numerically insignificant. > Another trick that is sometimes handy is picking another time scale, hours, > minutes, whatever it takes to make 1st, 2nd etc derivatives comparable > numerically to the signal itself. > > >> -- >> Ryan Krauss, Ph.D. >> Associate Professor >> Mechanical Engineering >> Southern Illinois University Edwardsville >> >> >> On Fri, Jun 14, 2013 at 4:16 PM, Rene van Paassen < >> ren...@gm...> wrote: >> >>> How about balancing the matrix first? >>> >>> Today I made a little fix in tb01id, at https://github.com/repagh/Slycot >>> >>> I get no errors with the attached modification. Don't know if the result >>> is valid, though. >>> >>> >>> On 14 June 2013 19:59, Ryan Krauss <rk...@si...> wrote: >>> >>>> I assume this is most likely an ill conditioning problem on my part >>>> (though I don't know how to fix the model if that is the case, since it is >>>> fitting experimental data as well as an infinite dimensional model), but I >>>> am getting the following error from control.lqr: >>>> >>>> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >>>> in <module>() >>>> 54 >>>> 55 #K = control.lqr(ol_sys, Q, 1.0) >>>> ---> 56 K, S, E = control.lqr(A, B, Q, 0.01) >>>> 57 >>>> 58 >>>> >>>> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >>>> in lqr(*args, **keywords) >>>> 236 >>>> 237 # Call the SLICOT function >>>> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >>>> 239 >>>> 240 # Now compute the return value >>>> >>>> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in >>>> sb02md(n, A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >>>> 348 e = ValueError('the Hamiltonian or symplectic matrix H >>>> has less than n stable eigenvalues') >>>> 349 e.info = info >>>> --> 350 raise e >>>> 351 if info == 5: >>>> 352 e = ValueError('if the N-th order system of linear >>>> algebraic equations is singular to working precision') >>>> >>>> ValueError: the Hamiltonian or symplectic matrix H has less than n >>>> stable eigenvalues >>>> >>>> In [5]: run lqr_problem.py >>>> >>>> --------------------------------------------------------------------------- >>>> ValueError Traceback (most recent call >>>> last) >>>> /usr/local/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in >>>> execfile(fname, *where) >>>> 176 else: >>>> 177 filename = fname >>>> --> 178 __builtin__.execfile(filename, *where) >>>> >>>> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >>>> in <module>() >>>> 53 Q = dot(Ca.T,Ca) >>>> 54 >>>> ---> 55 K, S, E = control.lqr(A, B, Q, 1.0) >>>> 56 >>>> 57 >>>> >>>> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >>>> in lqr(*args, **keywords) >>>> 236 >>>> 237 # Call the SLICOT function >>>> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >>>> 239 >>>> 240 # Now compute the return value >>>> >>>> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in >>>> sb02md(n, A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >>>> 348 e = ValueError('the Hamiltonian or symplectic matrix H >>>> has less than n stable eigenvalues') >>>> 349 e.info = info >>>> --> 350 raise e >>>> 351 if info == 5: >>>> 352 e = ValueError('if the N-th order system of linear >>>> algebraic equations is singular to working precision') >>>> >>>> ValueError: the Hamiltonian or symplectic matrix H has less than n >>>> stable eigenvalues >>>> >>>> -- >>>> Ryan Krauss, Ph.D. >>>> Associate Professor >>>> Mechanical Engineering >>>> Southern Illinois University Edwardsville >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Windows: >>>> >>>> Build for Windows Store. >>>> >>>> http://p.sf.net/sfu/windows-dev2dev >>>> _______________________________________________ >>>> python-control-discuss mailing list >>>> pyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>>> >>>> >>> >>> >>> -- >>> René van Paassen | ______o____/_| Ren...@gm... >>> <[___\_\_-----< t: +31 15 2628685 >>> | o' mobile: +31 6 39846891 >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Windows: >>> >>> Build for Windows Store. >>> >>> http://p.sf.net/sfu/windows-dev2dev >>> >>> _______________________________________________ >>> python-control-discuss mailing list >>> pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>> >>> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> > > > -- > René van Paassen | ______o____/_| Ren...@gm... > <[___\_\_-----< t: +31 15 2628685 > | o' mobile: +31 6 39846891 > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |
From: Rene v. P. <ren...@gm...> - 2013-06-15 08:09:21
|
On 15 June 2013 05:36, Ryan Krauss <rk...@si...> wrote: > That seems to work, but I am trying to wrap my head around the validity of > it. It seems to rescale the matrices to improve numeric conditioning. If > the relationship between the input and outputs is not affected, do I just > replace my old state-space model with this? > > Yes, no problem. The only thing is that you no longer have your original states; so if you needed those, make sure you send them out in in the C matrix before conditioning. You had a controllable canonical form of your state-space system. From somewhere near order 8 and up, this almost never works out right numerically. It also depends on the (time) scaling of your state variables. If you have a slow system, your 1st derivative is going to be a small number compared to the output state, the 2nd is even smaller, and by the time you get to the 5th or 6th derivative, it is going to be numerically insignificant. Another trick that is sometimes handy is picking another time scale, hours, minutes, whatever it takes to make 1st, 2nd etc derivatives comparable numerically to the signal itself. > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > > > On Fri, Jun 14, 2013 at 4:16 PM, Rene van Paassen < > ren...@gm...> wrote: > >> How about balancing the matrix first? >> >> Today I made a little fix in tb01id, at https://github.com/repagh/Slycot >> >> I get no errors with the attached modification. Don't know if the result >> is valid, though. >> >> >> On 14 June 2013 19:59, Ryan Krauss <rk...@si...> wrote: >> >>> I assume this is most likely an ill conditioning problem on my part >>> (though I don't know how to fix the model if that is the case, since it is >>> fitting experimental data as well as an infinite dimensional model), but I >>> am getting the following error from control.lqr: >>> >>> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >>> in <module>() >>> 54 >>> 55 #K = control.lqr(ol_sys, Q, 1.0) >>> ---> 56 K, S, E = control.lqr(A, B, Q, 0.01) >>> 57 >>> 58 >>> >>> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >>> in lqr(*args, **keywords) >>> 236 >>> 237 # Call the SLICOT function >>> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >>> 239 >>> 240 # Now compute the return value >>> >>> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >>> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >>> 348 e = ValueError('the Hamiltonian or symplectic matrix H >>> has less than n stable eigenvalues') >>> 349 e.info = info >>> --> 350 raise e >>> 351 if info == 5: >>> 352 e = ValueError('if the N-th order system of linear >>> algebraic equations is singular to working precision') >>> >>> ValueError: the Hamiltonian or symplectic matrix H has less than n >>> stable eigenvalues >>> >>> In [5]: run lqr_problem.py >>> >>> --------------------------------------------------------------------------- >>> ValueError Traceback (most recent call >>> last) >>> /usr/local/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in >>> execfile(fname, *where) >>> 176 else: >>> 177 filename = fname >>> --> 178 __builtin__.execfile(filename, *where) >>> >>> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >>> in <module>() >>> 53 Q = dot(Ca.T,Ca) >>> 54 >>> ---> 55 K, S, E = control.lqr(A, B, Q, 1.0) >>> 56 >>> 57 >>> >>> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >>> in lqr(*args, **keywords) >>> 236 >>> 237 # Call the SLICOT function >>> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >>> 239 >>> 240 # Now compute the return value >>> >>> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >>> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >>> 348 e = ValueError('the Hamiltonian or symplectic matrix H >>> has less than n stable eigenvalues') >>> 349 e.info = info >>> --> 350 raise e >>> 351 if info == 5: >>> 352 e = ValueError('if the N-th order system of linear >>> algebraic equations is singular to working precision') >>> >>> ValueError: the Hamiltonian or symplectic matrix H has less than n >>> stable eigenvalues >>> >>> -- >>> Ryan Krauss, Ph.D. >>> Associate Professor >>> Mechanical Engineering >>> Southern Illinois University Edwardsville >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Windows: >>> >>> Build for Windows Store. >>> >>> http://p.sf.net/sfu/windows-dev2dev >>> _______________________________________________ >>> python-control-discuss mailing list >>> pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>> >>> >> >> >> -- >> René van Paassen | ______o____/_| Ren...@gm... >> <[___\_\_-----< t: +31 15 2628685 >> | o' mobile: +31 6 39846891 >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > -- René van Paassen | ______o____/_| Ren...@gm... <[___\_\_-----< t: +31 15 2628685 | o' mobile: +31 6 39846891 |
From: Ryan K. <rk...@si...> - 2013-06-15 03:36:35
|
That seems to work, but I am trying to wrap my head around the validity of it. It seems to rescale the matrices to improve numeric conditioning. If the relationship between the input and outputs is not affected, do I just replace my old state-space model with this? -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Fri, Jun 14, 2013 at 4:16 PM, Rene van Paassen <ren...@gm... > wrote: > How about balancing the matrix first? > > Today I made a little fix in tb01id, at https://github.com/repagh/Slycot > > I get no errors with the attached modification. Don't know if the result > is valid, though. > > > On 14 June 2013 19:59, Ryan Krauss <rk...@si...> wrote: > >> I assume this is most likely an ill conditioning problem on my part >> (though I don't know how to fix the model if that is the case, since it is >> fitting experimental data as well as an infinite dimensional model), but I >> am getting the following error from control.lqr: >> >> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >> in <module>() >> 54 >> 55 #K = control.lqr(ol_sys, Q, 1.0) >> ---> 56 K, S, E = control.lqr(A, B, Q, 0.01) >> 57 >> 58 >> >> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >> in lqr(*args, **keywords) >> 236 >> 237 # Call the SLICOT function >> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >> 239 >> 240 # Now compute the return value >> >> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >> 348 e = ValueError('the Hamiltonian or symplectic matrix H >> has less than n stable eigenvalues') >> 349 e.info = info >> --> 350 raise e >> 351 if info == 5: >> 352 e = ValueError('if the N-th order system of linear >> algebraic equations is singular to working precision') >> >> ValueError: the Hamiltonian or symplectic matrix H has less than n stable >> eigenvalues >> >> In [5]: run lqr_problem.py >> >> --------------------------------------------------------------------------- >> ValueError Traceback (most recent call >> last) >> /usr/local/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in >> execfile(fname, *where) >> 176 else: >> 177 filename = fname >> --> 178 __builtin__.execfile(filename, *where) >> >> /Users/rkrauss/siue/Research/papers/SFLR_2010_paper/CND_ASME_Special_Issue_Version/python/SFLR_ROM_2013/LQG_learn/lqr_problem.py >> in <module>() >> 53 Q = dot(Ca.T,Ca) >> 54 >> ---> 55 K, S, E = control.lqr(A, B, Q, 1.0) >> 56 >> 57 >> >> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/control-0.6d-py2.7.egg/control/statefbk.pyc >> in lqr(*args, **keywords) >> 236 >> 237 # Call the SLICOT function >> --> 238 X,rcond,w,S,U,A_inv = sb02md(nstates, A_b, G, Q_b, 'C') >> 239 >> 240 # Now compute the return value >> >> /usr/local/lib/python2.7/site-packages/slycot/synthesis.pyc in sb02md(n, >> A, G, Q, dico, hinv, uplo, scal, sort, ldwork) >> 348 e = ValueError('the Hamiltonian or symplectic matrix H >> has less than n stable eigenvalues') >> 349 e.info = info >> --> 350 raise e >> 351 if info == 5: >> 352 e = ValueError('if the N-th order system of linear >> algebraic equations is singular to working precision') >> >> ValueError: the Hamiltonian or symplectic matrix H has less than n stable >> eigenvalues >> >> -- >> Ryan Krauss, Ph.D. >> Associate Professor >> Mechanical Engineering >> Southern Illinois University Edwardsville >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> > > > -- > René van Paassen | ______o____/_| Ren...@gm... > <[___\_\_-----< t: +31 15 2628685 > | o' mobile: +31 6 39846891 > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |
From: Ryan K. <rk...@si...> - 2013-06-14 19:35:22
|
So, my system is in controllable canonical form. To my limited understanding of modern control, that should mean it is controllable, right? But this looks bad: In [65]: numpy.linalg.matrix_rank(A) Out[65]: 9 In [62]: test = control.ctrb(A,B) In [63]: numpy.linalg.matrix_rank(test) Out[63]: 3 -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Fri, Jun 14, 2013 at 2:27 PM, Ryan Krauss <rk...@si...> wrote: > So, while waiting for a response on my LQR post, I decided to try a pole > placement approach instead (for the same system). It doesn't throw any > errors, but also fails to put the poles anywhere near my desired locations > (and driving some of the poles unstable). See attached. > > Any thoughts? > > > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > |
From: Rene v. P. <ren...@gm...> - 2013-06-12 20:07:12
|
A while ago I found this link: https://github.com/alchemyst/Skogestad-Python/ This contains a bunch of control calculations in Python, apparently aimed at solving the control problems in a book. Possibly some of the solutions can be used in python-control. I already got inspiration for the margin command from there (but in the end changed implementation to a purely analytic one for transfer functions). @Carl, apparently behind the Skogestad-Python page, python-control is a control library for Python, based on sourceforge. On 12 June 2013 21:29, Ryan Krauss <rk...@si...> wrote: > So, this seems to call my reading comprehension skills into question..... > > What is and is not implemented seems clear if you read the entire webpage, > which I obviously did not..... > > > On Wednesday, June 12, 2013, Richard Murray wrote: > >> Neither lag() or kalman() are currently implemented. In the link you >> sent, these are *not* marked with a star (=> not implemented). The legend >> for entries (at the top of the page) is: >> >> * : The feature is currently implemented. >> - : The feature is not planned for implementation. >> s : A similar feature from an other library (Scipy) is imported into the >> module, until the feature is implemented here. >> >> We should perhaps add to to this: >> >> : The feature is not yet implemented >> ~ : A prototype of the function is available, but with limited >> functionality >> >> For lqg() and kalman, the status is ' ' (empty) => nobody has yet >> implemented this. >> >> Since all that is required to implement these functions is (roughly) >> solving some Riccati equations and do some system manipulations (all of >> which are already in the current release), it shouldn't be >> >> -richard >> >> On 12 Jun 2013, at 9:51 , Ryan Krauss <rk...@si...> wrote: >> >> > I am trying to use the python-control module for a state-space design >> problem for the first time. The documentation makes it sound like LQG and >> Kalman functions should be available, at least through the Matlab >> compatibility module: >> > http://python-control.sourceforge.net/manual/matlab_strings.html >> > >> > But I am not seeing these functions in ipython. Am I missing something >> or are the functions located somewhere else or called something else? >> > >> > Thanks, >> > >> > Ryan >> > >> > -- >> > Ryan Krauss, Ph.D. >> > Associate Professor >> > Mechanical Engineering >> > Southern Illinois University Edwardsville >> > >> ------------------------------------------------------------------------------ >> > This SF.net email is sponsored by Windows: >> > >> > Build for Windows Store. >> > >> > >> http://p.sf.net/sfu/windows-dev2dev_______________________________________________ >> > python-control-discuss mailing list >> > pyt...@li... >> > https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> > > > -- > Sent from Gmail Mobile > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > -- René van Paassen | ______o____/_| Ren...@gm... <[___\_\_-----< t: +31 15 2628685 | o' mobile: +31 6 39846891 |
From: Ryan K. <rk...@si...> - 2013-06-12 19:29:40
|
So, this seems to call my reading comprehension skills into question..... What is and is not implemented seems clear if you read the entire webpage, which I obviously did not..... On Wednesday, June 12, 2013, Richard Murray wrote: > Neither lag() or kalman() are currently implemented. In the link you > sent, these are *not* marked with a star (=> not implemented). The legend > for entries (at the top of the page) is: > > * : The feature is currently implemented. > - : The feature is not planned for implementation. > s : A similar feature from an other library (Scipy) is imported into the > module, until the feature is implemented here. > > We should perhaps add to to this: > > : The feature is not yet implemented > ~ : A prototype of the function is available, but with limited > functionality > > For lqg() and kalman, the status is ' ' (empty) => nobody has yet > implemented this. > > Since all that is required to implement these functions is (roughly) > solving some Riccati equations and do some system manipulations (all of > which are already in the current release), it shouldn't be > > -richard > > On 12 Jun 2013, at 9:51 , Ryan Krauss <rk...@si... <javascript:;>> > wrote: > > > I am trying to use the python-control module for a state-space design > problem for the first time. The documentation makes it sound like LQG and > Kalman functions should be available, at least through the Matlab > compatibility module: > > http://python-control.sourceforge.net/manual/matlab_strings.html > > > > But I am not seeing these functions in ipython. Am I missing something > or are the functions located somewhere else or called something else? > > > > Thanks, > > > > Ryan > > > > -- > > Ryan Krauss, Ph.D. > > Associate Professor > > Mechanical Engineering > > Southern Illinois University Edwardsville > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > > http://p.sf.net/sfu/windows-dev2dev_______________________________________________ > > python-control-discuss mailing list > > pyt...@li... <javascript:;> > > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > python-control-discuss mailing list > pyt...@li... <javascript:;> > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > -- Sent from Gmail Mobile |
From: Richard M. <mu...@cd...> - 2013-06-12 18:55:48
|
Neither lag() or kalman() are currently implemented. In the link you sent, these are *not* marked with a star (=> not implemented). The legend for entries (at the top of the page) is: * : The feature is currently implemented. - : The feature is not planned for implementation. s : A similar feature from an other library (Scipy) is imported into the module, until the feature is implemented here. We should perhaps add to to this: : The feature is not yet implemented ~ : A prototype of the function is available, but with limited functionality For lqg() and kalman, the status is ' ' (empty) => nobody has yet implemented this. Since all that is required to implement these functions is (roughly) solving some Riccati equations and do some system manipulations (all of which are already in the current release), it shouldn't be -richard On 12 Jun 2013, at 9:51 , Ryan Krauss <rk...@si...> wrote: > I am trying to use the python-control module for a state-space design problem for the first time. The documentation makes it sound like LQG and Kalman functions should be available, at least through the Matlab compatibility module: > http://python-control.sourceforge.net/manual/matlab_strings.html > > But I am not seeing these functions in ipython. Am I missing something or are the functions located somewhere else or called something else? > > Thanks, > > Ryan > > -- > Ryan Krauss, Ph.D. > Associate Professor > Mechanical Engineering > Southern Illinois University Edwardsville > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev_______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss |
From: Ryan K. <rk...@si...> - 2013-06-12 16:52:05
|
I am trying to use the python-control module for a state-space design problem for the first time. The documentation makes it sound like LQG and Kalman functions should be available, at least through the Matlab compatibility module: http://python-control.sourceforge.net/manual/matlab_strings.html But I am not seeing these functions in ipython. Am I missing something or are the functions located somewhere else or called something else? Thanks, Ryan -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville |
From: Ryan K. <rk...@si...> - 2013-06-12 15:43:35
|
> >>> h > TransferFunction([1], [1, 2, 1]) This would be a big improvement in my mind and seems simple to implement. -- Ryan Krauss, Ph.D. Associate Professor Mechanical Engineering Southern Illinois University Edwardsville On Wed, Jun 12, 2013 at 2:16 AM, Rene van Paassen <ren...@gm... > wrote: > Numpy does this: > > Imported NumPy 1.6.2, SciPy 0.10.1, Matplotlib 1.0.1 > Type "scientific" for more details. > >>> import numpy as np > >>> x = np.arange(0, 9) > >>> x > array([0, 1, 2, 3, 4, 5, 6, 7, 8]) > >>> y = array([0, 1, 2, 3, 4, 5, 6, 7, 8]) > >>> y > array([0, 1, 2, 3, 4, 5, 6, 7, 8]) > >>> print x > [0 1 2 3 4 5 6 7 8] > > But for big arrays > > >>> y = np.arange(0, 100, 0.01) > > > >>> y > > array([ 0.00000000e+00, 1.00000000e-02, 2.00000000e-02, ..., > > 9.99700000e+01, 9.99800000e+01, 9.99900000e+01]) > > > I guess for python-control the proper thing is something like: > > > >>> h > > TransferFunction([1], [1, 2, 1]) > > > I wouldn't have known the distinction between __repr__ and __str__ either, > but stumbled upon it since I am currently teaching python to 1st year > undergrads. I also teach control theory to 2nd year, of which a quarter is > using Python (from last year's Python programming trial) and the rest is > using Matlab. > > > René > > > Associate Professor > > Aerospace Engineering > > Delft University of Technology > > > On 12 June 2013 04:26, Ryan Krauss <rk...@si...> wrote: > >> > __repr__ is ideally for printing a representation that can directly be >> fed back into Python to > re-create the object. >> >> I guess I didn't realize this convention. Like you said, I don't think >> it is typically followed. When I want to look at a variable at the IPython >> prompt, I am not used to having to type print in front of it. >> >> >> -- >> Ryan Krauss, Ph.D. >> Associate Professor >> Mechanical Engineering >> Southern Illinois University Edwardsville >> >> >> On Tue, Jun 11, 2013 at 2:37 PM, Rene van Paassen < >> ren...@gm...> wrote: >> >>> __str__ is for pretty printing >>> __repr__ is ideally for printing a representation that can directly be >>> fed back into Python to re-create the object. Many objects don't implement >>> that, though, it is basically limited to the standard Python objects. >>> >>> >>> On 10 June 2013 17:53, Ryan Krauss <rk...@si...> wrote: >>> >>>> I probably won't get to this one for a few weeks (I have a conference >>>> and another paper coming up), but I would like to contribute a __repr__ >>>> method for TransferFunctions if it would be welcome. I personally would >>>> prefer that when I type the name of a TransferFunction instance and hit >>>> enter that it pretty print an ascii numerator and denominator and a >>>> horizontal line. It might be tricky to do it really nicely with exponents, >>>> but this is what happend now: >>>> >>>> In [2]: G = control.TransferFunction(1,[1,2]) >>>> >>>> In [3]: G >>>> Out[3]: <control.xferfcn.TransferFunction instance at 0x10e94cf80> >>>> >>>> I then have to ask ro G.num and G.den separately, which I personally >>>> don't like. >>>> >>>> I see that there is a __str__ method which pretty much does what I >>>> would want, so that "print G" gives me an ascii representation. >>>> >>>> Is there any reason not to have __repr__ simply call __str__? Is there >>>> some historical reason to have one and not the other? >>>> >>>> -- >>>> Ryan Krauss, Ph.D. >>>> Associate Professor >>>> Mechanical Engineering >>>> Southern Illinois University Edwardsville >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> How ServiceNow helps IT people transform IT departments: >>>> 1. A cloud service to automate IT design, transition and operations >>>> 2. Dashboards that offer high-level views of enterprise services >>>> 3. A single system of record for all IT processes >>>> http://p.sf.net/sfu/servicenow-d2d-j >>>> _______________________________________________ >>>> python-control-discuss mailing list >>>> pyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>>> >>>> >>> >>> >>> -- >>> René van Paassen | ______o____/_| Ren...@gm... >>> <[___\_\_-----< t: +31 15 2628685 >>> | o' mobile: +31 6 39846891 >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Windows: >>> >>> Build for Windows Store. >>> >>> http://p.sf.net/sfu/windows-dev2dev >>> >>> _______________________________________________ >>> python-control-discuss mailing list >>> pyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >>> >>> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> python-control-discuss mailing list >> pyt...@li... >> https://lists.sourceforge.net/lists/listinfo/python-control-discuss >> >> > > > -- > René van Paassen | ______o____/_| Ren...@gm... > <[___\_\_-----< t: +31 15 2628685 > | o' mobile: +31 6 39846891 > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > python-control-discuss mailing list > pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-control-discuss > > |