# Exercise 3: caldera width from erupted volume and collapse depth import math def caldera_diameter(volume_km3, depth_km): return 2 * math.sqrt(volume_km3 / (math.pi * depth_km)) for depth in (0.5, 1.0, 2.0): print(f"collapse depth {depth} km: 50 km3 -> {caldera_diameter(50, depth):5.1f} km wide") # volume needed for a 20 km wide caldera with 1 km of collapse r = 10 print(f"20 km caldera, 1 km collapse needs {math.pi * r**2 * 1.0:.0f} km3") # collapse depth 0.5 km: 50 km3 -> 11.3 km wide # collapse depth 1.0 km: 50 km3 -> 8.0 km wide # collapse depth 2.0 km: 50 km3 -> 5.6 km wide # 20 km caldera, 1 km collapse needs 314 km3 # Deeper collapse means a narrower caldera for the same volume (width goes as 1/sqrt(depth)). # A 20 km caldera needs hundreds of km3, which is supereruption territory.