1require_relative "../physics"23question :a_resistor_on_an_ac_supply do4 kind :numerical5 describes "A %{resistance} resistor is connected to a %{supply}, 50 Hz ac supply. %{current}, in amperes?"6 given resistance: "100 Ω"7 given supply: "220 V"8 asks current: "What is the rms value of current in the circuit"9end
1require_relative "../questions/a_resistor_on_an_ac_supply"2require_relative "../science/alternating_current/resistor_on_ac"34solve :a_resistor_on_an_ac_supply, using: ResistorOnAc do5 objects :resistor67 take resistance: resistor.resistance8 take supply: resistor.rms_voltage910 current = resistor.rms_current11 answer current:, in: "A", figures: 31213 conclusion "A resistor follows the source from instant to instant, so its rms current is the rms voltage " \14 "over its resistance, whatever the frequency."15end
1require_relative "../solutions/a_resistor_on_an_ac_supply"23play_with :a_resistor_on_an_ac_supply do4 title "A Resistor on an AC Supply"5end