# Exercise 1: pressure under the ground # P = density x g x depth, using 3300 kg/m3 (upper mantle rock). G = 9.81 DENSITY = 3300 def pressure_gpa(depth_km): return DENSITY * G * depth_km * 1000 / 1e9 for d in (10, 50, 100, 200, 400): print(f"{d:4d} km {pressure_gpa(d):6.2f} GPa") # Depth at which the pressure reaches 1 GPa: rearrange P = density * g * depth depth_1gpa = 1e9 / (DENSITY * G) / 1000 print(f"1 GPa is reached at {depth_1gpa:.1f} km") # Roughly 30 km of rock adds 1 GPa, so pressure climbs about 0.03 GPa per km.