diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-02-24 11:24:49 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-02-24 11:24:49 +0100 |
commit | ce3380149066dc49191579960a035f4580f920ae (patch) | |
tree | a8e78bb2b8e3b4de44021ab74fb2c944621acd29 | |
parent | 09e74dd9be959b72c12710d75201b5dc8213abcc (diff) |
nonlin_ode: print the first coefficient as well as the delta
Also, print to stderr, not stdout.
-rw-r--r-- | nonlin_ode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nonlin_ode.py b/nonlin_ode.py index b6d73d8..106a449 100644 --- a/nonlin_ode.py +++ b/nonlin_ode.py @@ -1,5 +1,7 @@ # coding=utf-8 + import numpy as np +import sys import series_expansion @@ -83,7 +85,7 @@ def nonlin_solve_1d(initial_guess, Fs, args, maxiter = 100, atol = 1e-14, grid = delta = np.max(np.abs(solution_new.coeffs - solution_old.coeffs)) if np.isnan(delta): raise RuntimeError('nan') - print delta + sys.stderr.write('delta: %g, coeffs[0]: %g\n' % (delta, solution_new.coeffs[0])) if delta < atol: return solution_new solution_old = solution_new |