question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_coil_held_against_a_field do 4 kind :numerical 5 describes "A circular coil of %{turns} turns and radius %{radius} carrying a current of %{current} is suspended " \ 6 "vertically in a uniform horizontal magnetic field of magnitude %{field}. The field lines make an angle " \ 7 "of %{angle} with the normal of the coil. %{torque}, in N m?" 8 given turns: "30" 9 given radius: "8.0 cm" 10 given current: "6.0 A" 11 given field: "1.0 T" 12 given angle: "60 deg" 13 asks torque: "Calculate the magnitude of the counter torque that must be applied to prevent the coil from turning" 14 end
1 require_relative "../questions/a_coil_held_against_a_field" 2 require_relative "../science/moving_charges_and_magnetism/current_loop_in_a_field" 3 4 solve :a_coil_held_against_a_field , using: CurrentLoopInAField do 5 objects :coil 6 7 take turns: coil . turns 8 take radius: coil . radius 9 take current: coil . current 10 take field: B 11 take angle: coil . angle_to_the_field 12 13 torque = coil . torque 14 answer torque :, in: "N m" , figures: 2 15 16 conclusion "To hold the coil still, the counter torque must match the turning the field gives it, which goes " \ 17 "with the sine of the angle between the coil's normal and the field." 18 end
1 require_relative "../solutions/a_coil_held_against_a_field" 2 3 play_with :a_coil_held_against_a_field do 4 title "A Coil Held Against a Field" 5 end