question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :an_electron_drifting_three_metres do 4 kind :numerical 5 describes "The number density of free electrons in a copper conductor is %{density}. A wire %{length} long has an " \ 6 "area of cross-section of %{area} and is carrying a current of %{current}. %{time} to drift from one " \ 7 "end of the wire to its other end, in seconds?" 8 given density: "8.5e28 m-3" 9 given length: "3.0 m" 10 given area: "2.0e-6 m2" 11 given current: "3.0 A" 12 asks time: "How long does an electron take" 13 end
1 require_relative "../questions/an_electron_drifting_three_metres" 2 require_relative "../science/current_electricity/drift_velocity" 3 4 solve :an_electron_drifting_three_metres , using: DriftVelocity do 5 objects :wire 6 7 take density: wire . free_electrons 8 take length: wire . length_of_the_conductor 9 take area: wire . cross_section 10 take current: wire . current 11 12 time = wire . drift_time 13 answer time :, in: "s" , figures: 2 14 15 conclusion "So many free electrons share the current that each drifts very slowly, taking hours to cross a " \ 16 "few metres even though the current starts at once." 17 end
1 require_relative "../solutions/an_electron_drifting_three_metres" 2 3 play_with :an_electron_drifting_three_metres do 4 title "An Electron Drifting Three Metres" 5 end