# Determine Vout/Vin for a circuit

#### beggi9

Joined Mar 3, 2016
42
I'm uncertain about a few things regarding these circuit problems.

1) Determine Vout/Vin for the circuit ( see photo 1) and explain how it works when
a) The switch is connected to the ground
-- Here I would think that Vout/Vin=-R/R=-1 and it would work as a magnifier where the same current goes through both resistors.

b) The switch is connected to Vin
--I'm really not sure here, would it work like a non-inverting amplifier with gain = 1. Would the resistor between the inputs have no affect?

2) Determine Vout/Vin for the circuit (see photo 2). Assume that it's a perfect operation amplifier (that is v+=v-)
I think the 10kΩ would have virtually no effect here so it would simply be:
Vin=Va, Va=Vout*(20kΩ/(20kΩ+20kΩ+5kΩ))
so Vout/Vin=45kΩ/20kΩ=4.5

3) For the circuit (see photo 3)
a) Find the Vout/Vin
I got Vout/Vin = (R2 + 1/jωC)/(R2 + 1/jωC + R1)
But that ground troubles me, would it change anything?
b) Find the length of Vout/Vin, and what it would be if ω→0, ω→∞
Given that a) is correct I got |Vout/Vin| = sqrt(R2^2+1/ω^2C^2)/sqrt(R1^2+R2^2+1/ω^2C^2)
if ω→0 then |Vout/Vin|→1
if ω→∞ then |Vout/Vin|→R2/sqrt(R1^2+R2^2)

#### Jony130

Joined Feb 17, 2009
5,445
1 ) Do you ever heard about inverting and non-inverting amplifier ?
I think the 10kΩ would have virtually no effect here so it would simply be:
Vin=Va, Va=Vout*(20kΩ/(20kΩ+20kΩ+5kΩ))
so Vout/Vin=45kΩ/20kΩ=4.5
Wrong, 10K together with 5k resistor will have big impact on Vout.
Tip - non-inverting amplifier + voltage divider.

3) there must be something wrong with your solution, because |Vout/Vin| for ω→∞ should be equal to R2/(R1+R2)

• beggi9

#### beggi9

Joined Mar 3, 2016
42
1 ) Do you ever heard about inverting and non-inverting amplifier ?

Wrong, 10K together with 5k resistor will have big impact on Vout.
Tip - non-inverting amplifier + voltage divider.

3) there must be something wrong with your solution, because |Vout/Vin| for ω→∞ should be equal to R2/(R1+R2)
(1) Yes I've heard of them, but we were only shown two types and no further explanations. So if the switch is connected to the ground it would be an inverting amplifier right? with Vout/Vin=-R/R=-1. When the switch is connected to Vin I though that it might be non-inverting amplifier but to be honest I don't fully understand how v+=v- when the resistor is between them (over that there would be a voltage drop I presume).

(3) Oh okay, do you see a fault that I'm doing? No matter how I look at it I can't seem to be able to get R2/R1^2+R2^2.

And hmm okay thank you so much for your help, I'll have a closer look on the circuit in nr.2 ... I thought that Vout would be equal in both 10Ω and 5Ω-20Ω-20Ω and that everything going through 10Ω would simply bypass straight to the ground.

#### WBahn

Joined Mar 31, 2012
28,475
(1) Yes I've heard of them, but we were only shown two types and no further explanations. So if the switch is connected to the ground it would be an inverting amplifier right? with Vout/Vin=-R/R=-1. When the switch is connected to Vin I though that it might be non-inverting amplifier but to be honest I don't fully understand how v+=v- when the resistor is between them (over that there would be a voltage drop I presume).
Yes, when the switch is at ground your explanation is correct.

When the switch is at Vin then the voltage at v+ will be Vin and the output will be whatever is required in order to make the voltage at v- also equal to Vin. Because there is a resistor between Vin and v-, that means that there can't be ANY voltage drop across the resistor, which means there can't be any current in the resistor. If there is no current in that resistor, then there won't be any current in the other resistor. What does that then mean about Vout?

(3) Oh okay, do you see a fault that I'm doing? No matter how I look at it I can't seem to be able to get R2/R1^2+R2^2.
That's good, because the answer ISN'T doesn't involve R2/R1^2+R2^2

You problem is that you are missing a critical point, and that is that the magnitude of a complex number is the square root of the squares of the real and the imaginary parts (because the real part is 90° away from the imaginary part). You are treating R1 and R2 as if they are not only 90° away from the imaginary part, but also from each other.

And hmm okay thank you so much for your help, I'll have a closer look on the circuit in nr.2 ... I thought that Vout would be equal in both 10Ω and 5Ω-20Ω-20Ω and that everything going through 10Ω would simply bypass straight to the ground.
Everything going through the 10 kΩ does pass straight to ground -- but your output voltage is the voltage that is developed across the 10 kΩ resistor as this happens. Remember that Vout in this circuit is NOT the same as the output of the opamp.

• beggi9

#### The Electrician

