question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_syringes_joined do 4 kind :numerical 5 describes "Two syringes of different cross-sections (without needles) filled with water are connected with a " \ 6 "tightly fitted rubber tube filled with water. Diameters of the smaller piston and larger piston are " \ 7 "%{small_diameter} and %{large_diameter} respectively. %{force} when a force of %{push} is applied to " \ 8 "the smaller piston, in newtons?" 9 given small_diameter: "1.0 cm" 10 given large_diameter: "3.0 cm" 11 given push: "10 N" 12 asks force: "What is the force exerted on the larger piston" 13 end
1 require_relative "../questions/two_syringes_joined" 2 require_relative "../science/mechanical_properties_of_fluids/pascals_law" 3 4 solve :two_syringes_joined , using: PascalsLaw do 5 objects :small , :large 6 7 take small_diameter: small . piston_diameter 8 take large_diameter: large . piston_diameter 9 take push: small . thrust 10 11 deduce_from "connected with a tightly fitted rubber tube filled with water" , large . pressure => small . pressure 12 13 force = large . thrust 14 answer force :, in: "N" , figures: 2 15 16 conclusion "The water carries the pressure across undiminished, so each piston feels it over its own " \ 17 "area: three times the diameter is nine times the area and nine times the force." 18 end
1 require_relative "../solutions/two_syringes_joined" 2 3 play_with :two_syringes_joined do 4 title "Two Syringes Joined" 5 end