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 (), apply it to the even square-well residual, compare iteration counts with bisection, and add backtracking.
Newton convention for graded output: start at ; each iteration evaluate ; stop if ; else , , ; also stop if . Use . Count the iteration number of the successful stop (first with or ).
Even residual (same as §6.2b):
Formula refresh
Warm up: pick the matching equation among lookalikes (same walk as the theory lesson).
Labs
Find a root of by Newton–Raphson from (, ). Print the root with 10 decimals.
No input.
Write-ups
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”.
Meet the writing requirements, then you can open the model answer.
Explorers
Next: 6.4 Magnetization search — mean-field by residual search (then §6.5 Lagrange).