HP Forums
Display of Complex Numbers on wp34s - 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: Display of Complex Numbers on wp34s (/thread-191503.html)



Display of Complex Numbers on wp34s - Jeff O. - 08-22-2011

My biggest wish for wp34s is that it handled and displayed complex numbers more like the 42s and 35s. I think I understand why that was not practical, or at least did not seem practical at the beginning of development. And the way wp34s handles complex numbers is probably as good as can be without adopting a paradigm similar to the 42s/35s. I also understand that Walter and perhaps others on the team felt that the dot-matrix part of the display was not suitable for “full-time” numerical display and better used for status, annunciators and messages. But for some reason I recently wondered how it would look to use the dot-matrix area to display the imaginary part or angle of a complex number. Not sure if it is new, but I was recently made aware of the aRC# (using small “a” for alpha) command and it occurred to me that I could use it to simulate imaginary or angle display. So I wrote two small programs, as follows:

Command      Comment
LBL 16 so I can press XEQ CPX for this one. Depending on your version you might have to press XEQ 16
CLa
ai
aRC# Y
PROMPT
RTN

Command Comment
LBL 41 so I can press XEQ XEQ for this one. Depending on your version you might have to press XEQ 41
CLa
a/ that is the first symbol (looks like the 42s angle symbol) on the h-test menu in alpha mode
aRC# Y
PROMPT
RTN

Key in the above programs, I’ll wait….

Set your calculator to FIX 4. Press 4 ENTER, 3, XEQ CPX. The dot matrix area should be displaying “i4.0000”, and I think it looks pretty good. Now press g ->P, then XEQ XEQ. Now the dot-matrix area should be displaying “/53.1301”, and again, I think it looks pretty good. I realize that I would be free to use the above at my leisure to display rectangular complex and/or polar complex values as I desire. But, it got me thinking, maybe a little of this display methodology could be built into the 34s. Not some sort of complex display mode that would always display as such, just a couple little things as follows:

  1. Create two new internal commands that would temporarily display the Y register as the imaginary component or angle. By temporary I mean the same as the SHOW command, active only until some other key is pressed. Call one RDISP, one PDISP for rectangular display and polar display, respectively
  2. Upon execution of the ->REC command, temporarily put in RDISP mode, so you can see both the real and imaginary components you just created without doing an exchange.
  3. Upon execution of the ->POL command, temporarily put in PDISP mode, so you can see both the magnitude and angle you just created without doing an exchange.
  4. Upon execution of ANY Complex command, temporarily put in RDISP mode so you can see your complex result without doing an exchange.
  5. Upon pressing CPX, put in RDISP mode (instead of displaying the small “C” annunciator) to both indicate that you are about to treat the x and y registers as a complex rectangular value, (i.e. execute a function on a complex argument) and let you see both values you are about to use.

The programs work in other display modes besides FIX 4 of course, I just specified FIX 4 for my example because it looks good. In other display modes, the dot-matrix area might be forced to use the small font. It still looks fine to me, but looked best in large font. If my suggested RDISP and PDISP commands are adopted, perhaps they could always truncate the Y value so it could be displayed in the large font. That brings me to one last question, I noticed that the small font version of the / symbol looks like a “less than” symbol, i.e. “<”. Any reason it could not simply be the left three columns of the large font symbol, i.e. in ASCII art:

  *
*
***

Or maybe the right three columns:

  *
*
*
***

I realize that as usual, it is easy for me to suggest things and there may be many reasons why the above cannot or will not be implemented by the developers, from technical coding reasons to not liking the ideas even if they are feasible. But I would be interested in hearing comments on the ideas, positive, negative or in between.

Best regards

Jeff


.


Re: Display of Complex Numbers on wp34s - Lode - 08-22-2011

I think a complex number should be displayed like this:

1.234E499i1.23 499

Where the E symbol is made out of the 7-segment display, the i is one short vertical stripe of the 7-segment display, and the exponent of the imaginary part uses the 3 small digits while the exponent of the real part uses the E notation.

For polar notation, the i would become a short L.

For those into electronics where j is often used instead of i, it could also be a mirrored L symbol instead, like a J (again short, taking only half a 7-segment digit, so that you spot the non number symbol easily).

If the imaginary part is 0, it automatically doesn't add the i etc... to the number.

The way the WP34s handles complex numbers was a big disappointment to me. The 35s has it almost perfect, with its dedicated i key, except they screwed it up totally by not allowing the sqrt, sin-1, sinh, log10, etc... functions to use it.

A calculator which uses a i key, i notation, and supports all operations on complex numbers as if they're native values, would be perfect for me. And when in deg mode, it should do the conversion from deg to rad even for complex numbers for the trig functions (and only the trig functions).


Edited: 22 Aug 2011, 5:16 p.m.


Re: Display of Complex Numbers on wp34s - Paul Dale - 08-22-2011

Quote:
My biggest wish for wp34s is that it handled and displayed complex numbers more like the 42s and 35s. I think I understand why that was not practical, or at least did not seem practical at the beginning of development.

There are two reasons we didn't do better complex support:

  • The display problems. We couldn't honour the user's display settings on the top line. We couldn't even get close for many mode settings.
  • No type identification in registers. We don't and cannot know if what is in the stack is complex or not. The 42s and 35s do know this.


