Sub topic 14
KVL with sinusoidal sources and phasors
This chapter assumes you can write a KVL loop equation with consistent signs, apply Ohm's law to resistors, and do arithmetic with complex numbers in rectangular and polar form. You should also know that an inductor obeys v = L di/dt and a capacitor obeys i = C dv/dt. Nothing new is added to KVL here. The phasor method lets you apply the same law when the sources are sinusoidal and the circuit contains inductors and capacitors.
KVL still holds at every instant
With a sinusoidal source, every branch voltage changes with time. KVL is a statement about energy and potential at one moment, so it holds at each instant t:
vs(t) − vR(t) − vL(t) − vC(t) = 0
The equation is the same one you wrote for DC circuits. The only change is that each term is now a function of time. For a series RLC loop, substituting the element laws gives an integro-differential equation:
v_s(t) = R·i(t) + L·di/dt + (1/C)·∫i dt
Solving this directly means solving a differential equation. Phasors turn it into algebra.
From time functions to phasors
Assume the circuit is in sinusoidal steady state. Every source has the same angular frequency ω, and all transients have died out. Every voltage and current is then a sinusoid at that same ω. Only its amplitude and phase differ.
A sinusoid v(t) = V_m cos(ωt + φ) can be written as the real part of a rotating complex number:
v(t) = Re{ V_m e^{jφ} · e^{jωt} }
The factor e^{jωt} is common to every term in the loop. Drop it and keep the complex number V = V_m∠φ. This is the phasor. It stores the amplitude and phase of one sinusoid at the known frequency ω.
Differentiation in the time domain becomes multiplication by jω. Integration becomes division by jω. That gives each element a complex ratio of voltage to current, called impedance (Z, in ohms).
| Element | Time-domain law | Impedance Z | Voltage relative to current |
|---|---|---|---|
| Resistor | v = R·i | R | In phase |
| Inductor | v = L·di/dt | jωL | Leads by 90° |
| Capacitor | i = C·dv/dt | 1/(jωC) = −j/(ωC) | Lags by 90° |
Each element then obeys a phasor form of Ohm's law, V = Z·I, with the passive sign convention unchanged. The current enters the positive terminal of the element, and the voltage across it is V = Z·I.
KVL in phasor form
Because the common factor e^{jωt} cancels, KVL becomes a statement about phasors:
ΣVk = 0 around any closed loop, where each Vk is a complex number.
This is the same law with the same sign rules, applied to complex quantities. Pick a loop direction. A source whose positive terminal is met first contributes a rise. Each element contributes a drop equal to Z·I in the direction of the assumed current. For a series loop:
Vs = I·(R + jωL + 1/(jωC)) = I·Ztotal
The sum of the impedances in series is the total impedance, just as resistances add in series. The voltage divider also carries over. The phasor voltage across element k in a series string is Vs · Zk / Z_total.
Worked example: series RLC
A source v_s(t) = 10 cos(1000t) V drives R = 100 Ω, L = 100 mH and C = 20 µF in series. Here ω = 1000 rad/s.
- Impedances: ZR = 100 Ω. ZL = j(1000)(0.1) = j100 Ω. Z_C = 1/(j·1000·20×10⁻⁶) = −j50 Ω.
- Total: Z = 100 + j100 − j50 = 100 + j50 Ω, which is 111.80 Ω ∠26.57°.
- Current: I = 10∠0° / 111.80∠26.57° = 0.08944 A ∠−26.57°.
- Element voltages:
- V_R = I·R = 8.944 V ∠−26.57°, which is 8.0 − j4.0 V.
- V_L = I·j100 = 8.944 V ∠63.43°, which is 4.0 + j8.0 V.
- V_C = I·(−j50) = 4.472 V ∠−116.57°, which is −2.0 − j4.0 V.
- KVL check: the real parts sum to 8 + 4 − 2 = 10, and the imaginary parts sum to −4 + 8 − 4 = 0. So VR + VL + V_C = 10∠0° V, which equals the source.
The code below repeats the calculation. It also evaluates the instantaneous voltages at an arbitrary time, to show that KVL holds in the time domain too.
import cmath
import math
w = 1000.0 # angular frequency, rad/s
R, L, C = 100.0, 0.1, 20e-6
Vs = cmath.rect(10.0, 0.0) # 10 V peak, phase 0
Z = {"R": R, "L": 1j * w * L, "C": 1 / (1j * w * C)}
I = Vs / sum(Z.values())
V = {name: I * z for name, z in Z.items()}
mag, ang = cmath.polar(I)
print(f"I = {mag:.5f} A at {math.degrees(ang):.2f} deg")
for name, v in V.items():
mag, ang = cmath.polar(v)
print(f"V_{name} = {mag:.3f} V at {math.degrees(ang):.2f} deg")
# Phasor KVL: source minus the sum of the drops should be zero.
print(f"Phasor residual = {abs(Vs - sum(V.values())):.2e} V")
# The magnitudes do NOT add up to the source magnitude.
print(f"Sum of magnitudes = {sum(abs(v) for v in V.values()):.3f} V")
# Time-domain check at an arbitrary instant.
t = 0.00037
def inst(phasor):
return (phasor * cmath.exp(1j * w * t)).real
print(f"Instantaneous residual = {inst(Vs) - sum(inst(v) for v in V.values()):.2e} V")The magnitudes of VR, VL and V_C add up to about 22.36 V, which is more than twice the 10 V source. That does not violate KVL. The three phasors point in different directions in the complex plane, and only their vector sum equals the source.
Why the magnitudes do not add
Many errors in AC analysis come from treating phasor magnitudes like DC voltages. Three points help.
- KVL applies to complex phasors (or to instantaneous values). It does not apply to magnitudes or to RMS readings taken separately.
- VL and VC are 180° apart in a series loop, so they partly cancel. In the example, the inductor shows 8.944 V and the capacitor 4.472 V, but together they contribute only j4 × 2.236 ... more simply, 4 + j8 plus −2 − j4 gives 2 + j4 V.
- Near resonance (here ω = 1/√(LC) ≈ 707 rad/s), the reactive voltages can each be much larger than the source. This is normal. The two nearly cancel in the loop sum.
Practical rules
- Same frequency. Phasor KVL requires every source to have the same ω. If a circuit has sources at different frequencies, solve once per frequency with phasors and add the resulting time-domain waveforms (superposition). Never add phasors from different frequencies.
- Peak or RMS. Choose one convention and keep it. Peak phasors have magnitude Vm. RMS phasors have magnitude Vm/√2. Power formulas change by a factor of 2 between the two.
- Cosine reference. A sine source converts as sin(ωt + φ) = cos(ωt + φ − 90°). Convert before writing the phasor.
- Signs and direction. The loop direction, source polarity and passive sign convention work exactly as in DC. Reversing the loop direction flips the sign of every term, and the equation still holds.
- Mesh analysis. The matrix method from the earlier chapter works unchanged. The resistances become impedances and the unknowns become complex mesh-current phasors.
numpy.linalg.solveaccepts complex matrices.
Summary of the method
- Confirm that all sources share one frequency and that the circuit is in steady state.
- Convert each source to a phasor, with cosine as the reference.
- Replace each element by its impedance.
- Write KVL (and KCL where there is more than one loop) with the same sign rules as in DC.
- Solve with complex algebra.
- Check that the phasor loop sum is zero, then convert back to v(t) if a time-domain answer is needed.
Exercise
A series loop has vs(t) = 20 cos(2000t) V, R = 30 Ω and L = 20 mH. Find the phasor current, the phasor voltage across the inductor, and check KVL. Do the magnitudes of VR and V_L add up to 20 V?
Show answer
ω = 2000 rad/s, so ZL = j(2000)(0.02) = j40 Ω. Z = 30 + j40 = 50 Ω ∠53.13°. I = 20∠0° / 50∠53.13° = 0.4 A ∠−53.13°. VR = 30 × 0.4∠−53.13° = 12 V ∠−53.13° = 7.2 − j9.6 V. VL = j40 × 0.4∠−53.13° = 16 V ∠36.87° = 12.8 + j9.6 V. The sum is 20 + j0 V, which matches the source, so KVL holds. The magnitudes 12 V + 16 V = 28 V do not equal 20 V, because VR and V_L are 90° apart and add as vectors: √(12² + 16²) = 20 V.
Exercise
In the worked RLC example, the capacitor value is changed to 10 µF while everything else stays the same. Does the loop impedance become larger or smaller in magnitude, and does the current lead or lag the source voltage?
Show answer
ZC = 1/(j·1000·10×10⁻⁶) = −j100 Ω. Then Z = 100 + j100 − j100 = 100 Ω, which is purely resistive. This is resonance, since ω = 1/√(LC) = 1000 rad/s. The magnitude drops from 111.8 Ω to 100 Ω, so the current rises to 0.1 A, and it is in phase with the source (neither leading nor lagging). VL = 10 V ∠90° and VC = 10 V ∠−90° cancel exactly in the loop sum, so VR = 10 V equals the source.