question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :three_capacitors_in_series_on_120_volts do 4 kind :numerical 5 describes "Three capacitors each of capacitance %{each} are connected in series. %{voltage} if the combination " \ 6 "is connected to a %{supply} supply, in volts?" 7 given each: "9 pF" 8 given supply: "120 V" 9 asks voltage: "What is the potential difference across each capacitor" 10 end
1 require_relative "../questions/three_capacitors_in_series_on_120_volts" 2 require_relative "../science/electrostatic_potential_and_capacitance/capacitance" 3 4 solve :three_capacitors_in_series_on_120_volts , using: Capacitance do 5 objects :one , :row 6 7 take each: one . capacitance 8 take supply: row . voltage 9 10 deduce_from "connected in series" , row . capacitance => 1 / ( 3 / one . capacitance ) 11 deduce_from "in series" , one . charge => row . charge 12 13 voltage = one . voltage 14 answer voltage :, in: "V" , figures: 2 15 16 conclusion "Capacitors in series all carry the same charge, so equal ones share the supply's voltage equally." 17 end
1 require_relative "../solutions/three_capacitors_in_series_on_120_volts" 2 3 play_with :three_capacitors_in_series_on_120_volts do 4 title "Three Capacitors in Series on 120 Volts" 5 end