question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_charge_on_a_capacitor_in_parallel do 4 kind :numerical 5 describes "Three capacitors of capacitances 2 pF, 3 pF and %{third} are connected in parallel, and the " \ 6 "combination is connected to a %{supply} supply. %{charge}, in coulombs?" 7 given third: "4 pF" 8 given supply: "100 V" 9 asks charge: "Determine the charge on the last of them" 10 end
1 require_relative "../questions/the_charge_on_a_capacitor_in_parallel" 2 require_relative "../science/electrostatic_potential_and_capacitance/capacitance" 3 4 solve :the_charge_on_a_capacitor_in_parallel , using: Capacitance do 5 objects :third , :combination 6 7 take third: third . capacitance 8 take supply: combination . voltage 9 10 deduce_from "connected in parallel" , third . voltage => combination . voltage 11 12 charge = third . charge 13 answer charge :, in: "C" , figures: 1 14 15 conclusion "In parallel each capacitor has the whole supply voltage across it, so each holds its own " \ 16 "capacitance times that voltage." 17 end
1 require_relative "../solutions/the_charge_on_a_capacitor_in_parallel" 2 3 play_with :the_charge_on_a_capacitor_in_parallel do 4 title "The Charge on a Capacitor in Parallel" 5 end