A13 · Lesson 4 · Bisection and fixed-point iteration
Two slow, simple ways to solve f(x) = 0, and when each works
A diode in series with a resistor: the current depends on the diode's voltage, the voltage depends on the current through an exponential, and no algebra untangles them. Equations like that, with no formula for x, are everywhere in circuits, from a bias point to the frequency where a gain crosses 1. The two simplest ways to solve them are bisection, which can't fail once you've bracketed a root but gains only one bit per step, and fixed-point iteration, which rewrites the equation as and repeats. Whether the second converges, and how fast, comes down to a single number: the slope of g at the answer.
- The orange dots are iterates of : each dot sits on the curve at , and the dots on the dashed line mark where the next step starts. Read them alternately to trace the cobweb.
- With a = 1 the iterates spiral in to 0.739, where . The slope there is −0.67, so each step cuts the error by about a third and flips its sign.
- Raise a past about 1.32: the slope at the fixed point passes −1, and the iterates spiral outward instead. The fixed point is still there; iteration just can't reach it.
Predict
Bisection starts with a root bracketed in [0, 2]. How many halvings guarantee the midpoint is within of it?
20: after n halvings the bracket is wide and its midpoint is within half of that, , of the root. That's below once , at n = 20. Each step buys one bit, about 0.3 decimal digits, no matter how nice f is.
Name it
Bisection
If f is continuous and , have opposite signs, there's a root between them. Evaluate f at the midpoint m and keep the half whose ends still differ in sign. After n steps the midpoint is within
so reaching a tolerance δ takes steps. In double, about 52 halvings exhaust the bits of a bracket of width 1.
Fixed-point iteration
Rewrite as and iterate . Near the fixed point ,
- If , it converges linearly: each step multiplies the error by about , gaining digits.
- If the iterates approach from one side; if they alternate sides (the spiral).
- If , it diverges from the fixed point, however close it starts.
The same equation can be rewritten many ways, and the choice of g decides everything. Lesson 6 picks the best possible one, with : Newton's method.
When to stop
Stop when the step is below a tolerance, with a cap on the number of steps. For a linear rate ρ the remaining error is about times the last step, which is large when ρ is near 1.
Worked example
A 5 V source drives a diode ( A, = 25.85 mV) through 1 kΩ. Solve for the diode voltage by iterating from 0.7 V.
Show the solution
- Iterate from 0.7 V. The iterates are 0.692445, 0.692491 and 0.692490 V: settled to six digits in three steps.
- Why it's fast. so each step gains more than two digits.
- The other rearrangement. It iterates with , so it blows up at once.
Answer = 0.692490 V, settled to six digits in three steps.
Worked example
Iterate from 1. How fast does it converge?
Show the solution
- The rate at the fixed point. The fixed point is 0.739085, where
- What each step does. Each step multiplies the error by 0.674 and flips its sign, gaining digits.
- Steps for full precision. At that rate, 15 digits take about 90 steps.
Answer linearly, to 0.739085, gaining 0.17 digits a step: about 90 steps for 15 digits.
Worked example
Solve Kepler's equation for e = 0.5 and M = 1 by fixed-point iteration.
Show the solution
- Iterate. Run from E = 1: 1.420735, 1.494381, 1.498541, 1.498695, 1.498701. The limit is 1.4987011.
- The rate. At the root so each step gains about digits.
- When it works. Since everywhere, the iteration converges from any start for every orbit with e < 1. For nearly parabolic orbits, e close to 1, it slows down and Newton's method is better.
Answer E = 1.4987011, with each step gaining about 1.4 digits.
Check
A root is bracketed in an interval 2 wide. How many bisection steps guarantee the midpoint is within 0.001 of it?
Check
After 10 bisection steps on a bracket 4 wide, what's the worst-case error of the midpoint?
Check
The iteration converges to the positive root of . By what factor does each step shrink the error?
Check
A linearly convergent iteration has rate ρ = 0.1. About how many steps does it take to gain 6 decimal digits?
Check
A 5 V source drives a diode ( A, = 25.85 mV) through 470 Ω. What's after one fixed-point step from 0.7 V?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
Which rearrangement of converges fastest to by fixed-point iteration?
Check
Kepler's equation is solved by from .
(a)
What is ?
(b)
Using the bound , at most how many steps gain 6 digits?
Check
The iteration seeks .
Step 1
What is ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
Which c makes , for the fastest convergence?
Explain why
Why does fixed-point iteration converge when and fail when it's greater?
Near the fixed point, g is almost a straight line through with slope . If the current guess is off by e, the next guess is off by about , because g maps the small interval around onto an interval times as wide. With every step shrinks the error by that factor, so the iterates close in geometrically; with every step stretches it, so even a guess very near is pushed away. The sign of only decides whether the iterates approach from one side or alternate around the fixed point.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.