A switch can represent the unit step function
You're right, this specific substitution only works if the initial voltage of the capacitor is 0V.
You could of course replace the voltage source with &quot;Vs u(t) + Vo&quot;, then it'd also work if there was an initial voltage Vo.