1require_relative "../physics"23question :a_resistor_s_power_over_a_cycle do4 kind :numerical5 describes "A %{resistance} resistor is connected to a %{supply}, 50 Hz ac supply. %{power}, in watts?"6 given resistance: "100 Ω"7 given supply: "220 V"8 asks power: "What is the net power consumed over a full cycle"9end
1require_relative "../questions/a_resistor_s_power_over_a_cycle"2require_relative "../science/alternating_current/resistor_on_ac"34solve :a_resistor_s_power_over_a_cycle, using: ResistorOnAc do5 objects :resistor67 take resistance: resistor.resistance8 take supply: resistor.rms_voltage910 power = resistor.power_drawn11 answer power:, in: "W", figures: 31213 conclusion "The rms voltage is the steady voltage that would heat the resistor as much, so the average " \14 "power over a cycle is its square over the resistance."15end
1require_relative "../solutions/a_resistor_s_power_over_a_cycle"23play_with :a_resistor_s_power_over_a_cycle do4 title "A Resistor's Power over a Cycle"5end