diff options
Diffstat (limited to 'throw.py')
-rw-r--r-- | throw.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -120,7 +120,7 @@ def solve_fun(func, init_vars, timespace): time0 = current_time() time = numpy.linspace(*timespace) soln = odeint(func, init_vars, time) - print "took %s seconds to solve" % (current_time() - time0) + print " :: took %s seconds" % (current_time() - time0) return time, soln TimespaceTooSmall = Warning(" *** Requires larger timespace!!! *** ") @@ -145,6 +145,7 @@ def interpret(soln, max_tension): def solver(func, init_vars, timespace=(0,600,10**5), max_tension=max_tension, returns=['time', 'variables', 'slices', 'maxes']): + time0 = current_time() for n in itertools.count(1): time, soln = solve_fun(func, init_vars, timespace) @@ -159,6 +160,8 @@ def solver(func, init_vars, timespace=(0,600,10**5), max_tension=max_tension, slices = map(getslice, (time,) + variables) maxes = map(getmax, (time,) + variables) + print ": took %s seconds to solve" % (current_time() - time0) + out = [] for item in returns: out.append(vars()[item]) return tuple(out) |