Newton's method for a system updates by solving for the Jacobian

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Scientific programming for physicists

Scientific Computing for Physicists, Ch Letting the computer do advanced algebra: operators, series and differentiated programs

Problem

Newton's method for a system F(x,y)=0\mathbf{F}(x,y)=\mathbf{0} updates (x,y)(x,y) by solving J Δ=−FJ\,\Delta=-\mathbf{F} for the Jacobian J=∂Fi/∂(x,y)J=\partial F_i/\partial(x,y), exactly as used for Chapter 2's van der Waals system. Consider F1(x,y)=x2+y2−4F_1(x,y)=x^2+y^2-4 and F2(x,y)=ex−y−1F_2(x,y)=e^x-y-1. ((a)) Rather than differentiating F\mathbf{F} by hand, generate the Jacobian symbolically and test the generated function at the three points (0,0)(0,0), (1,2)(1,2) and (−1,0.5)(-1,0.5) against the hand-differentiated formula J=(2x2yex−1)J=\begin{pmatrix}2x & 2y\\e^x & -1\end{pmatrix}. Every entry is a single well-conditioned operation (multiplication or exponentiation), and two entries are exactly zero at (0,0)(0,0). Using the chapter's rule 100 κ ϵmach100\,\kappa\,\epsilon_{\rm mach} with ϵmach=2−52\epsilon_{\rm mach}=2^{-52}, state a test that each entry should pass and that stays defined where an entry is zero. ((b)) Starting from (x0,y0)=(1,1)(x_0,y_0)=(1,1), use the generated Jacobian to take one Newton step and report the new point (x1,y1)(x_1,y_1). ((c)) Report the residual F(x1,y1)\mathbf{F}(x_1,y_1) after that one step, and say whether it shows the iteration has converged in a single step.

Browse the problem library