1818
1919class TestPhasePlot (unittest .TestCase ):
2020 def setUp (self ):
21- pass ;
21+ pass
2222
2323 def testInvPendNoSims (self ):
24- phase_plot (self .invpend_ode , (- 6 ,6 ,10 ), (- 6 ,6 ,10 ));
24+ phase_plot (self .invpend_ode , (- 6 ,6 ,10 ), (- 6 ,6 ,10 ))
2525
2626 def testInvPendSims (self ):
2727 phase_plot (self .invpend_ode , (- 6 ,6 ,10 ), (- 6 ,6 ,10 ),
28- X0 = ([1 ,1 ], [- 1 ,1 ]));
28+ X0 = ([1 ,1 ], [- 1 ,1 ]))
2929
3030 def testInvPendTimePoints (self ):
3131 phase_plot (self .invpend_ode , (- 6 ,6 ,10 ), (- 6 ,6 ,10 ),
32- X0 = ([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 ):
3535 phase_plot (self .invpend_ode , X0 =
@@ -46,12 +46,15 @@ def testInvPendAuto(self):
4646 [[- 2.3056 , 2.1 ], [2.3056 , - 2.1 ]], T = 6 , verbose = False )
4747
4848 def testOscillatorParams (self ):
49- m = 1 ; b = 1 ; k = 1 ; # default values
49+ # default values
50+ m = 1
51+ b = 1
52+ k = 1
5053 phase_plot (self .oscillator_ode , timepts = [0.3 , 1 , 2 , 3 ], X0 =
5154 [[- 1 ,1 ], [- 0.3 ,1 ], [0 ,1 ], [0.25 ,1 ], [0.5 ,1 ], [0.7 ,1 ],
5255 [1 ,1 ], [1.3 ,1 ], [1 ,- 1 ], [0.3 ,- 1 ], [0 ,- 1 ], [- 0.25 ,- 1 ],
5356 [- 0.5 ,- 1 ], [- 0.7 ,- 1 ], [- 1 ,- 1 ], [- 1.3 ,- 1 ]],
54- T = np .linspace (0 , 10 , 100 ), parms = (m , b , k ));
57+ T = np .linspace (0 , 10 , 100 ), parms = (m , b , k ))
5558
5659 def testNoArrows (self ):
5760 # Test case from aramakrl that was generating a type error
@@ -71,7 +74,7 @@ def d1(x1x2,t):
7174 # Sample dynamical systems - inverted pendulum
7275 def invpend_ode (self , x , t , m = 1. , l = 1. , b = 0 , g = 9.8 ):
7376 import numpy as np
74- return (x [1 ], - b / m * x [1 ] + (g * l / m ) * np .sin (x [0 ]))
77+ return (x [1 ], - b / m * x [1 ] + (g * l / m )* np .sin (x [0 ]))
7578
7679 # Sample dynamical systems - oscillator
7780 def oscillator_ode (self , x , t , m = 1. , b = 1 , k = 1 , extra = None ):
0 commit comments