Joined Oct 9, 2007
2,924
You problem is that you are missing a critical point, and that is that the magnitude of a complex number is the square root of the sum of the squares of the real and the imaginary parts (because the real part is 90° away from the imaginary part). You are treating R1 and R2 as if they are not only 90° away from the imaginary part, but also from each other.
I think the part in red above should be added to your explanation. • beggi9

#### beggi9

Joined Mar 3, 2016
42
Yes, when the switch is at ground your explanation is correct.

When the switch is at Vin then the voltage at v+ will be Vin and the output will be whatever is required in order to make the voltage at v- also equal to Vin. Because there is a resistor between Vin and v-, that means that there can't be ANY voltage drop across the resistor, which means there can't be any current in the resistor. If there is no current in that resistor, then there won't be any current in the other resistor. What does that then mean about Vout?.
That means Vin = Vout, and Vout/Vin=1 right?

Everything going through the 10 kΩ does pass straight to ground -- but your output voltage is the voltage that is developed across the 10 kΩ resistor as this happens. Remember that Vout in this circuit is NOT the same as the output of the opamp.
Of course, so it should be: (Vb=output of the opamp)
Vin=Vb*(20kΩ/20kΩ+20kΩ) ---> Vb=2Vin
Then there is a voltage divider so:
10kΩ/15kΩ * Vb = Vout ---> Vout/Vin = 1.333 (4/3)

You problem is that you are missing a critical point, and that is that the magnitude of a complex number is the square root of the squares of the real and the imaginary parts (because the real part is 90° away from the imaginary part). You are treating R1 and R2 as if they are not only 90° away from the imaginary part, but also from each other.
Okay I need to take better look at that one and think it over.

#### WBahn

Joined Mar 31, 2012
28,475
I think the part in red above should be added to your explanation. Yes, it should. It's implied, but it's better if it is explicit.

#### WBahn

Joined Mar 31, 2012
28,475
Vin=Vb*(20kΩ/20kΩ+20kΩ) ---> Vb=2Vin
Take more care in writing your expressions. What you have written above is equivalent to

Vb*((20 kΩ / 20 kΩ) + 20 kΩ) = Vb*(1 + 20 kΩ)

Which, had you made the mistake of evaluating it the way you wrote it (which is an easy mistake to make), the fact that you are properly tracking your units (thank you!) would have let you catch the mistake since you can't add a pure number (1) to a resistance (20 kΩ).

Okay I need to take better look at that one and think it over.
Think of it this way:

X = 3 + j4

What is the magnitude?

|X| = √(3² + 4²) = √25 = 5

X = 1 + 2 + j4

Your way would have it be

|X| = √(1² + 2² + 4²) = √21 = 4.58

You MUST identify the real part and the imaginary part and take the Pythagorean sum of those two components.

X = (1 + 2) + j(4)

|X| = √( (1 + 2)² + (4)² ) = 5

• beggi9

#### beggi9

Joined Mar 3, 2016
42
You MUST identify the real part and the imaginary part and take the Pythagorean sum of those two components.

X = (1 + 2) + j(4)

|X| = √( (1 + 2)² + (4)² ) = 5
Okay so it should be:
|Vout/Vin| = sqrt(R2^2+1/ω^2C^2)/sqrt((R1+R2)^2+1/ω^2C^2)
so when ω-->0 then |Vout/Vin|-->1
and ω-->infinite then |Vout/Vin|-->R2/(R1+R2)

#### WBahn

Joined Mar 31, 2012
28,475
Okay so it should be:
|Vout/Vin| = sqrt(R2^2+1/ω^2C^2)/sqrt((R1+R2)^2+1/ω^2C^2)
so when ω-->0 then |Vout/Vin|-->1
and ω-->infinite then |Vout/Vin|-->R2/(R1+R2)
Yes, very good.

But you still need to watch order of operations in your writing.

You should have typed

sqrt(R2^2 + 1/(ω^2C^2)) / sqrt((R1+R2)^2 + 1/(ω^2C^2))

If you type

x = 1/ab

then this is equivalent to

x = (1/a) * b, or effectively b/a

because multiplication and division have equal precedence and are performed left to right.

I harp on these things because it is very, very common for people to make these kinds of mistakes when entering code into a spreadsheet or program or some other electronic form and end up with wrong results that they can't track down because they don't see anything wrong. So you want to get in the habit of seeing stuff like 1/ab as being wrong.

Now, since someone may likely point out that in almost any programming environment, 1/ab would either see 'ab' as a single identifier or, if 'a' and 'b' are declared, it would see it as a syntax error. That's certainly the case, but the concept still applies. People write 1/a+b when they mean 1/(a+b) or they write 1/a*b when they mean 1/(a*b). In both of these cases, the incorrect code would compile and run (in almost all languages).

As a final note, you can sanity check these results by realizing that, at DC, a capacitor looks like an open circuit while at very high frequencies it looks like a short. So do a quick visual analysis of the circuit with the capacitor removed and left open and then with it removed and replaced by a short and see if those results agree with the results you obtain from the transfer function.

Oh, and you can simplify the form of the result a bit to

