Advertisement
Guest User

Earth's water

a guest
Oct 25th, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.45 KB | None | 0 0
  1. from math import pi
  2.  
  3. # source: https://www.google.com/search?q=volume+of+the+earth+in+cubic+miles
  4. volume_earth = 259875159532 # cubic miles
  5.  
  6. # source: https://www.usgs.gov/media/images/all-earths-water-a-single-sphere
  7. volume_water = 332500000 # cubic miles
  8.  
  9. water_ratio = volume_water/volume_earth # ratio of water volume to earth as a whole
  10.  
  11. # Formulas to convert between volume and radius of a sphere
  12. sphere_volume = lambda radius: (4/3) * pi * radius**3
  13. sphere_radius = lambda volume: (volume / ((4/3)*pi))**(1/3)
  14.  
  15. print(f"Earth radius: {sphere_radius(volume_earth):.2f} mi^3.")
  16. print(f"Earth's water radius: {sphere_radius(volume_water):.2f} mi^3.")
  17. print(f"Water accounts for {water_ratio:.5f}% of Earth's volume.")
  18.  
  19. radius_globe = 6 # inches
  20. volume_globe = sphere_volume(radius_globe) # cubic inches
  21. volume_globe_h20 = volume_globe * water_ratio # cubic inches
  22. in3_to_tsp_factor = 3.32468  # conversion from in^3 to teaspoons
  23. volume_globe_h20_tsp = volume_globe_h20 * in3_to_tsp_factor # tsp
  24.  
  25. print(f"Classroom globe-sized model of Earth requires {volume_globe_h20:.2f} in^3 ({volume_globe_h20_tsp:.2f} tsp) of water.")
  26.  
  27. depth_globe_h20 = sphere_radius(volume_globe + volume_globe_h20) - radius_globe # inches
  28. in_to_um_factor = 25400 # conversion from in to micrometer
  29. depth_globe_h20_um = depth_globe_h20 * in_to_um_factor # um
  30. print(f"A spherical shell of that water around a classroom globe would be {depth_globe_h20_um:.2f} microns thick.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement