question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_soap_bubble_s_excess_pressure do 4 kind :numerical 5 describes "%{excess} of radius %{radius}, given that the surface tension of soap solution at the temperature " \ 6 "(20 °C) is %{tension}, in pascals?" 7 given radius: "5.00 mm" 8 given tension: "2.50e-2 N/m" 9 asks excess: "What is the excess pressure inside a bubble of soap solution" 10 end
1 require_relative "../questions/a_soap_bubble_s_excess_pressure" 2 require_relative "../science/mechanical_properties_of_fluids/surface_tension" 3 4 solve :a_soap_bubble_s_excess_pressure , using: SurfaceTension do 5 objects :bubble 6 7 take radius: bubble . radius 8 take tension: S 9 10 excess = bubble . excess_pressure_in_a_soap_bubble 11 answer excess :, in: "Pa" , figures: 3 12 13 conclusion "A soap bubble is a thin film with two surfaces, inner and outer, so it squeezes the air " \ 14 "inside twice as hard as a single surface of the same radius would." 15 end
1 require_relative "../solutions/a_soap_bubble_s_excess_pressure" 2 3 play_with :a_soap_bubble_s_excess_pressure do 4 title "A Soap Bubble's Excess Pressure" 5 end