# Impedance Calculation

#### PAKMAN

Joined Apr 21, 2018
16
Hmmmm?....

Is ChatGPT correct here? If a series circuit containing a capacitor, inductor and resistor is driven at a known fixed frequency, then is the Impedance calculation as simple as Z=R+Xl-Xc? Why is the impedance triangle not necessary?

#### Papabravo

Joined Feb 24, 2006
21,217
You still have an impedance triangle except in the case where the inductive reactance is equal to the capacitive reactance. In that case you have a degenerate triangle along the real axis. This happens because of the presence of the imaginary unit j in the denominator of the expression for capacitive reactance.

$$\cfrac{1}{j\omega C}\cdot\cfrac{j}{j}\;=\;\cfrac{j}{j^2\omega C}\;=\;\cfrac{-j}{\omega C}$$

Taking the magnitude of the impedance to get the reactance, we get the desired expression:

$$X_{TOTAL}\;=\;X_L\;-\;X_C$$

#### LvW

Joined Jun 13, 2013
1,753
I am afraid that in the future we will be asked - more amd more - in this forum to correct ChatGPT errors.

#### PAKMAN

Joined Apr 21, 2018
16
You still have an impedance triangle except in the case where the inductive reactance is equal to the capacitive reactance. In that case you have a degenerate triangle along the real axis. This happens because of the presence of the imaginary unit j in the denominator of the expression for capacitive reactance.

$$\cfrac{1}{j\omega C}\cdot\cfrac{j}{j}\;=\;\cfrac{j}{j^2\omega C}\;=\;\cfrac{-j}{\omega C}$$

Taking the magnitude of the impedance to get the reactance, we get the desired expression:

$$X_{TOTAL}\;=\;X_L\;-\;X_C$$
So ChatGPT gets it wrong again?

#### Papabravo

Joined Feb 24, 2006
21,217
So ChatGPT gets it wrong again?
I did not say that. In fact, I think they have it right. The two reactances do indeed have opposite signs. Just look at a VNA display.

#### LvW

Joined Jun 13, 2013
1,753
So ChatGPT gets it wrong again?
Yes - of course. ChatGPT did not consider any phase shift - the result will be a complex impedance.

#### Ron H

Joined Apr 14, 2005
7,063
I did not say that. In fact, I think they have it right. The two reactances do indeed have opposite signs. Just look at a VNA display.
But you just said (correctly): "You still have an impedance triangle except in the case where the inductive reactance is equal to the capacitive reactance." ChatGPT didn't mention equal magnitudes. Am I missing something?

#### Papabravo

Joined Feb 24, 2006
21,217
The only time you have a triangle is when the imaginary part is nonzero. When the imaginary part is zero and the real part is nonzero the triangle collapses into a line. If you are missing something, I can't fathom what it might be.

ETA: Reactances are real numbers, and the corresponding impedance is the reactance times the imaginary unit j. It is wrong to add a resistance and a reactance. The magnitude of a resistance and a non-zero net reactance is:

$$Z_T\;=\;\sqrt{R^2+X_T^2}$$

Last edited:

#### WBahn

Joined Mar 31, 2012
30,008
Hmmmm?....

Is ChatGPT correct here? If a series circuit containing a capacitor, inductor and resistor is driven at a known fixed frequency, then is the Impedance calculation as simple as Z=R+Xl-Xc? Why is the impedance triangle not necessary?
Don't rely on ChatGPT to EVER be correct. Yes, sometimes it is, but only because it happens to statistically end up being the most likely chain of words in its search vector. The correctness, and internal consistency even, of that search vector depends on how predominant the "correct" answer is. As soon as you start adding in common alternate ways of expressing things, the quality of it's generated babble goes to hell.

The impedance of a series circuit is the sum of the individual impedances. But impedances are complex quantities, while reactances are the real coefficients of impedance (and resistances are the real part of the impedance). Resistances add in series. Reactances add in series. Resistance and reactances in series do not add.

The ChatGPT response also makes a very common mistake (because this is an extremely common mistake found all over the place) and has capacitive reactance as being a positive quantity. It isn't, it's negative. But it is common for "trade school" level courses to treat it as a positive number and then deal with the fact that it is negative by mangling simple equations in order to artificially carrying the minus sign via subtraction. This works find for the simplest of cases, but it makes it extremely difficult to analyze more complex systems symbolically because you end up with exploding special cases based on whether the unknown magnitude of the inductive reactance is greater or less than the capacitive reactance, rather than just treating reactance as reactance and letting the math take care of itself in the end.

At least the ChatGPT response came with with a series of babble that turned out to be internally consistent in this sense, which is far from always being the case.

#### WBahn

Joined Mar 31, 2012
30,008
I did not say that. In fact, I think they have it right. The two reactances do indeed have opposite signs. Just look at a VNA display.
They only have it right under the very special case that the two reactances cancel each other out (i.e., at resonance). The response says nothing about resonance, only that the frequency is fixed. At anything other than resonance, their equation is simply wrong.

Aside from that, how do the two reactances, as they have defined them, have opposite signs?

They have defined capacitive reactance as 1/(2πfC) and inductive reactance as 2πfL, both of which are positive quantities (for positive frequencies and component values).

They have divorced the sign of capacitive reactance from the reactance and embedded it into a formula that is more complicated as a result than it needs to be.

#### Ron H

Joined Apr 14, 2005
7,063
The only time you have a triangle is when the imaginary part is nonzero. When the imaginary part is zero and the real part is nonzero the triangle collapses into a line. If you are missing something, I can't fathom what it might be.

