question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_steady_push_forward do 4 kind :numerical 5 describes "A steady force on a body of %{mass} takes it from %{initial_speed} to %{final_speed} in %{time}, without " \ 6 "turning it. %{force}, in newtons?" 7 given mass: "3.0 kg" 8 given initial_speed: "2.0 m/s" 9 given final_speed: "3.5 m/s" 10 given time: "25 s" 11 asks force: "How strong is the force" 12 end
1 require_relative "../questions/a_steady_push_forward" 2 require_relative "../science/laws_of_motion/newtons_second_law" 3 4 solve :a_steady_push_forward , using: NewtonsSecondLaw do 5 objects :body 6 body . goes ( :speeding_up ) 7 8 take mass: body . mass 9 take initial_speed: body . initial_velocity 10 take final_speed: body . final_velocity 11 take time: speeding_up . time_taken 12 13 force = body . net_force 14 answer force :, in: "N" , figures: 2 15 16 conclusion "The force is the mass times the speed it gains each second, and it points the way " \ 17 "the body is already going." 18 end
1 require_relative "../solutions/a_steady_push_forward" 2 3 play_with :a_steady_push_forward do 4 title "A Steady Push Forward" 5 end