From: <mur...@us...> - 2011-02-13 03:25:58
|
Revision: 130 http://python-control.svn.sourceforge.net/python-control/?rev=130&view=rev Author: murrayrm Date: 2011-02-13 03:25:52 +0000 (Sun, 13 Feb 2011) Log Message: ----------- missing test file (was referred to in ChangeLog, but handn't been committed Added Paths: ----------- trunk/examples/test-response.py Added: trunk/examples/test-response.py =================================================================== --- trunk/examples/test-response.py (rev 0) +++ trunk/examples/test-response.py 2011-02-13 03:25:52 UTC (rev 130) @@ -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) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |