question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_harmonic_wave_s_speed do 4 kind :numerical 5 describes "A transverse harmonic wave on a string is described by y(x, t) = 3.0 sin (36 t + 0.018 x + π/4) where x " \ 6 "and y are in cm and t in s. The positive direction of x is from left to right. %{speed}, in m/s?" 7 asks speed: "What is the speed of its propagation" 8 end
1 require_relative "../questions/a_harmonic_wave_s_speed" 2 require_relative "../science/waves/travelling_wave" 3 4 solve :a_harmonic_wave_s_speed , using: TravellingWave do 5 objects :wave 6 7 deduce_from "36 t" , wave . angular_frequency => "36 rad/s" 8 deduce_from "0.018 x" , wave . wave_number => "0.018 rad/cm" 9 10 speed = wave . wave_speed 11 answer speed :, in: "m/s" , figures: 2 12 13 conclusion "A crest keeps its phase fixed, so it moves the angular frequency over the wave number each " \ 14 "second; with t and x added, it runs from right to left." 15 end
1 require_relative "../solutions/a_harmonic_wave_s_speed" 2 3 play_with :a_harmonic_wave_s_speed do 4 title "A Harmonic Wave's Speed" 5 end