A Newton-Raphson root finder computes the eccentric anomaly from Kepler's equation…
PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Research software practice, verification and validation
Scientific Computing for Physicists, Ch Is the equation solved right? Testing, debugging and code verification
Problem
A Newton-Raphson root finder computes the eccentric anomaly E from Kepler's equation M=E−esinE for a highly eccentric orbit with e=0.9, at the test case M=0.01rad, whose root is E=0.0986rad. At the converged root, a rounding error in evaluating the residual E−esinE−M, of order ϵmach∣E∣, is amplified into E by the local condition number κ=1/(1−ecosE). Chapter 2's backward-error bound for an iterative root finder that has converged to machine precision gives a relative error bound of cκϵmach, with c=6 absorbing the arithmetic operations of the final Newton step, and ϵmach=2−52.
((a)) Evaluate κ at the test case, derive the tolerance cκϵmach/2 for a unit test comparing this solver's output with an independent high-precision solve, and give its numerical value.
((b)) A previous bug in this solver (a wrong sign in the derivative 1−ecosE used for the Newton update) was fixed in a commit that added exactly the e=0.9 test case described here. Using the repository workflow, state why this test case must be added to the continuous-integration job that runs on every pull request, rather than simply run once by hand after the fix, for it to serve as a genuine regression test.