Post Reply 
HP35s Entering complex number arguments
08-20-2015, 10:41 PM
Post: #1
HP35s Entering complex number arguments
I feel that I am missing something, but I am struggling to enter non-trivial arguments for complex numbers in RPN mode on the HP35s. For example, how would I enter something like "5 theta pi"? When I try it the obvious way, I get a syntax error. Or if I would like to do something like "2*2 + 4i"?

Is there a way to use the value of the stack registers as the arguments for complex numbers? I am also not able to use stored values for the arguments for complex numbers.

I really hope there is a simple way to do this, and that I do not have to write programs to do simple things like this, something that I am completely unfamiliar with.

BR,
Find all posts by this user
Quote this message in a reply
08-21-2015, 05:58 AM (This post was last modified: 08-21-2015 05:59 AM by Dieter.)
Post: #2
RE: HP35s Entering complex number arguments
(08-20-2015 10:41 PM)Merwedv Wrote:  For example, how would I enter something like "5 theta pi"? When I try it the obvious way, I get a syntax error. Or if I would like to do something like "2*2 + 4i"?

I do not have a simple solution for the theta case, but the latter is simple and rather straightforward: 2 [ENTER] 2 [x] 4 [i] [+].
Assuming the calculator is set to RPN mode. In ALG mode you simply type "2x2+4i". ;-)

(08-20-2015 10:41 PM)Merwedv Wrote:  Is there a way to use the value of the stack registers as the arguments for complex numbers?

Sure. If the real and complex parts are in Y and X, simply press [i] [x] [+] to get y+ix.

(08-20-2015 10:41 PM)Merwedv Wrote:  I am also not able to use stored values for the arguments for complex numbers.

This can be done in the same way: [RCL] B [i] [x] [RCL] A [+]
Or, saving one stack register: [i] [RCL][x] B [RCL][+] A.

Dieter
Find all posts by this user
Quote this message in a reply
08-21-2015, 09:05 PM (This post was last modified: 08-21-2015 09:17 PM by Merwedv.)
Post: #3
RE: HP35s Entering complex number arguments
Hi Dieter,

Thanks so much for your response. It does seem very obvious now that you clarified. I was regarding "i" as a operand, rather than an actual number, albeit complex, and that completely threw me off the right track. (led astray by the xiy notation).

As for "r /_ theta", since it is merely a shorthand of r*e^(j*theta), it is neither an operand nor a "number"(like i) and cannot be treated as such. I spend some time learning how to program the thing (not as difficult as I anticipated), and did the following to be able to use the X and Y registers to enter a complex number in the r /_ theta notation:

Code:

A001 LBL A
A002 REGYxCOS(REGX)
A003 ixREGZxSIN(REGY)
A004 +
A005 RTN

So it will take the Y-reg as the magnitude, and the X-reg as the angle, and place the complex result in X-reg, in either rectangular or polar notaion, depending on the diplay mode.

Cheers,
Merwe
Find all posts by this user
Quote this message in a reply
08-21-2015, 10:03 PM
Post: #4
RE: HP35s Entering complex number arguments
(08-21-2015 09:05 PM)Merwedv Wrote:  
Code:
A001 LBL A
A002 REGYxCOS(REGX)
A003 ixREGZxSIN(REGY)
A004 +
A005 RTN

Why don't you simply put it on a single line (and save one stack register)?

Code:
REGY*COS(REGX)+i*REGY*SIN(REGX)

You may also define this as an equation, so a simple EQN ENTER will turn X and Y into a complex number.

However, I would prefer a stack drop like this:

Code:
T          T
Z   XEQ A  T
Y    =>    Z
X         (complex number)

Which may be implemented in a short program this way:

Code:
LBL A
R↓
REGX*COS(REGT)+i*REGX*SIN(REGT)
X<>Y
CLx
+
RTN

Dieter
Find all posts by this user
Quote this message in a reply
08-24-2015, 09:14 AM
Post: #5
RE: HP35s Entering complex number arguments
Yeah, your way is much better. Thanks again.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)