Sub topic 8
Finding Current from Voltage
The previous chapters used v = L di/dt to find voltage from a known current. This chapter reverses the question: you know the voltage across an inductor over time, and you need the current. The tool is the integral form of the inductor law. It is also the form that makes the "current cannot jump" rule easy to see.
This chapter assumes you can integrate simple functions (constants, sines, piecewise pieces) and that you use the passive sign convention: current enters the terminal where the voltage reference is positive.
From the derivative to the integral
Start with the law and solve for the change in current:
v(t) = L di/dt → di = (1/L) v(t) dtAdd up the small changes from a starting time t0 to a later time t:
i(t) = i(t0) + (1/L) ∫ v(τ) dτ (integral from t0 to t)The variable τ (tau) is a dummy variable. It keeps the integration variable separate from the upper limit t.
Three parts of this equation matter:
i(t0)is the initial current. The lawv = L di/dtonly tells you how current changes. It never tells you where the current started, so you must supplyi(t0).- The integral is the area under the voltage curve, measured in volt-seconds.
- Dividing by
Lconverts volt-seconds into amperes. A larger inductance turns the same volt-seconds into a smaller current change.
The units agree: 1 H = 1 V·s/A, so 1 V·s divided by 1 H gives 1 A.
A procedure you can reuse
Because each interval starts from the current at the end of the previous one, the current is continuous across the boundaries automatically. A finite voltage can only change the current gradually.
Worked example: a constant voltage
A 50 mH inductor starts with 0.2 A. A constant 6 V is applied from t = 0. Then:
i(t) = 0.2 + (1/0.05)(6)(t) = 0.2 + 120 t (A, with t in seconds)The current ramps linearly at 120 A/s. After 10 ms it is 0.2 + 1.2 = 1.4 A. This is the same ramp as di/dt = v/L, now with an explicit starting value.
Worked example: a piecewise voltage
A 20 mH inductor has i(0) = 0. The applied voltage is:
- 10 V from 0 to 2 ms
- 0 V from 2 to 4 ms
- −5 V from 4 to 8 ms
Interval by interval:
- 0 to 2 ms: area = 10 × 0.002 = 0.02 V·s. Change = 0.02/0.02 = +1 A. Current at 2 ms is 1 A.
- 2 to 4 ms: area = 0. Current holds at 1 A.
- 4 to 8 ms: area = −5 × 0.004 = −0.02 V·s. Change = −1 A. Current at 8 ms is 0 A.
The current at 6 ms is 1 + (−5 × 0.002)/0.02 = 0.5 A.
Notice that the current is flat while the voltage is zero. An ideal inductor with no voltage across it holds its current. That is the same fact as the DC steady-state behavior from the earlier chapter.
You can check the arithmetic numerically. The program below accumulates volt-microseconds in whole numbers, which avoids floating-point drift at the interval boundaries.
L = 20e-3 # inductance in henries
i0 = 0.0 # initial current in amperes
def v_volts(k):
"""Voltage during the k-th microsecond."""
if k < 2000:
return 10
if k < 4000:
return 0
if k < 8000:
return -5
return 0
volt_us = 0 # running area under v, in volt-microseconds
for k in range(8000):
volt_us += v_volts(k)
n = k + 1
if n in (2000, 4000, 6000, 8000):
i = i0 + (volt_us * 1e-6) / L
print(f"t = {n / 1000:.0f} ms: i = {i:.3f} A")It prints 1.000 A at 2 ms, 1.000 A at 4 ms, 0.500 A at 6 ms and 0.000 A at 8 ms, matching the hand calculation.
Common waveform shapes
The integral turns each voltage shape into a current shape that is one power of t higher.
| Voltage across the inductor | Current (starting from i0) |
|---|---|
| Constant V | Straight line: `i0 + (V/L) t` |
| Zero | Constant: `i0` |
| Linear ramp `k t` | Parabola: `i0 + (k/2L) t²` |
| Sine `Vm sin(ωt)` | `i0 + (Vm/ωL)(1 − cos ωt)` |
| Square wave (average zero) | Triangle wave |
The triangle-wave row is how switching converters work. A square voltage across an inductor gives a triangular current, and the average voltage over a full period must be zero for the current to repeat.
Edge case: the initial condition sets a DC offset
Take a 10 mH inductor driven by v = 10 sin(1000 t) V with i(0) = 0. Integrating:
i(t) = (1/0.01) ∫ 10 sin(1000 τ) dτ = 1 − cos(1000 t) (A)The current swings between 0 A and 2 A, not between −1 A and +1 A. The constant "1" is not a mistake. It comes from the zero initial current. A symmetric swing requires i(0) = −1 A, because then the cosine term starts at its negative peak.
In a real circuit, a series resistance slowly removes such an offset. An ideal inductor with an ideal source never removes it, since nothing in the model dissipates the extra volt-seconds.
import math
L = 10e-3
Vm = 10.0
w = 1000.0
def current(t, i0):
# i(t) = i0 + (Vm / (w L)) (1 - cos(w t))
return i0 + (Vm / (w * L)) * (1 - math.cos(w * t))
# Sample one full period (2*pi/w) in 101 points
period = 2 * math.pi / w
for i0 in (0.0, -1.0):
samples = [current(period * k / 100, i0) for k in range(101)]
print(f"i0 = {i0:+.1f} A: min = {min(samples):+.3f} A, max = {max(samples):+.3f} A")Running it shows a range of 0 to +2 A for i0 = 0 and −1 to +1 A for i0 = −1.
Common errors
- Dropping
i(t0). The result is the change in current, not the current. This is the most frequent mistake. - Mixing units. Convert ms to s and mH to H before you divide. A 20 mH inductor is 0.02 H, not 20.
- Using the source voltage instead of the inductor voltage. In a series RL circuit, the voltage across the inductor is the source voltage minus the resistor drop, and that drop changes as the current changes. The simple integral applies directly only when you know
vacross the inductor itself. - Ignoring polarity. If the voltage reference and current direction do not follow the passive sign convention, flip the sign of the integral term.
- Expecting a jump from a step. A voltage step makes the current ramp, so the current itself stays continuous. Only a voltage impulse (infinite for an instant) would change the current by a finite amount in zero time, and a real circuit cannot produce one.
- Trusting the integral past saturation. The formula assumes constant
L. If the current reaches the saturation level of a real core, the inductance drops and the real current rises faster than the formula predicts.
Numerical integration notes
When the voltage comes from a measurement or a simulation, you integrate samples instead of formulas. The running sum of v × Δt is a rectangle rule, and the trapezoid rule averages neighboring samples for better accuracy. Both accumulate error from offsets in the data. A voltage measurement that is off by 1 mV adds a drift of 0.001/L amperes per second, so a long record of a "zero-average" waveform can show a current that wanders. Always check that the computed current is physically consistent with the known starting value.
Exercise
A 40 mH inductor has an initial current of −0.5 A. The voltage across it is +8 V for 5 ms, then −2 V for 10 ms (the reference follows the passive sign convention). Find the current at 5 ms and at 15 ms.
Show answer
Convert L to 0.04 H. In the first interval the area is 8 × 0.005 = 0.04 V·s, so the change is 0.04/0.04 = +1 A and the current at 5 ms is −0.5 + 1 = +0.5 A. In the second interval the area is −2 × 0.010 = −0.02 V·s, so the change is −0.02/0.04 = −0.5 A and the current at 15 ms is 0.5 − 0.5 = 0 A.
Exercise
A 10 mH inductor is driven by a square wave that is +5 V for 1 ms, then −5 V for 1 ms, repeating, with i(0) = 0. What are the peak current and the current at 2 ms, and why is the current a triangle wave?
Show answer
During the first millisecond the area is 5 × 0.001 = 0.005 V·s, so the current rises by 0.005/0.01 = 0.5 A. The peak current is 0.5 A at 1 ms. During the next millisecond the area is −0.005 V·s, so the current falls by 0.5 A and is 0 A at 2 ms. Constant voltage gives a linear ramp, and the sign of the voltage sets the ramp direction, so alternating signs give rising and falling straight lines, which form a triangle wave.