Pauli


Re: Display of Complex Numbers on wp34s - Jeff O. - 08-22-2011

I'm not sure if I would like the way your display suggestion would look, but that is just a matter of taste. I believe the bigger problem with it is that it would require major changes to wp34s. The way wp34s "holds" and operates on complex numbers is pretty well set in stone, I think. I'm just trying to add a few tweaks to make it a little easier (on me, at least, don't know about others.)

I am a big proponent of the "i" key and full operating support for complex values. Maybe we can get closer to our ideal on the "next" project. Or, wp34s is open source and we are free to make any changes we like.


Re: Display of Complex Numbers on wp34s - Walter B - 08-22-2011

WP 34S *is* open source, so you can change what you like, but will be responsible for your changes as well [:-)

We (Pauli and me) had discussed the complex display a year ago IIRC, and we came to the result Pauli explained below. YMMV

Walter


Re: Display of Complex Numbers on wp34s - Jeff O. - 08-22-2011

It was not my intention to complain about your complex number support, just throwing out ideas. I was aware of the second point above. Regarding the first point, I guess I was "seduced" by the good looking results I got with my initial simple trials. My simplistic idea would be to not honor the display settings in the top line, it looks like FIX 2 would allow 3 digits for any number with any 3 digit negative exponent. But then it is not so simple to implement, as I would guess that you would have to do a lot of finagling with the number to get the best fit. Perhaps too much trouble for "temporary" displays of the imaginary part/angle.


Re: Display of Complex Numbers on wp34s - Jeff O. - 08-22-2011

Source code generally looks like greek to me, so I'll stick with your product. Learning C might be possible, I learned _gasp_ Fortran once. But the rest of the development chain looks like a tall, tall mountain to climb. Maybe when I retire I can learn the requisite skills, although I am not sure I would live long enough unless I retire pretty darn soon.

Edited: 22 Aug 2011, 8:01 p.m.


Re: Display of Complex Numbers on wp34s - Walter B - 08-23-2011

Quote:
Learning C might be possible, I learned _gasp_ Fortran once.

Same experience decades ago. Source-code-wise, Greek's easy in comparison ;-)


Re: Display of Complex Numbers on wp34s - Walter B - 08-23-2011

Hi Jeff,

Quote:
I noticed that the small font version of the / symbol looks like a “less than” symbol, i.e. “<”.

:-) The large font version of the "<" symbol shall be a "less than" symbol as well. Look at TEST in alpha mode (e.g. on page 68). I didn't include an angle symbol like featured by the 42S for obvious reasons.

Walter

Edited: 23 Aug 2011, 1:53 a.m.


Re: Display of Complex Numbers on wp34s - Paul Dale - 08-23-2011

Knowledge of Fortran will put you in good stead. I haven't played too many tricks or used the weird features of C all that much. There are a few pointers but not many e.g.

The numeric code should read easily to anyone familiar with a programming language. This won't necessarily make it obvious why I've done what I did of course.


- Pauli


Re: Display of Complex Numbers on wp34s - Lode - 08-23-2011

You know what, I've been playing around with it more now, and in fact I find the way the WP34s works with complex numbers quite OK and consistent! Never mind what I said earlier :)


Re: Display of Complex Numbers on wp34s - Paul Dale - 08-23-2011

You are not the first person to change their impression of the 34S's complex support after using the device :-)

At least the 34S has a very complete suite of complex functions unlike several of its predecessors.


- Pauli


Re: Display of Complex Numbers on wp34s - Lode - 08-24-2011

I do have one more trouble with the complex numbers in fact, and that's that you have to enter the imaginary part first and then the real part. That's extremely confusing and annoying! Every notation of complex numbers uses real part first, then imaginary part!

I guess this was done to have the real part in the X stack and imaginary part in the Y stack, but it's still backwards to enter them in the wrong order to me. On the HP 42s you also enter the real part first.

Maybe it could be an option what order is taken, in the modes?


Re: Display of Complex Numbers on wp34s - fhub - 08-24-2011

Quote:
I do have one more trouble with the complex numbers in fact, and that's that you have to enter the imaginary part first and then the real part. That's extremely confusing and annoying! Every notation of complex numbers uses real part first, then imaginary part!

Real [Enter] Imag [x<>y] ;-)


Re: Display of Complex Numbers on wp34s - Paul Dale - 08-24-2011

Quote:
Real [Enter] Imag [x<>y]
Exactly what I was going to suggest and exactly what I do when I need to test the complex functions :-)

Not that I'd recommend it, but you could relabel 'x<>y' with 'i' and your initial desire for this key will be satisfied as well ;-)

- Pauli


Edited: 24 Aug 2011, 5:30 p.m.


Re: Display of Complex Numbers on wp34s - Jeff O. - 08-24-2011

If there is an "i" key as on the 35s, or a "complexify"* operation as on the 42s and 15C, then I agree with you that it is preferable to key in real then imaginary. But if the components must occupy separate stack levels, then I prefer the 34s approach.

* - I do not claim that "complexify" is a real word. However, I find it nicely descriptive of pressing f - I on the 15C or shift - COMPLEX on the 42s to shove the value in stack X into the imaginary "slot" and drop the value in stack Y into the real slot, thus creating a complex number.

Edited: 30 Aug 2011, 8:05 a.m.