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.
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.