Potentiometer simulation

You might sweep the resistor electronically as shown in this thread: