question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_copper_spheres_fifty_centimetres_apart do 4 kind :numerical 5 describes "Two insulated charged copper spheres A and B have their centres separated by a distance of %{apart}, " \ 6 "and the charge on each is %{charge}. The radii of A and B are negligible compared to the distance of " \ 7 "separation. %{force}, in newtons?" 8 given apart: "50 cm" 9 given charge: "6.5e-7 C" 10 asks force: "What is the mutual force of electrostatic repulsion" 11 end
1 require_relative "../questions/two_copper_spheres_fifty_centimetres_apart" 2 require_relative "../science/electric_charges_and_fields/coulombs_law" 3 4 solve :two_copper_spheres_fifty_centimetres_apart , using: CoulombsLaw do 5 objects :a , :b 6 7 take apart: a . separation ( from: b ) 8 take charge: a . charge 9 10 deduce_from "the charge on each" , b . charge => a . charge 11 12 force = a . electric_force ( by: b ) 13 answer force :, in: "N" , figures: 2 14 15 conclusion "Spheres small beside their distance act as point charges, so Coulomb's law gives the push " \ 16 "between them." 17 end
1 require_relative "../solutions/two_copper_spheres_fifty_centimetres_apart" 2 3 play_with :two_copper_spheres_fifty_centimetres_apart do 4 title "Two Copper Spheres Fifty Centimetres Apart" 5 end