---
title: Solving circuits with Laplace
heading: Switching problems as algebra, initial conditions included
eyebrow: A10 · Lesson 21 · Solving circuits with Laplace
xp: 50
---

::: hook
A8 solved switching problems by writing a differential equation, guessing the form of the solution, and fitting the constants to the starting values. Laplace does all of that in one pass. Every capacitor and inductor becomes an impedance in $s$, the initial charge or current becomes a small extra source, and the whole circuit is solved like a resistor network. What's left is a fraction to break into pieces and look up in the table.

::: play
- A 5 V step drives a series RLC circuit (L = 10 mH, C = 10 µF). The scope shows the input and the capacitor's voltage.
- Change R. Find the value where the ringing just disappears; compare it with $2\sqrt{L/C}$.
- The lesson below finds this curve by hand with Laplace. Keep the sim open to check each step.
:::
:::

```sim circuit
V1 in 0 step 5      @ 0,0 down
R1 in a 20          @ 0,0 right
L1 a out 10m        @ 2,0 right
C1 out 0 10u        @ 4,0 down
slider: R1 1..200 log
scope: v(in), v(out)
time: 0..10m s
meter: v(out)
```

::: predict
## In the Laplace domain, a capacitor that starts charged to $v_0$ behaves like what?

- [ ] An impedance $1/(sC)$ on its own
- [x] An impedance $1/(sC)$ in series with a source $v_0/s$
- [ ] A short circuit
- [ ] A source $v_0$ on its own

::: reveal
An impedance $1/(sC)$ in series with a source $v_0/s$, which is the transform of a constant $v_0$ switched on at $t = 0$. It comes straight from $\mathcal{L}\{dv/dt\} = sV(s) - v(0)$: the starting charge appears as a step of voltage inside the capacitor. An inductor carrying $i_0$ works the same way: an impedance $sL$ in series with a source $Li_0$.
:::
:::

::: nameit
## The method

1. **Transform the circuit.** Resistors stay $R$. A capacitor becomes $\frac{1}{sC}$ with a series source $\frac{v_0}{s}$; an inductor becomes $sL$ with a series source $Li_0$. A step source $V$ becomes $\frac{V}{s}$.
2. **Solve it like a resistor circuit**: dividers, KVL, node equations, all with algebra in $s$.
3. **Break the answer into partial fractions**, simple terms that are in the table.
4. **Transform back** term by term.

**A worked example: RC charging.** A capacitor at $v_0$ is connected through R to a source $V_s$. In the $s$ domain, the loop current is $I = \dfrac{V_s/s - v_0/s}{R + 1/sC}$, and the capacitor's voltage is

$$V(s) = \frac{v_0}{s} + \frac{I}{sC} = \frac{v_0}{s} + \frac{V_s - v_0}{s(1 + sRC)}$$

Partial fractions split the second piece: $\dfrac{1}{s(1 + s\tau)} = \dfrac1s - \dfrac{1}{s + 1/\tau}$ with $\tau = RC$. Transforming back:

$$v(t) = v_0 + (V_s - v_0)\left(1 - e^{-t/\tau}\right) = V_s + (v_0 - V_s)e^{-t/\tau}$$

the same answer as A8, with no guessing.

**Partial fractions.** For distinct poles, $\dfrac{N(s)}{(s - p_1)(s - p_2)} = \dfrac{A}{s - p_1} + \dfrac{B}{s - p_2}$, and each coefficient comes from the **cover-up rule**: $A$ is the rest of the fraction evaluated at $s = p_1$. For example $\dfrac{1}{s(s + a)}$ has $A = \frac{1}{a}$ at $s = 0$ and $B = -\frac1a$ at $s = -a$. A complex pair is usually kept together and matched to the $e^{-at}\cos\omega t$ and $e^{-at}\sin\omega t$ entries.

**The sim's circuit.** For the series RLC with $v(0) = 0$ and $i(0) = 0$, the divider gives

$$V_C(s) = \frac{5}{s}\cdot\frac{1/sC}{R + sL + 1/sC} = \frac{5}{s}\cdot\frac{\omega_0^2}{s^2 + 2\zeta\omega_0s + \omega_0^2}$$

with $\omega_0 = 1/\sqrt{LC} = 3162$ rad/s and $\zeta = \frac R2\sqrt{C/L}$, the poles of A8 lesson 18.

**Shortcuts without transforming back.** If the response settles, the **final value theorem** gives where it ends up: $\lim_{t \to \infty} x(t) = \lim_{s \to 0} sX(s)$. The **initial value theorem** gives where it starts: $x(0^+) = \lim_{s \to \infty} sX(s)$. For the RLC, $sV_C(s) \to 5$ as $s \to 0$: it settles at 5 V, as the scope shows.
:::

