NapkinCalc

Differential Equations

The king: y′ = −k·y

"It shrinks in proportion to how much is left." Radioactive decay, RC discharge, drug elimination — same equation, same solution: y(t) = y₀·e^(−kt). Don't take the solution on faith — differentiate it numerically and check it really obeys the equation:

kd=0.3k_{d} = 0.3 decay rate
yd(t)=50exp(0.3t)y_{d}\left(t\right) = 50 \cdot \mathrm{exp}\left(-0.3 \cdot t\right) the claimed solution, y₀ = 50
h:=1e7h := 1e-7 tiny step for the numeric derivative
slope2:=(yd(2+h)yd(2))/hslope_{2} := (y_{d}(2 + h) - y_{d}(2)) / h = 8.2322-8.2322 y′ at t = 2, measured
✓ pass abs(slope2+kdyd(2))<0.001\mathrm{abs}\left(slope_{2} + k_{d} \cdot \mathrm{y_{d}}\left(2\right)\right) < 0.001 measured y′ equals −k·y — it obeys the equation
y_d(x)
1020304050051015

exponential decay — equal times, equal FRACTIONS lost