6.2 Bisection search
Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §6.2. Rewritten in original wording — not a paste of
Bisection.py. Continues 6.1 Quantum bound states. Labs: 6.2b Bisection labs.
Interval halving
Suppose is continuous on . The intermediate-value theorem plus repeated discarding of the unsigned half traps a root. Pick the sign condition and the midpoint update among lookalikes.
Stop when (or is tiny). The reported root is the final midpoint.
Implementation notes
- Pick from the physics (energy to or better), not from “as small as possible.”
- Poles of / can fake sign changes — use the equivalent residual
and a bracket already known to have opposite signs (e.g. for ).
- Bisection needs only the sign of , so mild evaluation noise is usually tolerable.
Warm-up polynomial
Before the well, practice on
, , so a root is trapped; bisection yields .
Back to the well
With from §6.1 on , the same loop returns
Check in scientific notation — it should sit near machine round-off for a tight .
Bisection
1 / 4Bisection requires…
Pick an answer to see if you are right.
Next: 6.2b Bisection labs — implement generic bisection, probe , and lock . Then 6.3 Newton–Raphson.