ETA: Reactances are real numbers, and the corresponding impedance is the reactance times the imaginary unit j. It is wrong to add a resistance and a reactance. The magnitude of a resistance and a non-zero net reactance is:

$$Z_T\;=\;\sqrt{R^2+X_T^2}$$
I know you understand complex impedance. I was just reacting to this statement: " I think they have it right ".

#### Papabravo

Joined Feb 24, 2006
21,217
I know you understand complex impedance. I was just reacting to this statement: " I think they have it right ".
For normal frequency ranges where lumped components are appropriate, what they got right was the signs of the reactances. I glossed over the part about adding reactance to resistance. That is never appropriate.

#### PAKMAN

Joined Apr 21, 2018
16
Don't rely on ChatGPT to EVER be correct. Yes, sometimes it is, but only because it happens to statistically end up being the most likely chain of words in its search vector. The correctness, and internal consistency even, of that search vector depends on how predominant the "correct" answer is. As soon as you start adding in common alternate ways of expressing things, the quality of it's generated babble goes to hell.

The impedance of a series circuit is the sum of the individual impedances. But impedances are complex quantities, while reactances are the real coefficients of impedance (and resistances are the real part of the impedance). Resistances add in series. Reactances add in series. Resistance and reactances in series do not add.

The ChatGPT response also makes a very common mistake (because this is an extremely common mistake found all over the place) and has capacitive reactance as being a positive quantity. It isn't, it's negative. But it is common for "trade school" level courses to treat it as a positive number and then deal with the fact that it is negative by mangling simple equations in order to artificially carrying the minus sign via subtraction. This works find for the simplest of cases, but it makes it extremely difficult to analyze more complex systems symbolically because you end up with exploding special cases based on whether the unknown magnitude of the inductive reactance is greater or less than the capacitive reactance, rather than just treating reactance as reactance and letting the math take care of itself in the end.

At least the ChatGPT response came with with a series of babble that turned out to be internally consistent in this sense, which is far from always being the case.
Thanks for the reply. I have found ChatGPT to be wrong in many instances, especially basic mathematics. I was pretty certain it was incorrect, but then I always question my own understanding.

#### BobTPH

Joined Jun 5, 2013
8,921
It sounds to me like chatGPT is the Fox News of search engines.

disclaimer: I have never used it

#### LvW

Joined Jun 13, 2013
1,753
..... I always question my own understanding.
This is a very good attitude, which I have often missed, for example, in the discussion of how the bipolar transistor really works.

#### LvW

Joined Jun 13, 2013
1,753
Thanks for the reply. I have found ChatGPT to be wrong in many instances, especially basic mathematics. I was pretty certain it was incorrect, but then I always question my own understanding.
If I may be a little polemical: sometimes I get the impression that AI is often used by people who don't have enough NI (natural intelligence).
(PS: This is a general remark and, of course, not specifically related to this thread.

#### MrAl

Joined Jun 17, 2014
11,447
Hmmmm?....

Is ChatGPT correct here? If a series circuit containing a capacitor, inductor and resistor is driven at a known fixed frequency, then is the Impedance calculation as simple as Z=R+Xl-Xc? Why is the impedance triangle not necessary?

View attachment 315189
Hi,

I have found through extensive 'chat' sessions that ChatGPT can never be used for technical problems. It just does not understand them correctly.
The reason I say "never" and not "not always" when "not always" is more correct is because you can never tell if it is right or wrong unless you already know the answer. Even though it may get it right some of the time, you'll never know when that is unless you check the result yourself, and most of the time it is just wrong so it turns out to be quite a waste of time for those uses.
I think its strong point is that it can "sort of" carry on a human conversation, which is hard to get a program to do, but it's weak at almost everything else or at least not reliable at all. It should be regarded as a first attempt at an ai program I think. From what I have delt with in the past with ai programs it is might be regarded as a second generation ai program.
As an alternative, you might try 'asking' Google because that just looks up stuff on the web I think, but I do not have extensive experience with the verbal input Google.

In the case of this series impedance, it is of course wrong in the general sense, and it is clearly stating what it thinks is the correct general result.

In the most general case of impedance, the impedances for a capacitor and inductor are always complex. The only impedance that is not complex is the resistor. That means that we must use complex mathematics if we expect to get the right result all the time, for any circuit. If we reduce ourselves to only understanding a few different circuits, even just RLC ones, then we have to memorize formulas and there will be one formula for each topology. If we use complex math we only need to know one way to do it, and that is to use complex math which isn't that hard to learn if you already know how to add and subtract numbers.

The complex impedance of the RLC series circuit is:
Z=R+j*w*L-1/(j*w*C)

and so the result is:
Z=R+j*(w*L-1/(w*C))

The magnitude is the square root of the sum of the squares of the real (R) and imaginary (w*L-1/(w*C)) parts:
|Z|=sqrt(R^2+(w*L-1/(w*C))^2)

but that's only the magnitude of the impedance.

So, in the most general case, the impedance is complex. There will be times when we get a real (in the complex number sense) value through, such as when the frequency is at the resonate frequency, and then the impedance is simply R (for the more usual positive resistance values).

So in summary, do not use ChatGPT for anything you really need to know, and use complex math for impedances that involve either inductors or capacitors or both. For pure resistive circuits you can use regular math though.

BTW there is a simpler form for the impedance using what we call the Laplace variable 's'. The impedance then would be:
Z(s)=R+s*L+1/(s*C)

Note if we replace the two 's' variables with "j*w" we get the complex impedance as above.
This second form is very good to know because for one thing it writes out in a simpler way and for another thing we can then use the Laplace Transform if we need to later.