The Museum of HP Calculators

HP Forum Archive 21

 Complex Number Entry on PrimeMessage #1 Posted by Jeff O. on 11 Nov 2013, 12:57 p.m. I appreciate that it is possible to directly enter complex numbers in either polar or rectangular form directly from the keyboard with no need to use parentheses, and that they may be displayed as x+y*i. (I wish that the i key was primary, but accept that I'll have to wait for the 43s to get that wish fulfilled.) However, there are a couple of problems (in my view) with entry of rectangular-form complex numbers using the i key, as follows: Currently, there appears to be no way to enter a value with a negative imaginary component. Say you want to enter 3 - 4 i. If you key in 3 i 4 +/-, the sign of the 3 changes, not the sign of the 4. The only way to enter a complex number with a negative imaginary component appears to be to use parentheses, where pressing +/- after entering the comma will either change sign of the imaginary value, if already keyed-in, or insert a minus sign that can then be followed by the imaginary value. I realize that using parentheses to enter a complex number takes the exact same number of keystrokes as using shift-2 to enter using i, and that if you have complex display set to a+b*i the value will appear in that form after entry. But I would prefer to enter all complex values as aib, and not have to remember that I need to enter as (a,b) if b happens to be negative. It is possible to use the +/- key to enter a negative angle after pressing the angle key when entering a polar form complex value, so I’m hopeful that this behavior can be applied to rectangular form after pressing the i. Although you may key in just i to either use directly or press Enter to get i on the stack, if you want to enter any other complex number which has zero real part, you must press 0 before pressing i. In other words, press shift-2 Enter and you get i in stack-1. Pressing shift-2 2 in an effort to get 2*i in the stack throws a syntax error, you must enter 0i2. It would be nice if any complex value with zero real part could be entered as ib. It is possible that the above have already been reported. I searched the archive for “Prime” and “complex”, but found no mention. If they have indeed been reported, please accept my apologies for reporting them again.

 Re: Complex Number Entry on PrimeMessage #2 Posted by Michael de Estrada on 11 Nov 2013, 1:05 p.m.,in response to message #1 by Jeff O. 1. Enter it as 3 + 4 +/- i

 Re: Complex Number Entry on PrimeMessage #3 Posted by Mark Hardman on 11 Nov 2013, 1:11 p.m.,in response to message #2 by Michael de Estrada That will work in algebraic mode but not RPN.

 Re: Complex Number Entry on PrimeMessage #4 Posted by Michael de Estrada on 11 Nov 2013, 1:16 p.m.,in response to message #3 by Mark Hardman Yeah, there are a lot of problems with RPN entry on this calculator. I've given up on it completely, and use only algebraic or textbook entry on the Prime. I use my 50g if I want to do anything in RPN.

 Re: Complex Number Entry on PrimeMessage #5 Posted by Jeff O. on 11 Nov 2013, 2:17 p.m.,in response to message #4 by Michael de Estrada I understand. I continue to use RPN mode and hope it can improved if possible.

 Re: Complex Number Entry on PrimeMessage #6 Posted by Mark Hardman on 11 Nov 2013, 1:17 p.m.,in response to message #1 by Jeff O. In RPN mode you will need to use single quotes to enter a negative imaginary component. ```'3-4*i' ``` Note that the multiplication sign is required.

 Re: Complex Number Entry on PrimeMessage #7 Posted by Jeff O. on 11 Nov 2013, 2:13 p.m.,in response to message #6 by Mark Hardman Thanks for the suggestion. That method does take a few more keystrokes than just using parentheses. Also, if I enter a value this way, the calculator treats it differently: ```(3,-4) ENTER ----> 3 - 4*i shift x2 (for square root) ----> 2 - i vs. '3-4*i' ENTER ----> 3 - 4*i _______ shift x2 (for square root) ----> \/3 - 4*i ``` My real hope is that Tim W might incorporate my suggestions into a future upgrade.

 Re: Complex Number Entry on PrimeMessage #8 Posted by Tim Wessman on 11 Nov 2013, 2:51 p.m.,in response to message #7 by Jeff O. Couple of things jump out immediately. 1) I suspect the issue with typing 3i4 NEG comes from the desire for 1+5i[NEG] to put in a negative before the 5i rather then adding it in place such as on the 50g where '1+5i[NEG]' would actually insert '1+5i-' like so. I can see how making the i behave like that would be helpful, but tick everyone else off. Will investigate here. 2) The reason the sqrt('') behaves like you are showing is precisely why it does the same thing on the 50g. You have an algebraic and take the sqrt of it. Use the EVAL on the shifted comma and it will evaluate appropriately. Now that being said, this does seem to show a problem with the display of a complex in RPN. It prints out the complex as 3+4i for example, but it really is not a algebraic object. Rather, it is just printed in the 'standard' form. Would it hugely offend anyone if the options you have for a complex number printing while in RPN mode were (X,Y) or XiY forms rather then the current (X,Y) and X+Yi? Note that wouldn't impact any algebraic, but rather be the purely "numerical" complex number. Edited: 11 Nov 2013, 3:01 p.m.

 Re: Complex Number Entry on PrimeMessage #9 Posted by Michael de Estrada on 11 Nov 2013, 3:34 p.m.,in response to message #8 by Tim Wessman It makes no difference to me, since I've always used the (X,Y) form going all the way back to my HP 28S.

 Re: Complex Number Entry on PrimeMessage #10 Posted by Jeff O. on 11 Nov 2013, 8:23 p.m.,in response to message #8 by Tim Wessman Tim, Thanks for your attention to and consideration of my issue. I can't really comment on 3i4 NEG messing up how the 50g works. I just seems like* if it can parse a "naked" (i.e., no tick marks, no parentheses) 3i4 into 3+4*i and 3/4 +/- into 3/-4 , then it should parse 3i4 +/- into 3-4*i. As for the behavior when entering as '3-4*i' (with the tick marks), I assumed it was due to my ignorance regarding algebraics. It just looked exactly the same upon entry in the display. As for displaying purely "numerical" complex numbers as XiY, would that be 3+i4 or 3i4? More importantly, for negative imaginary, 3-i4 or 3i-4? I would very much like the 3+i4, 3-i4 option. * to clarify, I guess I mean it seems to me, as a person ignorant of all the implications of implmenting the behavior I would like to see. edited to add clarification Edited: 12 Nov 2013, 12:11 p.m.

 Re: Complex Number Entry on PrimeMessage #11 Posted by Eddie W. Shore on 13 Nov 2013, 9:04 p.m.,in response to message #8 by Tim Wessman I would vote for X+Yi over XiY. The latter would confuse people who are not users of the 35S. Edited: 13 Nov 2013, 9:04 p.m.

 Re: Complex Number Entry on PrimeMessage #12 Posted by Tim Wessman on 14 Nov 2013, 10:57 a.m.,in response to message #11 by Eddie W. Shore The problem is how do you distinguish between 1+5*i and 1+5*i. One is an algebraic object, and the other is a complex number. Take a look a the example where he did a sqrt and it did not evaluate the result down. TW

 Re: Complex Number Entry on PrimeMessage #13 Posted by Mark Hardman on 14 Nov 2013, 11:47 a.m.,in response to message #12 by Tim Wessman The Prime could rigorously distinguish between lowercase i as a variable and italicized i (shift-2) as being the sqrt(-1).

 Re: Complex Number Entry on PrimeMessage #14 Posted by Tim Wessman on 14 Nov 2013, 12:41 p.m.,in response to message #13 by Mark Hardman I beleive that is the end goal, but requires quite a bit of extensive work in the CAS interactions first.

 Re: Complex Number Entry on PrimeMessage #15 Posted by Michael de Estrada on 14 Nov 2013, 11:50 a.m.,in response to message #12 by Tim Wessman Which is why I prefer the form (X,Y). ;>)

 Re: Complex Number Entry on PrimeMessage #16 Posted by Jeff O. on 15 Nov 2013, 12:22 p.m.,in response to message #15 by Michael de Estrada I basically detest the (X,Y) form. Really hoping for X+iY and X-iY, depending on the sign of the imaginary part.

 Re: Complex Number Entry on PrimeMessage #17 Posted by Michael de Estrada on 15 Nov 2013, 8:21 p.m.,in response to message #16 by Jeff O. Different strokes for different folks.

 Re: Complex Number Entry on PrimeMessage #18 Posted by Jeff O. on 15 Nov 2013, 9:55 p.m.,in response to message #17 by Michael de Estrada Certainly!

 Re: Complex Number Entry on PrimeMessage #19 Posted by Joe Horn on 15 Nov 2013, 10:18 p.m.,in response to message #16 by Jeff O. Quote:I basically detest the (X,Y) form. Many students like it because it looks like the coordinates of a point on the complex plane, which of course it is. They are already very accustomed to using (a,b) for points, so they are comfortable with this notation.

 Re: Complex Number Entry on PrimeMessage #20 Posted by Jeff O. on 16 Nov 2013, 12:34 p.m.,in response to message #19 by Joe Horn I guess I don't like it because it looks like the coordinates on an X-Y plane, i.e., it is not unequivocally complex to me. But mostly because 4 years of EE schooling and a _few_ years of practice drilled R + j X into my head. I can live with i vs. j, but prefer that form. Edited: 16 Nov 2013, 4:50 p.m.

Go back to the main exhibit hall