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

A5 · Lesson 34 · Newton's method

Follow the tangent to the root

Every circuit simulator, from SPICE to the one in this course, solves its nonlinear equations the same way. Guess the answer, replace each nonlinear part by its tangent line at that guess, solve the now-linear problem, and repeat. Each round roughly doubles the number of correct digits. For a single equation it's Newton's method, and it's the most important numerical idea in this course.

  • The curve is f(x)=x2−2; its positive root is 2. The dashed line is the tangent at your guess x0.
  • The tangent hits zero at the next guess, x1. Move x0 and watch x1.
  • Start at x0=3. How close is x1 to 2=1.41421? Then imagine starting again from x1.

Predict

Starting from x0=1, one Newton step for 2 (on f=x2−2) gives what?

Name it

The method

At a guess xn, replace f by its tangent line and find where the tangent is zero:

xn+1=xn−f(xn)f′(xn)

Repeat until the change, or |f(xn)|, is small enough.

For square roots (f=x2−a), the step simplifies to xn+1=12(xn+axn): the averaging rule from A4.

How fast it converges

Close to a simple root, the error roughly squares each step: en+1≈Cen2. Errors of 10−2, 10−4, 10−8, 10−16: four steps from two correct digits to full double precision. That's quadratic convergence, and it's why simulators converge in a handful of iterations per time step.

Bisection (lesson 6 and A4) gains one bit per step; Newton doubles the digits. But Newton needs a derivative and a decent starting guess.

How it fails

  • Flat tangent: if f′(xn)≈0, the step shoots off far away.
  • Cycling or wandering: a bad starting point can bounce between values or head for a different root.
  • Exponentials overshoot. A diode's eV/VT is so steep that a guess slightly too high makes a tiny step, and one slightly too low makes a huge one. SPICE limits how far the diode voltage can move per step for exactly this reason ("junction limiting").

Practical solvers combine Newton's speed with a safeguard: bracket the root first, take Newton steps that stay in the bracket, fall back to bisection when they don't.

Worked example

Solve cos⁡x=x with Newton's method from x0=1.

Show the solution
  1. Set up. f(x)=cos⁡x−x,f′(x)=−sin⁡x−1
  2. First step. x1=1−cos⁡1−1−sin⁡1−1=1−−0.4597−1.8415=0.7504
  3. Keep going. x2=0.7391,x3=0.739085
  4. Check. Three steps give six correct digits. The root, 0.7390851, is where the cosine curve crosses the line y=x.

Answer x=0.739085 after three steps.

Worked example

A diode (Is=10−14 A, VT = 25.85 mV) is in series with 1 kΩ across 5 V. Take one Newton step for the diode voltage from 0.7 V.

Show the solution
  1. KCL. The diode's current must equal the resistor's, so the voltage is a zero of g(V)=Is(eV/VT−1)−5−V1000
  2. Derivative. g′(V)=IsVTeV/VT+11000
  3. Evaluate at 0.7 V. Ise0.7/0.02585=5.76 mA and the resistor's current is 4.30 mA, so g=1.46mA g′=0.2228+0.001=0.2238S
  4. Newton step. V1=0.7−0.001460.2238=0.6935V
  5. Check. The true answer is 0.6925 V; two more steps get it to the microvolt.

Answer one Newton step takes the diode voltage from 0.7 V to 0.6935 V.

Worked example

Find 2 with Newton's method on f(x)=x2−2, starting from x0=1.

Show the solution
  1. The Newton step. xn+1=xn−xn2−22xn
  2. Iterate from 1. x1=1.5x2=1.416667x3=1.414216
  3. Check. The true value is 1.414 214. The number of correct digits roughly doubles at each step: 1, 3, 6.

Answer 2≈1.414216 after three steps.

Check

Take one Newton step toward 3 from x0 = 1, using f(x)=x2−3.

Check

Take one Newton step for cos⁡x=x from x0 = 0.5.

Check

Near a root, Newton's error behaves like en+1=0.5en2. Starting with an error of 0.01, what is the error after two steps?

Check

A diode (Is=10−14 A, VT = 25.85 mV) and 1000 Ω are in series across 3 V. With g(V)=Is(eV/VT−1)−(Vs−V)/R, take one Newton step from V0 = 0.7 V.

Check

Newton's method on f(x)=x3−2x+2 from x0=0 gives x1=1, then x2=0, then 1, 0, ... What went wrong?

Check

Find 5 with Newton's method on x2−5, from x0 = 1.

(a)

What is x1?

(b)

What is x2?

Check

Write Newton's step for the cube root of a, using f(x)=x3−a.

Step 1

What is f′(x)?

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 do circuit simulators use Newton's method, and why do they limit how far a diode's voltage can move in one step?

Practice

Keep practicing

7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.