Calculating the power output of a resistor