Back

Green's Function: Building a Solution from Tent Responses

A Green's-function playground for the 1D problem -u'' = f on [0, 1] with the ends pinned at zero. The response to a single point spike is the tent G(x, x'): zero at both walls, peaked at the spike, with a unit downward kink there. Because the equation is linear, the response to any source is the superposition of tents weighted by the source value, u = integral G f. The top panel is the draggable tent and the faint stack of weighted tents that build u; the middle panel shows the source and the solution it produces (each on its own scale, since the solution is usually far smaller); the bottom panel shows that the recovered u really does satisfy -u'' = f and lists the defining facts. The Green function is symmetric, vanishes at both pinned ends, has a unit downward slope kink at the source point, and the weighted superposition of tents reproduces the exact solution and the analytic sine series.

Figure 1. To solve -u'' = f you can first solve it for a single spike at one point x'. That answer is the Green's function, a tent that is zero at both walls and has a kink where the spike sits. Any source is just a pile of spikes, so the full solution is the same pile of tents, each scaled by how strong the source is there: u(x) = integral G(x, x') f(x') dx'. Method: closed-form tent Green's function, trapezoidal superposition, shared tridiagonal reference solve; Canvas2D, deterministic.
source f(x)
source parameter2
tent position x'0.50

WHAT TO TRY

  • Click anywhere on the source plot (middle panel) to drop a point source: its Green tent appears instantly in the solution. Right-click drops a negative source; shift-click clears them.
  • Drag the x' slider: the gold tent slides along, always pinned to zero at both walls with its kink at the source point. That single tent is the response to a unit impulse there.
  • Switch the source shape and watch the solution: it is the weighted superposition of all the tents, and the green dashed direct-solve curve lands on top of it.
  • Read the residual panel: max | -u'' - f | sits at machine zero for the smooth sources, the proof that the Green superposition really solves the equation.