function of variable resistor in electric circuit