question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_capacitor_s_drop_at_resonance do 4 kind :numerical 5 describes "A series LCR circuit is connected to a variable frequency %{supply} source, with L = %{inductance}, " \ 6 "C = %{capacitance} and R = %{resistance}. The source is tuned to the frequency which drives the " \ 7 "circuit in resonance. %{drop}, in volts?" 8 given supply: "230 V" 9 given inductance: "5.0 H" 10 given capacitance: "80 μF" 11 given resistance: "40 Ω" 12 asks drop: "What is the rms potential drop across the capacitor" 13 end
1 require_relative "../questions/the_capacitor_s_drop_at_resonance" 2 require_relative "../science/alternating_current/series_lcr" 3 4 solve :the_capacitor_s_drop_at_resonance , using: SeriesLcr do 5 objects :circuit 6 7 take supply: circuit . rms_voltage 8 take inductance: circuit . inductance 9 take capacitance: circuit . capacitance 10 take resistance: circuit . resistance 11 12 deduce_from "drives the circuit in resonance" , circuit . frequency => circuit . resonant_frequency 13 14 drop = circuit . voltage_across_the_capacitor 15 answer drop :, in: "V" , figures: 5 16 17 conclusion "At resonance the inductor and the capacitor each drop far more than the source supplies, but " \ 18 "half a cycle apart, so across the two together the drop is nothing." 19 end
1 require_relative "../solutions/the_capacitor_s_drop_at_resonance" 2 3 play_with :the_capacitor_s_drop_at_resonance do 4 title "The Capacitor's Drop at Resonance" 5 end