question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_wire_at_thirty_degrees_to_a_field do 4 kind :numerical 5 describes "%{force} on a wire carrying a current of %{current} and making an angle of %{angle} with the direction " \ 6 "of a uniform magnetic field of %{field}, in N/m?" 7 given current: "8 A" 8 given angle: "30 deg" 9 given field: "0.15 T" 10 asks force: "What is the magnitude of magnetic force per unit length" 11 end
1 require_relative "../questions/a_wire_at_thirty_degrees_to_a_field" 2 require_relative "../science/moving_charges_and_magnetism/magnetic_force" 3 4 solve :a_wire_at_thirty_degrees_to_a_field , using: MagneticForce do 5 objects :wire 6 7 take current: wire . current 8 take angle: wire . angle_to_the_field 9 take field: B 10 11 force = wire . force_per_length 12 answer force :, in: "N/m" , figures: 1 13 14 conclusion "Only the part of the field across the wire pushes on its current, so the force goes with the sine " \ 15 "of the angle between them." 16 end
1 require_relative "../solutions/a_wire_at_thirty_degrees_to_a_field" 2 3 play_with :a_wire_at_thirty_degrees_to_a_field do 4 title "A Wire at Thirty Degrees to a Field" 5 end