---
title: AC nodal and mesh analysis
heading: Systematic analysis with complex admittances, and sources at different frequencies
eyebrow: C3 · Lesson 8 · AC nodal and mesh analysis
xp: 40
---

::: hook
Lesson 7 showed that once every part becomes an impedance, any DC method works on AC circuits. For circuits too tangled for dividers, that means nodal and mesh analysis with complex numbers: the same matrices as in C1, now with entries like $1/(j\omega L)$. The arithmetic is heavier but the method is identical, and it's exactly what a circuit simulator's AC analysis does at each frequency. The one new rule is about circuits with sources at different frequencies, where phasors can't be mixed at all.
:::

::: play
- A 10 V, 1 kHz source drives two nodes: $a$ through 1 kΩ, with 220 nF to ground and 1 kΩ on to $b$, which has a 100 mH inductor to ground. The meters give each node's amplitude and phase.
- At 1 kHz, $v_a$ lags the source by 28° and $v_b$ leads it by 29°: the capacitor and inductor pull the phases opposite ways.
- Sweep the frequency. At low frequency the inductor shorts $b$; at high frequency the capacitor shorts $a$.
:::
:::

```sim circuit
V1 in 0 sine 10 V 1k Hz     @ 0,0 down
R1 in a 1k                  @ 0,0 right
C1 a 0 220n                 @ 2,0 down
R2 a b 1k                   @ 2,0 right
L1 b 0 100m                 @ 4,0 down
slider: V1.f 100..10k log
scope: v(in), v(a), v(b)
time: 0..3m s
meter: v(a), v(b)
```

::: predict
## A circuit has a 5 V DC source and a 3 V RMS, 50 Hz source driving the same resistor in series. What RMS voltage is across it?

- [ ] 8 V
- [ ] 2 V
- [x] About 5.8 V
- [ ] 5 V

::: reveal
About 5.8 V. Signals at different frequencies (DC counts as zero frequency) don't interfere on average, so their powers add: $V_\text{rms} = \sqrt{5^2 + 3^2} = 5.83$ V. You can't add them as phasors; each frequency is solved separately and the results are combined in time.
:::
:::

::: nameit
## Nodal analysis with admittances

Write KCL at each node using **admittances** $Y = 1/Z$: $\frac1R$, $j\omega C$ and $\frac{1}{j\omega L}$. The equations take the familiar form $\mathbf Y\mathbf v = \mathbf i$, with complex entries:

- diagonal: the sum of admittances touching the node;
- off-diagonal: minus the admittance between two nodes;
- right side: currents injected by sources (a voltage source through $Z$ injects $V/Z$).

For one node fed through several impedances, **Millman's** form gives it directly:

$$v = \frac{\sum_k V_k/Z_k}{\sum_k 1/Z_k}$$

## Mesh analysis with impedances

Mesh analysis works the same way: $\mathbf Z\mathbf i = \mathbf v$, with each mesh's total impedance on the diagonal and shared impedances, negated, off it.

## Solving by hand

For a 2 × 2 system, Cramer's rule with complex numbers: $v_1 = \frac{i_1Y_{22} - Y_{12}i_2}{Y_{11}Y_{22} - Y_{12}^2}$. Keep numbers in rectangular form to add and in polar form to multiply and divide. Software (lesson 25) does larger systems.

## Different frequencies

A phasor carries a single frequency, so sources at different frequencies can't share one phasor solution. Use superposition (C1.16): solve the circuit once per frequency with only that frequency's sources on, convert each answer back to time, and add the time functions. For power and RMS, contributions at different frequencies add in squares:

$$V_\text{rms} = \sqrt{V_0^2 + V_{1,\text{rms}}^2 + V_{2,\text{rms}}^2 + \ldots}$$
:::

::: example
## Solve the sim's circuit at 1 kHz: 10 V into 1 kΩ to node $a$ (220 nF to ground), 1 kΩ from $a$ to $b$ (100 mH to ground).

::: solution
1. **Impedances at 1 kHz.**
   $$\begin{aligned} Z_C &= -j723\ \Omega \\ Z_L &= j628\ \Omega \end{aligned}$$
2. **Nodal equations.** In mS, with the source in mA:
   $$Y = \begin{bmatrix}2 + j1.383 & -1\\ -1 & 1 - j1.592\end{bmatrix}$$
   $$Y\mathbf v = \begin{bmatrix}10\\0\end{bmatrix}$$
3. **Solve by Cramer's rule.**
   $$\begin{aligned} v_a &= 5.12\angle{-28.5°}\ \text{V} \\ v_b &= 2.72\angle 29.4°\ \text{V} \end{aligned}$$
   as the meters show.

**Answer:** $v_a = 5.12\angle{-28.5°}$ V and $v_b = 2.72\angle 29.4°$ V.
:::
:::

::: example
## A load sees 10 V peak at 50 Hz plus 5 V peak at 150 Hz. What is its RMS voltage?

::: solution
1. **Add in squares.** Different frequencies add in squares:
   $$\begin{aligned} V_\text{rms} &= \sqrt{\frac{10^2}{2} + \frac{5^2}{2}} \\ &= 7.91\ \text{V} \end{aligned}$$
2. **A common mistake.** Adding the peaks first would give $\frac{15}{\sqrt2} = 10.6$ V, which is wrong.

**Answer:** 7.91 V RMS.
:::
:::

::: example
## A 1 kΩ, 1 µF RC low-pass is driven by both a 50 Hz and a 1 kHz signal. How much of each reaches the output?

::: solution
1. **One frequency at a time.** Phasors only work one frequency at a time, so solve twice and add the results in time, using
   $$H = \frac{1}{1 + j\omega RC}$$
2. **At 50 Hz.** Here $\omega RC = 0.314$, so
   $$\begin{aligned} |H| &= \frac{1}{\sqrt{1 + 0.314^2}} \\ &= 0.954 \end{aligned}$$
3. **At 1 kHz.** Here $\omega RC = 6.28$, so
   $$\begin{aligned} |H| &= \frac{1}{\sqrt{1 + 6.28^2}} \\ &= 0.157 \end{aligned}$$
4. **Compare.** The 50 Hz signal passes almost whole and the 1 kHz one is cut to 16%, each with its own phase shift.
5. **Why it works.** Superposition across frequencies is what lets any periodic signal be analyzed as a sum of sinusoids, as lesson 20 does.

**Answer:** the 50 Hz signal comes through at 0.954 of its size and the 1 kHz one at 0.157, about 16%.
:::
:::

::: check
given: V = 5 | 10; R = 1 | 4.7; C = 10 | 100; f = 1 | 10
answer: abs(V/(1 + j*2*pi*f*1000*R*1000*C*1e-9))
unit: V
tolerance: 0.5%

## {V} V at {f} kHz drives {R} kΩ into a node with {C} nF to ground. What is the node's amplitude?

::: right
Right. $\left|\frac{V}{1 + j\omega RC}\right|$ = {answer}.
:::

::: misses
- [V/(1 + 2*pi*f*1000*R*1000*C*1e-9)] Take the magnitude of the complex denominator, $\sqrt{1 + (\omega RC)^2}$.
- [any] Not yet. Millman with $Z_C = 1/(j\omega C)$.
:::
:::

::: check
given: R = 1 | 4.7; C = 10 | 100; f = 1 | 10
answer: arg(1/(1 + j*2*pi*f*1000*R*1000*C*1e-9))*180/pi
unit: °
tolerance: 0.5%

## In the same circuit ({R} kΩ, {C} nF, {f} kHz), what is the node's phase relative to the source?

::: right
Right. $-\tan^{-1}\omega RC$ = {answer}.
:::

::: misses
- [-arg(1/(1 + j*2*pi*f*1000*R*1000*C*1e-9))*180/pi] The capacitor makes the node lag: the angle is negative.
- [any] Not yet. The angle of $1/(1 + j\omega RC)$.
:::
:::

::: check
given: V1 = 5 | 10; V2 = 2 | 4; R = 1 | 2; X = 1 | 3
answer: abs((V1/R + V2/(j*X))/(1/R + 1/(j*X) + 1/R))
unit: V
tolerance: 0.5%

## {V1} V (phase 0) drives a node through {R} kΩ, and {V2} V (phase 0, same frequency) through an inductor of reactance {X} kΩ. The node has {R} kΩ to ground. What is its amplitude?

::: right
Right. Millman: $\left|\frac{V_1/R + V_2/(jX)}{2/R + 1/(jX)}\right|$ = {answer}.
:::

::: misses
- [(V1/R + V2/X)/(2/R + 1/X)] Inductor admittances are imaginary; add them as complex numbers.
- [any] Not yet. $v = \frac{\sum V_k/Z_k}{\sum 1/Z_k}$ with $Z_L = jX$.
:::
:::

