question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_bottom_of_the_ocean do 4 kind :numerical 5 describes "The average depth of the Indian Ocean is about %{depth}. Given that the bulk modulus of water is " \ 6 "%{modulus} and taking g as %{gravity} and the density of water as %{density}, %{compression}?" 7 given depth: "3000 m" 8 given modulus: "2.2e9 N/m2" 9 given gravity: "10 m/s2" 10 given density: "1000 kg/m3" 11 asks compression: "what is the fractional compression, ΔV/V, of water at the bottom of the ocean" 12 end
1 require_relative "../questions/the_bottom_of_the_ocean" 2 require_relative "../science/mechanical_properties_of_solids/bulk_modulus" 3 4 solve :the_bottom_of_the_ocean , using: BulkModulus do 5 objects :bottom_water 6 7 take depth: bottom_water . depth 8 take modulus: bottom_water . bulk_modulus 9 take gravity: g 10 take density: rho 11 12 compression = bottom_water . fractional_compression 13 answer compression :, figures: 3 14 15 conclusion "Three kilometres of water press hard, but water is hard to squeeze: the pressure over the " \ 16 "bulk modulus is barely more than a percent." 17 end
1 require_relative "../solutions/the_bottom_of_the_ocean" 2 3 play_with :the_bottom_of_the_ocean do 4 title "The Bottom of the Ocean" 5 end