(Feature Request) - Convert to polar (phasor) notation 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: (Feature Request) - Convert to polar (phasor) notation in CAS (/thread-14737.html) |
(Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 03-29-2020 07:48 AM Hi, If you have a complex number in rectangular form in the home screen and want to convert it to phasor notation (r∠θ), you can simply press shift + "∠". Why this doesn't work in CAS? Is there any way I can request this to HP? -Edit- See below an example of a matrix containing complex numbers in rectangular form and the result in phasor notation. This is easy to do in Home, but won't work in CAS. Thanks RE: Convert to polar (phasor) representation in CAS - Eddie W. Shore - 03-29-2020 03:12 PM You can file a bug report, see the thread about the Beta thread. In the mean time, there are two conversion CAS commands that work both in Home and CAS modes: polar_coordinates( real + imag*i ) -> [ approximate radius, approximate angle ] polar_coordinates( real, imag ) -> [ radius, angle ] Approximate at Home, Exact at CAS rectangular_coordinates( radius, angle ) -> [ real, imag ] Approximate at Home, Exact at CAS Both polar_coordinates and rectangular_coordiantes are found in the Catalog. polar_coordinates is also found in [Toolbox], (App), Geometry, Cartesian, Polar Coordinates RE: Convert to polar (phasor) representation in CAS - Dands - 03-30-2020 09:06 PM (03-29-2020 03:12 PM)Eddie W. Shore Wrote: You can file a bug report, see the thread about the Beta thread. Thanks for your reply. Unfortunately those don't work well for me because I often pass matrices with multiple entries to be converted. I really wished the "home" functionality also worked in CAS because it's so easy to use. See below. Also, where exactly should I request new features? How does posting them here gets sent to HP? Thanks RE: Convert to polar (phasor) notation in CAS - rprosperi - 03-30-2020 09:56 PM (03-30-2020 09:06 PM)Dands Wrote: Also, where exactly should I request new features? How does posting them here gets sent to HP? Members of the Prime team are quite active MoHPC Forum members and they will see your posts here. That said, if you want to suggest new or modified features, it's best to make a new post with something like "Feature Request" in the title, rather than burying it on some other long or only somewhat related thread. Also, history has shown that general enhancements that affect lots of users, with detailed explanations and examples of how the new (or modified) feature should (could) work receive the best response. But also understand that deep inside the Prime, HOME and CAS modes are not tightly integrated, so quite often requests along the lines of "Please make CAS treatment of XYZ act like HOME mode" or vice-versa, can't practically be implemented. There are some areas where they obviously can behave similarly, but others where it either makes no sense, or isn't technically feasible. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 03-30-2020 10:49 PM (03-30-2020 09:56 PM)rprosperi Wrote:(03-30-2020 09:06 PM)Dands Wrote: Also, where exactly should I request new features? How does posting them here gets sent to HP? That's good to know. I will leave this post here as a request. Hopefully this functionality won't be too hard to implement. Thanks RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Tim Wessman - 03-31-2020 05:54 AM It actually is very hard to implement because there is no such thing as a "complex" object in the CAS. You have expressions that contain complex parts, but those can be in very varying forms and varieties. Whereas in home and numeric parts, the two values are intrinsically linked as a single object. That object has a flag that means "display in rectangular" or "display in polar". Hence nothing changes and it just toggles the bit on that individual object. Bernard the CAS author could possibly extend the polar_coordinates/rectangular_coordinates to also work with vectors of vectors (there is no MATRIX object in CAS actually either, which is another major difference), but that will depend on him desiring to do so. It will not be able to use the same display routines and keep the pairs together because that type of object just does not exist in CAS land... RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 03-31-2020 06:24 AM (03-31-2020 05:54 AM)Tim Wessman Wrote: It actually is very hard to implement because there is no such thing as a "complex" object in the CAS. You have expressions that contain complex parts, but those can be in very varying forms and varieties. Whereas in home and numeric parts, the two values are intrinsically linked as a single object. That object has a flag that means "display in rectangular" or "display in polar". Hence nothing changes and it just toggles the bit on that individual object. That is pretty interesting, kind of bad news... I really wished CAS handled phasor notation better since it is so relevant in many electrical engineering applications. Meanwhile, I just found a possible bug. In CAS, I can write 1∠45 and execute. The calculator will change the notation to ∠(1,45). But if you try yourself to use this notation, it gives you an error. See below. Might worth taking a look? RE: (Feature Request) - Convert to polar (phasor) notation in CAS - parisse - 03-31-2020 11:25 AM I have added some list processing to polar/rectangular_coordinates. For the copy/paste problem with the angle symbol, it seems to happen only in textbook display mode, therefore it's probably not a CAS bug. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - victorvbc - 03-31-2020 12:31 PM This is the code I made for displaying polar coordinates {magnitude,angle}, it works with matrices and lists. I'm also quite new to the Prime, so I don't know if there's any better way to do it... Code:
Keep in mind that it's purely for display purposes, you can't make any operations with this format. Also, if you want to convert any expressions that have real-valued variables, you should do something like assume(x,float) before doing the conversion. Otherwise you can have very complicated expressions. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 03-31-2020 04:22 PM (03-31-2020 12:31 PM)victorvbc Wrote: This is the code I made for displaying polar coordinates {magnitude,angle}, it works with matrices and lists. This program works great, however, it's showing angles in radians. It might be because you're using the convert_polar function which is based in rad. Is there a way to modify it so that it uses the system's preferred angle output? I mostly need my angles in degrees. Thank you! RE: (Feature Request) - Convert to polar (phasor) notation in CAS - victorvbc - 03-31-2020 04:38 PM (03-31-2020 04:22 PM)Dands Wrote: This program works great, however, it's showing angles in radians. It might be because you're using the convert_polar function which is based in rad. Is there a way to modify it so that it uses the system's preferred angle output? I mostly need my angles in degrees. The function is defined right under the main program. It uses the modulus and argument commands, which should function according to the system angle setting. Are you sure you switched it right? The calc. should have a <° symbol on the top right corner. On mine it works as expected, outputs a float in degrees. If you check the variable 'HAngle', it should return 1. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 03-31-2020 08:14 PM (03-31-2020 04:38 PM)victorvbc Wrote:(03-31-2020 04:22 PM)Dands Wrote: This program works great, however, it's showing angles in radians. It might be because you're using the convert_polar function which is based in rad. Is there a way to modify it so that it uses the system's preferred angle output? I mostly need my angles in degrees. I think something weird is happening, probably because you used the simplify command in the output. I removed it and it persisted, so I'm clueless. Both of these should provide an angle of 45deg. I think it is not handling it properly when coefficients a and b are not integers. Also, is it normal to see the terminal showing so many alerts? RE: (Feature Request) - Convert to polar (phasor) notation in CAS - victorvbc - 03-31-2020 09:16 PM (03-31-2020 08:14 PM)Dands Wrote: I think something weird is happening, probably because you used the simplify command in the output. I removed it and it persisted, so I'm clueless. Both of these should provide an angle of 45deg. I think it is not handling it properly when coefficients a and b are not integers. That is quite weird... I guess the CAS doesn't like converting angles from floating point complex numbers to degrees. Anyway, here's a quick & dirty fix: Code:
It works for that case now. I don't know about the errors, I didn't get them. [attachment=8274] [attachment=8275] RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 04-01-2020 05:52 AM (03-31-2020 09:16 PM)victorvbc Wrote:(03-31-2020 08:14 PM)Dands Wrote: I think something weird is happening, probably because you used the simplify command in the output. I removed it and it persisted, so I'm clueless. Both of these should provide an angle of 45deg. I think it is not handling it properly when coefficients a and b are not integers. Works great now. Thanks a lot. Still hoping it gets officially implemented in the future though. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - compsystems - 04-05-2020 01:35 PM Another request The imaginary unit i is used like z = a+b*i in general mathematics, however, sometimes j is used as an imaginary unit in the electricity or magnetism classroom because the symbol i has the meaning of current. The imaginary unit may be changed to j on the Imaginary Unit setting screen in System application on casio classPad Even the character i must be free to be used as a counter variable, therefore another unicode character is required to show (i, e), this will help us to use the i, j counters of the for loops RE: (Feature Request) - Convert to polar (phasor) notation in CAS - CyberAngel - 04-13-2020 12:23 AM (04-05-2020 01:35 PM)compsystems Wrote: Another request There is a special character for the imaginary 'i' with a dedicated key [ Shift] [ 2 ]. Another character is needed for the new imaginary 'j'. Perhaps HOLDING DOWN the [ Shift ] key would do it? Reintroducing an old HP 50g concept: shift levels via hold-the-shift-down and an extra parameter for the - - VPN RE: (Feature Request) - Convert to polar (phasor) notation in CAS - NullGeodesic - 11-27-2023 03:37 PM I found this thread because like Dands, I also needed a way to convert matrices and vectors to polar form within the CAS view. Based on victorvbc's helpful code I have written a new program that outputs the polar result directly into the CAS entry line after pressing a user mode hotkey. Please note that the program only outputs the results in numeric form because I could not get exact form outputs to work reliably. The program works by assembling the polar matrix/vector using strings and then passing the string as a return value for a hotkey. Code:
Note: The approx() command can be used to convert matrices back to rectangular form in CAS mode. RE: (Feature Request) - Convert to polar (phasor) notation in CAS - Dands - 09-16-2024 09:49 PM Just wanted to bring this thread back to life because a few years passed, I went back to school and I still would love to see a solution for this. I'm now working on my Master's degree in power engineering and the HP Prime remains as the best calculator in my area. The CAS app is absolutely amazing handling matrices with complex numbers, but won't convert results to phasor notation. I have to either use the programs posted here (thank you very much once again) or bring my results to Home and then convert. I know it's not easy to implement in CAS as explained above, but please try. Power engineers will be forever grateful |