question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :an_air_bubble_in_soap_solution do 4 kind :numerical 5 describes "An air bubble of radius %{radius} is formed at depth of %{depth} inside a container containing soap " \ 6 "solution (of relative density 1.20). The surface tension of soap solution at the temperature (20 °C) " \ 7 "is %{tension}. Taking 1 atmospheric pressure as %{atmosphere} and g as %{gravity}, %{pressure}, in " \ 8 "pascals?" 9 given radius: "5.00 mm" 10 given depth: "40.0 cm" 11 given tension: "2.50e-2 N/m" 12 given atmosphere: "1.01e5 Pa" 13 given gravity: "9.8 m/s2" 14 asks pressure: "what would be the pressure inside the bubble" 15 end
1 require_relative "../questions/an_air_bubble_in_soap_solution" 2 require_relative "../science/mechanical_properties_of_fluids/surface_tension" 3 4 solve :an_air_bubble_in_soap_solution , using: SurfaceTension do 5 objects :bubble 6 7 take radius: bubble . radius 8 take depth: bubble . depth 9 take tension: S 10 take atmosphere: P_a 11 take gravity: g 12 13 deduce_from "relative density 1.20" , rho => "1.20e3 kg/m3" 14 15 pressure = bubble . pressure_inside 16 answer pressure :, in: "Pa" , figures: 3 17 18 conclusion "The air in the bubble bears the atmosphere and the solution above it, and its one curved " \ 19 "surface squeezes it a little more." 20 end
1 require_relative "../solutions/an_air_bubble_in_soap_solution" 2 3 play_with :an_air_bubble_in_soap_solution do 4 title "An Air Bubble in Soap Solution" 5 end