question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_pure_inductor_on_ac do 4 kind :numerical 5 describes "A pure inductor of %{inductance} is connected to a source of %{supply}. The frequency of the source is " \ 6 "%{frequency}. %{current}, in amperes?" 7 given inductance: "25.0 mH" 8 given supply: "220 V" 9 given frequency: "50 Hz" 10 asks current: "What is the rms current in the circuit" 11 end
1 require_relative "../questions/a_pure_inductor_on_ac" 2 require_relative "../science/alternating_current/series_lcr" 3 4 solve :a_pure_inductor_on_ac , using: SeriesLcr do 5 objects :circuit 6 7 take inductance: circuit . inductance 8 take supply: circuit . rms_voltage 9 take frequency: circuit . frequency 10 11 deduce_from "A pure inductor" , circuit . resistance => "0 Ω" , circuit . capacitive_reactance => "0 Ω" 12 13 current = circuit . rms_current 14 answer current :, in: "A" , figures: 2 15 16 conclusion "An inductor opposes a changing current by its reactance, which grows with the frequency and the " \ 17 "inductance; at mains frequency a few millihenries let tens of amperes through." 18 end
1 require_relative "../solutions/a_pure_inductor_on_ac" 2 3 play_with :a_pure_inductor_on_ac do 4 title "A Pure Inductor on AC" 5 end