C5 · Lesson 14 · Diode circuit lab
Solving diode circuits exactly with Newton's method
Every circuit simulator, including the one in these lessons, solves nonlinear circuits the same way: guess the node voltages, replace each diode by the straight line that touches its curve at the guess, solve that linear circuit, and repeat. That's Newton's method (A6), and near the answer it doubles the number of correct digits on every step. In this lab you'll write it for one diode, then for a network of two, and then use exact analysis to find out how good the rectifier ripple formula of lesson 7 really is.
- A half-wave rectifier, solved by the simulator's Newton iteration at every time step.
- The simple estimate for its ripple is . Read the ripple off the scope and compare: at large ripple the estimate is noticeably high.
- Raise C until the ripple is small: the estimate and the scope agree better and better.
Predict
Newton's method solves a diode-resistor circuit to 0.01 mV. Starting from 0.7 V, how many steps does it typically need?
Three to six. Each step replaces the exponential by its tangent at the current guess; near the answer the error is squared on every step, so 10 mV becomes about 1 mV, then 0.01 mV, then far less. Starting far above the answer is slower, because each step can only come down about one thermal voltage while the exponential is huge.
Name it
Newton's method for one diode
Kirchhoff's current law at the diode's anode, with the supply through R:
Newton's step is with
In circuit terms, is the total conductance at the node: the resistor's plus the diode's small-signal conductance at the guess. Start at 0.7 V and stop when the step is below, say, V.
Several nodes
For node voltages , KCL at every node gives a vector . Newton's step solves the linear system
and is exactly the nodal conductance matrix of the circuit with each diode replaced by its conductance at the guess. Simulators add limiting so that one step can't raise a diode's voltage by much more than a few thermal voltages.
Exact rectifier ripple
With an ideal diode and input , the diode stops conducting just after the peak, at , when the input starts falling faster than the capacitor can discharge. The capacitor then decays as until the next cycle's input rises to meet it at , between and , where
Solving that by bisection gives the exact ripple, .
Worked example
Do one Newton step by hand for 5 V, 1 kΩ, A, starting from 0.7 V.
Show the solution
- Diode current at 0.7 V.
- The function to zero.
- Its slope. The diode's conductance is so S.
- Newton step. which gives 0.6935 V.
- Compare. The answer is 0.6925 V; the next step lands within 0.02 mV.
Answer one Newton step takes the guess from 0.7 V to 0.6935 V, against an answer of 0.6925 V.
Worked example
Compare the estimate with the exact ripple for = 10 V, 50 Hz, 1 kΩ and 100 µF.
Show the solution
- Estimate.
- Exact. The exact analysis gives 1.65 V.
- Why it's smaller. The capacitor's decay is exponential, so it falls a little less than a straight line, and the input meets it about 9% of a period early.
Answer the estimate gives 2.0 V of ripple, and the exact ripple is 1.65 V.
Check
A diode with = 1 fA is guessed at 0.6 V. What small-signal conductance does Newton's method use for it?
Write units the way you normally would: 1.5 S, 1500 mS and 0.0015 kS are the same answer.
Check
Take one Newton step from 0.7 V for a diode ( A) in series with 1 kΩ across 5 V. Where does it land?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
A half-wave rectifier at 60 Hz has RC of 0.1 kΩ × 1000 µF. How long after the peak does its ideal diode stop conducting?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
Write solve_diode(Vs, R, IS=1e-14, n=1) returning (V, I) for a diode in series with R across Vs, by Newton's method from 0.7 V. Use VT = 0.025852 V.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A supply Vs feeds R1 to node 1, which has diode D1 to ground and R2 on to node 2; node 2 has diode D2 to ground. Write solve_network(Vs, R1, R2) returning (V1, V2) by Newton's method on both nodes at once (both diodes have A, n = 1).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write exact_ripple(Vp, f, R, C): the steady-state peak-to-peak ripple of a half-wave rectifier with an ideal diode, input , found by bisection as in the explanation above.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why is the Jacobian in Newton's method the same as the conductance matrix of a linear circuit?
Each row of the system is Kirchhoff's current law at one node: the currents leaving through every element must add to zero. Newton's method replaces each element's current by its tangent at the present guess. For a resistor that's the resistor itself; for a diode it's a conductance equal to the slope of its curve, , plus a constant current. So the derivatives of the node currents with respect to the node voltages are exactly the conductances you'd stamp into a nodal matrix for that linearized circuit, and each Newton step is just a nodal analysis of it.
Practice
Keep practicing
6 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.