Why do I get two different transfer functions for the same gain?

Thread Starter

RitterTree

Joined Dec 18, 2022
23
I'm trying to derive the expression for \( A_X = \frac{V_X}{V_{IN}}\) but I'm getting two different ones relatively to the \(KCL\) I use to calculate it.

Screenshot 2023-06-12 183238.png

With \( KCL \; A)\; -\frac{V_{IN}}{R_S} = \frac{V_{IN}-V_O}{R_F}\)
therefore with \(V_O = \left(1+\frac{R_F}{R_S} \right)V_{IN}\) , if I use:

  • \(KCL \; X)\; \frac{V_{IN}-V_X}{R_3}+sC\left(V_O-V_X\right) = \frac{V_X}{R_4}\) , \(\\\) then I get \( R_4V_{IN}-R_4V_X + sCR_3 R_4 \left(1+\frac{R_F}{R_S} \right)V_{IN} - sCR_3 R_4V_X=R_3 V_X\) , \(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{R_SR_4+sCR_3R_4\left( R_S+R_F\right)}{R_S\left(R_3+R_4 \right)+sCR_3R_4R_S} \) .

  • \( KCL\;O)\; \frac{V_{IN}-V_O}{R_F}=sC\left(V_O-V_X\right)\) , \(\\\) then I get \( V_{IN}-\left(1+\frac{R_F}{R_S} \right)V_{IN} = sCR_F\left(1+\frac{R_F}{R_S} \right)V_{IN}-sCR_FV_X\) ,\(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{1+sC\left(R_S+R_F\right)}{sCR_S}\) .

I was thinking that maybe not considering the current that goes into the output of the op-amp when applying Kirchhoff's current law at the \( O\) node is an error thus resulting in the second expression being wrong, but I'm not sure.
 

MrAl

Joined Jun 17, 2014
13,667
Hello there,

What reasoning do you use to equate those two in the second attempt:
(Vin-Vo)/Rf=s*C*(Vo-Vx)

That is, what makes you think these have to be equal currents?

A little about the notation being used.
I don't think it is a good idea to use mixed notation as it makes parts of the post harder to read. Using pure text mixed with Latex makes the lines look uneven and kind of strange. If you want to use Latex, then maybe better to use all Latex.
However, using Latex makes it harder for someone to check your work. That's because we have to type everything in and make sure we type it exactly as you did or else we might get a different result. If it was pure text, we could just copy and paste your text into our own software and check it in less than 1 minute. To check your first attempt, it took me about 10 minutes, but if it was in pure text i could have done it in less than 1 minute.
It's nice to see the formulas in Latex, but if you can post them in text also that would make checking them much, much faster for us.
It's up to you but i think you will get more replies if you use text, and if you still want to use Latex you can include that too.

I Checked your first attempt, and it does in fact look correct. You might also note that it contains all the components and is not missing any. It is rarer, although certainly not impossible, to eliminate components from a network through math, so if you see some missing you might think about if that is really possible for the given network.
 

Thread Starter

RitterTree

Joined Dec 18, 2022
23
What reasoning do you use to equate those two in the second attempt:
(Vin-Vo)/Rf=s*C*(Vo-Vx)

That is, what makes you think these have to be equal currents?
We consider the gain of ideal op-amps \( A \to \infty\), therefore given \(V_o = AV_d = A\left(V^+-V^-\right) \), the relationship holds true only if \(V_d \to 0\). If the op-amp has no feedback then its output saturates to its supply. Instead, if it has negative feedback, it tries to keep \( V_d = 0\) relatively to the input. In the case of the exercise there is negative feedback.
Am I wrong?

A little about the notation being used.
I don't think it is a good idea to use mixed notation as it makes parts of the post harder to read. Using pure text mixed with Latex makes the lines look uneven and kind of strange. If you want to use Latex, then maybe better to use all Latex.
However, using Latex makes it harder for someone to check your work. That's because we have to type everything in and make sure we type it exactly as you did or else we might get a different result. If it was pure text, we could just copy and paste your text into our own software and check it in less than 1 minute. To check your first attempt, it took me about 10 minutes, but if it was in pure text i could have done it in less than 1 minute.
It's nice to see the formulas in Latex, but if you can post them in text also that would make checking them much, much faster for us.
It's up to you but i think you will get more replies if you use text, and if you still want to use Latex you can include that too.
Noted. So, for instance, something like "\( A = \frac{\frac{B}{C}}{D} + E\)" would become "A = (B/C)/D + E" ?
Writing in latex is very time consuming but I thought that it was the right thing to do to make the math easily readable. I never thought someone would actually want to check the calculations with software.

Thanks again!
 

WBahn

Joined Mar 31, 2012
32,706
I'm trying to derive the expression for \( A_X = \frac{V_X}{V_{IN}}\) but I'm getting two different ones relatively to the \(KCL\) I use to calculate it.

View attachment 296304

With \( KCL \; A)\; -\frac{V_{IN}}{R_S} = \frac{V_{IN}-V_O}{R_F}\)
therefore with \(V_O = \left(1+\frac{R_F}{R_S} \right)V_{IN}\) , if I use:

  • \(KCL \; X)\; \frac{V_{IN}-V_X}{R_3}+sC\left(V_O-V_X\right) = \frac{V_X}{R_4}\) , \(\\\) then I get \( R_4V_{IN}-R_4V_X + sCR_3 R_4 \left(1+\frac{R_F}{R_S} \right)V_{IN} - sCR_3 R_4V_X=R_3 V_X\) , \(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{R_SR_4+sCR_3R_4\left( R_S+R_F\right)}{R_S\left(R_3+R_4 \right)+sCR_3R_4R_S} \) .

  • \( KCL\;O)\; \frac{V_{IN}-V_O}{R_F}=sC\left(V_O-V_X\right)\) , \(\\\) then I get \( V_{IN}-\left(1+\frac{R_F}{R_S} \right)V_{IN} = sCR_F\left(1+\frac{R_F}{R_S} \right)V_{IN}-sCR_FV_X\) ,\(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{1+sC\left(R_S+R_F\right)}{sCR_S}\) .

I was thinking that maybe not considering the current that goes into the output of the op-amp when applying Kirchhoff's current law at the \( O\) node is an error thus resulting in the second expression being wrong, but I'm not sure.
KCL applied to the output node HAS to account for the current sourced or sunk by the opamp. Remember, that's how an opamp works, is sources or sinks whatever current is necessary (within it's capabilities) in order to establish a particular voltage on the output node.
 

MrAl

Joined Jun 17, 2014
13,667
We consider the gain of ideal op-amps \( A \to \infty\), therefore given \(V_o = AV_d = A\left(V^+-V^-\right) \), the relationship holds true only if \(V_d \to 0\). If the op-amp has no feedback then its output saturates to its supply. Instead, if it has negative feedback, it tries to keep \( V_d = 0\) relatively to the input. In the case of the exercise there is negative feedback.
Am I wrong?



Noted. So, for instance, something like "\( A = \frac{\frac{B}{C}}{D} + E\)" would become "A = (B/C)/D + E" ?
Writing in latex is very time consuming but I thought that it was the right thing to do to make the math easily readable. I never thought someone would actually want to check the calculations with software.

Thanks again!
Hey there,

Well that's nice that you are looking into the Latex vs pure text issues, and remember if you like to show your results in Latex you can always include a pure text version along with it. The pure text version makes it very fast to check your expressions, while the Latex version makes it easier to read the expressions.

As to the equality, you will note that in the linear mode the two inputs are equal. That means the inverting input (vn) and the non inverting input (vp) are equal and acting like a voltage source with voltage equal to Vin. That makes the voltage across Rf equal to Vout-Vin, and the voltage across R3 in series with C equal to Vout-Vin. That means that for the current to be the same, the two impedances Rf and R3+zC would have to be equal at the operating frequency (zC is the impedance of C at the operating frequency). There is a catch however, and that is R4. R4 shunts some of the current out of the series combination of R3 and C so the actual impedance includes R4. That means in order to know the current though C we would have to include R3 and R4 in the calculation.

This is easy to check though. You know the circuit is basically a non inverting amplifier, and you know the output VOLTAGE is due to the input voltage and the two upper feedback resistors. So you know the input voltage Vin and the output voltage Vout. That means you can immediately calculate the current through Rf as iRf=(Vout-Vin)/Rf. You may note however that the current through C is not as easy to calculate because we have that pesky R4 resistor that goes to ground. If it was not for R4 we would have iC=(Vout-Vin)/(R3+zC) and that would be quite simple too. With R4 in the circuit though, we have to calculate the current through C using superposition (or some other method) because we have a three terminal network with two voltage sources Vin and Vout.

So, why don't you try that to be sure you have the right current through C, and also this is a good supplementary exercise. Calculate the current through Rf (symbolically would be best but you could start with some actual values too) and the current through C using the entire three component associated network, then equate the two and see if they are really equal.
There is a chance that you can find an equality, but it will only be at one operating frequency and so that's not really a general solution for this circuit. In fact, if you find that they are not equal for all frequencies then see if you can find a frequency where they are equal, but then you have to check the phase too to see if the phases are the same. To get the phase to be the same when the frequency is the right value is going to be next to impossible if ever possible simply because an RC network always has a phase shift while a single R never has a phase shift. It might still be interesting to find that frequency and then do the math to find out how much phase difference there is.

One of the simpler ways to help explain this is that the network with Rf affects the output voltage but because Vin is a voltage source at the non-inverting terminal, the network with R3, R4, and C do not affect the output. That in itself means there is no means for equality to happen to occur for the two currents.
 
Last edited:

RBR1317

Joined Nov 13, 2010
715
Because Vin is a voltage source (source impedance = zero) the output voltage Vo is determined only by Rs & Rf & Vin. Then Vx is determined only by the calculated value for Vo, Vin, R3, R4, & C. (Seems so to me.)

OP-amp.png
 

WBahn

Joined Mar 31, 2012
32,706
I'm trying to derive the expression for \( A_X = \frac{V_X}{V_{IN}}\) but I'm getting two different ones relatively to the \(KCL\) I use to calculate it.

View attachment 296304

With \( KCL \; A)\; -\frac{V_{IN}}{R_S} = \frac{V_{IN}-V_O}{R_F}\)
therefore with \(V_O = \left(1+\frac{R_F}{R_S} \right)V_{IN}\) , if I use:

  • \(KCL \; X)\; \frac{V_{IN}-V_X}{R_3}+sC\left(V_O-V_X\right) = \frac{V_X}{R_4}\) , \(\\\) then I get \( R_4V_{IN}-R_4V_X + sCR_3 R_4 \left(1+\frac{R_F}{R_S} \right)V_{IN} - sCR_3 R_4V_X=R_3 V_X\) , \(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{R_SR_4+sCR_3R_4\left( R_S+R_F\right)}{R_S\left(R_3+R_4 \right)+sCR_3R_4R_S} \) .

  • \( KCL\;O)\; \frac{V_{IN}-V_O}{R_F}=sC\left(V_O-V_X\right)\) , \(\\\) then I get \( V_{IN}-\left(1+\frac{R_F}{R_S} \right)V_{IN} = sCR_F\left(1+\frac{R_F}{R_S} \right)V_{IN}-sCR_FV_X\) ,\(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{1+sC\left(R_S+R_F\right)}{sCR_S}\) .

I was thinking that maybe not considering the current that goes into the output of the op-amp when applying Kirchhoff's current law at the \( O\) node is an error thus resulting in the second expression being wrong, but I'm not sure.
A couple of things that can be helpful in sanity checking results are the initial and final value theorems. Look these up.

So pick a waveform for Vin that you can determine the value of Vx at t=0+ and/or t=∞ confidently, preferably by inspection. Then apply these theorems to see if they agree. If they do, you might still have a problem, but If they don't, then you know something is wrong.

In this case, I'd recommend using a unit step function multiplied by Vs, making Vin = Vs/s.

Before the step, Vin = 0 and so Vo will equal 0 and so will Vx.

Immediately after the step, Vo will jump to Vs(Rf+Rs)/Rs.

Because the voltage across a capacitor can't change immediately, this will also be Vx at t=0+.

After a long time, The capacitor will look like an open circuit and so Vx will be Vs·R4/(R3+R4) at t=∞.
 

RoofSheep

Joined Mar 7, 2023
36
I'm trying to derive the expression for \( A_X = \frac{V_X}{V_{IN}}\) but I'm getting two different ones relatively to the \(KCL\) I use to calculate it.

View attachment 296304

With \( KCL \; A)\; -\frac{V_{IN}}{R_S} = \frac{V_{IN}-V_O}{R_F}\)
therefore with \(V_O = \left(1+\frac{R_F}{R_S} \right)V_{IN}\) , if I use:

  • \(KCL \; X)\; \frac{V_{IN}-V_X}{R_3}+sC\left(V_O-V_X\right) = \frac{V_X}{R_4}\) , \(\\\) then I get \( R_4V_{IN}-R_4V_X + sCR_3 R_4 \left(1+\frac{R_F}{R_S} \right)V_{IN} - sCR_3 R_4V_X=R_3 V_X\) , \(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{R_SR_4+sCR_3R_4\left( R_S+R_F\right)}{R_S\left(R_3+R_4 \right)+sCR_3R_4R_S} \) .

  • \( KCL\;O)\; \frac{V_{IN}-V_O}{R_F}=sC\left(V_O-V_X\right)\) , \(\\\) then I get \( V_{IN}-\left(1+\frac{R_F}{R_S} \right)V_{IN} = sCR_F\left(1+\frac{R_F}{R_S} \right)V_{IN}-sCR_FV_X\) ,\(\\\) therefore \( A_X = \frac{V_X}{V_{IN}} = \frac{1+sC\left(R_S+R_F\right)}{sCR_S}\) .

I was thinking that maybe not considering the current that goes into the output of the op-amp when applying Kirchhoff's current law at the \( O\) node is an error thus resulting in the second expression being wrong, but I'm not sure.
I think the reason for the two transfer functions is that the circuit is inherently infeasible. At high frequencies, the capacitor becomes a short circuit. This is the same as an opamp with its non-inverting input connected to its output. You would have to take some of the nonidealities of the opamp into account in order to get meaningful equations.
 

MrAl

Joined Jun 17, 2014
13,667
Because Vin is a voltage source (source impedance = zero) the output voltage Vo is determined only by Rs & Rf & Vin. Then Vx is determined only by the calculated value for Vo, Vin, R3, R4, & C. (Seems so to me.)

View attachment 296451
Hi,

Yes that was my whole point really. The two currents are going to be different in the general case and probably very hard if not impossible to get to be the same because one branch contains a capacitor and the other just a resistor, so one has complex impedance and the other just a real impedance.
I actually went through the calculations i mentioned to prove that the two currents are different.

You summed it up very well though.
 

WBahn

Joined Mar 31, 2012
32,706
I think the reason for the two transfer functions is that the circuit is inherently infeasible. At high frequencies, the capacitor becomes a short circuit. This is the same as an opamp with its non-inverting input connected to its output. You would have to take some of the nonidealities of the opamp into account in order to get meaningful equations.
No, the reason for the two transfer functions is that the second transfer function is based on an incorrect KCL equation that doesn't account for the current sourced/sunk by the op amp.

At high frequencies where the capacitor is becoming a short, the opamp output is NOT connected to the non-inverting input -- it is connected to midpoint of the R3, R4 resistor network. All that happens is that Vx becomes equal to Vo at that point.

Do the math and you will see that, as the frequency grows higher the voltage a Vx approaches Vin*(1 + Rf/Rs).
 

