From: <kk...@us...> - 2011-02-08 22:18:20
|
Revision: 103 http://python-control.svn.sourceforge.net/python-control/?rev=103&view=rev Author: kkchen Date: 2011-02-08 22:18:14 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Changed gram back to not needed 'deepcopy' now that slycot sb03md is fixed. Also added a unittest to check that an exception is raised when gram is give something other than StateSpace object. Lauren Padilla <lpa...@pr...> Modified Paths: -------------- branches/control-0.4a/doc/Makefile branches/control-0.4a/src/TestStatefbk.py branches/control-0.4a/src/statefbk.py Modified: branches/control-0.4a/doc/Makefile =================================================================== --- branches/control-0.4a/doc/Makefile 2011-02-08 22:18:08 UTC (rev 102) +++ branches/control-0.4a/doc/Makefile 2011-02-08 22:18:14 UTC (rev 103) @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = /Users/steve/CODES/Sphinx-1.0.6/sphinx-build.py +SPHINXBUILD = /Applications/Sphinx-1.0.6/sphinx-build.py PAPER = BUILDDIR = _build Modified: branches/control-0.4a/src/TestStatefbk.py =================================================================== --- branches/control-0.4a/src/TestStatefbk.py 2011-02-08 22:18:08 UTC (rev 102) +++ branches/control-0.4a/src/TestStatefbk.py 2011-02-08 22:18:14 UTC (rev 103) @@ -73,6 +73,12 @@ Wo = gram(sys,'o') np.testing.assert_array_almost_equal(Wo, Wotrue) + def testGramsys(self): + num =[1.] + den = [1., 1., 1.] + sys = tf(num,den) + self.assertRaises(ValueError, gram, sys, 'o') + self.assertRaises(ValueError, gram, sys, 'c') if __name__ == '__main__': unittest.main() Modified: branches/control-0.4a/src/statefbk.py =================================================================== --- branches/control-0.4a/src/statefbk.py 2011-02-08 22:18:08 UTC (rev 102) +++ branches/control-0.4a/src/statefbk.py 2011-02-08 22:18:14 UTC (rev 103) @@ -43,6 +43,7 @@ import numpy as np import ctrlutil from exception import * +import statesp # Pole placement def place(A, B, p): @@ -255,6 +256,7 @@ Raises ------ ValueError + if system is not instance of StateSpace class if `type` is not 'c' or 'o' if system is unstable (sys.A has eigenvalues not in left half plane) ImportError @@ -267,10 +269,10 @@ """ - from copy import deepcopy - - #Check for ss system object, need a utility for this? - + #Check for ss system object + if not isinstance(sys,statesp.StateSpace): + raise ValueError, "System must be StateSpace!" + #TODO: Check for continous or discrete, only continuous supported right now # if isCont(): # dico = 'C' @@ -302,7 +304,7 @@ raise ControlSlycot("can't find slycot module 'sb03md'") n = sys.states U = np.zeros((n,n)) - A = deepcopy(sys.A) + A = sys.A out = sb03md(n, C, A, U, dico, 'X', 'N', trana) gram = out[0] return gram This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 22:18:57
|
Revision: 110 http://python-control.svn.sourceforge.net/python-control/?rev=110&view=rev Author: kkchen Date: 2011-02-08 22:18:49 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Modified examples so that they are compatible with the new classes. Minor changes to some of the python-control files to handle bugs found in examples. Lauren Padilla <lpa...@pr...> Modified Paths: -------------- branches/control-0.4a/examples/pvtol-lqr.py branches/control-0.4a/examples/pvtol-nested-ss.py branches/control-0.4a/examples/pvtol-nested.py branches/control-0.4a/examples/secord-matlab.py branches/control-0.4a/examples/slicot-test.py branches/control-0.4a/examples/type2_type3.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/pzmap.py branches/control-0.4a/src/statesp.py Modified: branches/control-0.4a/examples/pvtol-lqr.py =================================================================== --- branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:18:49 UTC (rev 110) @@ -119,7 +119,7 @@ subplot(221); title("Identity weights") # plot(T, Y[:,1, 1], '-', T, Y[:,2, 2], '--'); hold(True); -plot(Tx, Yx[0,:].T, '-', Ty, Yy[0,:].T, '--'); hold(True); +plot(Tx.T, Yx[0,:].T, '-', Ty.T, Yy[0,:].T, '--'); hold(True); plot([0, 10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -141,9 +141,9 @@ [T3, Y3] = step(H1cx, T=linspace(0,10,100)); subplot(222); title("Effect of input weights") -plot(T1, Y1[0,:].T, 'b-'); hold(True); -plot(T2, Y2[0,:].T, 'b-'); hold(True); -plot(T3, Y3[0,:].T, 'b-'); hold(True); +plot(T1.T, Y1[0,:].T, 'b-'); hold(True); +plot(T2.T, Y2[0,:].T, 'b-'); hold(True); +plot(T3.T, Y3[0,:].T, 'b-'); hold(True); plot([0 ,10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -162,7 +162,7 @@ subplot(223); title("Output weighting") [T2x, Y2x] = step(H2x, T=linspace(0,10,100)); [T2y, Y2y] = step(H2y, T=linspace(0,10,100)); -plot(T2x, Y2x[0,:].T, T2y, Y2y[0,:].T) +plot(T2x.T, Y2x[0,:].T, T2y.T, Y2y[0,:].T) ylabel('position'); xlabel('time'); ylabel('position'); legend(('x', 'y'), loc='lower right'); @@ -185,7 +185,7 @@ # step(H3x, H3y, 10); [T3x, Y3x] = step(H3x, T=linspace(0,10,100)); [T3y, Y3y] = step(H3y, T=linspace(0,10,100)); -plot(T3x, Y3x[0,:].T, T3y, Y3y[0,:].T) +plot(T3x.T, Y3x[0,:].T, T3y.T, Y3y[0,:].T) title("Physically motivated weights") xlabel('time'); legend(('x', 'y'), loc='lower right'); Modified: branches/control-0.4a/examples/pvtol-nested-ss.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:18:49 UTC (rev 110) @@ -10,6 +10,7 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions +import numpy as np # System parameters m = 4; # mass of aircraft @@ -107,7 +108,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, phase, 'b-') +semilogx(w, np.squeeze(phase), 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -144,14 +145,15 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec, Yvec); hold(True); +plot(Tvec.T, Yvec.T); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec, Yvec); +plot(Tvec.T, Yvec.T); +#TODO: PZmap for statespace systems has not yet been implemented. figure(10); clf(); -(P, Z) = pzmap(T, Plot=True) -print "Closed loop poles and zeros: ", P, Z +#(P, Z) = pzmap(T, Plot=True) +#print "Closed loop poles and zeros: ", P, Z # Gang of Four figure(11); clf(); Modified: branches/control-0.4a/examples/pvtol-nested.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:18:49 UTC (rev 110) @@ -10,6 +10,7 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions +import numpy as np # System parameters m = 4; # mass of aircraft @@ -97,7 +98,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, phase, 'b-') +semilogx(w, np.squeeze(phase), 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -134,10 +135,10 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec, Yvec); hold(True); +plot(Tvec.T, Yvec.T); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec, Yvec); +plot(Tvec.T, Yvec.T); figure(10); clf(); (P, Z) = pzmap(T, Plot=True) Modified: branches/control-0.4a/examples/secord-matlab.py =================================================================== --- branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:18:49 UTC (rev 110) @@ -18,7 +18,7 @@ # Step response for the system figure(1) T, yout = step(sys) -plot(T, yout) +plot(T.T, yout.T) # Bode plot for the system figure(2) Modified: branches/control-0.4a/examples/slicot-test.py =================================================================== --- branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:18:49 UTC (rev 110) @@ -17,7 +17,7 @@ sys = ss(A, B, C, 0); # Eigenvalue placement -from slycot import sb01bd +#from slycot import sb01bd K = place(A, B, [-3, -2, -1]) print "Pole place: K = ", K print "Pole place: eigs = ", np.linalg.eig(A - B * K)[0] Modified: branches/control-0.4a/examples/type2_type3.py =================================================================== --- branches/control-0.4a/examples/type2_type3.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/examples/type2_type3.py 2011-02-08 22:18:49 UTC (rev 110) @@ -15,7 +15,7 @@ Kii = Ki # Plant transfer function from torque to rate -inertia = integrator*1/J +inertia = integrator*(1/J) friction = b # transfer function from rate to torque P = inertia # friction is modelled as a separate block Modified: branches/control-0.4a/src/freqplot.py =================================================================== --- branches/control-0.4a/src/freqplot.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/src/freqplot.py 2011-02-08 22:18:49 UTC (rev 110) @@ -177,7 +177,12 @@ # Select a default range if none is provided if (omega == None): omega = default_frequency_range(syslist) - + # Interpolate between wmin and wmax if a tuple or list are provided + elif (isinstance(omega,list) | isinstance(omega,tuple)): + # Only accept tuple or list of length 2 + if (len(omega) != 2): + raise ValueError("Supported frequency arguments are (wmin,wmax) tuple or list, or frequency vector. ") + omega = np.logspace(np.log10(omega[0]),np.log10(omega[1]),num=50,endpoint=True,base=10.0) for sys in syslist: if (sys.inputs > 1 or sys.outputs > 1): #TODO: Add MIMO nyquist plots. Modified: branches/control-0.4a/src/pzmap.py =================================================================== --- branches/control-0.4a/src/pzmap.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/src/pzmap.py 2011-02-08 22:18:49 UTC (rev 110) @@ -52,7 +52,7 @@ poles = sp.roots(sys.den); zeros = sp.roots(sys.num); else: - raise TypeException + raise NotImplementedError("pzmap not implemented for state space systems yet.") if (Plot): # Plot the locations of the poles and zeros Modified: branches/control-0.4a/src/statesp.py =================================================================== --- branches/control-0.4a/src/statesp.py 2011-02-08 22:18:42 UTC (rev 109) +++ branches/control-0.4a/src/statesp.py 2011-02-08 22:18:49 UTC (rev 110) @@ -73,7 +73,7 @@ """ from numpy import all, angle, any, array, concatenate, cos, delete, dot, \ - empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, sin, zeros + empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, shape, sin, zeros from numpy.random import rand, randn from numpy.linalg import inv, det, solve from numpy.linalg.linalg import LinAlgError @@ -456,6 +456,8 @@ # TODO: transfer function to state space conversion is still buggy! print "Warning: transfer function to state space conversion by td04ad \ is still buggy!" + #print num + #print shape(num) ssout = td04ad(sys.inputs, sys.outputs, index, den, num) states = ssout[0] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 22:19:05
|
Revision: 112 http://python-control.svn.sourceforge.net/python-control/?rev=112&view=rev Author: kkchen Date: 2011-02-08 22:18:58 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Fixed pzmap.py for transfer functions. Still not implemented for state space. Lauren Padilla <lpa...@pr...> Modified Paths: -------------- branches/control-0.4a/examples/pvtol-nested.py branches/control-0.4a/examples/type2_type3.py branches/control-0.4a/src/pzmap.py Modified: branches/control-0.4a/examples/pvtol-nested.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:18:53 UTC (rev 111) +++ branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:18:58 UTC (rev 112) @@ -24,8 +24,8 @@ Po = tf([1], [m, c, 0]); # outer loop (position) # Use state space versions -# Pi = tf2ss(Pi); -# Po = tf2ss(Po); +Pi = tf2ss(Pi); +Po = tf2ss(Po); # # Inner loop control design Modified: branches/control-0.4a/examples/type2_type3.py =================================================================== --- branches/control-0.4a/examples/type2_type3.py 2011-02-08 22:18:53 UTC (rev 111) +++ branches/control-0.4a/examples/type2_type3.py 2011-02-08 22:18:58 UTC (rev 112) @@ -15,7 +15,7 @@ Kii = Ki # Plant transfer function from torque to rate -inertia = integrator*(1/J) +inertia = integrator*1/J friction = b # transfer function from rate to torque P = inertia # friction is modelled as a separate block Modified: branches/control-0.4a/src/pzmap.py =================================================================== --- branches/control-0.4a/src/pzmap.py 2011-02-08 22:18:53 UTC (rev 111) +++ branches/control-0.4a/src/pzmap.py 2011-02-08 22:18:58 UTC (rev 112) @@ -42,6 +42,7 @@ import matplotlib.pyplot as plt import scipy as sp +import numpy as np import xferfcn # Compute poles and zeros for a system @@ -49,8 +50,8 @@ def pzmap(sys, Plot=True): """Plot a pole/zero map for a transfer function""" if (isinstance(sys, xferfcn.TransferFunction)): - poles = sp.roots(sys.den); - zeros = sp.roots(sys.num); + poles = sp.roots(np.squeeze(np.asarray(sys.den))); + zeros = sp.roots(np.squeeze(np.asarray(sys.num))); else: raise NotImplementedError("pzmap not implemented for state space systems yet.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 22:19:13
|
Revision: 113 http://python-control.svn.sourceforge.net/python-control/?rev=113&view=rev Author: kkchen Date: 2011-02-08 22:19:07 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Updated test.py to be in repository I forgot to hg add test.py last time, oops. Made a few other minor edits, removing some duplicate code with "execs" in test.py for python versions <2.7 bb...@ra... Modified Paths: -------------- branches/control-0.4a/examples/pvtol-lqr.py branches/control-0.4a/examples/pvtol-nested-ss.py branches/control-0.4a/examples/pvtol-nested.py branches/control-0.4a/examples/secord-matlab.py branches/control-0.4a/examples/slicot-test.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/pzmap.py branches/control-0.4a/src/statesp.py branches/control-0.4a/src/xferfcn.py Added Paths: ----------- branches/control-0.4a/src/test.py Modified: branches/control-0.4a/examples/pvtol-lqr.py =================================================================== --- branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:19:07 UTC (rev 113) @@ -119,7 +119,7 @@ subplot(221); title("Identity weights") # plot(T, Y[:,1, 1], '-', T, Y[:,2, 2], '--'); hold(True); -plot(Tx.T, Yx[0,:].T, '-', Ty.T, Yy[0,:].T, '--'); hold(True); +plot(Tx, Yx[0,:].T, '-', Ty, Yy[0,:].T, '--'); hold(True); plot([0, 10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -141,9 +141,9 @@ [T3, Y3] = step(H1cx, T=linspace(0,10,100)); subplot(222); title("Effect of input weights") -plot(T1.T, Y1[0,:].T, 'b-'); hold(True); -plot(T2.T, Y2[0,:].T, 'b-'); hold(True); -plot(T3.T, Y3[0,:].T, 'b-'); hold(True); +plot(T1, Y1[0,:].T, 'b-'); hold(True); +plot(T2, Y2[0,:].T, 'b-'); hold(True); +plot(T3, Y3[0,:].T, 'b-'); hold(True); plot([0 ,10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -162,7 +162,7 @@ subplot(223); title("Output weighting") [T2x, Y2x] = step(H2x, T=linspace(0,10,100)); [T2y, Y2y] = step(H2y, T=linspace(0,10,100)); -plot(T2x.T, Y2x[0,:].T, T2y.T, Y2y[0,:].T) +plot(T2x, Y2x[0,:].T, T2y, Y2y[0,:].T) ylabel('position'); xlabel('time'); ylabel('position'); legend(('x', 'y'), loc='lower right'); @@ -185,7 +185,7 @@ # step(H3x, H3y, 10); [T3x, Y3x] = step(H3x, T=linspace(0,10,100)); [T3y, Y3y] = step(H3y, T=linspace(0,10,100)); -plot(T3x.T, Y3x[0,:].T, T3y.T, Y3y[0,:].T) +plot(T3x, Y3x[0,:].T, T3y, Y3y[0,:].T) title("Physically motivated weights") xlabel('time'); legend(('x', 'y'), loc='lower right'); Modified: branches/control-0.4a/examples/pvtol-nested-ss.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:19:07 UTC (rev 113) @@ -10,7 +10,6 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions -import numpy as np # System parameters m = 4; # mass of aircraft @@ -108,7 +107,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, np.squeeze(phase), 'b-') +semilogx(w, phase, 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -145,15 +144,14 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec.T, Yvec.T); hold(True); +plot(Tvec, Yvec); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec.T, Yvec.T); +plot(Tvec, Yvec); -#TODO: PZmap for statespace systems has not yet been implemented. figure(10); clf(); -#(P, Z) = pzmap(T, Plot=True) -#print "Closed loop poles and zeros: ", P, Z +(P, Z) = pzmap(T, Plot=True) +print "Closed loop poles and zeros: ", P, Z # Gang of Four figure(11); clf(); Modified: branches/control-0.4a/examples/pvtol-nested.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:19:07 UTC (rev 113) @@ -10,7 +10,6 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions -import numpy as np # System parameters m = 4; # mass of aircraft @@ -24,8 +23,8 @@ Po = tf([1], [m, c, 0]); # outer loop (position) # Use state space versions -Pi = tf2ss(Pi); -Po = tf2ss(Po); +# Pi = tf2ss(Pi); +# Po = tf2ss(Po); # # Inner loop control design @@ -98,7 +97,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, np.squeeze(phase), 'b-') +semilogx(w, phase, 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -135,10 +134,10 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec.T, Yvec.T); hold(True); +plot(Tvec, Yvec); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec.T, Yvec.T); +plot(Tvec, Yvec); figure(10); clf(); (P, Z) = pzmap(T, Plot=True) Modified: branches/control-0.4a/examples/secord-matlab.py =================================================================== --- branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:19:07 UTC (rev 113) @@ -18,7 +18,7 @@ # Step response for the system figure(1) T, yout = step(sys) -plot(T.T, yout.T) +plot(T, yout) # Bode plot for the system figure(2) Modified: branches/control-0.4a/examples/slicot-test.py =================================================================== --- branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:19:07 UTC (rev 113) @@ -17,7 +17,7 @@ sys = ss(A, B, C, 0); # Eigenvalue placement -#from slycot import sb01bd +from slycot import sb01bd K = place(A, B, [-3, -2, -1]) print "Pole place: K = ", K print "Pole place: eigs = ", np.linalg.eig(A - B * K)[0] Modified: branches/control-0.4a/src/freqplot.py =================================================================== --- branches/control-0.4a/src/freqplot.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/src/freqplot.py 2011-02-08 22:19:07 UTC (rev 113) @@ -177,12 +177,7 @@ # Select a default range if none is provided if (omega == None): omega = default_frequency_range(syslist) - # Interpolate between wmin and wmax if a tuple or list are provided - elif (isinstance(omega,list) | isinstance(omega,tuple)): - # Only accept tuple or list of length 2 - if (len(omega) != 2): - raise ValueError("Supported frequency arguments are (wmin,wmax) tuple or list, or frequency vector. ") - omega = np.logspace(np.log10(omega[0]),np.log10(omega[1]),num=50,endpoint=True,base=10.0) + for sys in syslist: if (sys.inputs > 1 or sys.outputs > 1): #TODO: Add MIMO nyquist plots. Modified: branches/control-0.4a/src/pzmap.py =================================================================== --- branches/control-0.4a/src/pzmap.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/src/pzmap.py 2011-02-08 22:19:07 UTC (rev 113) @@ -42,7 +42,6 @@ import matplotlib.pyplot as plt import scipy as sp -import numpy as np import xferfcn # Compute poles and zeros for a system @@ -50,10 +49,10 @@ def pzmap(sys, Plot=True): """Plot a pole/zero map for a transfer function""" if (isinstance(sys, xferfcn.TransferFunction)): - poles = sp.roots(np.squeeze(np.asarray(sys.den))); - zeros = sp.roots(np.squeeze(np.asarray(sys.num))); + poles = sp.roots(sys.den); + zeros = sp.roots(sys.num); else: - raise NotImplementedError("pzmap not implemented for state space systems yet.") + raise TypeException if (Plot): # Plot the locations of the poles and zeros Modified: branches/control-0.4a/src/statesp.py =================================================================== --- branches/control-0.4a/src/statesp.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/src/statesp.py 2011-02-08 22:19:07 UTC (rev 113) @@ -73,7 +73,7 @@ """ from numpy import all, angle, any, array, concatenate, cos, delete, dot, \ - empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, shape, sin, zeros + empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, sin, zeros from numpy.random import rand, randn from numpy.linalg import inv, det, solve from numpy.linalg.linalg import LinAlgError @@ -456,8 +456,6 @@ # TODO: transfer function to state space conversion is still buggy! print "Warning: transfer function to state space conversion by td04ad \ is still buggy!" - #print num - #print shape(num) ssout = td04ad(sys.inputs, sys.outputs, index, den, num) states = ssout[0] Added: branches/control-0.4a/src/test.py =================================================================== --- branches/control-0.4a/src/test.py (rev 0) +++ branches/control-0.4a/src/test.py 2011-02-08 22:19:07 UTC (rev 113) @@ -0,0 +1,63 @@ +import subprocess as SP + +def tests_old(): + """ Runs all of the tests written for python-control. This should be + changed in the future so it does run seperate main functions/scripts, + but is integrated into the package. Also, the tests should be in their + own directory /trunk/tests. Running the test should be as simple as: + "import control; control.tests()" + """ + testList = ['TestBDAlg.py','TestConvert.py','TestFreqRsp.py',\ + 'TestMatlab.py','TestModelsimp.py','TestSlycot.py',\ + 'TestStateSp.py','TestStatefbk.py','TestXferFcn.py'] + #Add more tests to this list as they are created. Each is assumed to run + #as a script, as is usually done with unittest. + for test in testList: + print 'Running',test + print SP.Popen(['./'+test],stdout=SP.PIPE).communicate()[0] + print 'Completed',test + +def tests(): + import unittest + try: #auto test discovery is only implemented in python 2.7+ + start_dir='./' #change to a tests directory eventually. + pattern = 'Test*.py' + top_level_dir = './' #this might change? see + #http://docs.python.org/library/unittest.html#unittest.TestLoader.discover + test_mods=unittest.defaultTestLoader.discover(start_dir,pattern=pattern,\ + top_level_dir=top_level_dir) + #now go through each module and run all of its tests. + print 'found test mods and they are',test_mods + for mod in test_mods: + print 'Running tests in',mod + tests = unittest.defaultTestLoader.loadTestFromModule(mod) + t = unittest.TextTestRunner() + t.run(tests) + print 'Completed tests in',mod + except: + #If can't do auto discovery, for now it is hard-coded. This is not ideal for + #when new tests are added or existing ones are reorganized/renamed. + + #remove all of the print commands once tests are debugged and converted to + #unittests. + + print 'Tests may be incomplete' + t=unittest.TextTestRunner() + + testModules = ['TestBDAlg','TestConvert','TestFreqRsp','TestMatlab','TestModelsimp',\ + 'TestStateSp','TestStatefbk','TestXferFcn'] #add additional tests here, or discovery? + suite = unittest.TestSuite() + for mod in testModules: + exec('import '+mod+' as currentModule') + print 'TEST',mod + suite = currentModule.suite() + t.run(suite) + #After tests have been debugged and made into unittests, remove + #the above (except the import) and replace with something like this: + #suiteList.append(ts.suite()) + #alltests = unittest.TestSuite(suiteList) + #t.run(alltests) + + +if __name__=='__main__': + tests() Modified: branches/control-0.4a/src/xferfcn.py =================================================================== --- branches/control-0.4a/src/xferfcn.py 2011-02-08 22:18:58 UTC (rev 112) +++ branches/control-0.4a/src/xferfcn.py 2011-02-08 22:19:07 UTC (rev 113) @@ -344,14 +344,14 @@ def __div__(self, other): """Divide two LTI objects.""" - # Convert the second argument to a transfer function. - other = _convertToTransferFunction(other) - if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): raise NotImplementedError("TransferFunction.__div__ is currently \ implemented only for SISO systems.") + # Convert the second argument to a transfer function. + other = _convertToTransferFunction(other) + num = polymul(self.num[0][0], other.den[0][0]) den = polymul(self.den[0][0], other.num[0][0]) @@ -487,9 +487,8 @@ computes the single denominator containing all the poles of sys.den, and reports it as the array d. The output numerator array n is modified to - use the common denominator; the coefficient arrays are also padded with - zeros to be the same size as d. n is an sys.outputs-by-sys.inputs-by- - len(d) array. + use the common denominator. It is an sys.outputs-by-sys.inputs-by- + [something] array. """ @@ -589,12 +588,16 @@ # Multiply in the missing poles. for p in missingpoles[i][j]: num[i][j] = polymul(num[i][j], [1., -p]) - # Pad all numerator polynomials with zeros so that the numerator arrays - # are the same size as the denominator. + # Find the largest numerator polynomial size. + largest = 0 for i in range(self.outputs): for j in range(self.inputs): - num[i][j] = insert(num[i][j], zeros(len(den) - len(num[i][j])), - zeros(len(den) - len(num[i][j]))) + largest = max(largest, len(num[i][j])) + # Pad all smaller numerator polynomials with zeros. + for i in range(self.outputs): + for j in range(self.inputs): + num[i][j] = insert(num[i][j], zeros(largest - len(num[i][j])), + zeros(largest - len(num[i][j]))) # Finally, convert the numerator to a 3-D array. num = array(num) # Remove trivial imaginary parts. Check for nontrivial imaginary parts. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 22:19:20
|
Revision: 114 http://python-control.svn.sourceforge.net/python-control/?rev=114&view=rev Author: kkchen Date: 2011-02-08 22:19:13 +0000 (Tue, 08 Feb 2011) Log Message: ----------- merging changes bb...@ra... Modified Paths: -------------- branches/control-0.4a/examples/pvtol-lqr.py branches/control-0.4a/examples/pvtol-nested-ss.py branches/control-0.4a/examples/pvtol-nested.py branches/control-0.4a/examples/secord-matlab.py branches/control-0.4a/examples/slicot-test.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/pzmap.py branches/control-0.4a/src/statesp.py branches/control-0.4a/src/xferfcn.py Modified: branches/control-0.4a/examples/pvtol-lqr.py =================================================================== --- branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/examples/pvtol-lqr.py 2011-02-08 22:19:13 UTC (rev 114) @@ -119,7 +119,7 @@ subplot(221); title("Identity weights") # plot(T, Y[:,1, 1], '-', T, Y[:,2, 2], '--'); hold(True); -plot(Tx, Yx[0,:].T, '-', Ty, Yy[0,:].T, '--'); hold(True); +plot(Tx.T, Yx[0,:].T, '-', Ty.T, Yy[0,:].T, '--'); hold(True); plot([0, 10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -141,9 +141,9 @@ [T3, Y3] = step(H1cx, T=linspace(0,10,100)); subplot(222); title("Effect of input weights") -plot(T1, Y1[0,:].T, 'b-'); hold(True); -plot(T2, Y2[0,:].T, 'b-'); hold(True); -plot(T3, Y3[0,:].T, 'b-'); hold(True); +plot(T1.T, Y1[0,:].T, 'b-'); hold(True); +plot(T2.T, Y2[0,:].T, 'b-'); hold(True); +plot(T3.T, Y3[0,:].T, 'b-'); hold(True); plot([0 ,10], [1, 1], 'k-'); hold(True); axis([0, 10, -0.1, 1.4]); @@ -162,7 +162,7 @@ subplot(223); title("Output weighting") [T2x, Y2x] = step(H2x, T=linspace(0,10,100)); [T2y, Y2y] = step(H2y, T=linspace(0,10,100)); -plot(T2x, Y2x[0,:].T, T2y, Y2y[0,:].T) +plot(T2x.T, Y2x[0,:].T, T2y.T, Y2y[0,:].T) ylabel('position'); xlabel('time'); ylabel('position'); legend(('x', 'y'), loc='lower right'); @@ -185,7 +185,7 @@ # step(H3x, H3y, 10); [T3x, Y3x] = step(H3x, T=linspace(0,10,100)); [T3y, Y3y] = step(H3y, T=linspace(0,10,100)); -plot(T3x, Y3x[0,:].T, T3y, Y3y[0,:].T) +plot(T3x.T, Y3x[0,:].T, T3y.T, Y3y[0,:].T) title("Physically motivated weights") xlabel('time'); legend(('x', 'y'), loc='lower right'); Modified: branches/control-0.4a/examples/pvtol-nested-ss.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/examples/pvtol-nested-ss.py 2011-02-08 22:19:13 UTC (rev 114) @@ -10,6 +10,7 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions +import numpy as np # System parameters m = 4; # mass of aircraft @@ -107,7 +108,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, phase, 'b-') +semilogx(w, np.squeeze(phase), 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -144,14 +145,15 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec, Yvec); hold(True); +plot(Tvec.T, Yvec.T); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec, Yvec); +plot(Tvec.T, Yvec.T); +#TODO: PZmap for statespace systems has not yet been implemented. figure(10); clf(); -(P, Z) = pzmap(T, Plot=True) -print "Closed loop poles and zeros: ", P, Z +#(P, Z) = pzmap(T, Plot=True) +#print "Closed loop poles and zeros: ", P, Z # Gang of Four figure(11); clf(); Modified: branches/control-0.4a/examples/pvtol-nested.py =================================================================== --- branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/examples/pvtol-nested.py 2011-02-08 22:19:13 UTC (rev 114) @@ -10,6 +10,7 @@ from matplotlib.pyplot import * # Grab MATLAB plotting functions from control.matlab import * # MATLAB-like functions +import numpy as np # System parameters m = 4; # mass of aircraft @@ -23,8 +24,8 @@ Po = tf([1], [m, c, 0]); # outer loop (position) # Use state space versions -# Pi = tf2ss(Pi); -# Po = tf2ss(Po); +Pi = tf2ss(Pi); +Po = tf2ss(Po); # # Inner loop control design @@ -97,7 +98,7 @@ subplot(phaseh); semilogx([10^-4, 10^3], [-180, -180], 'k-') hold(True); -semilogx(w, phase, 'b-') +semilogx(w, np.squeeze(phase), 'b-') axis([10^-4, 10^3, -360, 0]); xlabel('Frequency [deg]'); ylabel('Phase [deg]'); # set(gca, 'YTick', [-360, -270, -180, -90, 0]); @@ -134,10 +135,10 @@ figure(9); (Tvec, Yvec) = step(T, None, linspace(1, 20)); -plot(Tvec, Yvec); hold(True); +plot(Tvec.T, Yvec.T); hold(True); (Tvec, Yvec) = step(Co*S, None, linspace(1, 20)); -plot(Tvec, Yvec); +plot(Tvec.T, Yvec.T); figure(10); clf(); (P, Z) = pzmap(T, Plot=True) Modified: branches/control-0.4a/examples/secord-matlab.py =================================================================== --- branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:19:13 UTC (rev 114) @@ -18,7 +18,7 @@ # Step response for the system figure(1) T, yout = step(sys) -plot(T, yout) +plot(T.T, yout.T) # Bode plot for the system figure(2) Modified: branches/control-0.4a/examples/slicot-test.py =================================================================== --- branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/examples/slicot-test.py 2011-02-08 22:19:13 UTC (rev 114) @@ -17,7 +17,7 @@ sys = ss(A, B, C, 0); # Eigenvalue placement -from slycot import sb01bd +#from slycot import sb01bd K = place(A, B, [-3, -2, -1]) print "Pole place: K = ", K print "Pole place: eigs = ", np.linalg.eig(A - B * K)[0] Modified: branches/control-0.4a/src/freqplot.py =================================================================== --- branches/control-0.4a/src/freqplot.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/src/freqplot.py 2011-02-08 22:19:13 UTC (rev 114) @@ -177,7 +177,12 @@ # Select a default range if none is provided if (omega == None): omega = default_frequency_range(syslist) - + # Interpolate between wmin and wmax if a tuple or list are provided + elif (isinstance(omega,list) | isinstance(omega,tuple)): + # Only accept tuple or list of length 2 + if (len(omega) != 2): + raise ValueError("Supported frequency arguments are (wmin,wmax) tuple or list, or frequency vector. ") + omega = np.logspace(np.log10(omega[0]),np.log10(omega[1]),num=50,endpoint=True,base=10.0) for sys in syslist: if (sys.inputs > 1 or sys.outputs > 1): #TODO: Add MIMO nyquist plots. Modified: branches/control-0.4a/src/pzmap.py =================================================================== --- branches/control-0.4a/src/pzmap.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/src/pzmap.py 2011-02-08 22:19:13 UTC (rev 114) @@ -42,6 +42,7 @@ import matplotlib.pyplot as plt import scipy as sp +import numpy as np import xferfcn # Compute poles and zeros for a system @@ -49,10 +50,10 @@ def pzmap(sys, Plot=True): """Plot a pole/zero map for a transfer function""" if (isinstance(sys, xferfcn.TransferFunction)): - poles = sp.roots(sys.den); - zeros = sp.roots(sys.num); + poles = sp.roots(np.squeeze(np.asarray(sys.den))); + zeros = sp.roots(np.squeeze(np.asarray(sys.num))); else: - raise TypeException + raise NotImplementedError("pzmap not implemented for state space systems yet.") if (Plot): # Plot the locations of the poles and zeros Modified: branches/control-0.4a/src/statesp.py =================================================================== --- branches/control-0.4a/src/statesp.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/src/statesp.py 2011-02-08 22:19:13 UTC (rev 114) @@ -73,7 +73,7 @@ """ from numpy import all, angle, any, array, concatenate, cos, delete, dot, \ - empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, sin, zeros + empty, exp, eye, matrix, ones, pi, poly, poly1d, roots, shape, sin, zeros from numpy.random import rand, randn from numpy.linalg import inv, det, solve from numpy.linalg.linalg import LinAlgError @@ -456,6 +456,8 @@ # TODO: transfer function to state space conversion is still buggy! print "Warning: transfer function to state space conversion by td04ad \ is still buggy!" + #print num + #print shape(num) ssout = td04ad(sys.inputs, sys.outputs, index, den, num) states = ssout[0] Modified: branches/control-0.4a/src/xferfcn.py =================================================================== --- branches/control-0.4a/src/xferfcn.py 2011-02-08 22:19:07 UTC (rev 113) +++ branches/control-0.4a/src/xferfcn.py 2011-02-08 22:19:13 UTC (rev 114) @@ -344,14 +344,14 @@ def __div__(self, other): """Divide two LTI objects.""" + # Convert the second argument to a transfer function. + other = _convertToTransferFunction(other) + if (self.inputs > 1 or self.outputs > 1 or other.inputs > 1 or other.outputs > 1): raise NotImplementedError("TransferFunction.__div__ is currently \ implemented only for SISO systems.") - # Convert the second argument to a transfer function. - other = _convertToTransferFunction(other) - num = polymul(self.num[0][0], other.den[0][0]) den = polymul(self.den[0][0], other.num[0][0]) @@ -487,8 +487,9 @@ computes the single denominator containing all the poles of sys.den, and reports it as the array d. The output numerator array n is modified to - use the common denominator. It is an sys.outputs-by-sys.inputs-by- - [something] array. + use the common denominator; the coefficient arrays are also padded with + zeros to be the same size as d. n is an sys.outputs-by-sys.inputs-by- + len(d) array. """ @@ -588,16 +589,12 @@ # Multiply in the missing poles. for p in missingpoles[i][j]: num[i][j] = polymul(num[i][j], [1., -p]) - # Find the largest numerator polynomial size. - largest = 0 + # Pad all numerator polynomials with zeros so that the numerator arrays + # are the same size as the denominator. for i in range(self.outputs): for j in range(self.inputs): - largest = max(largest, len(num[i][j])) - # Pad all smaller numerator polynomials with zeros. - for i in range(self.outputs): - for j in range(self.inputs): - num[i][j] = insert(num[i][j], zeros(largest - len(num[i][j])), - zeros(largest - len(num[i][j]))) + num[i][j] = insert(num[i][j], zeros(len(den) - len(num[i][j])), + zeros(len(den) - len(num[i][j]))) # Finally, convert the numerator to a 3-D array. num = array(num) # Remove trivial imaginary parts. Check for nontrivial imaginary parts. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 22:19:45
|
Revision: 119 http://python-control.svn.sourceforge.net/python-control/?rev=119&view=rev Author: kkchen Date: 2011-02-08 22:19:39 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Added rss-balred.py to /examples and bode now returns mag, phase, freq, with the option to supress plotting. Lauren Padilla <lpa...@pr...> Modified Paths: -------------- branches/control-0.4a/examples/secord-matlab.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/modelsimp.py branches/control-0.4a/src/xferfcn.py Added Paths: ----------- branches/control-0.4a/examples/rss-balred.py Added: branches/control-0.4a/examples/rss-balred.py =================================================================== --- branches/control-0.4a/examples/rss-balred.py (rev 0) +++ branches/control-0.4a/examples/rss-balred.py 2011-02-08 22:19:39 UTC (rev 119) @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +import numpy as np +import control.modelsimp as msimp +import control.matlab as mt +from control.statesp import StateSpace +import matplotlib.pyplot as plt + +plt.close('all') + +#controlable canonical realization computed in matlab for the transfer function: +# num = [1 11 45 32], den = [1 15 60 200 60] +A = np.matrix('-15., -7.5, -6.25, -1.875; \ +8., 0., 0., 0.; \ +0., 4., 0., 0.; \ +0., 0., 1., 0.') +B = np.matrix('2.; 0.; 0.; 0.') +C = np.matrix('0.5, 0.6875, 0.7031, 0.5') +D = np.matrix('0.') + +# The full system +fsys = StateSpace(A,B,C,D) +# The reduced system, truncating the order by 1 +ord = 3 +rsys = msimp.balred(fsys,ord, method = 'truncate') + +# Comparison of the step responses of the full and reduced systems +plt.figure(1) +t, y = mt.step(fsys) +tr, yr = mt.step(rsys) +plt.plot(t.T, y.T) +plt.hold(True) +plt.plot(tr.T, yr.T) + +# Repeat balanced reduction, now with 100-dimensional random state space +sysrand = mt.rss(100, 1, 1) +rsysrand = msimp.balred(sysrand,10,method ='truncate') + +# Comparison of the impulse responses of the full and reduced random systems +plt.figure(2) +trand, yrand = mt.impulse(sysrand) +trandr, yrandr = mt.impulse(rsysrand) +plt.plot(trand.T, yrand.T,trandr.T, yrandr.T) + Property changes on: branches/control-0.4a/examples/rss-balred.py ___________________________________________________________________ Added: svn:executable + * Modified: branches/control-0.4a/examples/secord-matlab.py =================================================================== --- branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:19:33 UTC (rev 118) +++ branches/control-0.4a/examples/secord-matlab.py 2011-02-08 22:19:39 UTC (rev 119) @@ -22,7 +22,7 @@ # Bode plot for the system figure(2) -bode(sys, logspace(-2, 2)) +mag,phase,om = bode(sys, logspace(-2, 2),Plot=True) # Nyquist plot for the system figure(3) Modified: branches/control-0.4a/src/freqplot.py =================================================================== --- branches/control-0.4a/src/freqplot.py 2011-02-08 22:19:33 UTC (rev 118) +++ branches/control-0.4a/src/freqplot.py 2011-02-08 22:19:39 UTC (rev 119) @@ -54,12 +54,12 @@ # # Bode plot -def bode(syslist, omega=None, dB=False, Hz=False, color=None): +def bode(syslist, omega=None, dB=False, Hz=False, color=None, Plot=True): """Bode plot for a system Usage ===== - (magh, phaseh) = bode(syslist, omega=None, dB=False, Hz=False) + (magh, phaseh, omega) = bode(syslist, omega=None, dB=False, Hz=False, color=None, Plot=True) Plots a Bode plot for the system over a (optional) frequency range. @@ -73,16 +73,18 @@ If True, plot result in dB Hz : boolean If True, plot frequency in Hz (omega must be provided in rad/sec) + Plot : boolean + If True, plot magnitude and phase Return values ------------- - magh : graphics handle to magnitude plot (for rescaling, etc) - phaseh : graphics handle to phase plot + magh : magnitude array + phaseh : phase array + omega : frequency array Notes ----- - 1. Use (mag, phase, freq) = sys.freqresp(freq) to generate the - frequency response for a system. + 1. Alternatively, may use (mag, phase, freq) = sys.freqresp(freq) to generate the frequency response for a system. """ # If argument was a singleton, turn it into a list if (not getattr(syslist, '__iter__', False)): @@ -108,46 +110,47 @@ # Get the dimensions of the current axis, which we will divide up #! TODO: Not current implemented; just use subplot for now - # Magnitude plot - plt.subplot(211); - if dB: - if color==None: - plt.semilogx(omega, mag) + if (Plot): + # Magnitude plot + plt.subplot(211); + if dB: + if color==None: + plt.semilogx(omega, mag) + else: + plt.semilogx(omega, mag, color=color) + plt.ylabel("Magnitude (dB)") else: - plt.semilogx(omega, mag, color=color) - plt.ylabel("Magnitude (dB)") - else: - if color==None: - plt.loglog(omega, mag) - else: - plt.loglog(omega, mag, color=color) - plt.ylabel("Magnitude") + if color==None: + plt.loglog(omega, mag) + else: + plt.loglog(omega, mag, color=color) + plt.ylabel("Magnitude") - # Add a grid to the plot - plt.grid(True) - plt.grid(True, which='minor') - plt.hold(True); + # Add a grid to the plot + plt.grid(True) + plt.grid(True, which='minor') + plt.hold(True); - # Phase plot - plt.subplot(212); - if color==None: - plt.semilogx(omega, phase) - else: - plt.semilogx(omega, phase, color=color) - plt.hold(True) + # Phase plot + plt.subplot(212); + if color==None: + plt.semilogx(omega, phase) + else: + plt.semilogx(omega, phase, color=color) + plt.hold(True) - # Add a grid to the plot - plt.grid(True) - plt.grid(True, which='minor') - plt.ylabel("Phase (deg)") + # Add a grid to the plot + plt.grid(True) + plt.grid(True, which='minor') + plt.ylabel("Phase (deg)") - # Label the frequency axis - if Hz: - plt.xlabel("Frequency (Hz)") - else: - plt.xlabel("Frequency (rad/sec)") + # Label the frequency axis + if Hz: + plt.xlabel("Frequency (Hz)") + else: + plt.xlabel("Frequency (rad/sec)") - return (211, 212) + return mag, phase, omega # Nyquist plot def nyquist(syslist, omega=None): Modified: branches/control-0.4a/src/modelsimp.py =================================================================== --- branches/control-0.4a/src/modelsimp.py 2011-02-08 22:19:33 UTC (rev 118) +++ branches/control-0.4a/src/modelsimp.py 2011-02-08 22:19:39 UTC (rev 119) @@ -207,6 +207,8 @@ #Check system is stable D,V = np.linalg.eig(sys.A) + print D.shape + print D for e in D: if e.real >= 0: raise ValueError, "Oops, the system is unstable!" Modified: branches/control-0.4a/src/xferfcn.py =================================================================== --- branches/control-0.4a/src/xferfcn.py 2011-02-08 22:19:33 UTC (rev 118) +++ branches/control-0.4a/src/xferfcn.py 2011-02-08 22:19:39 UTC (rev 119) @@ -710,7 +710,8 @@ num[i][j] = list(tfout[6][i, j, :]) # Each transfer function matrix row has a common denominator. den[i][j] = list(tfout[5][i, :]) - + print num + print den return TransferFunction(num, den) elif isinstance(sys, (int, long, float, complex)): if "inputs" in kw: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-08 23:04:52
|
Revision: 124 http://python-control.svn.sourceforge.net/python-control/?rev=124&view=rev Author: kkchen Date: 2011-02-08 23:04:46 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Removed .hgignore; set some svn:ignore properties. Removed Paths: ------------- .hgignore Property Changed: ---------------- / branches/control-0.4a/ branches/control-0.4a/build/ branches/control-0.4a/doc/ branches/control-0.4a/src/ Property changes on: ___________________________________________________________________ Added: svn:ignore + .DS_Store Deleted: .hgignore =================================================================== --- .hgignore 2011-02-08 22:19:58 UTC (rev 123) +++ .hgignore 2011-02-08 23:04:46 UTC (rev 124) @@ -1,17 +0,0 @@ - -# Automatically generated by `hgimportsvn` -syntax:glob -.svn -.hgsvn - -# These lines are suggested according to the svn:ignore property -# Feel free to enable them by uncommenting them -syntax:glob - -.DS_Store -.*.swp -build/* -doc/_build/* -doc/_templates/* -doc/_static/* -*.pyc Property changes on: branches/control-0.4a ___________________________________________________________________ Added: svn:ignore + build/ Property changes on: branches/control-0.4a/build ___________________________________________________________________ Added: svn:ignore + * Property changes on: branches/control-0.4a/doc ___________________________________________________________________ Added: svn:ignore + _build/ _templates/ _static/ Property changes on: branches/control-0.4a/src ___________________________________________________________________ Added: svn:ignore + *.pyc .*.swp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2011-02-09 16:08:28
|
Revision: 125 http://python-control.svn.sourceforge.net/python-control/?rev=125&view=rev Author: kkchen Date: 2011-02-09 16:08:17 +0000 (Wed, 09 Feb 2011) Log Message: ----------- Removed build/* and some other stuff from version control. Removed Paths: ------------- branches/control-0.4a/MANIFEST.in branches/control-0.4a/build/ Property Changed: ---------------- branches/control-0.4a/ branches/control-0.4a/doc/ Property changes on: branches/control-0.4a ___________________________________________________________________ Modified: svn:ignore - build/ + MANIFEST* build dist Deleted: branches/control-0.4a/MANIFEST.in =================================================================== --- branches/control-0.4a/MANIFEST.in 2011-02-08 23:04:46 UTC (rev 124) +++ branches/control-0.4a/MANIFEST.in 2011-02-09 16:08:17 UTC (rev 125) @@ -1,5 +0,0 @@ -include README -include setup.py -include src/*.py -include examples/README examples/*.py -prune examples/*-test.py Property changes on: branches/control-0.4a/doc ___________________________________________________________________ Modified: svn:ignore - _build/ _templates/ _static/ + _build _templates _static *.pdf This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mur...@us...> - 2011-02-13 16:50:05
|
Revision: 134 http://python-control.svn.sourceforge.net/python-control/?rev=134&view=rev Author: murrayrm Date: 2011-02-13 16:49:58 +0000 (Sun, 13 Feb 2011) Log Message: ----------- Copied over latest changes from v0.3d: * Added in latest nichols() code from Allan McInnes (including 13 Feb commits) * Turned svn:keyword Id back on for source code files * Set version number to 0.4a Modified Paths: -------------- branches/control-0.4a/ChangeLog branches/control-0.4a/setup.py branches/control-0.4a/src/__init__.py branches/control-0.4a/src/bdalg.py branches/control-0.4a/src/ctrlutil.py branches/control-0.4a/src/delay.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/matlab.py branches/control-0.4a/src/rlocus.py branches/control-0.4a/src/statesp.py branches/control-0.4a/src/xferfcn.py Added Paths: ----------- branches/control-0.4a/examples/bdalg-matlab.py branches/control-0.4a/examples/test-response.py branches/control-0.4a/examples/test-statefbk.py Property Changed: ---------------- branches/control-0.4a/src/__init__.py branches/control-0.4a/src/bdalg.py branches/control-0.4a/src/ctrlutil.py branches/control-0.4a/src/delay.py branches/control-0.4a/src/exception.py branches/control-0.4a/src/freqplot.py branches/control-0.4a/src/lti.py branches/control-0.4a/src/matlab.py branches/control-0.4a/src/modelsimp.py branches/control-0.4a/src/pzmap.py branches/control-0.4a/src/rlocus.py branches/control-0.4a/src/robust.py branches/control-0.4a/src/statefbk.py branches/control-0.4a/src/statesp.py branches/control-0.4a/src/test.py branches/control-0.4a/src/xferfcn.py Modified: branches/control-0.4a/ChangeLog =================================================================== --- branches/control-0.4a/ChangeLog 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/ChangeLog 2011-02-13 16:49:58 UTC (rev 134) @@ -1,3 +1,18 @@ +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 Copied: branches/control-0.4a/examples/bdalg-matlab.py (from rev 132, trunk/examples/bdalg-matlab.py) =================================================================== --- branches/control-0.4a/examples/bdalg-matlab.py (rev 0) +++ branches/control-0.4a/examples/bdalg-matlab.py 2011-02-13 16:49:58 UTC (rev 134) @@ -0,0 +1,17 @@ +# bdalg-matlab.py - demonstrate some MATLAB commands for block diagram altebra +# RMM, 29 May 09 + +from control.matlab import * # MATLAB-like functions + +# System matrices +A1 = [[0, 1.], [-4, -1]] +B1 = [[0], [1.]] +C1 = [[1., 0]] +sys1ss = ss(A1, B1, C1, 0) +sys1tf = ss2tf(sys1ss) + +sys2tf = tf([1, 0.5], [1, 5]); +sys2ss = tf2ss(sys2tf); + +# Series composition +series1 = sys1ss + sys2ss; Copied: branches/control-0.4a/examples/test-response.py (from rev 132, trunk/examples/test-response.py) =================================================================== --- branches/control-0.4a/examples/test-response.py (rev 0) +++ branches/control-0.4a/examples/test-response.py 2011-02-13 16:49:58 UTC (rev 134) @@ -0,0 +1,18 @@ +# test-response.py - Unit tests for system response functions +# RMM, 11 Sep 2010 + +from matplotlib.pyplot import * # Grab MATLAB plotting functions +from control.matlab import * # Load the controls systems library +from scipy import arange # function to create range of numbers + +# Create several systems for testing +sys1 = tf([1], [1, 2, 1]) +sys2 = tf([1, 1], [1, 1, 0]) + +# Generate step responses +(T1a, y1a) = step(sys1) +(T1b, y1b) = step(sys1, T = arange(0, 10, 0.1)) +(T1c, y1c) = step(sys1, X0 = [1, 0]) +(T2a, y2a) = step(sys2, T = arange(0, 10, 0.1)) + +plot(T1a, y1a, T1b, y1b, T1c, y1c, T2a, y2a) Copied: branches/control-0.4a/examples/test-statefbk.py (from rev 132, trunk/examples/test-statefbk.py) =================================================================== --- branches/control-0.4a/examples/test-statefbk.py (rev 0) +++ branches/control-0.4a/examples/test-statefbk.py 2011-02-13 16:49:58 UTC (rev 134) @@ -0,0 +1,27 @@ +# test-statefbk.py - Unit tests for state feedback code +# RMM, 6 Sep 2010 + +import numpy as np # Numerical library +from scipy import * # Load the scipy functions +from control.matlab import * # Load the controls systems library + +# Parameters defining the system +m = 250.0 # system mass +k = 40.0 # spring constant +b = 60.0 # damping constant + +# System matrices +A = matrix([[1, -1, 1.], [1, -k/m, -b/m], [1, 1, 1]]) +B = matrix([[0], [1/m], [1]]) +C = matrix([[1., 0, 1.]]) +sys = ss(A, B, C, 0); + +# Controllability +Wc = ctrb(A, B) +print "Wc = ", Wc + +# Observability +Wo = obsv(A, C) +print "Wo = ", Wo + + Modified: branches/control-0.4a/setup.py =================================================================== --- branches/control-0.4a/setup.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/setup.py 2011-02-13 16:49:58 UTC (rev 134) @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='control', - version='0.3c', + version='0.4a', description='Python Control Systems Library', author='Richard Murray', author_email='mu...@cd...', Modified: branches/control-0.4a/src/__init__.py =================================================================== --- branches/control-0.4a/src/__init__.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/__init__.py 2011-02-13 16:49:58 UTC (rev 134) @@ -37,7 +37,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: __init__.py 29 2010-11-06 13:03:55Z murrayrm $ +# $Id$ """Control System Library Property changes on: branches/control-0.4a/src/__init__.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/bdalg.py =================================================================== --- branches/control-0.4a/src/bdalg.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/bdalg.py 2011-02-13 16:49:58 UTC (rev 134) @@ -47,7 +47,7 @@ Date: 24 May 09 Revised: Kevin K. Chen, Dec 10 -$Id: bdalg.py 17 2010-05-29 23:50:52Z murrayrm $ +$Id$ """ Property changes on: branches/control-0.4a/src/bdalg.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/ctrlutil.py =================================================================== --- branches/control-0.4a/src/ctrlutil.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/ctrlutil.py 2011-02-13 16:49:58 UTC (rev 134) @@ -38,7 +38,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: ctrlutil.py 21 2010-06-06 17:29:42Z murrayrm $ +# $Id$ # Packages that we need access to import scipy as sp Property changes on: branches/control-0.4a/src/ctrlutil.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/delay.py =================================================================== --- branches/control-0.4a/src/delay.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/delay.py 2011-02-13 16:49:58 UTC (rev 134) @@ -38,7 +38,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: pade.py 17 2010-05-29 23:50:52Z murrayrm $ +# $Id$ def pade(T, n=1): """ Property changes on: branches/control-0.4a/src/delay.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/exception.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/freqplot.py =================================================================== --- branches/control-0.4a/src/freqplot.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/freqplot.py 2011-02-13 16:49:58 UTC (rev 134) @@ -38,7 +38,7 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: freqplot.py 33 2010-11-26 21:59:57Z murrayrm $ +# $Id$ import matplotlib.pyplot as plt import scipy as sp @@ -212,16 +212,15 @@ plt.plot([-1], [0], 'r+') return x, y, omega - # Nichols plot # Contributed by Allan McInnes <All...@ca...> #! TODO: need unit test code -def nichols(syslist, omega=None, Plot=True): +def nichols(syslist, omega=None): """Nichols plot for a system Usage ===== - mag, phase, freq = nichols(sys, omega=None, Plot=True) + magh = nichols(sys, omega=None) Plots a Nichols plot for the system over a (optional) frequency range. @@ -231,15 +230,10 @@ List of linear input/output systems (single system is OK) omega : freq_range Range of frequencies (list or bounds) in rad/sec - Plot : boolean - if True, plot the Nichols frequency response Return values ------------- - mag : array of magnitudes - phase : array of phases - freq : array of frequencies - + None """ # If argument was a singleton, turn it into a list @@ -250,35 +244,107 @@ if (omega == None): omega = default_frequency_range(syslist) - for sys in syslist: - if (sys.inputs > 1 or sys.outputs > 1): - #TODO: Add MIMO nichols plots. - raise NotImplementedError("Nichols 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) - - # Convert to Nichols-plot format (phase in degrees, - # and magnitude in dB) - x = unwrap(sp.degrees(phase), 360) - y = 20*sp.log10(mag) + # Get the magnitude and phase of the system + mag, phase, omega = sys.freqresp(omega) - if (Plot): - # Generate the plot - plt.plot(x, y) + # Convert to Nichols-plot format (phase in degrees, + # and magnitude in dB) + x = unwrap(sp.degrees(phase), 360) + y = 20*sp.log10(mag) + + # Generate the plot + plt.plot(x, y) - plt.xlabel('Phase (deg)') - plt.ylabel('Magnitude (dB)') - plt.title('Nichols Plot') + plt.xlabel('Phase (deg)') + plt.ylabel('Magnitude (dB)') + plt.title('Nichols Plot') - # Mark the -180 point - plt.plot([-180], [0], 'r+') + # Mark the -180 point + plt.plot([-180], [0], 'r+') - return mag, phase, omega +# Nichols grid +def nichols_grid(): + """Nichols chart grid + + Usage + ===== + nichols_grid() + Plots a Nichols chart grid on the current axis. + + Parameters + ---------- + None + + Return values + ------------- + None + """ + mag_min_default = -40.0 # dB + mag_step = 20.0 # dB + + # Chart defaults + phase_min, phase_max, mag_min, mag_max = -360.0, 0.0, mag_min_default, 40.0 + + # Set actual chart bounds based on current plot + if plt.gcf().gca().has_data(): + phase_min, phase_max, mag_min, mag_max = plt.axis() + + # M-circle magnitudes. + # The "fixed" set are always generated, since this guarantees a recognizable + # Nichols chart grid. + mags_fixed = np.array([-40.0, -20.0, -12.0, -6.0, -3.0, -1.0, -0.5, 0.0, + 0.25, 0.5, 1.0, 3.0, 6.0, 12.0]) + + if mag_min < mag_min_default: + # Outside the "fixed" set of magnitudes, the generated M-circles + # are extended in steps of 'mag_step' dB to cover anything made + # visible by the range of the existing plot + mags_adjust = np.arange(mag_step*np.floor(mag_min/mag_step), + mag_min_default, mag_step) + mags = np.concatenate((mags_adjust, mags_fixed)) + else: + mags = mags_fixed + + # N-circle phases (should be in the range -360 to 0) + phases = np.array([-0.25, -10.0, -20.0, -30.0, -45.0, -60.0, -90.0, + -120.0, -150.0, -180.0, -210.0, -240.0, -270.0, + -310.0, -325.0, -340.0, -350.0, -359.75]) + + # Find the M-contours + m = m_circles(mags, phase_min=np.min(phases), phase_max=np.max(phases)) + m_mag = 20*sp.log10(np.abs(m)) + m_phase = sp.mod(sp.degrees(sp.angle(m)), -360.0) # Unwrap + + # Find the N-contours + n = n_circles(phases, mag_min=np.min(mags), mag_max=np.max(mags)) + n_mag = 20*sp.log10(np.abs(n)) + n_phase = sp.mod(sp.degrees(sp.angle(n)), -360.0) # Unwrap + + # Plot the contours behind other plot elements. + # The "phase offset" is used to produce copies of the chart that cover + # the entire range of the plotted data, starting from a base chart computed + # over the range -360 < phase < 0 (see above). Given the range + # the base chart is computed over, the phase offset should be 0 + # for -360 < phase_min < 0. + phase_offset_min = 360.0*np.ceil(phase_min/360.0) + phase_offset_max = 360.0*np.ceil(phase_max/360.0) + 360.0 + phase_offsets = np.arange(phase_offset_min, phase_offset_max, 360.0) + for phase_offset in phase_offsets: + plt.plot(m_phase + phase_offset, m_mag, color='gray', + linestyle='dashed', zorder=0) + plt.plot(n_phase + phase_offset, n_mag, color='gray', + linestyle='dashed', zorder=0) + + # Add magnitude labels + for x, y, m in zip(m_phase[:][-1], m_mag[:][-1], mags): + align = 'right' if m < 0.0 else 'left' + plt.text(x, y, str(m) + ' dB', size='small', ha=align) + + # Make sure axes conform to any pre-existing plot. + plt.axis([phase_min, phase_max, mag_min, mag_max]) + # Gang of Four #! TODO: think about how (and whether) to handle lists of systems def gangof4(P, C, omega=None): @@ -395,3 +461,85 @@ np.ceil(np.max(features))+1) return omega + +# Compute contours of a closed-loop transfer function +def closed_loop_contours(Hmag, Hphase): + """Contours of the function H = G/(1+G). + + Usage + ===== + contours = closed_loop_contours(mags, phases) + + Parameters + ---------- + mags : array-like + Meshgrid array of magnitudes of the contours + phases : array-like + Meshgrid array of phases in radians of the contours + + Return values + ------------- + contours : complex array + Array of complex numbers corresponding to the contours. + """ + # Compute the contours in H-space + H = Hmag*sp.exp(1.j*Hphase) + + # Invert H = G/(1+G) to get an expression for the contours in G-space + return H/(1.0 - H) + +# M-circle +def m_circles(mags, phase_min=-359.75, phase_max=-0.25): + """Constant-magnitude contours of the function H = G/(1+G). + + Usage + ===== + contours = m_circles(mags) + + Parameters + ---------- + mags : array-like + Array of magnitudes in dB of the M-circles + phase_min : degrees + Minimum phase in degrees of the N-circles + phase_max : degrees + Maximum phase in degrees of the N-circles + + Return values + ------------- + contours : complex array + Array of complex numbers corresponding to the contours. + """ + # Convert magnitudes and phase range into a grid suitable for + # building contours + phases = sp.radians(sp.linspace(phase_min, phase_max, 500)) + Hmag, Hphase = sp.meshgrid(10.0**(mags/20.0), phases) + return closed_loop_contours(Hmag, Hphase) + +# N-circle +def n_circles(phases, mag_min=-40.0, mag_max=12.0): + """Constant-phase contours of the function H = G/(1+G). + + Usage + ===== + contour = n_circles(angles) + + Parameters + ---------- + phases : array-like + Array of phases in degrees of the N-circles + mag_min : dB + Minimum magnitude in dB of the N-circles + mag_max : dB + Maximum magnitude in dB of the N-circles + + Return values + ------------- + contours : complex array + Array of complex numbers corresponding to the contours. + """ + # Convert phases and magnitude range into a grid suitable for + # building contours + mags = sp.linspace(10**(mag_min/20.0), 10**(mag_max/20.0), 2000) + Hphase, Hmag = sp.meshgrid(sp.radians(phases), mags) + return closed_loop_contours(Hmag, Hphase) Property changes on: branches/control-0.4a/src/freqplot.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/lti.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/matlab.py =================================================================== --- branches/control-0.4a/src/matlab.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/matlab.py 2011-02-13 16:49:58 UTC (rev 134) @@ -51,7 +51,7 @@ Date: 29 May 09 Revised: Kevin K. Chen, Dec 10 -$Id: matlab.py 33 2010-11-26 21:59:57Z murrayrm $ +$Id$ """ @@ -744,6 +744,16 @@ # Call the bode command return freqplot.bode(syslist, omega, **keywords) +# Nichols chart grid +def ngrid(): + """Nichols chart grid. + + Usage + ===== + ngrid() + """ + freqplot.nichols_grid() + # # Modifications to scipy.signal functions # Property changes on: branches/control-0.4a/src/matlab.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/modelsimp.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/pzmap.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/rlocus.py =================================================================== --- branches/control-0.4a/src/rlocus.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/rlocus.py 2011-02-13 16:49:58 UTC (rev 134) @@ -40,7 +40,7 @@ # or a controls.TransferFunction object. # * Added some comments to make sure I understand the code # -# $Id: rlocus.py 29 2010-11-06 13:03:55Z murrayrm $ +# $Id$ # Packages used by this module from scipy import * Property changes on: branches/control-0.4a/src/rlocus.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/robust.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/statefbk.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/statesp.py =================================================================== --- branches/control-0.4a/src/statesp.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/statesp.py 2011-02-13 16:49:58 UTC (rev 134) @@ -68,7 +68,7 @@ Date: 24 May 09 Revised: Kevin K. Chen, Dec 10 -$Id: statepy 21 2010-06-06 17:29:42Z murrayrm $ +$Id$ """ Property changes on: branches/control-0.4a/src/statesp.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: branches/control-0.4a/src/test.py ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/control-0.4a/src/xferfcn.py =================================================================== --- branches/control-0.4a/src/xferfcn.py 2011-02-13 13:21:29 UTC (rev 133) +++ branches/control-0.4a/src/xferfcn.py 2011-02-13 16:49:58 UTC (rev 134) @@ -70,7 +70,7 @@ Date: 24 May 09 Revised: Kevin K. Chewn, Dec 10 -$Id: xferfcn.py 21 2010-06-06 17:29:42Z murrayrm $ +$Id$ """ Property changes on: branches/control-0.4a/src/xferfcn.py ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |