question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_points_half_a_metre_apart do 4 kind :numerical 5 describes "For the travelling harmonic wave y(x, t) = 2.0 cos 2π (10t – 0.0080 x + 0.35) where x and y are in cm " \ 6 "and t in s, %{phase} separated by a distance of %{separation}, in radians?" 7 given separation: "0.5 m" 8 asks phase: "what is the phase difference between oscillatory motion of two points" 9 end
1 require_relative "../questions/two_points_half_a_metre_apart" 2 require_relative "../science/waves/travelling_wave" 3 4 solve :two_points_half_a_metre_apart , using: TravellingWave do 5 objects :wave 6 7 take separation: wave . separation 8 9 deduce_from "2π (10t – 0.0080 x" , wave . wave_number => "0.0080 rev/cm" 10 11 phase = wave . phase_difference 12 answer phase :, in: "rad" , figures: 2 13 14 conclusion "Along the wave the phase falls behind by the wave number for every unit of distance, so two points " \ 15 "differ in phase by the wave number times their separation." 16 end
1 require_relative "../solutions/two_points_half_a_metre_apart" 2 3 play_with :two_points_half_a_metre_apart do 4 title "Two Points Half a Metre Apart" 5 end