Why do streams respond so quickly when storm flow is so old?
Explain why streams react within hours of rain although storm runoff is largely old water, and how long water takes to cross catchments.

| 1 | """The old-water paradox on one hillslope, as a schematic (the README gives no profile to draw from). |
| 2 | |
| 3 | Rain (this storm's new water, sand) falls on the slope and has only wetted the top of the soil; the stream at the |
| 4 | foot has already risen, and what fills it comes mostly from the saturated zone above the bedrock (old water, the |
| 5 | field colour), pushed out along the flow lines. README.md: streams rise within minutes to hours of heavy rain, while |
| 6 | much of the storm runoff is old water and typical mean transit times are years to decades. |
| 7 | """ |
| 8 | import math |
| 9 | from pathlib import Path |
| 10 | |
| 11 | import kit |
| 12 | |
| 13 | X0, XS, X1 = 14, 470, 626 # top of the slope, the stream's left bank, the end of the floodplain |
| 14 | CH = 64 # channel width |
| 15 | smooth = lambda u: u * u * (3 - 2 * u) |
| 16 | |
| 17 | |
| 18 | def surface(x): |
| 19 | if x <= XS: |
| 20 | return 58 + 132 * smooth((x - X0) / (XS - X0)) |
| 21 | if x >= XS + CH: |
| 22 | return 190 - 3 * (x - XS - CH) / (X1 - XS - CH) |
| 23 | return 190 + 26 * math.sin(math.pi * (x - XS) / CH) # the channel |
| 24 | |
| 25 | |
| 26 | def bedrock(x): |
| 27 | u = min(1, (x - X0) / (XS - X0)) |
| 28 | return 164 + 132 * smooth(u) - 50 * u + (x - XS) * 0.02 * (x > XS) |
| 29 | |
| 30 | |
| 31 | def table(x): |
| 32 | """The water table: halfway down the soil upslope, meeting the surface at the stream.""" |
| 33 | u = min(1, (x - X0) / (XS - X0)) |
| 34 | return surface(x) + 58 * (1 - u) ** 1.3 |
| 35 | |
| 36 | |
| 37 | xs = [X0 + k * 2 for k in range((X1 - X0) // 2 + 1)] |
| 38 | ground = [(x, surface(x)) for x in xs] |
| 39 | sat = [(x, table(x) if x <= XS else min(surface(x), 200) if x < XS + CH else surface(x)) for x in xs] |
| 40 | body = [kit.polygon(sat + [(x, bedrock(x)) for x in reversed(xs)], 'f-soft')] # stored old water |
| 41 | body.append(kit.polyline([(x, bedrock(x)) for x in xs], 'faint-s', 2.5)) |
| 42 | body.append(kit.polyline([(x, y) for x, y in sat if x <= XS], 'f-s', 2)) |
| 43 | |
| 44 | # flow lines through the saturated zone, rising into the stream bed |
| 45 | bed = (XS + CH / 2, surface(XS + CH / 2) - 5) |
| 46 | for f in (0.3, 0.68): |
| 47 | pts = [] |
| 48 | for x in range(36, int(bed[0]) + 1, 4): |
| 49 | y = table(min(x, XS)) + f * (bedrock(x) - table(min(x, XS))) |
| 50 | w = smooth(max(0, min(1, (x - (bed[0] - 190)) / 190))) |
| 51 | pts.append((x, y * (1 - w) + bed[1] * w)) |
| 52 | pts = pts[:-4] |
| 53 | body.append(kit.polyline(pts, 'f-s', 3)) |
| 54 | (ax, ay), (bx, by) = pts[-2], pts[-1] |
| 55 | L = math.hypot(bx - ax, by - ay) |
| 56 | ux, uy = (bx - ax) / L, (by - ay) / L |
| 57 | body.append(kit.polygon([(bx + ux * 11, by + uy * 11), (bx - uy * 6.5, by + ux * 6.5), (bx + uy * 6.5, by - ux * 6.5)], 'f')) |
| 58 | |
| 59 | # the stream, filled mostly with old water |
| 60 | water = [(x, max(surface(x), 196)) for x in range(XS, XS + CH + 1, 2)] |
| 61 | body.append(kit.polygon(water, 'f')) |
| 62 | # this storm's water: rain above the slope, and a shallow wetting front just under the surface |
| 63 | for k in range(26): |
| 64 | x = 34 + k * 17.5 + (k % 3) * 4 |
| 65 | top = 12 + (k * 37) % 30 |
| 66 | if top + 16 < surface(x) - 10: |
| 67 | body.append(kit.line(x, top, x - 5, top + 16, 'sand-s', 3)) |
| 68 | body.append(kit.polyline([(x, surface(x) + 11) for x in xs if table(x) - surface(x) > 20], 'sand-s', 4, ' stroke-dasharray="2 8"')) |
| 69 | body.append(kit.polyline(ground, 'ink-s', 3)) |
| 70 | kit.write(__file__, 'earth-environment', ''.join(body), label='rain in, years-old water out in hours · schematic', |
| 71 | title='A hillslope in a storm: new rain wets only the topsoil while the stream fills with old groundwater') |