WBahn

Joined Mar 31, 2012
32,706
Hi,

Yes that was my whole point really. The two currents are going to be different in the general case and probably very hard if not impossible to get to be the same because one branch contains a capacitor and the other just a resistor, so one has complex impedance and the other just a real impedance.
I actually went through the calculations i mentioned to prove that the two currents are different.

You summed it up very well though.
The only way for those two currents to be the same is for the opamp to not be sourcing or sinking ANY current at all. That was an incorrect assumption on the part of the TS when they set up their KCL equation at the opamp output. The equation is simply wrong. It would only be valid if the opamp output were disconnected from the circuit, which would clearly make it a different circuit and not the one the TS is trying to analyze.

It's an incorrect assumption than many people make when they try to do KCL at a node connected to any kind of a voltage source -- they don't see how to account for the current in the source, but instead of recognizing that this makes it effectively impossible to use KCL at that node, their mind chooses to simply ignore it completely. You see the same thing at nodes connected to common.
 
I think the reason for the two transfer functions is that the circuit is inherently infeasible. At high frequencies, the capacitor becomes a short circuit. This is the same as an opamp with its non-inverting input connected to its output. You would have to take some of the nonidealities of the opamp into account in order to get meaningful equations.
In post #1 you said " I was thinking that maybe not considering the current that goes into the output of the op-amp when applying Kirchhoff's current law at the O node is an error "

In post #4, WBahn said " KCL applied to the output node HAS to account for the current sourced or sunk by the opamp. "

That's all there is to it; there's no mystery.

The standard opamp symbol conceals this. Remember that an opamp is just a dependent source; it's a VCVS (voltage controlled voltage source). If you redraw the circuit with the opamp replaced with a VCVS having the appropriate control law, it will be obvious that the current supplied or absorbed by it must be accounted for.

The circuit is not inherently infeasible; what does that even mean? An opamp with its inverting input connected to its output (this is a unity gain buffer) is not the same as a short circuit. A buffer is unilateral, whereas a true short circuit is bilateral. A true short circuit works in both directions, but a buffer only works in one direction.

Edit: Changed copied error "non-inverting" to "inverting".
 
Last edited:

WBahn

Joined Mar 31, 2012
32,706
An opamp with its non-inverting input connected to its output (this is a unity gain buffer) is not the same as a short circuit.
A unity gain buffer has it's output connected to the INVERTING input.

If it's connecting to the non-inverting input, then it is essentially a Schmitt trigger comparator on steroids.
 
A unity gain buffer has it's output connected to the INVERTING input.

If it's connecting to the non-inverting input, then it is essentially a Schmitt trigger comparator on steroids.
I copied and pasted " An opamp with its non-inverting input connected to its output " from post #8 intending to remove "non-" from it, but got distracted. What I said is still true with "unity gain buffer" as I used it. Unity gain buffers are NOT the same as a short circuit.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,706
I copied and pasted " An opamp with its non-inverting input connected to its output " from post #8 intending to remove "non-" from it, but got distracted. What I said is still true with "unity gain buffer" as I used it. Unity gain buffers are the same as a short circuit.
I think you've got another goof -- we all make them -- and meant to say that unity gain buffers are NOT the same as a short circuit.

I agree. This is why I balk when people talk about the ideal opamp amp criteria as being that the is a short between the inputs. It is best described as a virtual short -- when operating in the active region (and stable) the inputs are at the same voltage, but no current flows between those nodes. Even more erroneously, people will talk about the inputs being at ground (or a virtual ground). This only applies when in some circumstances, usually when the non-inverting input is tied to "ground". But since this is the common case in the first few opamp configurations people see, they tend to overgeneralize.
 
I think you've got another goof -- we all make them -- and meant to say that unity gain buffers are NOT the same as a short circuit.

