Improving equation for selective amplifier's LC tank impedance

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
I would like to incorporate resistor - I name it R6 in attached screenshot (which is in series with inductor and both parallel with capacitor)
into equation of LC tank's impedance. Why? Because real inductor has resistor connected in series with it.
I am including only LC impedance equation, not entire script, which calculates AC voltage gain.

// 1ST EQUATION
// produces result of AC voltage gain equation: -103.09889, which is far from peak inside bode plotter inside simulator
var ZC = 1 / (2*Math.PI*f*C);
var ZL = 2*Math.PI*f*L;
var Zlc = (ZL * ZC) / (ZL + ZC);

// 2ND EQUATION
// this one produces result of AC voltage gain equation: -1373.9779, which corresponds to measured value inside bode plotter inside multisim
var Zlc = (2*Math.PI*f*L) / (1 - ((2*Math.PI*f*L)*2*Math.PI*f*C));


I don't understand why second equation works, because it is derived from first equation (I took both equations from
https://www.geeksforgeeks.org/lc-circuits/ ).

Please see attached second screenshot, to see where they are originally on website.

Increasing R6 resistor value, the AC voltage gain at resonant frequency drops down inside simulator.
Where in my second equation to put it's resistance variable, so it would reflect the simulated one?
 

Attachments

Papabravo

Joined Feb 24, 2006
21,256
I think your transcription of the 2nd equation is wrong.
The algebra is fairly simple and it looks like this:

\( \text{Let }\omega=2\pi f \)

\( \cfrac{Z_L\times Z_C}{Z_L+Z_C}\;=\cfrac{j\omega L \cdot\cfrac{1}{j\omega C}}{j\omega L+\cfrac{1}{j\omega C}} \)

\( =\;\cfrac{\cfrac{L}{C}}{\cfrac{j^2\omega^2LC\;+\;1}{j\omega C}}\cdot\cfrac{j\omega C}{j\omega C}\;=\;\cfrac{j\omega L}{1\;-\;\omega^2LC} \)
 
Last edited:

WBahn

Joined Mar 31, 2012
30,233
You say that the second equation is derived from the first.

So, if that's the case, how does that minus sign appear out of nowhere in the second equation given that there's no subtractions going on in the first?
 

WBahn

Joined Mar 31, 2012
30,233
Impedance (typically indicated by the variable Z), is a complex number.

What you have in your first set of equations are reactances (usually indicated by the variable X), not impedances. Worse, you are defining your reactances such that they are positive quantities, but then using equations that assume that they are signed quantities. You need to pick one or the other and not mix and match them.

I recommend using the convention that reactance is a signed quantity (positive for inductive reactance and negative for capacitive reactance), that makes the equations and the logic much simpler and makes it less likely that you will make the mistake you made in your first set of equations.
 

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
You say that the second equation is derived from the first.

So, if that's the case, how does that minus sign appear out of nowhere in the second equation given that there's no subtractions going on in the first?
It appears to be derived from first - please see my 2nd screen
 

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
Impedance (typically indicated by the variable Z), is a complex number.

What you have in your first set of equations are reactances (usually indicated by the variable X), not impedances. Worse, you are defining your reactances such that they are positive quantities, but then using equations that assume that they are signed quantities. You need to pick one or the other and not mix and match them.

I recommend using the convention that reactance is a signed quantity (positive for inductive reactance and negative for capacitive reactance), that makes the equations and the logic much simpler and makes it less likely that you will make the mistake you made in your first set of equations.
I am not using 1st equation pack, since it does not produce correct result for me.
Is there anything wrong with 2nd one? Would that one produce bad result in some cases?
 

WBahn

Joined Mar 31, 2012
30,233
It appears to be derived from first - please see my 2nd screen
It appears that you don't know what 'j' represents, and so you just conveniently throw it out.

Math doesn't work that way.

What you have as your first equation:

