question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_lift_falling_freely do 4 kind :numerical 5 describes "A man of mass %{mass} stands on a weighing scale in a lift whose mechanism has failed, so that it " \ 6 "hurtles down freely under gravity. Taking g as %{gravity}, %{reading}, in newtons?" 7 given mass: "70 kg" 8 given gravity: "10 m/s2" 9 asks reading: "what would be the reading on the scale" 10 end
1 require_relative "../questions/a_lift_falling_freely" 2 require_relative "../science/laws_of_motion/newtons_second_law" 3 4 solve :a_lift_falling_freely , using: NewtonsSecondLaw do 5 objects :man , :scale 6 axes :y 7 man . goes ( :riding ) 8 deduce_from "under gravity" , man . weight . direction => - y 9 10 take mass: man . mass 11 take gravity: g 12 13 deduce_from "freely under gravity" , man . acceleration => - g 14 deduce_from "stands on a weighing scale" , man . force ( by: scale ). direction => y 15 16 reading = man . force ( by: scale ). magnitude 17 answer reading :, in: "N" 18 19 conclusion "Falling freely, the man and the scale drop together with nothing to spare, so the scale need " \ 20 "not push at all." 21 end
1 require_relative "../solutions/a_lift_falling_freely" 2 3 play_with :a_lift_falling_freely do 4 title "A Lift Falling Freely" 5 end