::: example
## A 10 mH inductor, carrying no current, is switched onto 5 V through 50 Ω. Find $i(t)$.

::: solution
1. **Write the current in $s$.** The step is $5/s$ and the impedance is $50 + 0.01s$:
   $$\begin{aligned} I(s) &= \frac{5/s}{50 + 0.01s} \\ &= \frac{500}{s(s + 5000)} \\ &= \frac{0.1}{s} - \frac{0.1}{s + 5000} \end{aligned}$$
2. **Invert.**
   $$i = 0.1(1 - e^{-5000t})\ \text{A}$$
3. **Read it.** It rises to 100 mA with time constant $L/R = 0.2$ ms.

**Answer:** $i(t) = 0.1(1 - e^{-5000t})$ A, rising to 100 mA with a 0.2 ms time constant.
:::
:::

::: example
## A 1 µF capacitor at 10 V is connected through 1 kΩ to a 5 V source. What is its voltage after 1 ms?

::: solution
1. **Write the voltage in $s$.** With $\tau = RC = 1$ ms,
   $$V(s) = \frac{10}{s} + \frac{5 - 10}{s(1 + s\tau)}$$
2. **Transform back.**
   $$v = 5 + 5e^{-t/\tau}$$
3. **At 1 ms.**
   $$\begin{aligned} v &= 5 + 5e^{-1} \\ &= 6.84\ \text{V} \end{aligned}$$

**Answer:** 6.84 V after 1 ms.
:::
:::

::: example
## A 1 mA step drives a 10 kΩ resistor in parallel with 1 µF, starting from 0 V. What is the voltage after 10 ms?

::: solution
1. **Write the voltage in $s$.**
   $$\begin{aligned} V &= I(s)Z(s) \\ &= \frac{10^{-3}}{s} \cdot \frac{R}{1 + sRC} \end{aligned}$$
2. **Invert.**
   $$v = IR(1 - e^{-t/RC})$$
   with $IR$ = 10 V and $RC$ = 10 ms.
3. **After 10 ms.**
   $$\begin{aligned} v &= 10(1 - e^{-1}) \\ &= 6.32\ \text{V} \end{aligned}$$
4. **Where it settles.** The current source charges the capacitor until the resistor takes all of the current, at 10 V.

**Answer:** 6.32 V after 10 ms, on its way to 10 V.
:::
:::

::: check
given: K = 2..9 int; a = 2 | 4 | 5 | 10
answer: K/a
tolerance: 0.5%

## A response has $X(s) = \dfrac{\given{K}}{s(s + \given{a})}$. Where does it settle?

::: right
Right. Final value theorem: $sX(s) = \frac{\given{K}}{s + \given{a}} \to \frac{\given{K}}{\given{a}}$ as $s \to 0$: {answer}.
:::

::: misses
- [K] Take $sX(s)$ and let $s \to 0$: that leaves $\given{K}/\given{a}$.
- [0] There's a pole at $s = 0$ (a step), so it doesn't settle to zero.
- [any] Not yet. $\lim_{s \to 0} sX(s)$.
:::
:::

::: check
given: A = 2..9 int; B = 1..9 int; c = 2 | 3; d = 10 | 20
answer: A
tolerance: 0.5%

## A response has $X(s) = \dfrac{\given{A}s + \given{B}}{s^2 + \given{c}s + \given{d}}$. What is $x(0^+)$?

::: right
Right. Initial value theorem: $sX(s) \to \given{A}$ as $s \to \infty$, since the $s^2$ terms dominate.
:::

::: misses
- [B/d] That's $X(0)$. The initial value comes from $s \to \infty$.
- [0] Multiply by s first: $sX(s) = \frac{\given{A}s^2 + \given{B}s}{s^2 + \cdots}$.
- [any] Not yet. $x(0^+) = \lim_{s \to \infty} sX(s)$.
:::
:::

::: check
kind: parts
given: a = 2 | 4 | 5 | 8

## Split $\dfrac{1}{s(s + \given{a})}$ into $\dfrac{A}{s} + \dfrac{B}{s + \given{a}}$.

::: part
answer: 1/a
tolerance: 0.5%

### What is A?

::: misses
- [a] Cover up $s$ and set $s = 0$ in what's left: $1/(0 + \given{a})$.
- [-1/a] That's B.
- [any] Cover-up rule: evaluate $\frac{1}{s + \given{a}}$ at $s = 0$.
:::
:::

::: part
answer: -1/a
tolerance: 0.5%

### What is B?

::: misses
- [1/a] Evaluate $\frac1s$ at $s = -\given{a}$: it's negative.
- [any] Cover-up: evaluate $\frac1s$ at $s = -\given{a}$.
:::
:::