var ZC = 1 / (2*Math.PI*f*C);
var ZL = 2*Math.PI*f*L;
var Zlc = (ZL * ZC) / (ZL + ZC);
While the last equation there is correct, your first two are not.

ZC = 1 / (j*2*Math.PI*f*C);
ZL = j*2*Math.PI*f*L;

You cannot just ignore the imaginary unit!
 

WBahn

Joined Mar 31, 2012
30,233
I am not using 1st equation pack, since it does not produce correct result for me.
Is there anything wrong with 2nd one? Would that one produce bad result in some cases?
It doesn't produce the correct result because it is wrong.

The second one will produce bad things at resonance because it will result in division by zero.

None of these equations incorporate the series resistance of the inductor.
 

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
I think I got the right equation for incorporating inductor's resistor.

var r = 100; // this is resistor of real inductor
var Zlc = (2*Math.PI*f*L-r) / (1 - (2*Math.PI*f*L-r)*2*Math.PI*f*C);

So I subtract r from the X_l reactance. X_l equals 2*Math.PI*f*L
I tested many r's and the result corresponds with one inside simulator
 

Papabravo

Joined Feb 24, 2006
21,256
I think I got the right equation for incorporating inductor's resistor.

var r = 100; // this is resistor of real inductor
var Zlc = (2*Math.PI*f*L-r) / (1 - (2*Math.PI*f*L-r)*2*Math.PI*f*C);

So I subtract r from the X_l reactance. X_l equals 2*Math.PI*f*L
I tested many r's and the result corresponds with one inside simulator
Why do you think the minus sign is correct? That would correspond to a negative resistance. The correct expression for the series combination of a resistor and an inductor is:

\( Z_{LR}\;=\;R\;+\;j\omega L \)

It is a complex number with a real part R and an imaginary part ωL. The magnitude of this complex number is:

\( |Z_{RL}|\;=\;\sqrt{R^2\;+\;(\omega L)^2} \)

You can also compute the angle this impedance makes with the real axis as:

\(\angle Z_{RL}\;=\;tan^{-1}\left(\cfrac{\omega L}{R}\right) \)
 
Last edited:

WBahn

Joined Mar 31, 2012
30,233
I think I got the right equation for incorporating inductor's resistor.

var r = 100; // this is resistor of real inductor
var Zlc = (2*Math.PI*f*L-r) / (1 - (2*Math.PI*f*L-r)*2*Math.PI*f*C);

So I subtract r from the X_l reactance. X_l equals 2*Math.PI*f*L
I tested many r's and the result corresponds with one inside simulator
Again, impedance is a complex quantity. You are just ignoring that fact and doing math-by-happening -- you're hoping that something will somehow happen to work out right.
 

Papabravo

Joined Feb 24, 2006
21,256
Again, impedance is a complex quantity. You are just ignoring that fact and doing math-by-happening -- you're hoping that something will somehow happen to work out right.
It is true that a stopped clock will tell the correct time twice a day, and that has about the same utility as math-by-happening.
 

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
As WBahn has said more than once, you can't just throw away the "j" in the equations. You need to do proper complex arithmetic to get the correct answer.

See:

View attachment 316353
Can you please correct my javascript code how to get the final number, like
under yours "(* Evaluate properly as a complex expresion *)",
the Z1 equation. Because in my JavaScript code, the bolded line
throws wrong number, because of missing j .



function parallel(v1, v2)
{
return (v1*v2) / (v1+v2);
}

var ICQ = 7 / 1000;
var beta = 100;
var VT = 26 / 1000;
var gm = ICQ / VT;
var rx = 19;
var rπ = beta / gm;
var ro = 22.5 * 1000;
var ro_avg = 22.5 * 1000;
var hre = 4 * (1/10000);
var rμ = rπ / hre;
var rout_miller = rμ;

var f = 15.915 * 1000 * 1000;
var C = 10 / 1000 / 1000 / 1000 / 1000;
var L = 10 / 1000 / 1000;

