question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_hydraulic_automobile_lift do 4 kind :numerical 5 describes "A hydraulic automobile lift is designed to lift cars with a maximum mass of %{mass}. The area of " \ 6 "cross-section of the piston carrying the load is %{area}. Taking g as %{gravity}, %{pressure}, in " \ 7 "pascals?" 8 given mass: "3000 kg" 9 given area: "425 cm2" 10 given gravity: "9.8 m/s2" 11 asks pressure: "what maximum pressure would the smaller piston have to bear" 12 end
1 require_relative "../questions/a_hydraulic_automobile_lift" 2 require_relative "../science/mechanical_properties_of_fluids/pascals_law" 3 4 solve :a_hydraulic_automobile_lift , using: PascalsLaw do 5 objects :car , :large , :small 6 7 take mass: car . mass 8 take area: large . area 9 take gravity: g 10 11 deduce_from "the piston carrying the load" , large . thrust => car . mass * g 12 deduce_from "hydraulic" , small . pressure => large . pressure 13 14 pressure = small . pressure 15 answer pressure :, in: "Pa" , figures: 3 16 17 conclusion "The liquid passes the pressure on undiminished, so the small piston bears the same pressure " \ 18 "as the large one: the car's weight over the large piston's area." 19 end
1 require_relative "../solutions/a_hydraulic_automobile_lift" 2 3 play_with :a_hydraulic_automobile_lift do 4 title "A Hydraulic Automobile Lift" 5 end