---
title: First-order PDEs and characteristics
heading: Equations that carry values along lines, and how to solve them with ODEs
eyebrow: A12 · Lesson 29 · Characteristics
xp: 40
---

::: hook
Some equations don't spread or smooth anything: they just carry values along. A pulse of injected electrons drifting in a field, a voltage wave on a lossless line and a dye blob in a steady flow all obey equations of the form $u_t + cu_x = 0$. The value of u stays constant on lines $x - ct$ = constant, called **characteristics**, so the whole PDE collapses to an ODE along each line. The same idea splits the wave equation into two waves running in opposite directions, explains why a charged cable discharges as a rectangular pulse, and shows how a wave whose speed depends on its own height breaks into a shock.
:::

::: play
- A bump starts at x = 0 and is carried at speed c while it decays at rate k: $u = e^{-(x - ct)^2}e^{-kt}$. Press Play.
- With k = 0, the bump slides along unchanged: the characteristics are straight lines $x = ct + x_0$.
- Raise k: the bump still moves at c but shrinks as it goes. That's injected carriers drifting while they recombine. The readout gives the distance it travels while falling by a factor e.
:::

```sim plot
view: graph
x: x = -2..12
y: u = 0..1.1
time: tt
slider: c = 0.5..3 step 0.1 = 1.5
slider: k = 0..1 step 0.05 = 0.2
plot: exp(-(x - c*(tt - 6*floor(tt/6)))^2)*exp(-k*(tt - 6*floor(tt/6))) | label: u at the current time | samples: 500
plot: exp(-x^2) | label: start | dashed
readout: distance to fall by a factor e = c/(k + 1e-9) | digits: 3
```

::: predict
## The equation $u_t + 2u_x = 0$ starts from $u(x, 0) = e^{-x^2}$. What is u at x = 3, t = 1?

- [ ] $e^{-9}$
- [x] $e^{-1}$
- [ ] $e^{-5}$
- [ ] 1

::: reveal
$e^{-1} = 0.368$. The solution is $u = e^{-(x - 2t)^2}$: the starting shape moved two units to the right in one unit of time. At x = 3 you see the value that started at $x = 3 - 2 = 1$.
:::
:::

::: nameit
## Transport

For $u_t + cu_x = 0$, look along the lines $x = x_0 + ct$. On such a line, $\frac{d}{dt}u(x_0 + ct, t) = u_t + cu_x = 0$, so u keeps its starting value: $u(x, t) = f(x - ct)$. Those lines are the **characteristics**.

## Sources and decay

With a right-hand side, the equation becomes an ODE along each characteristic. For $u_t + cu_x = -ku$, $\frac{du}{dt} = -ku$ along the line, so $u = f(x - ct)e^{-kt}$. Electrons drifting at $v = \mu E$ with lifetime τ travel a **drift length** $\mu E\tau$ while falling by a factor e.

## Variable speed

For $u_t + c(x)u_x = 0$, solve $\frac{dx}{dt} = c(x)$ for the characteristics; u is still constant along each one. For $c = ax$ they are $x = x_0e^{at}$, so $u = f(xe^{-at})$.

## Boundary conditions

Information travels along characteristics, so a boundary needs data only where characteristics enter the domain. For $c > 0$ on $0 < x < L$ you give u at x = 0 and nothing at x = L.

## The wave equation as two transports

$u_{tt} - c^2u_{xx} = (\partial_t - c\partial_x)(\partial_t + c\partial_x)u = 0$, so the wave equation is two transports in opposite directions. On a lossless line, $V + Z_0I$ is carried forward at v and $V - Z_0I$ backward at −v. Each forward wave has $V = Z_0I$, and each backward wave has $V = -Z_0I$.

## Breaking

