# Current in opamp

Im trying to do a node analysis on the next opamp configuration

simulate this circuit – Schematic created using CircuitLab

But the issue is at the third node ($$\Vo+\$$). What current is supposed the flow there?

$$\i_{22}=\Large\frac{v_{s}-v_{1}}{22k}\$$

$$\i_{33}=\Large\frac{v_{1}-v_{2}}{33k}\$$

$$\i_{47}=\Large\frac{v_{1}}{47k}\$$

$$\i_{330}=\Large\frac{v_{2}-v_{3}}{330k}\$$

kcl in $$\1\$$

$$\i_{22}=i_{33}+i_{47}\$$

kcl in $$\2\$$

$$\i_{33}=i_{330}\$$

kcl in $$\3\$$

$$\i_{330}=?\$$

First, I will present a method that uses Mathematica to solve this problem. When I was studying this stuff I used the method all the time (without using Mathematica of course).

Well, we are trying to analyze the following opamp-circuit:

simulate this circuit – Schematic created using CircuitLab

When we use and apply KCL, we can write the following set of equations:

$$\begin{cases} \text{I}_1=\text{I}_2+\text{I}_3\\ \\ 0=\text{I}_3+\text{I}_4\\ \\ \text{I}_2=\text{I}_1+\text{I}_4 \end{cases}\tag1$$

When we use and apply Ohm's law, we can write the following set of equations:

$$\begin{cases} \text{I}_1=\frac{\text{V}_\text{i}-\text{V}_1}{\text{R}_1}\\ \\ \text{I}_2=\frac{\text{V}_1}{\text{R}_2}\\ \\ \text{I}_3=\frac{\text{V}_1-\text{V}_2}{\text{R}_3}\\ \\ \text{I}_4=\frac{\text{V}_3-\text{V}_2}{\text{R}_4} \end{cases}\tag2$$

Substitute $$\(2)\$$ into $$\(1)\$$, in order to get:

$$\begin{cases} \frac{\text{V}_\text{i}-\text{V}_1}{\text{R}_1}=\frac{\text{V}_1}{\text{R}_2}+\frac{\text{V}_1-\text{V}_2}{\text{R}_3}\\ \\ 0=\frac{\text{V}_1-\text{V}_2}{\text{R}_3}+\frac{\text{V}_3-\text{V}_2}{\text{R}_4}\\ \\ \frac{\text{V}_1}{\text{R}_2}=\frac{\text{V}_\text{i}-\text{V}_1}{\text{R}_1}+\frac{\text{V}_3-\text{V}_2}{\text{R}_4} \end{cases}\tag3$$

Now, using an ideal opamp, we know that:

$$\text{V}_+=\text{V}_-=\text{V}_2=0\space\text{V}\tag4$$

So we can rewrite equation $$\(3)\$$ as follows:

$$\begin{cases} \frac{\text{V}_\text{i}-\text{V}_1}{\text{R}_1}=\frac{\text{V}_1}{\text{R}_2}+\frac{\text{V}_1-0}{\text{R}_3}\\ \\ 0=\frac{\text{V}_1-0}{\text{R}_3}+\frac{\text{V}_3-0}{\text{R}_4}\\ \\ \frac{\text{V}_1}{\text{R}_2}=\frac{\text{V}_\text{i}-\text{V}_1}{\text{R}_1}+\frac{\text{V}_3-0}{\text{R}_4} \end{cases}\tag5$$

Now, we can solve for the transfer function:

$$\mathscr{H}:=\frac{\text{V}_3}{\text{V}_\text{i}}=-\frac{\text{R}_2\text{R}_4}{\text{R}_2\text{R}_3+\text{R}_1\left(\text{R}_2+\text{R}_3\right)}\tag6$$

Where I used the following Mathematica-code:

In[1]:=Clear["Global*"];
V2 = 0;
FullSimplify[
Solve[{I1 == I2 + I3, 0 == I3 + I4, I2 == I1 + I4,
I1 == (Vi - V1)/R1, I2 == V1/R2, I3 == (V1 - V2)/R3,
I4 == (V3 - V2)/R4}, {I1, I2, I3, I4, V1, V3}]]

Out[1]={{I1 -> ((R2 + R3) Vi)/(R2 R3 + R1 (R2 + R3)),
I2 -> (R3 Vi)/(R2 R3 + R1 (R2 + R3)),
I3 -> (R2 Vi)/(R2 R3 + R1 (R2 + R3)),
I4 -> -((R2 Vi)/(R2 R3 + R1 (R2 + R3))),
V1 -> (R2 R3 Vi)/(R2 R3 + R1 (R2 + R3)),
V3 -> -((R2 R4 Vi)/(R2 R3 + R1 (R2 + R3)))}}


My equation was also confirmed using LTspice.

$$\mathscr{H}=-\frac{1290}{281}\tag7$$

With $$\\text{V}_\text{i}=1\space\text{V}\$$, the output voltage is:

$$\text{V}_3=1\cdot\left(-\frac{1290}{281}\right)=-\frac{1290}{281}\approx-4.59075\space\text{V}\tag8$$

If you're interested in all the calculations:

In[2]:=Clear["Global*"];
V2 = 0;
Vi = 1;
R1 = 22*1000;
R2 = 43*1000;
R3 = 33*1000;
R4 = 330*1000;
FullSimplify[
Solve[{I1 == I2 + I3, 0 == I3 + I4, I2 == I1 + I4,
I1 == (Vi - V1)/R1, I2 == V1/R2, I3 == (V1 - V2)/R3,
I4 == (V3 - V2)/R4}, {I1, I2, I3, I4, V1, V3}]]

Out[2]={{I1 -> 19/772750, I2 -> 3/281000, I3 -> 43/3091000,
I4 -> -(43/3091000), V1 -> 129/281, V3 -> -(1290/281)}}

In[3]:=N[%2]

Out[3]={{I1 -> 0.0000245875, I2 -> 0.0000106762, I3 -> 0.0000139114,
I4 -> -0.0000139114, V1 -> 0.459075, V3 -> -4.59075}}

• I dont get why I2 is defined that way, isnt suppossed to be only I1-I3 and I3=I4? Thanks for the code and your time, is great example. And the way you simplify it, its clever, Im trying to adapt to matlab/octave and maxima, if you dont mind. Feb 15, 2021 at 3:32

Output current from the opamp is unspecified, but can be modeled as a voltage-controlled voltage source with series-connected source resistance around 20 ohms. The output voltage would be ideally given by $$\V_{OUT} = A_{v}(V_{IN+} - V_{IN-})\$$ where $$\A_{v}\$$ is the open-loop gain, start with 1000000 for 60dB open-loop gain.

simulate this circuit – Schematic created using CircuitLab

This simplified model of the op-amp doesn't account for its frequency response, phase shift, offset voltage, input offset current, power consumption, supply-rail output voltage limits, etc. It's just a very simplified model for simulation where you just want an "ideal" op amp.

Depending on the level of analysis you want to do, the output current can be unspecified.

Vout drives two currents, the feedback current into R4, and the output current into the (unspecified) load.

The Vout current is sourced from the op-amp's power pins (not shown on the diagram), which eventually return to the ground symbol through the power supply. Therefore show the output current as a current source connected to ground.