var ZC = 1 / (2*Math.PI*f*C);
var ZL = 2*Math.PI*f*L;
var Zlc = (ZL * ZC) / (ZL + ZC);


var Rl = 10000;
var Rlentire = 1 / (1/ro_avg + 1/Zlc + 1/Rl + 1 / rout_miller);
var Av = -gm * Rlentire;
var rin_miller = rμ / (1 + gm * Rlentire);
var Rb = parallel(10.13 * 1000, 3.143 * 1000);
var partA0 = (rπ*rin_miller)/(rπ+rin_miller);
var partA1 = rx + partA0;
var Rs = 1 / (1/ Rb + 1 / partA1 );
var partB1 = parallel(rπ, rin_miller);
var partB2 = partB1 / (partB1 + rx);
var partB3 = Rs / (Rs + 50);
var Avs = Av * partB2 * partB3;

console.log('AC voltage gain: ' + Avs.toString());
 
georgefrenk,

I don't know javascript, so I can't help you with that.

You are trying to analyze the behavior of a circuit with inductors and capacitors in steady state without using complex arithmetic.

javascript is not well suited to this, although I see that it is possible to do complex arithmetic in javascript: https://stackoverflow.com/questions/15399340/how-to-calculate-with-complex-numbers-in-javascript

I think you may not have taken a course in AC circuit analysis where you would have learned how to use complex numbers: https://open.umn.edu/opentextbooks/textbooks/883

You might also search on youtube for "AC analysis of bjt"

Are you a student at a school, or are you doing this by yourself? Most schools where circuit analysis is taught will have math programs such as Mathcad, or Matlab, etc., available. These math programs are much more suitable for what you're trying to do than javascript.
 

Thread Starter

georgefrenk

Joined Dec 24, 2023
54
I am not student at school, I am doing this for hobby. I have to figure out how to restructure my equation to make the result of my script correct. I don't understand why numerically solving (I mean ignoring j and putting values in variables) as I am doing is wrong.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,256
I am not student at school, I am doing this for hobby. I have to figure out how to restructure my equation to make the result of my script correct. I don't understand why numerically solving (I mean ignoring j and putting values in variables) as I am doing is wrong.
If you do not understand complex numbers, then I suggest that you put your immediate problem to the side temporarily so you can devote yourself to acquiring the requisite understanding. Only then can you appreciate why it is wrong. At this point the explanation would make no sense to you.

As it turns out this site has the resources to get you started:
Search Results (allaboutcircuits.com)
 

WBahn

Joined Mar 31, 2012
30,233
I am not student at school, I am doing this for hobby. I have to figure out how to restructure my equation to make the result of my script correct. I don't understand why numerically solving (I mean ignoring j and putting values in variables) as I am doing is wrong.
This is like saying that you don't understand why you ignoring everything to the left of the decimal point is wrong.

A better analogy is that if you are given directions in terms of going so many steps north (with negative values meaning go south) combined with so many steps east (with negative values meaning go west), why you can't just ignore the N and E notations on all of the directions and just treat everything as a north direction. Would you expect to get to the proper destination doing that?

j is the "imaginary unit". It is the value that, when squared, yields -1.

A complex number has a real part and an imaginary part,

z = a + jb

where a and b are both real numbers, known as the "real part" and the "imaginary part" of z, respectively. These are written as

a = Re{z]
b = Im{z}

Complex numbers obey all of the normal rules of algebra, so if we add two complex numbers together,

z1 = a + jb
z2 = c + jd

z3 = z1 + z2 = a + jb + c + jd = (a + c) + j(b + d)

If we multiply them together, we get

z4 = z1·z2 = (a + jb)(c + jd) = ac + jbc + jad + j²bd

We know that j² = -1 (this is the definition of j), so this becomes

z4 = ac + jbc + jad + (-1)bd = (ac - bd) + j(bc + ad)

That's the real basics of complex math -- and it is enough to solve your problem, if you will just be careful and stop ignoring parts of equations that you don't happen to understand.
 
Top