In $u_t + uu_x = 0$ the speed is u itself, so taller parts move faster and characteristics can cross. When they do, the solution develops a vertical front, a **shock**. For a starting profile f, the first crossing happens at $t^* = -\frac{1}{\min f'}$.
:::

::: example
## Electrons injected at one spot in silicon ($\mu$ = 0.135 m²/(V·s)) drift in a field of 1000 V/m and recombine with lifetime τ = 1 µs. Ignoring diffusion, what fraction survives a 1 mm trip?

::: solution
1. **The equation along the drift.** The electron density obeys
   $$n_t + vn_x = -\frac{n}{\tau}$$
   with $v = \mu E = 135$ m/s.
2. **Time for the trip.** Along a characteristic, $n$ falls as $e^{-t/\tau}$, and reaching x = 1 mm takes
   $$\begin{aligned} t &= \frac{10^{-3}}{135}\ \text{s} \\ &= 7.4\ \mu\text{s} \end{aligned}$$
3. **The surviving fraction.**
   $$e^{-7.4} = 6 \times 10^{-4}$$
4. **Another view.** The drift length is $\mu E\tau = 135$ µm, and 1 mm is 7.4 drift lengths.
5. **In the lab.** The Haynes–Shockley experiment uses exactly this, with diffusion added, to measure mobility and lifetime.

**Answer:** about $6 \times 10^{-4}$ of the electrons survive the 1 mm trip.
:::
:::

::: example
## A 10 m length of 50 Ω cable (signal speed $2 \times 10^8$ m/s) is charged to 10 kV with its far end open, then its near end is switched onto a 50 Ω load. What pulse does the load see?

::: solution
1. **Split into two waves.** At the moment of switching the cable has V = 10 kV and I = 0 everywhere, so the forward and backward waves are each
   $$\frac{V \pm Z_0I}{2} = 5\ \text{kV}$$
2. **The forward half.** It flows into the matched load at once: 5 kV across 50 Ω, 100 A.
3. **The backward half.** It travels to the open end, reflects with the same sign and follows the forward half out.
4. **The pulse length.** The load sees a flat 5 kV pulse lasting
   $$\frac{2 \times 10}{2 \times 10^8}\ \text{s} = 100\ \text{ns}$$
   and then nothing.
5. **What it's for.** This is a **pulse-forming line**, used to make clean high-voltage pulses for radar modulators and lasers: the pulse length is set by the cable length alone.

**Answer:** a flat 5 kV pulse (100 A into the 50 Ω load) lasting 100 ns.
:::
:::

::: example
## Solve $u_t + uu_x = 0$ with $u(x, 0) = -\tanh x$. When does it break?

::: solution
1. **The characteristics.** Each point starts at speed $f(x_0) = -\tanh x_0$ and keeps it:
   $$x = x_0 - t\tanh x_0$$
   Points on the left move right and points on the right move left, so they converge on the origin.
2. **When neighbors meet.** Two neighboring characteristics meet when $\partial x/\partial x_0$ is zero:
   $$1 - t\,\text{sech}^2x_0 = 0$$
3. **The first meeting.** That happens first where $\text{sech}^2x_0$ is largest, at $x_0 = 0$, at time $t^* = 1$.
4. **Check.** That matches $t^* = -\frac{1}{\min f'}$ with $\min f' = -1$.
5. **After the break.** The formula would give u three values at one x, so the physical solution has a shock instead.

**Answer:** the solution follows $x = x_0 - t\tanh x_0$, and it breaks at $t^* = 1$, at the origin.
:::
:::

::: check
given: c = 1 | 2; x = 1 | 3; t = 0.5 | 1
answer: exp(-(x - c*t)^2)
tolerance: 0.5%

## $u_t + \given{c}u_x = 0$ with $u(x, 0) = e^{-x^2}$. What is u at x = {x}, t = {t}?

::: right
Right. $u = e^{-(x - ct)^2}$: you see the value that started at $x - ct$.
:::

::: misses
- [exp(-(x + c*t)^2)] With c > 0 the shape moves right, so look back to $x - ct$.
- [any] u is constant along $x - ct$.
:::
:::

::: check
given: mu = 0.135 | 0.048; E = 500 | 2000; tau = 2 | 10
answer: mu*E*tau
unit: µm
tolerance: 0.5%

## Carriers with mobility {mu} m²/(V·s) drift in {E} V/m and recombine with lifetime {tau} µs. What is their drift length?

::: right
Right. $\mu E\tau$: the distance covered in one lifetime.
:::

::: misses
- [mu*E] That's the drift speed in m/s; multiply by the lifetime.
- [any] Speed times lifetime.
:::
:::

::: check
given: a = 0.5 | 1; x = 2 | 3; t = 1 | 2
answer: (x*exp(-a*t))^2
tolerance: 0.5%

## $u_t + \given{a}xu_x = 0$ with $u(x, 0) = x^2$. What is u at x = {x}, t = {t}?

::: right
Right. The characteristics are $x = x_0e^{at}$, so $u = (xe^{-at})^2$.
:::

::: misses
- [(x*exp(a*t))^2] Trace back to where the characteristic started: $x_0 = xe^{-at}$.
- [any] Solve $\frac{dx}{dt} = ax$.
:::
:::

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

## A {L} m cable (signal speed 2 × 10⁸ m/s), charged to {V} kV with its far end open, is switched into a matched load.

::: part
answer: 10*L
unit: ns
tolerance: 0.5%

### How long is the pulse?

::: misses
- [5*L] The backward half travels to the open end and back.
- [any] $2L/v$.
:::
:::

::: part
answer: V/2
unit: kV
tolerance: 0.5%

### What is its voltage?

::: misses
- [V] Half the charge goes each way, so each wave carries half the voltage.
- [any] $\frac{V + Z_0I}{2}$ with I = 0.
:::
:::
:::

::: check
given: V = 10 | 20; I = 0.1 | -0.1
answer: (V + 50*I)/2
unit: V
tolerance: 0.5%

## At one moment, a section of 50 Ω lossless line has V = {V} V and I = {I} A. What is the voltage of the forward-traveling part?

::: right
Right. $V^+ = \frac{V + Z_0I}{2}$; the rest, $\frac{V - Z_0I}{2}$, travels backward.
:::

::: misses
- [V/2] That ignores the current.
- [(V - 50*I)/2] That's the backward wave.
- [any] $\frac{V + Z_0I}{2}$.
:::
:::

::: check
given: a = 2 | 4; L = 1 | 3
answer: L/a
unit: s
tolerance: 0.5%

## $u_t + uu_x = 0$ starts from $u = -\given{a}\tanh(x/\given{L})$. When does it break?

::: right
Right. $\min f' = -a/L$ at the origin, so $t^* = L/a$.
:::

::: misses
- [a/L] Breaking time is $-1/\min f'$.
- [any] $f' = -\frac aL\text{sech}^2\frac xL$.
:::
:::

::: check
kind: choice

## $u_t + cu_x = 0$ with c > 0 holds on $0 < x < L$. Where must you specify boundary values?

- [x] At x = 0 only
- [ ] At x = L only
- [ ] At both ends
- [ ] Nowhere: the starting values are enough

::: right
Right. Characteristics enter at x = 0 and leave at x = L, so only the entry needs data.
:::

::: misses
- [2] Characteristics leave through x = L, carrying values out; nothing can be imposed there.
- [3] Data at x = L would conflict with what arrives along the characteristics.
- [4] Values entering at x = 0 after t = 0 come from outside the starting data.
:::
:::

::: check
kind: derivation
vars: c = 0.5..3, k = 0.1..2, x = -3..3, t = 0..2

## $u_t + cu_x = -ku$ with $u(x, 0) = \sin x$.

::: step
answer: sin(x - c*t)*exp(-k*t)

### What is u(x, t)?
:::

::: step
answer: ln(2)/k

### When has each crest fallen to half its height?
:::

::: right
Right. The crests move at c and shrink by $e^{-kt}$, so they halve after $\frac{\ln 2}{k}$ wherever they are.
:::
:::

::: check
kind: python

## For $u_t + uu_x = 0$, the first shock forms at $t^* = -1/\min f'$. Write `breaking_time(f, x)` using `np.gradient` on a grid x. On `np.linspace(-5, 5, 200001)`, set `t1` for $f = -\tanh x$ and `t2` for $f = e^{-x^2}$.

```python starter
import numpy as np

def breaking_time(f, x):
    return 0.0

x = np.linspace(-5, 5, 200001)
t1 = breaking_time(lambda x: -np.tanh(x), x)
t2 = breaking_time(lambda x: np.exp(-x**2), x)
print(t1, t2)
```

```python solution
import numpy as np

def breaking_time(f, x):
    return -1 / np.min(np.gradient(f(x), x))

x = np.linspace(-5, 5, 200001)
t1 = breaking_time(lambda x: -np.tanh(x), x)
t2 = breaking_time(lambda x: np.exp(-x**2), x)
print(t1, t2)
```

```python tests
import math
assert abs(t1 - 1) < 1e-6, f"min f' = -1 for -tanh, so t* = 1; got {t1}."
assert abs(t2 - math.exp(0.5) / math.sqrt(2)) < 1e-6, f"The Gaussian's steepest descent is -sqrt(2/e), so t* = 1.1658; got {t2}."
```

::: right
Right. 1 and 1.1658: the Gaussian's back side, where it slopes down most steeply, is where it breaks.
:::
:::

::: explain
## Why does a charged, open-ended cable discharge into a matched load as a flat pulse lasting twice its travel time?

::: model
At the switching moment the cable has a uniform voltage and no current. On a lossless line any state splits into a forward wave carrying $\frac{V + Z_0I}{2}$ and a backward wave carrying $\frac{V - Z_0I}{2}$, so each carries half the voltage. The forward half pours into the matched load and lasts as long as it takes the whole forward wave to leave, one travel time. The backward half runs to the open end, reflects without changing sign and follows, arriving after it as a second travel time's worth of the same voltage. The two halves join into one flat pulse at half the charging voltage, twice the travel time long, and nothing reflects from the matched load, so the cable is then empty.
:::
:::

::: practice

::: check
given: c = 3 | 0.5; x = 2 | 4; t = 1 | 2
answer: exp(-(x - c*t)^2)
tolerance: 0.5%

## $u_t + \given{c}u_x = 0$, $u_0 = e^{-x^2}$: u at x = {x}, t = {t}?

::: misses
- [any] $e^{-(x - ct)^2}$.
:::
:::

::: check
given: mu = 0.05 | 0.14; E = 100 | 1000; tau = 2 | 5
answer: mu*E*tau
unit: µm
tolerance: 0.5%

## Drift length for μ = {mu} m²/(V·s), E = {E} V/m, τ = {tau} µs?

::: misses
- [any] $\mu E\tau$.
:::
:::

::: check
given: L = 1 | 2 | 5 | 10 | 15 | 30
answer: 10*L
unit: ns
tolerance: 0.5%

## Pulse length from a {L} m pulse-forming line, v = 2 × 10⁸ m/s?

::: misses
- [any] $2L/v$.
:::
:::
:::
