# How to find the voltage of a capacitor in a Op-amp + RC network?

I found this practice problem online which asked to find the voltage across the capacitor as a function of time. The circuit is:

My intended approach is to first find the initial condition when the switch has been grounded for a very long time. Then find the final condition when the capacitor is at equilibrium when the switch has been connected.

To find the initial condition, I'm trying to do nodal analysis at the top right corner (right after the 4 kilo-ohm resistor.

I know that the voltages from the two terminals of the op-amp are going to be the same(assuming ideal op-amp as given in the problem). Since the wire connecting the positive terminal of the op-amp is grounded, the node potential at the negative terminal is also zero volts. As a result, the current through the bottom 10 kilo-ohm resistor is zero amps. By KCL, we know that no current can be flowing into point between the 10 kilo-ohm resistors which means that there is no current flowing to the top right node? So is initial condition of $$\ v_o = 0 \$$?

I would check but the website didn't provide an answer key

Edit: After doing some work to find out the voltage across the capacitor as a function of time.

We have $$\ V_c(t=0) = 0 \$$. Now looking for the equilibrium voltage when the switch is closed, we know that after a long time the capacitor will look like short circuit. Therefore, the voltage across the capacitor is the same as the voltage from right before the 4 kilo-ohm resistor to ground.

Let's find the voltage by doing nodal analysis at the node right before the 4 kilo-ohm resistor.

We know that the voltage at the two terminals of the op-amp are now 6 volts (since the switch is closed).

KCL at the node right before the 4 kilo-ohm resistor(let's call that node e):

$$\frac {0 - 6}{10} - \frac {6 - e}{10} = 0$$ Solving for e, we get that e = -12 volts. So, using our voltage formula for capacitors: $$V_c(t) = V_c(0) + (V(\inf) - V_c(0))*(1-e^{\frac {-t}{RC}})$$ Substituting in our conditions that we found: $$V_c(t) = -12 + 12e^{\frac {-t}{RC}}$$

Now it's only a matter of find the resistance seen by the capacitor. To me it seems that all the resistors are going to be in series with one another so the R should be 24 kilo-ohms. However, isn't current also capable of moving into the op-amp from the "out" terminal? How should I go about finding the resistance as seen by the capacitor?

• Your reasoning is sound. If that node is zero, they all are. – evildemonic Oct 11 '19 at 22:15
• Can you see how variations in the capacitor voltage affect the voltage at the output of the op-amp? – TimWescott Oct 11 '19 at 22:52

Yes, everything is at zero volts up until t=0. What happens after that?

Somehow, you've managed to get the sign wrong for the final output voltage.

$$\frac {0 - 6}{10} - \frac {6 - e}{10} = 0$$

$$\frac {0 - 6}{10} + \frac {e - 6}{10} = 0$$

$$0 - 6 + e - 6 = 0$$

$$e = 12$$

Remember that the output of an ideal opamp is a voltage source. What does this mean in terms of the resistance "seen" by the capacitor?

• Okay, so I've solved for the initial and final conditions and got the formula above. Now I'm trying to find R_eq as seen from the capacitor. I added my reasoning to my post above. – BigBear Oct 11 '19 at 22:47
• See edits above. – Dave Tweed Oct 11 '19 at 23:14

Well, we are trying to analyze the following circuit:

simulate this circuit – Schematic created using CircuitLab

Using KCL, we can write:

$$\begin{cases} \text{I}_{\text{R}_2}=\text{I}_{\text{R}_1}\\ \\ \text{I}_\text{op}=\text{I}_{\text{R}_2}+\text{I}_{\text{R}_3}\\ \\ \text{I}_\text{C}+\text{I}_{\text{R}_1}=\text{I}_\text{in}\\ \\ \text{I}_{\text{R}_3}=\text{I}_\text{C} \end{cases}\tag1$$

Using KVL, we can write:

$$\begin{cases} \text{I}_{\text{R}_1}=\frac{\text{V}_1}{\text{R}_1}\\ \\ \text{I}_{\text{R}_2}=\frac{\text{V}_2-\text{V}_1}{\text{R}_2}\\ \\ \text{I}_{\text{R}_3}=\frac{\text{V}_2-\text{V}_3}{\text{R}_3}\\ \\ \text{I}_\text{C}=\frac{\text{V}_3}{\left(\frac{1}{\text{sC}}\right)}=\text{V}_3\cdot\text{sC} \end{cases}\tag2$$

In the ideal opamp model we know that:

$$\text{V}_+=\text{V}_-\space\implies\space\text{V}_1=\text{V}_\text{in}\tag3$$

Substitute $$\(2)\$$ into $$\(1)\$$ and using $$\(3)\$$, we get:

$$\begin{cases} \frac{\text{V}_\text{in}}{\text{R}_1}=\frac{\text{V}_2-\text{V}_\text{in}}{\text{R}_2}\\ \\ \text{I}_\text{op}=\frac{\text{V}_2-\text{V}_\text{in}}{\text{R}_2}+\frac{\text{V}_2-\text{V}_3}{\text{R}_3}\\ \\ \text{V}_3\cdot\text{sC}+\frac{\text{V}_\text{in}}{\text{R}_1}=\text{I}_\text{in}\\ \\ \frac{\text{V}_2-\text{V}_3}{\text{R}_3}=\text{V}_3\cdot\text{sC} \end{cases}\tag4$$

Assuming that the voltage source delivers a constant voltage $$\\hat{\text{v}}\$$ we can write:

$$\text{V}_\text{in}=\frac{\hat{\text{v}}}{\text{s}}\tag5$$

Solving $$\(4)\$$ for the unknowns gives:

$$\begin{cases} \text{V}_2=\hat{\text{v}}\cdot\frac{\text{R}_1+\text{R}_2}{\text{sR}_1}\\ \\ \text{V}_3=\frac{\hat{\text{v}}}{\text{s}}\cdot\frac{\text{R}_1+\text{R}_2}{\text{R}_1+\text{CR}_1\text{R}_3}\\ \\ \text{I}_\text{in}=\hat{\text{v}}\cdot\frac{1+\text{sC}\left(\text{R}_1+\text{R}_2+\text{R}_3\right)}{\text{sR}_1\left(1+\text{sCR}_3\right)}\\ \\ \text{I}_\text{op}=\hat{\text{v}}\cdot\frac{1+\text{sC}\left(\text{R}_1+\text{R}_2+\text{R}_3\right)}{\text{sR}_1\left(1+\text{sCR}_3\right)} \end{cases}\tag6$$

Notice that those solutions are in the s-plane so we need to transfer back using inverse Laplace transform.

So, for the voltage across the capacitor we get:

$$\text{V}_\text{C}\left(t\right)=\mathcal{L}_\text{s}^{-1}\left[\text{V}_3\right]_{\left(t\right)}=\hat{\text{v}}\cdot\frac{\text{R}_1+\text{R}_2}{\text{R}_1}\cdot\left(1-\exp\left(-\frac{t}{\text{CR}_3}\right)\right)\tag7$$

$$\text{V}_\text{C}\left(t\right)=12\left(1-\exp\left(-10t\right)\right)\tag8$$