question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :inside_a_drop_of_mercury do 4 kind :numerical 5 describes "A drop of mercury has a radius of %{radius} at room temperature. Surface tension of mercury at that " \ 6 "temperature (20 °C) is %{tension}. The atmospheric pressure is %{atmosphere}. %{pressure}, in pascals?" 7 given radius: "3.00 mm" 8 given tension: "4.65e-1 N/m" 9 given atmosphere: "1.01e5 Pa" 10 asks pressure: "What is the pressure inside the drop" 11 end
1 require_relative "../questions/inside_a_drop_of_mercury" 2 require_relative "../science/mechanical_properties_of_fluids/surface_tension" 3 4 solve :inside_a_drop_of_mercury , using: SurfaceTension do 5 objects :drop 6 7 take radius: drop . radius 8 take tension: S 9 take atmosphere: P_a 10 11 deduce_from "The atmospheric pressure is" , drop . pressure => P_a 12 13 pressure = drop . pressure_inside 14 answer pressure :, in: "Pa" , figures: 5 15 16 conclusion "The air outside presses on the drop, and the mercury's curved skin squeezes it a little " \ 17 "more; the smaller the drop, the harder that skin squeezes." 18 end
1 require_relative "../solutions/inside_a_drop_of_mercury" 2 3 play_with :inside_a_drop_of_mercury do 4 title "Inside a Drop of Mercury" 5 end