HP Prime: Quite Happy



#15

At the risk of incurring the wrath of other non-Prime HP museum users about posting yet another Prime-related topic (but I have posted here before, asking for help, and have been helped, so I figure I owe this much):

I am quite happy with the bug fixes evident in the Nov. 25 2013 firmware update, most notably EDITLIST and EDITMAT, which were annoying, and the CAS settings now actually stay put. Things seem to be more stable overall - - but maybe this is too early to tell. HP support has been helpful in exchanging a Prime that died.

If now only PPL programs could work with CAS functions, and RPN syntax could be used throughout (not just in Home), I promise I'll hold my breath!


#16

CAS functions will work in PPL programs. You just have to CAS them, i.e. solve(x^2-3=1) in CAS becomes CAS("solve(x^2-3=1)") in a PPL program. Although it gets rather tedious, it does work.

Oh, and btw I'm also a lot happier with my replacement Prime. The first one was a real lemon.


Edited: 6 Dec 2013, 5:55 p.m.


#17

Hmmm . . . it doesn't quite work for me.

RETURN CAS("solve(x^2-k1,x)");

(k1 is the argument to the PPL program name, lets say I call it with "4" for k1)

results in {sqrt(k1), -sqrt(k1)} in home and CAS view.

So the argument does not get evaluated.

Does it work for you?


#18

OK, you've run into one of the CAS in PPL quirks. You can't pass a dummy or local variable with a numeric value to a CAS expression in a PPL program. So you need to use:

EXPORT CAS_TEST(k1)
BEGIN
K:=k1;
RETURN CAS("solve(x^2-K=0,x)");
END;

Where K is a global reserved real variable. You will get the result {-2,2}. Also note that I added =0, which is the proper format.

Edited: 6 Dec 2013, 7:22 p.m.


#19

Many thanks! I'll remember this trick.

But I think you'll agree that this does not *really* (by any stretch of the imagination) amount to direct support for CAS functions inside PPL programs.

Contrast this to what you would do in the 50G

<< -> k1 << 'X^2' k1 - SOLVEVX >> >>

Done.


#20

I'm not saying it is easier, just that it can be done. I just finished writing a short RPL program that would entail many lines of PPL:

<<K 1 N FOR I CLLCD "ENTER MASS NUMBER" 1 DISP I 2 DISP 1 FREEZE HALT INV I RCI NEXT>>

Live long and prosper.


#21

Yes, there is a certain combination of efficiency and elegance (for those who can appreciate this) in RPL programming. Of course, the unlimited stack helps as well. And the fact that everything is handled the same way (as objects on the stack, manipulated by the same commands, be it reals, complex, symbolics, lists, etc. ...).

I wish HP could come out with a 51G built on the speedy hardware foundation of the Prime.


#22

Don't forget a backlit LCD display.

#23

Wanna use the full power of CAS functions in programs? Then use CAS programs, not regular programs. Here's one way to create a CAS program.

Step 1: Create a dummy CAS program like this in CAS:

    CAS_TEST(k1):=k1

Step 2: Go into the Program Editor and see it marked as a CAS program, and listed as this:

    (k1)->k1

Step 3: Replace its contents with whatever you want, e.g.:

    (k1)->BEGIN    
RETURN(solve((x^2-k1)=0,x));
END;

Step 4: Now use it in either Home or CAS:

    CAS_TEST(4) --> {-2,2}

Cool, huh?

-Joe-


#24

Thanks, I know this works (I believe you posted that at an earlier point in time already). The reason I stayed away from this approach was because all "cool" CAS programs generated this way magically disappeared if one cleared the CAS settings or if the Prime rebooted, which it did too often in Rev. 5106.

Perhaps in this Prime firmware update (5447) CAS programs are not so volatile any more. I will check it out!


#25

Quote:
Thanks, I know this works (I believe you posted that at an earlier point in time already). The reason I stayed away from this approach was because all "cool" CAS programs generated this way magically disappeared if one cleared the CAS settings or if the Prime rebooted, which it did too often in Rev. 5106.

Perhaps in this Prime firmware update (5447) CAS programs are not so volatile any more. I will check it out!


I believe this was addressed in the recent firmware. Of course, you should always verify for yourself.

#26

Quote:
The reason I stayed away from this approach was because all "cool" CAS programs generated this way magically disappeared if one cleared the CAS settings or if the Prime rebooted, which it did too often in Rev. 5106.

Perhaps in this Prime firmware update (5447) CAS programs are not so volatile any more. I will check it out!


The good news is that the recent upgrade got rid of that CAS bug, so your CAS programs won't go away just by clearing the CAS history stack.

The bad news is that CAS programs are not saved as separate files by the Connectivity Kit, but are instead all saved together inside the "cas.settings" file, just like the other CAS variables. This means that you can't use the CK to directly transfer individual CAS programs... at least not as easily as regular programs.

-Joe-


#27

This all highlights the inconsistent way in which items and features are scattered throughout the Prime. So, you create a normal program or function and it appears in the Toolbox in the User menu. But if you create a CAS program or function, it appears under Vars in the CAS menu as a Program. How logical is that ? Then there is the inconsistent way in which you create or delete Home vs CAS variables. Programs appear in the CK for editing or saving, but not User Functions. It's almost as if different people were assigned to the development of certain portions of the Prime and never met with each other to coordinate the effort. I simply don't have to worry about these inconsistencies when using my 50g.

#28

Most (if not all) CAS commands should work in PPL with the 11/25/2013 update. Remember that the CAS. prefix needs to accommodate the command.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Happy Mother's Day! Eddie W. Shore 1 143 05-12-2013, 11:35 AM
Last Post: Walter B
  happy fibonacci day 5/8/13 Allen 8 425 05-09-2013, 01:48 AM
Last Post: Gerson W. Barbosa
  OT: Happy Pi Day! Eddie W. Shore 13 532 03-22-2013, 10:44 AM
Last Post: Les Koller
  Happy New Year! Eddie W. Shore 8 424 01-02-2013, 01:50 PM
Last Post: Chris Dreher
  Happy Halloween! Dave Britten 5 277 12-25-2012, 09:00 PM
Last Post: Dave Britten
  HP-28S plays "Happy Birthday" Kevin F 0 118 08-06-2012, 04:53 PM
Last Post: Kevin F
  [OT] Happy Father's Day! Les Wright 7 330 06-18-2012, 07:54 AM
Last Post: Andrés C. Rodríguez (Argentina)
  Happy PI Day from Europe Raymund Heuvel 22 796 03-14-2012, 09:19 AM
Last Post: Eddie W. Shore
  Happy 40th Birthday, HP35 Jake Schwartz 8 362 01-05-2012, 10:42 PM
Last Post: db (martinez, ca.)
  Happy New Year 0111.1101.1100 Marcus von Cube, Germany 10 383 01-02-2012, 01:58 PM
Last Post: Dave Shaffer (Arizona)

Forum Jump: