question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_field_dying_away do 4 kind :numerical 5 describes "A square loop of side 10 cm and resistance %{resistance} is placed vertically in the east-west plane. A " \ 6 "uniform magnetic field of %{field} is set up across the plane in the north-east direction. The magnetic " \ 7 "field is decreased to zero in %{time} at a steady rate. %{emf} during this time-interval, in volts?" 8 given resistance: "0.5 Ω" 9 given field: "0.10 T" 10 given time: "0.70 s" 11 asks emf: "What is the magnitude of the induced emf" 12 end
1 require_relative "../questions/a_field_dying_away" 2 require_relative "../science/electromagnetic_induction/faradays_law" 3 4 solve :a_field_dying_away , using: FaradaysLaw do 5 objects :square 6 square . goes ( :fading ) 7 8 take resistance: square . resistance 9 take field: square . magnetic_field ( at: fading . start ) 10 take time: fading . time_taken 11 12 deduce_from "square loop of side 10 cm" , square . area => "0.01 m2" 13 deduce_from "A square loop" , square . turns => "1" 14 deduce_from "in the north-east direction" , square . angle_to_the_field ( at: fading . start ) => "45 deg" , 15 square . angle_to_the_field ( at: fading . end ) => "45 deg" 16 deduce_from "decreased to zero" , square . magnetic_field ( at: fading . end ) => "0 T" 17 18 emf = square . induced_emf ( during: fading ) 19 answer emf :, in: "V" , figures: 2 20 21 conclusion "The field cuts the loop slantwise, so only its share along the loop's normal counts; as that " \ 22 "share dies away evenly, the flux falls at a steady rate and drives a steady emf." 23 end
1 require_relative "../solutions/a_field_dying_away" 2 3 play_with :a_field_dying_away do 4 title "A Field Dying Away" 5 end