|Vout/Vin| = sqrt( [1 + (ωR1C)^2)] / [1 + (ω(R1_R2)C)^2)] )

• beggi9

#### The Electrician

Joined Oct 9, 2007
2,924
Yes, very good.

But you still need to watch order of operations in your writing.

You should have typed

sqrt(R2^2 + 1/(ω^2C^2)) / sqrt((R1+R2)^2 + 1/(ω^2C^2))

If you type

x = 1/ab

then this is equivalent to

x = (1/a) * b, or effectively b/a

because multiplication and division have equal precedence and are performed left to right.

I harp on these things because it is very, very common for people to make these kinds of mistakes when entering code into a spreadsheet or program or some other electronic form and end up with wrong results that they can't track down because they don't see anything wrong. So you want to get in the habit of seeing stuff like 1/ab as being wrong.

Now, since someone may likely point out that in almost any programming environment, 1/ab would either see 'ab' as a single identifier or, if 'a' and 'b' are declared, it would see it as a syntax error. That's certainly the case, but the concept still applies. People write 1/a+b when they mean 1/(a+b) or they write 1/a*b when they mean 1/(a*b). In both of these cases, the incorrect code would compile and run (in almost all languages).

As a final note, you can sanity check these results by realizing that, at DC, a capacitor looks like an open circuit while at very high frequencies it looks like a short. So do a quick visual analysis of the circuit with the capacitor removed and left open and then with it removed and replaced by a short and see if those results agree with the results you obtain from the transfer function.

Oh, and you can simplify the form of the result a bit to

|Vout/Vin| = sqrt( [1 + (ωR1C)^2)] / [1 + (ω(R1_R2)C)^2)] )
An objection I have to your example of:

x = 1/ab

is that depending on how the program executing the expression assigns operator precedence to * and /, 1/ab might evaluate as 1/(ab).
But the precedence of * and / will always be greater than + and - (I've never seen an exception to this, but I have seen different choices for precedence of * and /), so the example of 1/a+b avoids that possibility.

Better yet, encourage people to use Tex.

#### beggi9

Joined Mar 3, 2016
42
I harp on these things because it is very, very common for people to make these kinds of mistakes when entering code into a spreadsheet or program or some other electronic form and end up with wrong results that they can't track down because they don't see anything wrong. So you want to get in the habit of seeing stuff like 1/ab as being wrong.
But yes the teacher added a last minute extra for the last problem to determine what |Vout/Vin| is when ω=10kHz and pointed out that Vin=V0*sin(ωt).
Shouldn't I just put in 10kHz into the equation for |Vin/Vout|, I don't see how Vin=V0*sin(ωt) is relevant (except to just tell me that the wave is sin).
But do I perhaps have to change the units first (that is from Hz to rad/s or something like that) before I put it into the equation?

Last edited:

#### WBahn

Joined Mar 31, 2012
28,475
An objection I have to your example of:

x = 1/ab

is that depending on how the program executing the expression assigns operator precedence to * and /, 1/ab might evaluate as 1/(ab).
But the precedence of * and / will always be greater than + and - (I've never seen an exception to this, but I have seen different choices for precedence of * and /), so the example of 1/a+b avoids that possibility.

Better yet, encourage people to use Tex.
I don't think that the fact that there may be some language out there that might interpret the expression the way it was intended is sufficient justification to write text expressions in a way that violates not only the way that most programming languages will interpret them, but also the nearly universal precedence and associativity rules that nearly everyone learns in math, which means that when someone writes x = 1/ab in text that nearly everyone should interpret this as x = (1/a)*b.

I can think of at least one language, Jack, in which the precedence and associativity of all of the arithmetic operators are implementation defined entirely. But in most programming languages the rules follow the conventional math rules in which multiplication and division have equal precedence and are left associative.

As for using Tex -- that's fine. But it is not always an option. But more to the point I was trying to make is that you do not enter equations into most evaluation engines using Tex -- you input them in text form and so when you do use text form, even if it is not actually being evaluated, it is good to get in the habit of doing it correctly -- and that is in addition to the fact that it is not good practice to be sloppy and write wrong equations that you expect the people reading them to interpret correct just because they know what you meant.

#### WBahn

Joined Mar 31, 2012
28,475
But yes the teacher added a last minute extra for the last problem to determine what |Vout/Vin| is when ω=10kHz and pointed out that Vin=V0*sin(ωt).
Shouldn't I just put in 10kHz into the equation for |Vin/Vout|, I don't see how Vin=V0*sin(ωt) is relevant (except to just tell me that the wave is sin).
But do I perhaps have to change the units first (that is from Hz to rad/s or something like that) before I put it into the equation?
The Vo would be relevant if you were asked for Vout, but for |Vout/Vin| the Vo factors cancel.

You do have to change units because Hz is in units of cycles/second and, like all transcendental functions, the sine function requires a dimensionless argument. So the frequency needs to be in radians/second (or radians per some unit of time) so that, when multiplied by 't' you end up with something in radians, which is dimensionless. So you use the conversion factor that equates 360° to 2π radians.

• beggi9