Maybe you can create a voltage controlled resistor as a switch, when switch-on, set the resistance = 0 , when switch-off, set the resistance = a large number, see, 1e15. In fact, the resistor just is the turn-on and turn-off resistance of the switch.