Skip to content

Commit a7aed0a

Browse files
committed
updated test suite for phaseplot
1 parent 53dfeb0 commit a7aed0a

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
2011-07-25 Richard Murray <murray@malabar.local>
22

3+
* tests/phaseplot_test.py: updated unit tests to use new call
4+
signatures
5+
36
* examples/phaseplots.py: updated calls to PhasePlot to use new
47
argument structure
58

tests/phaseplot_test.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,33 @@ def testInvPendNoSims(self):
2525

2626
def testInvPendSims(self):
2727
PhasePlot(self.invpend_ode, (-6,6,10), (-6,6,10),
28-
xinit = ([1,1], [-1,1]));
28+
X0 = ([1,1], [-1,1]));
2929

3030
def testInvPendTimePoints(self):
3131
PhasePlot(self.invpend_ode, (-6,6,10), (-6,6,10),
32-
xinit = ([1,1], [-1,1]), T=np.linspace(0,5,100));
32+
X0 = ([1,1], [-1,1]), T=np.linspace(0,5,100));
3333

3434
def testInvPendLogtime(self):
35-
PhasePlot(self.invpend_ode,
36-
'logtime', (3, 0.7), None,
35+
PhasePlot(self.invpend_ode, X0 =
3736
[ [-2*pi, 1.6], [-2*pi, 0.5], [-1.8, 2.1],
3837
[-1, 2.1], [4.2, 2.1], [5, 2.1],
3938
[2*pi, -1.6], [2*pi, -0.5], [1.8, -2.1],
4039
[1, -2.1], [-4.2, -2.1], [-5, -2.1] ],
41-
np.linspace(0, 40, 200), verbose=False)
40+
T = np.linspace(0, 40, 200),
41+
logtime=(3, 0.7),
42+
verbose=False)
4243

4344
def testInvPendAuto(self):
44-
PhasePlot(self.invpend_ode, 'auto', 0, None,
45-
[[-2.3056, 2.1], [2.3056, -2.1]], 6, verbose=False)
45+
PhasePlot(self.invpend_ode, lingrid = 0, X0=
46+
[[-2.3056, 2.1], [2.3056, -2.1]], T=6, verbose=False)
4647

4748
def testOscillatorParams(self):
4849
m = 1; b = 1; k = 1; # default values
49-
PhasePlot(self.oscillator_ode, 'timepts', [0.3, 1, 2, 3], None,
50+
PhasePlot(self.oscillator_ode, timepts = [0.3, 1, 2, 3], X0 =
5051
[[-1,1], [-0.3,1], [0,1], [0.25,1], [0.5,1], [0.7,1],
5152
[1,1], [1.3,1], [1,-1], [0.3,-1], [0,-1], [-0.25,-1],
5253
[-0.5,-1], [-0.7,-1], [-1,-1], [-1.3,-1]],
53-
np.linspace(0, 10, 100), parms = (m, b, k));
54+
T = np.linspace(0, 10, 100), parms = (m, b, k));
5455

5556
# Sample dynamical systems - inverted pendulum
5657
def invpend_ode(self, x, t, m=1., l=1., b=0, g=9.8):

0 commit comments

Comments
 (0)