I'm trying to create a model for how a capacitor charges and discharges in an RC circuit in response to an applied "control voltage" V2
. For this, I want to form the differential equation for time-dependent capacitor voltage for the below circuit:
simulate this circuit – Schematic created using CircuitLab (my interest stems from being able to simulate this circuit, e.g. used practically here: https://pimylifeup.com/raspberry-pi-light-sensor/)
I recall learning Kirchoff's voltage/current laws to analyze such circuits, but am having difficulty applying it to this circuit because of the added V2
voltage (which in practice is used for switching whether the capacitor is charging or discharging).
For example, if we consider the left-hand side 'loop', wouldn't Kirchoff's voltage law give us:
V2 = voltage across capacitor
thus eliminating all time dependence?
I feel I'm missing something simple?