question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :free_oscillations_of_an_lc_circuit do 4 kind :numerical 5 describes "A charged %{capacitance} capacitor is connected to a %{inductance} inductor. %{angular}, in rad/s?" 6 given capacitance: "30 μF" 7 given inductance: "27 mH" 8 asks angular: "What is the angular frequency of free oscillations of the circuit" 9 end
1 require_relative "../questions/free_oscillations_of_an_lc_circuit" 2 require_relative "../science/alternating_current/series_lcr" 3 4 solve :free_oscillations_of_an_lc_circuit , using: SeriesLcr do 5 objects :circuit 6 7 take capacitance: circuit . capacitance 8 take inductance: circuit . inductance 9 10 angular = circuit . resonant_angular_frequency 11 answer angular :, in: "rad/s" , figures: 3 12 13 conclusion "Charge sloshes between the capacitor and the inductor at the one frequency where their " \ 14 "reactances match, set by the product of inductance and capacitance." 15 end
1 require_relative "../solutions/free_oscillations_of_an_lc_circuit" 2 3 play_with :free_oscillations_of_an_lc_circuit do 4 title "Free Oscillations of an LC Circuit" 5 end