# Exercise 2: ash thickness with distance, and lahar arrival times def ash_mm(distance_km, thickness_at_10=50, half_distance=10): """Ash halves every half_distance km beyond 10 km (invented model).""" return thickness_at_10 * 0.5 ** ((distance_km - 10) / half_distance) def lahar_minutes(distance_km, speed_kmh=40): return distance_km / speed_kmh * 60 for d in (10, 20, 30, 50): print(f"{d:3d} km: {ash_mm(d):6.1f} mm") for d in (5, 15, 30): print(f"lahar reaches {d:2d} km in {lahar_minutes(d):4.0f} min") # 10 km: 50.0 mm # 20 km: 25.0 mm # 30 km: 12.5 mm # 50 km: 3.1 mm # lahar reaches 5 km in 8 min # lahar reaches 15 km in 22 min # lahar reaches 30 km in 45 min # Even 12 mm of wet ash can disrupt roads, water and power. The lahar times are short: the first village # gets minutes, not hours, so valley evacuation has to happen before the eruption, on the basis of the alert level. # Real ash fall depends on wind direction, which this model ignores.