question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :an_electron_shot_into_a_chamber do 4 kind :numerical 5 describes "In a chamber, a uniform magnetic field of %{field} is maintained. An electron is shot into the field " \ 6 "with a speed of %{speed} normal to the field. %{radius}, in cm? (mₑ = %{mass})" 7 given field: "6.5 G" 8 given speed: "4.8e6 m/s" 9 given mass: "9.1e-31 kg" 10 asks radius: "Determine the radius of the circular orbit" 11 end
1 require_relative "../questions/an_electron_shot_into_a_chamber" 2 require_relative "../science/moving_charges_and_magnetism/magnetic_force" 3 4 solve :an_electron_shot_into_a_chamber , using: MagneticForce do 5 objects :electron 6 7 take field: B 8 take speed: electron . speed 9 take mass: electron . mass 10 11 deduce_from "An electron is shot" , electron . charge => e 12 13 radius = electron . radius_of_the_path 14 answer radius :, in: "cm" , figures: 2 15 16 conclusion "The magnetic force is always square across the electron's motion, so it turns the electron without " \ 17 "speeding it up, round a circle." 18 end
1 require_relative "../solutions/an_electron_shot_into_a_chamber" 2 3 play_with :an_electron_shot_into_a_chamber do 4 title "An Electron Shot into a Chamber" 5 end