The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime - CAS functions in Spreadsheet App
Message #1 Posted by CR Haeger on 10 Nov 2013, 6:54 a.m.

Hello,

As I posted in an earlier post, I think the Spreadsheet App may be the most powerful/useful on on the Prime. It certainly seems to be able to do some things that traditional ones cannot.

I spent some time in a new spreadsheet which takes an expression entered in a cell - say =x^3-3*x-1 (in cell C3 which I named Expr1) then other cells contain CAS functions which use/refer to Expr1. Some worked and some did not. I was in Textbook, Minimum, Exact mode.

These WORKED:

=(Expr)',

=Integral(Expr1)dx using math template/integral,

=Integral(Expr1)dx using math template AND referring to named Lower/Upper limits of integration

=CAS.zeros(Expr1)

These had PROBLEMS:

= diff(Expr1) using math template, diff() and/or toolbox/cas/calculus/differentiate

= CAS.int(Expr1) using toolbox/cas/calculus/integrate

= CAS.solve(Expr1,x) and =CAS.nsolve(Expr1,x)

Best, Carl

      
Re: HP Prime - CAS functions in Spreadsheet App
Message #2 Posted by Michael de Estrada on 10 Nov 2013, 10:04 a.m.,
in response to message #1 by CR Haeger

Tim provided a better explanation, so I've deleted my post.

Edited: 10 Nov 2013, 12:26 p.m.

      
Re: HP Prime - CAS functions in Spreadsheet App
Message #3 Posted by Tim Wessman on 10 Nov 2013, 11:31 a.m.,
in response to message #1 by CR Haeger

When you are entering a forumula you'd like the CAS to evaluate, click the CAS menu key while editing the formula. The CAS parser/evaluator will then evaluate those cells completely.

Edited: 10 Nov 2013, 11:34 a.m.

            
Re: HP Prime - CAS functions in Spreadsheet App
Message #4 Posted by CR Haeger on 10 Nov 2013, 3:03 p.m.,
in response to message #3 by Tim Wessman

Thanks for the quick response Tim. Unfortunately, I have already tried enabling the CAS* key when entering - gives the RED CAS indicator, but some functions still not working.

In all the cases below, the cell result looked similar to the cell function but without any evaluation (or incorrectly) executed.

These had PROBLEMS:

= diff(Expr1) using math template, diff() and/or toolbox/cas/calculus/differentiate ==> gives diff(Expr1,x) or 0

= CAS.int(Expr1) using toolbox/cas/calculus/integrate ==> gives int(Expr1,x)

= CAS.solve(Expr1,x) and =CAS.nsolve(Expr1,x) ==> give solve(Expr1,x), nsolve(Expr1,x) respectively. However, CAS.zeros(Expr1) gives accurate roots.

This is still a really cool application.

Best, Carl

Edited: 10 Nov 2013, 3:30 p.m.

                  
Re: HP Prime - CAS functions in Spreadsheet App
Message #5 Posted by Michael de Estrada on 10 Nov 2013, 10:16 p.m.,
in response to message #4 by CR Haeger

Enter =solve(Expr1) with the CAS toggle set.

                        
Re: HP Prime - CAS functions in Spreadsheet App
Message #6 Posted by CR Haeger on 11 Nov 2013, 12:05 a.m.,
in response to message #5 by Michael de Estrada

THANKS! Works great now.

I didn't know you often need to delete the "CAS." in =CAS.solve() or for other CAS functions. The Toolbox/CAS menu puts the "CAS." in automatically I guess.

Best, Carl

Edited: 11 Nov 2013, 12:05 a.m.

                              
Re: HP Prime - CAS functions in Spreadsheet App
Message #7 Posted by Michael de Estrada on 11 Nov 2013, 12:37 a.m.,
in response to message #6 by CR Haeger

You use the CAS. prefix in a non-CAS environment such as Home, but just use the function name such as solve or zeros w/o the CAS. prefix in CAS. Go to CAS and insert a CAS function such as solve or zeros from the CAS menu in the Toolbox, and you won't see the CAS. prefix, but you will in Home. The CAS. prefix indicates that you are treating the function as if it were in CAS, and when you toggle the CAS button in the Spreadsheet App, you are treating the function as if it were already in CAS, so there is no need for the CAS. prefix. The easiest way to debug a CAS expression is to first enter it in CAS before inserting it in a Spreadsheet. Also, if a CAS function is being used in a program, the easiest way to make it work is to insert it in the CAS() command, which creates a CAS environment just as the toggle button does in the Spreadsheet. For example, CAS("solve(Expr1)").

Edited: 11 Nov 2013, 12:38 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall