---
title: Mass-spring systems and LC circuits
heading: One equation for a bouncing weight and a ringing circuit
eyebrow: A8 · Lesson 16 · Mass-spring systems and LC circuits
xp: 40
---

::: hook
Pull a weight on a spring down and let go, and it bounces at a steady rhythm. Charge a capacitor, connect it across an inductor, and the voltage swings back and forth at a steady rhythm too. These two look nothing alike, but they obey exactly the same second-order equation, so everything you learn about one tells you something about the other.

::: play
- The top graph is a weight on a spring, released from $x_0$ at rest. The bottom one is a charged capacitor connected across an inductor at $t = 0$.
- Make the weight heavier. Make the spring stiffer. Which way does the frequency move each time?
- Now raise L, then raise C. Which of those plays the part of the mass, and which plays the part of the spring?
:::
:::

```sim plot
view: graph
x: t = 0..3 s
y: x = -12..12 cm
slider: m = 0.1..2 step 0.05 = 0.5 kg
slider: k = 2..50 step 1 = 20 N/m
slider: x0 = 0..10 step 0.5 = 8 cm
plot: x0*cos(sqrt(k/m)*t) | label: position
readout: ω₀ in rad/s = sqrt(k/m)
readout: f₀ = sqrt(k/m)/(2*pi) Hz
```

```sim plot
view: graph
x: t = 0..10 ms
y: v = -7..7 V
slider: L = 2m..50m = 10m H log
slider: C = 2µ..50µ = 10µ F log
slider: V0 = 0..5 step 0.5 = 5 V
plot: V0*cos(t/1000/sqrt(L*C)) | samples: 2000 | label: v
plot: V0*sin(t/1000/sqrt(L*C)) | samples: 2000 | dashed | color: ch2 | label: i × √(L/C)
readout: f₀ = 1/(2*pi*sqrt(L*C)) Hz
readout: peak current = V0*sqrt(C/L)*1000 mA
```

::: predict
## You make the weight four times heavier. What happens to how fast it bounces?

- [ ] It bounces four times as fast
- [ ] It bounces at the same rate
- [x] It bounces half as fast
- [ ] It bounces a quarter as fast

::: reveal
Half as fast. The frequency is $\sqrt{k/m}$, so four times the mass gives half the frequency. A heavier weight takes longer to speed up and slow down under the same spring force. The circuit behaves the same way with $L$: four times the inductance halves the ringing frequency.
:::
:::

::: nameit
## The harmonic oscillator

**The weight.** The spring pulls back with force $-kx$, and Newton's law says force is mass times acceleration:

$$m\frac{d^2x}{dt^2} = -kx \quad\Rightarrow\quad \frac{d^2x}{dt^2} + \omega_0^2\,x = 0, \qquad \omega_0 = \sqrt{\frac{k}{m}}$$

**The circuit.** The capacitor and inductor share one voltage $v$, and the capacitor's current $i = -C\,dv/dt$ flows through the inductor, where $v = L\,di/dt$. Putting one into the other:

$$\frac{d^2v}{dt^2} + \omega_0^2\,v = 0, \qquad \omega_0 = \frac{1}{\sqrt{LC}}$$

The same equation. Its solutions are the sinusoids at $\omega_0$:

$$x(t) = A\cos\omega_0t + B\sin\omega_0t$$

Differentiate twice and you get $-\omega_0^2$ times what you started with, which is exactly what the equation asks for. The two constants come from the two starting facts: $A = x(0)$, and $B = \dot x(0)/\omega_0$ from the starting velocity.

**The analogy.** Line the two up term by term:

| Weight on a spring | LC circuit |
|---|---|
| position $x$ | charge $q$ on the capacitor |
| velocity $\dot x$ | current $i$ |
| mass $m$ | inductance $L$ |
| stiffness $k$ | $1/C$ |
| spring energy $\tfrac12kx^2$ | electric field energy $\tfrac12Cv^2$ |
| motion energy $\tfrac12m\dot x^2$ | magnetic field energy $\tfrac12Li^2$ |

Mass resists changes in velocity; inductance resists changes in current. A stiff spring stores energy with little stretch; a small capacitor builds a big voltage from little charge.

**Energy sloshing.** At the top of the swing the weight is momentarily still and all the energy is in the spring. At the middle it moves fastest and all of it is motion. The circuit does the same: the capacitor's electric field holds everything when $v$ peaks, and a quarter cycle later the inductor's magnetic field holds everything as the current peaks. That's why the dashed current curve is a quarter cycle behind the voltage. Setting the two energies equal gives the peak current: $\tfrac12CV_0^2 = \tfrac12LI_0^2$, so $I_0 = V_0\sqrt{C/L}$.
:::

::: example
## A 10 mH inductor rings with a 1 µF capacitor. At what frequency?

::: solution
1. **Use the resonance formula.** With $LC = 10^{-2} \times 10^{-6}$,
   $$\begin{aligned} f_0 &= \frac{1}{2\pi\sqrt{LC}} \\ &= \frac{1}{2\pi\sqrt{10^{-8}}} \\ &= 1592\ \text{Hz} \end{aligned}$$

**Answer:** it rings at 1592 Hz.
:::
:::

::: example
## A 0.2 kg mass on an 80 N/m spring. How fast does it bounce?

::: solution
1. **Angular frequency.**
   $$\begin{aligned} \omega_0 &= \sqrt{k/m} \\ &= \sqrt{400} \\ &= 20\ \text{rad/s} \end{aligned}$$
2. **In hertz.**
   $$\begin{aligned} f &= \frac{20}{2\pi} \\ &= 3.18\ \text{Hz} \end{aligned}$$

**Answer:** it bounces at 20 rad/s, which is 3.18 Hz.
:::
:::

::: example
## A 1 µF capacitor charged to 5 V is connected across a 10 mH inductor. What is the peak current?

::: solution
1. **Follow the energy.** Energy sloshes between the two with none lost: when the capacitor's voltage passes zero, all of $\frac12CV^2$ is in the inductor as $\frac12LI^2$.
2. **Solve for the current.**
   $$\begin{aligned} I &= V\sqrt{\frac CL} \\ &= 5\sqrt{\frac{10^{-6}}{10^{-2}}} \\ &= 5 \times 0.01 \\ &= 50\ \text{mA} \end{aligned}$$
3. **Characteristic impedance.** The ratio $\sqrt{L/C} = 100$ Ω is the tank's characteristic impedance: peak voltage over peak current.

**Answer:** the peak current is 50 mA.
:::
:::

::: check
given: L = 1µ..10m E6 H; C = 100p..1µ E6 F
answer: 1/(2*pi*sqrt(L*C))
unit: Hz
tolerance: 1%

## An {L} inductor is connected across a charged {C} capacitor. At what frequency does it ring?

::: right
Right. $f_0 = 1/(2\pi\sqrt{LC})$ = {answer}.
:::

::: misses
- [1/sqrt(L*C)] That's $\omega_0$ in radians per second. Divide by $2\pi$ for hertz.
- [1/(2*pi*L*C)] Take the square root of $LC$.
- [any] Not yet. $f_0 = 1/(2\pi\sqrt{LC})$.
:::
:::

::: check
given: m = 0.1 | 0.2 | 0.5 | 2 | 5; k = 10 | 40 | 90 | 160
answer: sqrt(k/m)
unit: rad/s
tolerance: 0.5%

## A {m} kg weight hangs on a spring of stiffness {k} N/m. What is its natural angular frequency?

::: right
Right. $\omega_0 = \sqrt{k/m}$ = {answer}.
:::

::: misses
- [k/m] Take the square root.
- [sqrt(m/k)] That's upside down: a stiffer spring gives a faster bounce.
- [sqrt(k/m)/(2*pi)] That's the frequency in hertz. The question asks for ω in rad/s.
- [any] Not yet. $\omega_0 = \sqrt{k/m}$.
:::
:::

::: check
given: V0 = 2..12 int; L = 1m..10m E6 H; C = 1µ..10µ E6 F
answer: V0*sqrt(C/L)
unit: A
tolerance: 1%

## A {C} capacitor charged to {V0} V is connected across an {L} inductor. What is the peak current?

::: right
Right. All of $\tfrac12CV_0^2$ moves into $\tfrac12LI_0^2$, so $I_0 = V_0\sqrt{C/L}$ = {answer}.
:::

::: misses
- [V0*sqrt(L/C)] That's upside down. Set $\tfrac12CV_0^2 = \tfrac12LI_0^2$ and solve for $I_0$.
- [V0*C/L] Take the square root: the energies have squares in them.
- [any] Not yet. Set the capacitor's starting energy equal to the inductor's peak energy.
:::
:::

::: check
kind: choice

## An LC circuit rings at 10 kHz. You replace the capacitor with one of twice the capacitance. What does it ring at now?

- [ ] 20 kHz
- [ ] 5 kHz
- [x] About 7.1 kHz
- [ ] About 14 kHz

::: right
Right. $f_0 \propto 1/\sqrt{C}$, so doubling C divides the frequency by $\sqrt2$.
:::

::: misses
- [1] More capacitance lowers the frequency.
- [2] The frequency goes as $1/\sqrt{C}$, so doubling C divides it by $\sqrt2$, not 2.
- [4] More capacitance lowers the frequency, like more mass on a spring.
:::
:::

::: check
given: x0 = 3 | 4 | 6 | 8; v0 = 10 | 20 | 30; w = 2 | 5 | 10
answer: sqrt(x0^2 + (v0/w)^2)
unit: cm
tolerance: 0.5%

## A weight with $\omega_0$ = {w} rad/s starts at $x$ = {x0} cm, moving at {v0} cm/s. How far does it swing from the middle?

::: right
Right. $x = x_0\cos\omega_0t + (v_0/\omega_0)\sin\omega_0t$, and its amplitude is $\sqrt{x_0^2 + (v_0/\omega_0)^2}$ = {answer} cm.
:::

::: misses
- [x0] That's where it starts. It's also moving, so it swings farther.
- [x0 + v0/w] The two parts are a quarter cycle apart, so they add like perpendicular sides: use Pythagoras.
- [sqrt(x0^2 + v0^2)] Divide the velocity by $\omega_0$ first to turn it into a distance.
- [any] Not yet. Find A and B, then the amplitude $\sqrt{A^2 + B^2}$.
:::
:::

::: check
kind: parts
given: L = 1 | 10; C = 0.1 | 1; V = 5 | 10

## A {C} µF capacitor charged to {V} V is connected across a {L} mH inductor.

::: part
answer: 1/(2*pi*sqrt(L*1e-3*C*1e-6))/1000
unit: kHz
tolerance: 0.5%

### At what frequency does it ring?

::: misses
- [1/sqrt(L*1e-3*C*1e-6)/1000] That's $\omega_0$ in krad/s; divide by $2\pi$.
- [any] $f_0 = \frac{1}{2\pi\sqrt{LC}}$.
:::
:::

::: part
answer: V*sqrt(C*1e-6/(L*1e-3))*1000
unit: mA
tolerance: 0.5%

### What is the peak current?

::: misses
- [any] $\frac12CV^2 = \frac12LI^2$.
:::
:::
:::

::: check
kind: derivation
vars: m = 0.1..2, k = 10..200, A = 0.01..0.1

## A mass $m$ on a spring $k$ is released from rest at $x = A$.

::: step
answer: sqrt(k/m)

### What is $\omega_0$?
:::

::: step
answer: A*sqrt(k/m)

### What is the peak speed?
:::

::: right
Right. $A\omega_0$: all of the spring's energy $\frac12kA^2$ becomes kinetic energy at the center.
:::
:::

::: explain
## Where is the energy in an LC circuit at the moment its current is largest, and why does the circuit keep oscillating?

::: model
When the current is largest, the capacitor's voltage is passing through zero, so all the energy is in the inductor's magnetic field, $\tfrac12LI_0^2$. The inductor resists any change in current, so the current keeps flowing and charges the capacitor up the other way, moving the energy back into the electric field. With no resistance nothing is lost, so the energy swaps between the two fields indefinitely, the way a weight on a spring trades spring energy for motion.
:::
:::

::: practice

::: check
given: m = 0.1 | 0.2 | 0.5 | 1 | 2; k = 5..50 int
answer: 2*pi*sqrt(m/k)
unit: s
tolerance: 0.5%

## What is the period of a {m} kg weight on a {k} N/m spring?

::: misses
- [sqrt(m/k)] That's $1/\omega_0$. A full period is $2\pi$ times that.
- [2*pi*sqrt(k/m)] Upside down: heavier means slower.
- [any] $T = 2\pi\sqrt{m/k}$.
:::
:::

::: check
given: f = 1k..100k E12 Hz; L = 10µ..1m E6 H
answer: 1/((2*pi*f)^2*L)
unit: F
tolerance: 1%

## What capacitor makes an {L} inductor ring at {f}?

::: misses
- [1/(f^2*L)] Use $\omega_0 = 2\pi f$: $C = 1/(\omega_0^2 L)$.
- [1/((2*pi*f)*L)] Square $\omega_0$.
- [any] Solve $\omega_0 = 1/\sqrt{LC}$ for C.
:::
:::

::: check
given: C = 1µ..100µ E6 F; V = 5..50 int
answer: 0.5*C*V^2
unit: J
tolerance: 1%

## A {C} capacitor charged to {V} V starts an LC circuit ringing. How much energy sloshes back and forth?

::: misses
- [C*V^2] Don't forget the ½.
- [0.5*C*V] Square the voltage.
- [any] $E = \tfrac12CV^2$.
:::
:::

::: check
given: L = 1µ..1m E6 H; C = 1n..1µ E6 F
answer: sqrt(L/C)
unit: Ω
tolerance: 1%

## The ratio of peak voltage to peak current in an LC circuit is $\sqrt{L/C}$. What is it for {L} and {C}?

::: misses
- [sqrt(C/L)] Upside down: it's $\sqrt{L/C}$.
- [L/C] Take the square root.
- [any] $\sqrt{L/C}$.
:::
:::
:::
