On a grid $x_i = i\Delta x$, $t_n = n\Delta t$, write $u_i^{n} \approx u(x_i, t_n)$. The explicit scheme is $$u_i^{n+1} = u_i^{n} + r\left(u_{i+1}^{n} - 2u_i^{n} + u_{i-1}^{n}\right),\qquad r = \frac{k\Delta t}{\Delta x^{2}},$$ with the end values given by the boundary conditions.
🔑 Idea clave
The explicit scheme is stable only when $r \le \frac{1}{2}$, that is, $\Delta t \le \frac{\Delta x^{2}}{2k}$. Refining the space grid by a factor of 2 forces 4 times as many time steps.
💡 Por qué funciona
Two views. First, rewrite the update as $u_i^{n+1} = ru_{i-1}^{n} + (1 - 2r)u_i^{n} + ru_{i+1}^{n}$. When $r \le \frac{1}{2}$ all three weights are nonnegative and add to 1, so each new value is an average of old ones and nothing can grow. Second, try the sawtooth $u_i = (-1)^{i}$: then $u_{i+1} - 2u_i + u_{i-1} = -4u_i$, so the sawtooth is multiplied by $1 - 4r$ each step. $|1 - 4r| \le 1$ exactly when $r \le \frac{1}{2}$; otherwise it grows and flips sign every step. (In method-of-lines terms, the fastest mode is $y' = \lambda y$ with $\lambda \approx -\frac{4k}{\Delta x^{2}}$, and Euler needs $\Delta t|\lambda| \le 2$.)
The explicit heat scheme on a rod with its ends held at 0. Below r = 1/2 the bump spreads smoothly; above it, a tiny sawtooth (like round-off) grows until it swamps the solution.
✏️ Ejemplo resuelto: One step
With $r = \frac{1}{4}$, the current row (ends held at 0) is $u = (0, 1, 2, 1, 0)$. Find the next row.
$u_1 = 1 + \frac{1}{4}(2 - 2 + 0) = 1$.
$u_2 = 2 + \frac{1}{4}(1 - 4 + 1) = 1.5$.
$u_3 = 1$ by symmetry. The peak drops and the heat spreads.
Respuesta: $(0, 1, 1.5, 1, 0)$
✏️ Ejemplo resuelto: The cost of refining
For $k = 1$ and $\Delta x = 0.1$, find the largest stable $\Delta t$. What happens if $\Delta x$ is halved?
$\Delta t \le \frac{(0.1)^{2}}{2} = 0.005$.
With $\Delta x = 0.05$: $\Delta t \le \frac{0.0025}{2} = 0.00125$, 4 times smaller.
Twice the grid points and 4 times the steps: 8 times the work to reach the same final time. In two space dimensions the same refinement costs 16 times as much.
Respuesta: $0.005$, then $0.00125$
✏️ Ejemplo resuelto: How fast instability wins
With $r = 0.6$, a sawtooth of size $10^{-16}$ (round-off) is present. How big is it after 100 steps?
Each step multiplies it by $|1 - 4(0.6)| = 1.4$.
$1.4^{100} \approx 4 \times 10^{14}$, so it reaches about $4 \times 10^{14} \times 10^{-16} = 0.04$, and a few dozen steps later it dominates the solution.
Respuesta: about $0.04$
⚠️ Error común
Refining the space grid without shrinking the time step. Halving $\Delta x$ quadruples $r$, which can push a stable computation past $r = \frac{1}{2}$. Always recompute $r = \frac{k\Delta t}{\Delta x^{2}}$ after changing either step. (Implicit schemes, such as backward Euler or Crank–Nicolson in time, remove this limit.)
Práctica
Apruebas con 3 respuestas correctas, las 2 últimas seguidas. Cada respuesta correcta da 3 XP.
Este es uno de los peldaños más altos de Análisis Numérico.
Fuentes y lecturas
Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation (University of Delaware, free online edition): chapter "Diffusion equations", sections "The method of lines" and "Method of lines for parabolic PDEs"
MIT OpenCourseWare 18.330, Introduction to Numerical Analysis: lecture notes on finite differences for the heat equation