::: check
given: V = 5 | 10; R = 10 | 100; L = 10 | 50; C = 1 | 10; f = 0.5 | 2
answer: V/abs(R + j*(2*pi*f*1000*L*1e-3 - 1/(2*pi*f*1000*C*1e-6)))*1000
unit: mA
tolerance: 0.5%

## A {V} V, {f} kHz source drives R = {R} Ω, L = {L} mH and C = {C} µF in series. What current amplitude flows?

::: right
Right. $\frac{V}{|R + j(\omega L - 1/\omega C)|}$ = {answer}.
:::

::: misses
- [V/(R + 2*pi*f*1000*L*1e-3 + 1/(2*pi*f*1000*C*1e-6))*1000] The reactances partly cancel, and they add to R at right angles.
- [any] Not yet. One mesh, total impedance.
:::
:::

::: check
given: A1 = 5 | 10; A2 = 2 | 4; A3 = 0 | 1
answer: sqrt(A1^2/2 + A2^2/2 + A3^2/2)
unit: V
tolerance: 0.5%

## A signal is the sum of sinusoids of peak {A1} V, {A2} V and {A3} V at three different frequencies. What is its RMS value?

::: right
Right. $\sqrt{\sum A_k^2/2}$ = {answer}.
:::

::: misses
- [(A1 + A2 + A3)/sqrt(2)] Different frequencies add in squares, not in amplitude.
- [any] Not yet. Add the squares of the RMS values.
:::
:::

::: check
given: Vdc = 2 | 5; Vac = 1 | 3
answer: sqrt(Vdc^2 + Vac^2)
unit: V
tolerance: 0.5%

## A signal is {Vdc} V DC plus {Vac} V RMS of AC. What is its total RMS value?

::: right
Right. $\sqrt{V_\text{dc}^2 + V_\text{ac}^2}$ = {answer}.
:::

::: misses
- [Vdc + Vac] DC and AC add in squares.
- [any] Not yet. DC is a zero-frequency component.
:::
:::

::: check
kind: parts
given: R = 1 | 10; C = 0.1 | 1; f = 50 | 1000

## An RC low-pass of {R} kΩ and {C} µF passes a {f} Hz signal.

::: part
answer: 1/sqrt(1 + (2*pi*f*R*1e3*C*1e-6)^2)
tolerance: 0.5%

### What fraction of its amplitude gets through?

::: misses
- [any] $\frac{1}{\sqrt{1 + (\omega RC)^2}}$.
:::
:::

::: part
answer: -atan(2*pi*f*R*1e3*C*1e-6)*180/pi
unit: °
tolerance: 0.5%

### What phase shift does it get?

::: misses
- [any] $-\arctan\omega RC$.
:::
:::
:::

::: check
kind: derivation
vars: w = 1..1000000, R = 1..100000, C = 0.000000001..0.001

## A low-pass $H = \frac{1}{1 + j\omega RC}$.

::: step
answer: 1/sqrt(1 + (w*R*C)^2)

### What's |H|?
:::

::: step
answer: -atan(w*R*C)

### What's its phase, in radians?
:::

::: step
answer: 20*log(1/sqrt(1 + (w*R*C)^2))

### What's its gain in dB?
:::

::: right
Right. Each frequency gets its own magnitude and phase.
:::
:::

::: explain
## Why can't two sources at different frequencies be combined in one phasor solution?

::: model
A phasor represents a sinusoid at one known frequency by its amplitude and phase; the frequency itself is left out because every quantity in the solution shares it. Impedances also depend on frequency, so a capacitor has one impedance at 50 Hz and another at 150 Hz. With two frequencies there's no single set of impedances, and adding the two phasors would produce something meaningless. Instead the circuit is solved once per frequency, which superposition allows because the circuit is linear, and the results are added as time functions.
:::
:::

::: practice

::: check
given: f = 50 | 1000; C = 1 | 10
answer: 2*pi*f*C*1e-6*1000
unit: mS
tolerance: 0.5%

## What is the admittance magnitude of {C} µF at {f} Hz?

::: misses
- [any] $\omega C$.
:::
:::

::: check
given: f = 50 | 1000; L = 10 | 100
answer: 1/(2*pi*f*L*1e-3)*1000
unit: mS
tolerance: 0.5%

## What is the admittance magnitude of {L} mH at {f} Hz?

::: misses
- [any] $1/(\omega L)$.
:::
:::

::: check
given: a = 3 | 6; b = 4 | 8
answer: sqrt(a^2 + b^2)
tolerance: 0.5%

## What is $|\given{a} + j\given{b}|$?

::: misses
- [any] $\sqrt{a^2 + b^2}$.
:::
:::
:::
