I have a problem where I am trying to model the voltage across a capacitor in the following circuit:
We can see we have a reference voltage source of 1.25V driving a buffer. For T/2 the Capacitor is connected to the 1V supply, such that the voltage across it is 1V. After T/2 it then switched to the output of the buffer and is charged to 1.25V. My goal is to find the voltage across the capactior, \$V_c(t)\$, as a function of time.
1st Approach
Initially I just thought to model the voltage across the cap as a 1.25V source charging a capacitor through the output resistance of an Opamp, as follows:
Given the capacitor starts at a voltage of 1V, we model the charging as:
$$V_c(t) = 1.0 + (1.25 - 1.0)(1 - e^{t/\tau}) = 1.0 + 0.25(1 - e^{t/\tau})$$
since the buffer provides a fixed 1.25v charging voltage. However, I was told this may be incorrect since the voltage used to charge the capacitor is itself a function of time, dependent on the voltage across the capacitor, so I tried another approach ...
2nd Approach
Using a model for the OpAmp, we replace the buffer circuit with a dependent voltage source as follows
The voltage generated by the OpAmp is \$A_{OL}(V_+ - V_-)\$, where \$A_{OL}\$ is the open loop gain of the OpAmp. In this case \$V_+ = 1.25v\$ and \$V_- = V_c(t)\$, yielding the above model. We can then model this as an RC circuit as before, this time the charging voltage a dependent voltage source:
Therefore, the voltage across the capacitor is
$$V_c(t) = 1.0 + [A_{OL}(1.25 - V_c(t)) - 1.0](1 - e^{t/\tau})$$
which can be re-arranged for \$V_c(t)\$ to give:
$$V_c(t) = \frac{1.0 + A_{OL}(1.25)(1-e^{-t/\tau}) - (1-e^{-t/\tau})}{1 + A_{OL}(1-e^{-t/\tau})}$$
Simulation
Plotting both these results in desmos yields : (https://www.desmos.com/calculator/9yzrm6hsnm)
where the red curve is method 1, and the purple is method 2. Now, i'd like to know people's opinion on which is the correct approach, or are BOTH wrong?
The reason I suspect that there is an error here is because I also have the conditions that \$V_c(0.48*T) = 1.249511\$, where \$T = 1/20Mhz\$, which yields a time constant of \$\tau_1 = 1.758e-7\$ for method 1 and \$\tau_2 = 7.93e-8\$ for method 2 (using the information \$A_{OL} = 4000\$). Dividing each by the load capacitance (1.5pF) yields output resistances for the OpAmp of \$119k\Omega\$ and \$52.8k\Omega\$ respectively, while I expect this value to be on the order of Mega Ohms.