question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_capacitor_filled_and_squeezed do 4 kind :numerical 5 describes "A parallel plate capacitor with air between the plates has a capacitance of %{air}. %{filled} if the " \ 6 "distance between the plates is reduced by half, and the space between them is filled with a substance " \ 7 "of dielectric constant %{constant}, in pF?" 8 given air: "8 pF" 9 given constant: "6" 10 asks filled: "What will be the capacitance" 11 end
1 require_relative "../questions/a_capacitor_filled_and_squeezed" 2 require_relative "../science/electrostatic_potential_and_capacitance/capacitance" 3 4 solve :a_capacitor_filled_and_squeezed , using: Capacitance do 5 objects :before , :after 6 7 take air: before . capacitance 8 take constant: after . dielectric_constant 9 10 deduce_from "with air between the plates" , before . dielectric_constant => 1 11 deduce_from "reduced by half" , after . plate_separation => before . plate_separation / 2 12 deduce_from "the space between them" , after . area => before . area 13 14 filled = after . capacitance 15 answer filled :, in: "pF" , figures: 2 16 17 conclusion "Halving the gap doubles the capacitance and the dielectric multiplies it again by its constant; the " \ 18 "plates' size never needs to be known." 19 end
1 require_relative "../solutions/a_capacitor_filled_and_squeezed" 2 3 play_with :a_capacitor_filled_and_squeezed do 4 title "A Capacitor Filled and Squeezed" 5 end