I agree. This is why I balk when people talk about the ideal opamp amp criteria as being that the is a short between the inputs. It is best described as a virtual short -- when operating in the active region (and stable) the inputs are at the same voltage, but no current flows between those nodes. Even more erroneously, people will talk about the inputs being at ground (or a virtual ground). This only applies when in some circumstances, usually when the non-inverting input is tied to "ground". But since this is the common case in the first few opamp configurations people see, they tend to overgeneralize.
Of course I goofed. I did say it correctly in post #12. :)

I added "not" where it belongs in post #14 :oops: because that's the misconception I want RoofSheep to avoid.
 
I agree. This is why I balk when people talk about the ideal opamp amp criteria as being that the is a short between the inputs. It is best described as a virtual short -- when operating in the active region (and stable) the inputs are at the same voltage, but no current flows between those nodes. Even more erroneously, people will talk about the inputs being at ground (or a virtual ground). This only applies when in some circumstances, usually when the non-inverting input is tied to "ground". But since this is the common case in the first few opamp configurations people see, they tend to overgeneralize.
In another thread this circuit was given:
2Opamp.jpg

I remember thinking that in this circuit if an actual short is placed between nodes 3 and 4 the circuit behavior is not changed, but the unity gain buffer between nodes 7 and 6 can't be replaced by a true short.

I've noticed that students just learning to apply nodal analysis think that they can apply KCL at the output of an opamp willy-nilly. The standard opamp symbol conceals the fact that it supplies or absorbs current. Sometimes they recognize that the opamp output must be involved in currents to that node as RitterTree did in this thread, for which I give him credit. I think the best way to see what's going is to replace the opamp symbol with a dependent voltage source symbol.

For the advanced student, solving an opamp network with finite gain opamps doesn't allow the virtual short shortcut, and necessitates a full solution. The limitations of the virtual short concept then become apparent.
 

MrAl

Joined Jun 17, 2014
13,667
In another thread this circuit was given:
View attachment 296492

I remember thinking that in this circuit if an actual short is placed between nodes 3 and 4 the circuit behavior is not changed, but the unity gain buffer between nodes 7 and 6 can't be replaced by a true short.

I've noticed that students just learning to apply nodal analysis think that they can apply KCL at the output of an opamp willy-nilly. The standard opamp symbol conceals the fact that it supplies or absorbs current. Sometimes they recognize that the opamp output must be involved in currents to that node as RitterTree did in this thread, for which I give him credit. I think the best way to see what's going is to replace the opamp symbol with a dependent voltage source symbol.

For the advanced student, solving an opamp network with finite gain opamps doesn't allow the virtual short shortcut, and necessitates a full solution. The limitations of the virtual short concept then become apparent.
Hi,

I sometimes like to refer to this phenomenon as to what kind of node it is. For example, 6 is a voltage node while 7 is an impedance node.

Of course in real life we cannot short 3 and 4 either, that's worth noting i think.
 
Of course in real life we cannot short 3 and 4 either, that's worth noting i think.
In real life opamps don't have infinite gain. It's a puzzle, don't you think, that the assumption of ideal opamps means that in a particular circuit we have an opamp with infinite gain such that the voltage between plus and minus inputs is truly zero, but the output of the opamp is some finite value? Apparently, sometimes zero volts times infinite gain (0 * ∞) is a finite value.
 

WBahn

Joined Mar 31, 2012
32,706
I've noticed that students just learning to apply nodal analysis think that they can apply KCL at the output of an opamp willy-nilly. The standard opamp symbol conceals the fact that it supplies or absorbs current. Sometimes they recognize that the opamp output must be involved in currents to that node as RitterTree did in this thread, for which I give him credit. I think the best way to see what's going is to replace the opamp symbol with a dependent voltage source symbol.
For most students that make this mistake, I think the problem is that they are trying to blindly apply rules without understanding concepts -- is far too common for my tastes. In the case of an opamp, they are told that there is no current into or out of the input pins (under the ideal opamp model) and they then blindly interpret this as being that there is no current into or out of any opamp pin. The ones that understand things well enough to even think of replacing the opamp with a VCVS generally aren't the ones that make this kind of blind conclusion in the first place.
 
Top