HP Forums
Complex numbers HP32SII - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Complex numbers HP32SII (/thread-130674.html)



Complex numbers HP32SII - ravwalia - 01-09-2008

Hello Everyone,

I have an equation which is the relationship between reflection coefficient and impedance

r=(ZL-ZS)/(ZL+ZS)

ZL and ZS are complex numbers. Typical ZS is always 50+j0.

At the moment I am doing the following for the calculation

ZL imaginary part
ENTER
ZL real part
ENTER
ZS imaginary part
ENTER
ZS real part
ENTER
COMPLEX
-

Then this gives me the numerator, I write this down and then

ZL imaginary part
ENTER
ZL real part
ENTER
ZS imaginary part
ENTER
ZS real part
ENTER
COMPLEX
+

To get the denominator and again write this down.

Finally I enter the complex numbers in again and / to get the reflection coefficient in rectangluar form and then finally convert it to polar.

I tried writing a program for this but the answer came out completely wrong, though if I do it by hand it's okay.

Anyone have any hints on how to start this?
Also anyone have any RF programs they would like to share?
Does the HP35s handle complex numbers better, so that I could use it as an excuse to buy one?

Thanks,

Rav




Re: Complex numbers HP32SII - Jeff Kearns - 01-09-2008

Hi ravwalia,

Can you please provide the values you are using? It seems like a simple error when I read your post:

When you divide the two complex numbers (i.e. numerator and denominator) you must also press LEFT SHIFT CMPLX prior to executing the division.

I also own the 35s and it does seems to have a much improved COMPLEX Operations implementation in that you can treat complex numbers as you do real numbers (without always pressing LEFT SHIFT CMPLX prior to executing the operation) and you actually enter the numbers in a more logical sequence - real part first, then imaginary part. The 35s has can also accommodate up to four separate complex numbers in the complex stack as opposed to only two as in the 32sii - that is a big selling point to me! This makes it 'almost' as good as the 15C in this regard.

Verdict: If you do a lot of COMPLEX operations, you will like the 35S. I haven't figured out a way to directly enter a number like: 2-4*SQRT(5)i, as one can easily do with the famous 15C... Oh well.

Jeff




Re: Complex numbers HP32SII - Jeff O. - 01-09-2008

Are you sure the keystrokes given above will give the right answer? It looks to me like you have an extra ENTER in each sequence. The last ENTER before you do the complex operation would push the imaginary part of the first number off of the top of the stack and screw up the complex numbers that you are operating on. If your program somehow does this, that would explain why it gives incorrect answers. What is your program listing? I don't have a 32SII in front of me, but an off-the-cuff program to do want you want might be as follows:

LABEL A
STO A
Rv
STO B
Rv
STO C
Rv
STO D
Rv
COMPLEX +
STO E
x<>y
STO F
RCL D
RCL C
RCL B
RCL A
COMPLEX -
RCL F
RCL E
COMPLEX /
R->P
STOP

Enter your ZL and ZS values as you described (without the last ENTER), press XEQ A and it will give you your answer in polar form without writng any intermediate answers down.

As Jeff K stated, the 35s handles complex numbers in a much more natural way. The only thing worth mentioning is that it does not do Polar to Rectangular and Rectangular to Polar conversions in a manner comparable to the 32SII. It does however let you enter the numbers in either polar or rectangular form, operate on them, and change the display mode to either polar or rectangular. For example, for your problem you could put the calculator in polar display mode, enter your numbers in rectangular form, operate on them, and when complete the answer would be displayed in polar form. The complex number handling capabilities and polar to rectangular conversion capabilities of the 35s generated MUCH discussion last summer when the 35s was released. Search the archives for more information.


Re: Complex numbers HP32SII - Trent Moseley - 01-09-2008

Or the other famous 42S.

tm


Re: Complex numbers HP32SII - Jeff O. - 01-09-2008

Quote:
I haven't figured out a way to directly enter a number like: 2-4*SQRT(5)i, as one can easily do with the famous 15C...

how about:
5
SQRT
4
*
i
*
CHS
2
+

I think the 15C would require the following:

5
SQRT
4
*
CHS
Re<>Im
(back-arrow)
2

And the 42S:

2
ENTER
5
SQRT
4
*
CHS
COMPLEX




Re: Complex numbers on HP-35s - Karl Schneider - 01-10-2008

Jeff --

Quote:
Verdict: If you do a lot of COMPLEX operations, you will like the 35S. I haven't figured out a way to directly enter a number like: 2-4*SQRT(5)i, as one can easily do with the famous 15C... Oh well.

That's a bit easier in Algebraic (ALG) mode:

MODE 4
2 - 4 i * SQRT 5 ENTER

Despite its lack of one-screen complex-number display, the HP-15C's complex-number handling is much better. The HP-42S is better yet.

-- KS




Re: Complex numbers HP32SII - George Bailey (Bedford Falls) - 01-10-2008

In the 35s you would enter R=(A-B)/(A+B) as an EQN equation just the way I wrote it down here. Then you display the equation list and solve for R (EQN Right-Shift R) and enter complex numbers A and B each once when prompted: real part followed by pressing i and then imaginary part and R/S. You can then read R from the display either in rectangular or in polar form, depending on how you've set the display mode. A matter of 10 seconds...


Re: Complex numbers HP32SII - ravwalia - 01-10-2008

Quote:
Hi ravwalia,

Can you please provide the values you are using? It seems like a simple error when I read your post:

When you divide the two complex numbers (i.e. numerator and denominator) you must also press LEFT SHIFT CMPLX prior to executing the division.

I also own the 35s and it does seems to have a much improved COMPLEX Operations implementation in that you can treat complex numbers as you do real numbers (without always pressing LEFT SHIFT CMPLX prior to executing the operation) and you actually enter the numbers in a more logical sequence - real part first, then imaginary part. The 35s has can also accommodate up to four separate complex numbers in the complex stack as opposed to only two as in the 32sii - that is a big selling point to me! This makes it 'almost' as good as the 15C in this regard.

Verdict: If you do a lot of COMPLEX operations, you will like the 35S. I haven't figured out a way to directly enter a number like: 2-4*SQRT(5)i, as one can easily do with the famous 15C... Oh well.

Jeff



Hello All,

I apologise for not being more precise in my question.

Firstly in the listing above there is an extra ENTER before each
of the complex command. Those should not be there as the stack is
already filled.

I can perform the calculation by hand but this is something that I
do a lot and 99% of the time ZS is always 50+j0. So I thought that
a program would be better. However, when I put in the program,
this first one I have ever written, and used the test case

ZL=40+j70 and ZS=50+j0

I get the wrong answer, doing it by hand I get the correct one. I
just programmed it in as the keypresses I was using and it was
still wrong.

It looks like I might have a good excuse to get the HP35S.

I'll try the program listing suggested and report back.

Thanks,

Rav.




Re: Complex numbers HP32SII - ravwalia - 01-10-2008

This program did it very nicely. Thanks for this.

I'll print this out and see if I can work out what's going on.

Thanks again,

Rav.




Re: Complex numbers HP32SII - ravwalia - 01-10-2008

Seems like a really nice and intuitive way to do it. I'm really tempted to get a HP35s now.

Thanks,

Rav.