From ce3380149066dc49191579960a035f4580f920ae Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 24 Feb 2016 11:24:49 +0100 Subject: nonlin_ode: print the first coefficient as well as the delta Also, print to stderr, not stdout. --- nonlin_ode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3