question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_jerk_along_a_string do 4 kind :numerical 5 describes "A string of mass %{mass} is under a tension of %{tension}. The length of the stretched string is " \ 6 "%{length}. If the transverse jerk is struck at one end of the string, %{time} to reach the other end, " \ 7 "in seconds?" 8 given mass: "2.50 kg" 9 given tension: "200 N" 10 given length: "20.0 m" 11 asks time: "how long does the disturbance take" 12 end
1 require_relative "../questions/a_jerk_along_a_string" 2 require_relative "../science/waves/waves_on_a_string" 3 4 solve :a_jerk_along_a_string , using: WavesOnAString do 5 objects :string 6 7 take mass: string . mass 8 take tension: string . tension 9 take length: string . length_of_the_string 10 11 time = string . travel_time 12 answer time :, in: "s" , figures: 2 13 14 conclusion "The jerk runs along at the speed the tension and the mass per metre set, so it crosses the string " \ 15 "in its length over that speed." 16 end
1 require_relative "../solutions/a_jerk_along_a_string" 2 3 play_with :a_jerk_along_a_string do 4 title "A Jerk Along a String" 5 end