|
13 | 13 | import numpy as np |
14 | 14 | import scipy as sp |
15 | 15 | import matplotlib.pyplot as mpl |
16 | | -from control.phaseplot import * |
| 16 | +from control import phase_plot |
17 | 17 | from numpy import pi |
18 | 18 |
|
19 | 19 | class TestPhasePlot(unittest.TestCase): |
@@ -53,6 +53,19 @@ def testOscillatorParams(self): |
53 | 53 | [-0.5,-1], [-0.7,-1], [-1,-1], [-1.3,-1]], |
54 | 54 | T = np.linspace(0, 10, 100), parms = (m, b, k)); |
55 | 55 |
|
| 56 | + def testNoArrows(self): |
| 57 | + # Test case from aramakrl that was generating a type error |
| 58 | + # System does not have arrows |
| 59 | + def d1(x1x2,t): |
| 60 | + x1,x2 = x1x2 |
| 61 | + return np.array([x2, x2 - 2*x1]) |
| 62 | + |
| 63 | + x1x2_0 = np.array([[-1.,1.], [-1.,-1.], [1.,1.], [1.,-1.], |
| 64 | + [-1.,0.],[1.,0.],[0.,-1.],[0.,1.],[0.,0.]]) |
| 65 | + |
| 66 | + mpl.figure(1) |
| 67 | + phase_plot(d1,X0=x1x2_0,T=100) |
| 68 | + |
56 | 69 | # Sample dynamical systems - inverted pendulum |
57 | 70 | def invpend_ode(self, x, t, m=1., l=1., b=0, g=9.8): |
58 | 71 | import numpy as np |
|
0 commit comments