HP Forums
Inconsistent Deg/Rad in CAS - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Inconsistent Deg/Rad in CAS (/thread-16977.html)



Inconsistent Deg/Rad in CAS - GregP - 05-19-2021 06:00 PM

Because CAS mode does not have the nifty shortcut of changing between rect/polar/complex display like Home does with(shift x) I had been using the ARG() function to get the polar degree number. However, even with degrees set, it sometimes displays in degrees and sometimes in radians. Irritating when working with phasors not to know which it is going to spit out.

For example:
ARG(3 + 3*i) = 45.
ARG(3. + 3*i) = 45.
ARG(3 + 3.*i) = 0.785398163397


RE: Inconsistent Deg/Rad in CAS - Albert Chan - 05-20-2021 06:18 PM

I recently did a hard reset on HP Prime emulator.
Trying your examples, with degree setting, it all work perfectly.


RE: Inconsistent Deg/Rad in CAS - GregP - 05-20-2021 11:10 PM

Thanks for your reply. Were you testing in CAS mode? ARG() always works correctly for me in Home mode.

I tried reset of the PC emulator, an actual V1 prime, and the Android paid app - which all do the same thing in degree setting when in CAS mode displaying degrees in the top right and typing in:

ARG(3 + 3.00 * i) gets 0.79
ARG(3 + 3 * i) gets 45.00
ARG(3/_45) gets 0.79 where /_ is the angle sign -> shift x


RE: Inconsistent Deg/Rad in CAS - Albert Chan - 05-21-2021 02:09 AM

Hi, GregP

Yes, I tested in CAS side. HP Prime emulator build 2.1.14181 (2018 10 16)

With degree setting, ARG(3+3.*i), ARG(3+3*i), ARG(3∡45) all give back 45.

Have you also tried using polar() ?

---

I would have guessed ARG(z) always return radians, regardless of angle settings.
Somehow, having it return degrees looks weird to me.

BTW, XCas (1.5.0-63 win32) in degree settings, we also have this issue.

XCAS> arg(3+4*i) → 53.1301023542
XCAS> arg(3+4.*i) → 0.927295218002
XCAS> polar(3+4i) → (5, 53.1301023542)
XCAS> polar(3+4.i) → (5.0, 0.927295218002)

Lucky for me, I don't use degree settings Big Grin


RE: Inconsistent Deg/Rad in CAS - GregP - 05-21-2021 08:24 PM

Thank you.

I was using build 2.1.14425 (2020 1 16). It appears that the older version probably worked correctly. rolinychupetin on youtube (Canadian professor of electrical engineering) has youtube videos on using the HP Prime for complex numbers and systems of equations where it also appears to work properly in 2017. For instance https://www.youtube.com/watch?v=NUGfqiLOelc

In electrical engineering conventions for use of phasors in AC circuits going all the way back to Steinmetz and his buddy Einstein, oftentimes AC frequencies in radians are mixed with phase offsets in degrees - weird but very common.


RE: Inconsistent Deg/Rad in CAS - GregP - 05-22-2021 03:35 AM

Downgraded to Build 2018 7.6 Rev 13865 in the emulator. Just have to find a way to downgrade V1 and V2 of the actual calculator.

This fixed the anomaly with ARG in CAS mode.
ARG(3.+3.*i) gets 45.


RE: Inconsistent Deg/Rad in CAS - GregP - 05-23-2021 02:57 AM

Does anyone have a link for build 2.1.14181 (2018 10 16)?
HP seems to have shut down access to their FTP directories some time ago. I am trying to test when the behavior changed and don't have a source for all the versions.


RE: Inconsistent Deg/Rad in CAS - Tim Wessman - 05-23-2021 04:05 AM

https://ftp.hp.com/pub/calculators/Prime/Archive/<file>;

For example: https://ftp.hp.com/pub/calculators/Prime/Archive/HP_Prime_Connectivity_Kit_x64_20181016.exe


RE: Inconsistent Deg/Rad in CAS - Liamtoh Resu - 05-23-2021 02:14 PM

The link to that version of the emulator is

"https://ftp.hp.com/pub/calculators/Prime/Archive/HP_Prime_Virtual_Calculator_2018_10_16.exe"

minus the qutoes.


RE: Inconsistent Deg/Rad in CAS - GregP - 05-28-2021 09:49 PM

I believe that version is the last one which behaves consistently in CAS when in degree mode and complex numbers are used with ARG().

The only other interesting thing I noticed is that the dedicated complex variables Z0...Zx will truncate any mantissa of the imaginary part if it is zero on entry and then correctly display degrees when ARG() is used.

My understanding of this situation is that CAS mode does not store complex numbers as an object. Doing so (with perhaps a preferred display flag) would make the lives of electrical engineers and EE students a lot easier (as would allowing i to be j - but that second item is easy to fix in CAS by entering j:=(0,1) )