::: right
Right. So the inverse transform is $\frac{1}{\given{a}}\left(1 - e^{-\given{a}t}\right)$: a charging curve.
:::
:::

::: check
given: K = 2..9 int; a = 2 | 3 | 5; t = 0.1 | 0.2 | 0.5
answer: K*exp(-a*t)
tolerance: 0.5%

## What is $x(t)$ at $t$ = {t} s if $X(s) = \dfrac{\given{K}}{s + \given{a}}$?

::: right
Right. $x(t) = \given{K}e^{-\given{a}t}$ = {answer}.
:::

::: misses
- [K*exp(a*t)] The pole at $-\given{a}$ means a decaying exponential.
- [K/a] That's $X(0)$, the area under $x(t)$.
- [any] Not yet. $\mathcal{L}^{-1}\left\{\frac{K}{s + a}\right\} = Ke^{-at}$.
:::
:::

::: check
given: Vs = 5 | 10 | 12; v0 = 2 | 3 | 4; tau = 1 | 2; t = 0.5 | 1 | 2
answer: Vs + (v0 - Vs)*exp(-t/tau)
unit: V
tolerance: 0.5%

## A capacitor at {v0} V charges through R toward {Vs} V, with τ = {tau} ms. Using the Laplace result, what is its voltage at {t} ms?

::: right
Right. $V_s + (v_0 - V_s)e^{-t/\tau}$ = {answer}.
:::

::: misses
- [Vs*(1 - exp(-t/tau))] That ignores the starting voltage, the $v_0/s$ source.
- [v0 + Vs*(1 - exp(-t/tau))] The capacitor charges by $V_s - v_0$, not by $V_s$.
- [any] Not yet. $v(t) = V_s + (v_0 - V_s)e^{-t/\tau}$.
:::
:::

::: check
kind: parts
given: I = 1 | 2; R = 5 | 10; C = 1 | 2; t = 5 | 20

## A {I} mA step drives {R} kΩ in parallel with {C} µF, from 0 V.

::: part
answer: I*R
unit: V
tolerance: 0.5%

### What does the voltage settle to?

::: misses
- [any] All the current ends up in the resistor.
:::
:::

::: part
answer: I*R*(1 - exp(-t/(R*C)))
unit: V
tolerance: 0.5%

### What is the voltage at {t} ms?

::: misses
- [any] $IR(1 - e^{-t/RC})$, with $RC$ in ms.
:::
:::
:::

::: check
kind: derivation
vars: V = 1..10, R = 10..100, L = 1..50, t = 0..5

## A switch connects $V$ through $R$ to an inductor $L$ (mH) at rest; $t$ in ms.

::: step
answer: V/R*(1 - exp(-R*t/L))

### $I(s) = \frac{V}{s(R + sL)}$. What is $i(t)$?
:::

::: step
answer: L/R

### What is the time constant, in ms?
:::

::: right
Right. The current rises toward $V/R$ with $\tau = L/R$.
:::
:::

::: explain
## Why do initial conditions appear as extra sources when a circuit is transformed to the s domain?

::: model
The Laplace transform of a derivative is $sX(s) - x(0)$, so the starting value is built into the transform of every capacitor's and inductor's equation. For a capacitor, $i = C\,dv/dt$ becomes $I = sCV - Cv_0$, which rearranges to $V = I/(sC) + v_0/s$: an impedance in series with a step source $v_0/s$. The same happens for an inductor with its starting current. Drawing those terms as sources lets you solve the transformed circuit with ordinary circuit rules.
:::
:::

::: practice

::: check
given: A = 2..9 int; a = 2..9 int
answer: A/a
tolerance: 0.5%

## A circuit's output is $\dfrac{\given{A}}{s(s + \given{a})}$. Where does it settle?

::: misses
- [A] Multiply by s, then let $s \to 0$.
- [any] Final value: $\lim_{s \to 0} sX(s)$.
:::
:::

::: check
given: V = 2..12 int; t = 2..5 int
answer: V
unit: V
tolerance: 0.5%

## What is $\mathcal{L}^{-1}\{\given{V}/s\}$ at $t$ = {t} s?

::: misses
- [V*t] $1/s$ is a step; $1/s^2$ would be a ramp.
- [any] $\mathcal{L}\{1\} = 1/s$.
:::
:::

::: check
given: L = 1m..100m E6 H; f = 100 | 1000
answer: 2*pi*f*L
unit: Ω
tolerance: 1%

## An inductor's s-domain impedance is $sL$. With {L} and $s = j2\pi f$ at {f} Hz, how big is it?

::: misses
- [f*L] $s = j2\pi f$, so the size is $2\pi fL$.
- [any] $|sL| = \omega L$.
:::
:::
:::
