Skip to main content

6.3b Newton–Raphson labs

Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §6.3. Rewritten as original drills — not textbook NewtonCD.py. Continues 6.3 Newton–Raphson search.

Implement Newton with a forward-difference derivative (δx=10−6\delta x=10^{-6}), apply it to the even square-well residual, compare iteration counts with bisection, and add backtracking.

Newton convention for graded output: start at x0x_0; each iteration evaluate f(x)f(x); stop if ∣f∣<ε|f|<\varepsilon; else f′←(f(x+δx)−f(x))/δxf'\leftarrow\bigl(f(x+\delta x)-f(x)\bigr)/\delta x, Δx←−f/f′\Delta x\leftarrow -f/f', x←x+Δxx\leftarrow x+\Delta x; also stop if ∣Δx∣<ε|\Delta x|<\varepsilon. Use ε=10−14\varepsilon=10^{-14}. Count the iteration number nn of the successful stop (first nn with ∣f∣<ε|f|<\varepsilon or ∣Δx∣<ε|\Delta x|<\varepsilon).

Even residual (same as §6.2b):

g(E)=E cot⁡V0−E−V0−E,cot⁡θ=cos⁡θ/sin⁡θ.g(E)=\sqrt{E}\,\cot\sqrt{V_0-E}-\sqrt{V_0-E}, \quad\cot\theta=\cos\theta/\sin\theta.

Formula refresh​

Warm up: pick the matching equation among lookalikes (same walk as the theory lesson).

Labs​

Activity: Newton on a cubic

Find a root of h(x)=x3−x−2h(x)=x^{3}-x-2 by Newton–Raphson from x0=1.5x_0=1.5 (ε=10−14\varepsilon=10^{-14}, δx=10−6\delta x=10^{-6}). Print the root with 10 decimals.

No input.

Write-ups​

0/3 solved
6.3b.W1

Using “tangent”, “intercept”, and “derivative”, explain:

In one sentence: what geometric construction is one Newton–Raphson step?

Minimum 3 words. Your answer must include: “tangent”, “intercept”, “derivative”.

0 words/ 3 min

Meet the writing requirements, then you can open the model answer.

Explorers​

Figure 6.2 — tangent intercept.

Figure 6.3 — failure modes.

Next: 6.4 Magnetization search — mean-field m(t)m(t) by residual search (then §6.5 Lagrange).