I was trying to simulate a circuit where a capacitor is being charged then discharged. I used an oscilloscope to measure the voltage and the current. I've noticed that when I switch the state of the capacitor from charging to discharging or from discharging to charging, the current suddenly changes to a different value.
I can understand that the voltage can change immediately, but the current? Shouldn't it have a smooth curve?
What is the explanation of what's happened with me?
What happened with me: