question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_dipole_on_the_z_axis do 4 kind :numerical 5 describes "A system has two charges qA = %{charge} and qB = –%{charge} located at points A: (0, 0, –15 cm) and " \ 6 "B: (0, 0, +15 cm), respectively. %{moment}, in C m?" 7 given charge: "2.5e-7 C" 8 asks moment: "What is the electric dipole moment of the system" 9 end
1 require_relative "../questions/a_dipole_on_the_z_axis" 2 require_relative "../science/electrostatic_potential_and_capacitance/dipole_in_a_field" 3 4 solve :a_dipole_on_the_z_axis , using: DipoleInAField do 5 objects :dipole 6 7 take charge: dipole . charge 8 9 deduce_from "(0, 0, –15 cm) and B: (0, 0, +15 cm)" , dipole . length_of_the_dipole => "30 cm" 10 11 moment = dipole . dipole_moment 12 answer moment :, in: "C m" , figures: 2 13 14 conclusion "Equal and opposite charges cancel in total, but held apart they make a dipole whose moment is the " \ 15 "charge times the distance between them." 16 end
1 require_relative "../solutions/a_dipole_on_the_z_axis" 2 3 play_with :a_dipole_on_the_z_axis do 4 title "A Dipole on the z Axis" 5 end