A134 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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, f(x)=0 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 x=g(x) 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 xn+1=acos⁡xn: each dot sits on the curve at (xn,xn+1), and the dots on the dashed line y=x mark where the next step starts. Read them alternately to trace the cobweb.
  • With a = 1 the iterates spiral in to 0.739, where cos⁡x=x. 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 10−6 of it?

Name it

Bisection

If f is continuous and f(a), f(b) 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

|xn−x*|≤b−a2n+1

so reaching a tolerance δ takes n≥log2⁡b−aδ−1 steps. In double, about 52 halvings exhaust the bits of a bracket of width 1.

Fixed-point iteration

Rewrite f(x)=0 as x=g(x) and iterate xn+1=g(xn). Near the fixed point x*,

en+1=xn+1−x*=g(xn)−g(x*)≈g′(x*)en
  • If |g′(x*)|<1, it converges linearly: each step multiplies the error by about ρ=|g′(x*)|, gaining log10⁡(1/ρ) digits.
  • If g′>0 the iterates approach from one side; if g′<0 they alternate sides (the spiral).
  • If |g′(x*)|>1, 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 g′(x*)=0: Newton's method.

When to stop

Stop when the step |xn+1−xn| is below a tolerance, with a cap on the number of steps. For a linear rate ρ the remaining error is about ρ1−ρ times the last step, which is large when ρ is near 1.

Worked example

A 5 V source drives a diode (Is=10−14 A, nVT = 25.85 mV) through 1 kΩ. Solve for the diode voltage by iterating VD←nVTln⁡((5−VD)/RIs+1) from 0.7 V.

Show the solution
  1. Iterate from 0.7 V. The iterates are 0.692445, 0.692491 and 0.692490 V: settled to six digits in three steps.
  2. Why it's fast. g′(VD)=−nVT5−VD≈−0.006 so each step gains more than two digits.
  3. The other rearrangement. It iterates VD←5−RIs(eVD/nVT−1) with |g′|=RI/nVT≈167, so it blows up at once.

Answer VD = 0.692490 V, settled to six digits in three steps.

Worked example

Iterate x←cos⁡x from 1. How fast does it converge?

Show the solution
  1. The rate at the fixed point. The fixed point is 0.739085, where g′(x*)=−sin⁡0.739085=−0.674
  2. What each step does. Each step multiplies the error by 0.674 and flips its sign, gaining log10⁡(1/0.674)=0.17 digits.
  3. 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 E=M+esin⁡E for e = 0.5 and M = 1 by fixed-point iteration.

Show the solution
  1. Iterate. Run E←1+0.5sin⁡E from E = 1: 1.420735, 1.494381, 1.498541, 1.498695, 1.498701. The limit is 1.4987011.
  2. The rate. At the root |g′(E)|=0.5|cos⁡E|=0.036 so each step gains about −log10⁡0.036=1.4 digits.
  3. When it works. Since |g′|≤e<1 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 x←2+1/x converges to the positive root of x2−2x−1=0. 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 (Is=10−14 A, nVT = 25.85 mV) through 470 Ω. What's VD 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 x2=2 converges fastest to 2 by fixed-point iteration?

Check

Kepler's equation E=M+esin⁡E is solved by E←1+0.1sin⁡E from E0=M.

(a)

What is E1?

(b)

Using the bound |g′|≤e, at most how many steps gain 6 digits?

Check

The iteration x←g(x)=x−c(x2−a) seeks a.

Step 1

What is g′(a)?

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°.

Explain why

Why does fixed-point iteration converge when |g′(x*)|<1 and fail when it's greater?

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.