question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :electrons_drifting_in_copper do 4 kind :numerical 5 describes "A copper wire of cross-sectional area %{area} carries a current of %{current}. Assume that each copper " \ 6 "atom contributes roughly one conduction electron. The density of copper is %{density}, and its atomic " \ 7 "mass is %{molar_mass}. %{drift}, in mm/s?" 8 given area: "1.0e-7 m2" 9 given current: "1.5 A" 10 given density: "9.0e3 kg/m3" 11 given molar_mass: "63.5 g/mol" 12 asks drift: "What is the average drift speed of the conduction electrons" 13 end
1 require_relative "../questions/electrons_drifting_in_copper" 2 require_relative "../science/current_electricity/drift_velocity" 3 4 solve :electrons_drifting_in_copper , using: DriftVelocity do 5 objects :wire 6 7 take area: wire . cross_section 8 take current: wire . current 9 take density: wire . density 10 take molar_mass: wire . molar_mass 11 12 drift = wire . drift_speed 13 answer drift :, in: "mm/s" , figures: 2 14 15 conclusion "Copper holds so many free electrons that a current of amperes needs them to drift only about " \ 16 "a millimetre a second." 17 end
1 require_relative "../solutions/electrons_drifting_in_copper" 2 3 play_with :electrons_drifting_in_copper do 4 title "Electrons Drifting in Copper" 5 end