question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_charge_on_each_plate do 4 kind :numerical 5 describes "In a parallel plate capacitor with air between the plates, each plate has an area of %{area} and the " \ 6 "distance between the plates is %{gap}. If this capacitor is connected to a %{supply} supply, " \ 7 "%{charge}, in coulombs?" 8 given area: "6e-3 m2" 9 given gap: "3 mm" 10 given supply: "100 V" 11 asks charge: "what is the charge on each plate of the capacitor" 12 end
1 require_relative "../questions/the_charge_on_each_plate" 2 require_relative "../science/electrostatic_potential_and_capacitance/capacitance" 3 4 solve :the_charge_on_each_plate , using: Capacitance do 5 objects :capacitor 6 7 take area: capacitor . area 8 take gap: capacitor . plate_separation 9 take supply: capacitor . voltage 10 11 deduce_from "with air between the plates" , capacitor . dielectric_constant => 1 12 13 charge = capacitor . charge 14 answer charge :, in: "C" , figures: 3 15 16 conclusion "The plates' area and gap fix the capacitance, and the supply's voltage times it is the charge " \ 17 "drawn onto each plate." 18 end
1 require_relative "../solutions/the_charge_on_each_plate" 2 3 play_with :the_charge_on_each_plate do 4 title "The Charge on Each Plate" 5 end