question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_larger_piston_moves_out 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. If the smaller piston is pushed in through " \ 8 "%{pushed}, %{moved}, in cm?" 9 given small_diameter: "1.0 cm" 10 given large_diameter: "3.0 cm" 11 given pushed: "6.0 cm" 12 asks moved: "how much does the larger piston move out" 13 end
1 require_relative "../questions/the_larger_piston_moves_out" 2 require_relative "../science/mechanical_properties_of_fluids/pascals_law" 3 4 solve :the_larger_piston_moves_out , using: PascalsLaw do 5 objects :small , :large 6 7 take small_diameter: small . piston_diameter 8 take large_diameter: large . piston_diameter 9 take pushed: small . stroke 10 11 deduce_from "filled with water" , large . volume_pushed => small . volume_pushed 12 13 moved = large . stroke 14 answer moved :, in: "cm" , figures: 2 15 16 conclusion "Water does not squeeze, so the water the small piston pushes in fills the large syringe; " \ 17 "spread over nine times the area, it moves the large piston a ninth as far." 18 end
1 require_relative "../solutions/the_larger_piston_moves_out" 2 3 play_with :the_larger_piston_moves_out do 4 title "The Larger Piston Moves Out" 5 end