question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_wave_along_a_string do 4 kind :numerical 5 describes "A wave travelling along a string is described by y(x, t) = 0.005 sin(80.0 x – 3.0 t), in which the " \ 6 "numerical constants are in SI units (0.005 m, %{wave_number} and 3.0 rad/s). %{wavelength}, in cm?" 7 given wave_number: "80.0 rad/m" 8 asks wavelength: "What is the wavelength" 9 end
1 require_relative "../questions/a_wave_along_a_string" 2 require_relative "../science/waves/travelling_wave" 3 4 solve :a_wave_along_a_string , using: TravellingWave do 5 objects :wave 6 7 take wave_number: wave . wave_number 8 9 wavelength = wave . wavelength 10 answer wavelength :, in: "cm" , figures: 3 11 12 conclusion "The number multiplying x counts radians of phase per metre, and one wavelength is a full " \ 13 "turn of phase." 14 end
1 require_relative "../solutions/a_wave_along_a_string" 2 3 play_with :a_wave_along_a_string do 4 title "A Wave Along a String" 5 end