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

C1 · Lesson 19 · Sources and equivalents lab

Fitting a Thevenin model to measurements, sweeping for maximum power, checking superposition, and a dependent-source amplifier stage, in Python

Lessons 14 to 17 replaced real sources and whole networks with two numbers, a Thevenin voltage and resistance, and used them to find load voltages, superposed contributions and the load that takes the most power. On the bench those two numbers come from measurements, which are noisy and more than two. In this lab you'll fit a Thevenin model to data by least squares, find the best load by sweeping, check superposition numerically, and analyze an emitter follower's dependent-source model, which leads into lesson 21.

  • A source's terminal voltage falls along the straight line V=Vth−IRth; a resistive load forces V=IRL. Where the lines cross is the operating point.
  • The sliders set the source and the load. Make the load equal to Rth and the operating point sits at half the open-circuit voltage and half the short-circuit current, where the power, the rectangle under the point, is largest.
  • The readouts give the operating point and the load power.

Predict

A bench supply's voltage is measured at four load currents: 12.10 V at 0 A, 12.00 V at 1 A, 11.90 V at 2 A and 11.60 V at 5 A. What's its internal resistance?

Name it

Fitting a Thevenin model

A linear source obeys V=Vth−IRth. Given several measured (I, V) pairs, a least-squares straight-line fit returns the intercept Vth and the slope −Rth. With noisy data, more points narrow the uncertainty; with a nonlinear source, the fit's residuals show where the linear model fails.

Sweeping for maximum power

The power into a load is P=Vth2RL(Rth+RL)2. Sweeping RL over a logarithmic grid and keeping the largest P finds the maximum at RL=Rth, as lesson 17 proved. The peak is broad: within a factor of two either side, the power stays above 89% of the maximum.

Superposition, numerically

For a node fed by several sources Vi through resistors Ri, with Rg to ground, v=∑Vi/Ri∑1/Ri+1/Rg. Setting all but one source to zero and summing the results must give the same v, to rounding: a quick test of any linear-circuit code.

A dependent-source stage

An emitter follower, modeled with a dependent current source βib, a source resistance Rs and a load RL, has

Rin=Rs+(β+1)RL,voutvin=(β+1)RLRs+(β+1)RL,

and seen from the load, the source resistance shrinks to Rsβ+1. Solving the model's equations numerically, with a test source where needed, reproduces all three.

Worked example

Fit a Thevenin model to the bench supply's readings: (0 A, 12.10 V), (1 A, 12.00 V), (2 A, 11.90 V), (5 A, 11.60 V).

Show the solution
  1. Fit the line. The points lie exactly on a line, with slope −0.10 V/A and intercept 12.10 V.
  2. Read off the model. So Vth = 12.10 V and Rth = 0.10 Ω.
  3. Short-circuit current. Isc=12.100.10=121A though the supply would current-limit long before.
  4. Noisy readings. With noisy readings, a least-squares fit uses all of them; the uncertainty in Rth shrinks as the spread of currents grows, which is why such tests use the widest current range the source safely allows.

Answer the supply is 12.10 V behind 0.10 Ω.

Worked example

A 5 V source has 50 Ω inside. Sweep the load: what's the power at 25, 50 and 100 Ω?

Show the solution
  1. Load power. With 5 V behind 50 Ω, P=25RL(50+RL)2
  2. At 25 Ω. P=25×25752=111mW
  3. At 50 Ω. P=25×501002=125mW the maximum.
  4. At 100 Ω. P=25×1001502=111mW
  5. A flat peak. Halving or doubling the load costs only 11%. That flat peak is why "matched" loads in practice are often off by tens of percent with little loss.
  6. The cost of a match. A matched load wastes half the source's power: at 50 Ω the source itself dissipates 125 mW too.

Answer the load gets 111 mW at 25 Ω, 125 mW at 50 Ω (the maximum) and 111 mW at 100 Ω.

Worked example

An emitter follower has β = 100, source resistance 1 kΩ and load 1 kΩ. Find its input resistance, voltage gain and output resistance.

Show the solution
  1. Input resistance. Rin=1+101×1=102kΩ
  2. Voltage gain. voutvin=101102=0.990
  3. Output resistance. Looking back from the load, the 1 kΩ source resistance appears divided by β + 1: 1000101=9.9Ω or 9.8 Ω with the 1 kΩ load in parallel.
  4. What the stage is for. It turns a 1 kΩ source into a 10 Ω one at nearly unity gain, which is its whole purpose: a buffer.

Answer the input resistance is 102 kΩ, the voltage gain 0.990, and the output resistance 9.9 Ω (9.8 Ω with the load in parallel).

Check

Step 1. Write thevenin_fit(I, V) returning (Vth, Rth) from a least-squares straight-line fit of measured voltages V against currents I.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 2. Write best_load(Vth, Rth) returning the load, among 2001 values spaced logarithmically from Rth/100 to 100 Rth, that takes the most power.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 3. Write node_voltage(sources, Rg) for a node fed by a list of (V, R) sources with Rg to ground, and superposed(sources, Rg) returning the sum of each source's contribution with the others set to zero.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 4. Write follower(beta, Rs, RL) returning (Rin, gain, Rout) for the emitter-follower model: solve for the base current with a 1 V input, then find the output resistance by driving the output with a test current, input source shorted.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 5. Write pulse_resistance(t, v, i_low, i_high, t_on, t_off) estimating a battery's internal resistance from a voltage record during a current pulse: average v before t_on, average v between t_on and t_off, and divide the drop by the current step.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

A source reads 12 V at 0.5 A and 0.5 V less at 8 A.

(a)

What's its Thevenin resistance?

Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.

(b)

What's its Thevenin voltage?

Check

A source of 5 V behind 8 Ω drives a matched load. How much power does the load get?

Write units the way you normally would: 1.5 mW, 1500 µW and 0.0015 W are the same answer.

Check

Sources of 5, 2 and 4 V each feed a node through 10 kΩ, and 1 × 10 kΩ connects it to ground. What's the node voltage?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

Check

An emitter follower has β = 100, source resistance 5 kΩ and load 2 kΩ.

(a)

What's its input resistance?

Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.

(b)

What's its voltage gain?

Explain why

Why does fitting a line to several load measurements give a better Thevenin model than using just two of them?

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.