hi all,

I wonder if there is a way to get something like the "SQ()" function in HP50:

For example I input √2 in CAS, then I press "ab/c" and get approx(), that's 1.414213..., but if I press again "ab/c" I get a fraction and not the root (√2) again, like it was in HP 50g, using SQ()...

Please, help.

If not, I hope this function could be added in a next firmware upgrade...

cheers

Salvo

(01-24-2015 01:32 PM)Han Wrote: [ -> ]http://www.hpmuseum.org/forum/thread-18.html

Would that fit your needs?

yes, thank you!

very interesting.

Is there a way to use it with a matrix? :-)

ex. having a matrix with [[1, 1.414213...], [3.141592..., 1.7320...]] to get [[1, √2], [∏, √3]]... The program, as it is, give error...

I found that we could use this method:

1. use mat2list with the matrix

2. use QPI

3. use list2mat; but this one require the matrix dimension

I hope to get an automatic program for that...

(01-24-2015 03:06 PM)salvomic Wrote: [ -> ] (01-24-2015 01:32 PM)Han Wrote: [ -> ]http://www.hpmuseum.org/forum/thread-18.html

Would that fit your needs?

yes, thank you!

very interesting.

Is there a way to use it with a matrix? :-)

ex. having a matrix with [[1, 1.414213...], [3.141592..., 1.7320...]] to get [[1, √2], [∏, √3]]... The program, as it is, give error...

I found that we could use this method:

1. use mat2list with the matrix

2. use QPI

3. use list2mat; but this one require the matrix dimension

I hope to get an automatic program for that...

You can, except Home view by design forces all matrices to be numeric and does not allow symbolic objects. Since all PPL programs are considered to be "Home" programs, the entries inside each matrix will always be converted back to decimal form. You can get what you want using by converting over to a CAS program, though.

any help to have a template for this? - I'm not so able for now with the new language...

(having a matrix selected)

(matdim is a variable = matrix dimension)

- mat2list (M) ;-)

- apply QPI program ;-)

- list2mat (M, matdim)

- results (again the matrix but with QPI applied)

:-)

Thank you in advance!

(01-25-2015 04:16 PM)salvomic Wrote: [ -> ]any help to have a template for this? - I'm not so able for now with the new language...

(having a matrix selected)

(matdim is a variable = matrix dimension)

- mat2list (M) ;-)

- apply QPI program ;-)

- list2mat (M, matdim)

- results (again the matrix but with QPI applied)

:-)

Thank you in advance!

Code:

`#cas`

qpimat(m):=

BEGIN

local s:=dim(m);

m:=mat2list(m);

m:=QPI(m);

m:=list2mat(m,s(2));

return m;

END;

#end

Create a new program named qpimat and make sure it's a CAS program. Then type in the code above. Note that you must be in CAS view in order to see symbolic matrices. In Home view, qpimat does nothing.

(01-25-2015 04:21 PM)Han Wrote: [ -> ]...

Create a new program named qpimat and make sure it's a CAS program. Then type in the code above. Note that you must be in CAS view in order to see symbolic matrices. In Home view, qpimat does nothing.

thank you a lot!

I created a program "QPIMAT" with Connectivy Kit, pasted the code and sent to calc, it works well with a test matrix, writing "qpimat()" directly, but I cannot see it listed in Catalog User (I've only QPI): why?

It's on Programs list...

(01-25-2015 05:56 PM)salvomic Wrote: [ -> ]thank you a lot!

I created a program "QPIMAT" with Connectivy Kit, pasted the code and sent to calc, it works well with a test matrix, writing "qpimat()" directly, but I cannot see it listed in Catalog User (I've only QPI): why?

It's on Programs list...

It's technically a CAS function. Perhaps this is why it is not listed. In the CAS view, you can create functions; for example: f(x):=x^2. You can see that if all such functions were listed as programs, it can cause a lot of clutter. Perhaps this may change in the future... I have no idea.

(01-25-2015 10:33 PM)Han Wrote: [ -> ]It's technically a CAS function. Perhaps this is why it is not listed. In the CAS view, you can create functions; for example: f(x):=x^2. You can see that if all such functions were listed as programs, it can cause a lot of clutter. Perhaps this may change in the future... I have no idea.

yes,

I understand.

The problem is related to the fact we can't use "EXPORT" with #cas/#end structure, I think, so the function won't listed.

I hope in the future could be a way to get that, as it's very useful!

Thanks again!

salvo

(01-25-2015 10:33 PM)Han Wrote: [ -> ]It's technically a CAS function. ...

Han, please,

is it possible to rationalize (symbolic representation) using QPI (on in other way) some "classical" irrational or transcendental expressions, like √π (1.77245385091), π^2 (9.86960440109), 2/π, 1/√π, golden ratio (0.618 033 988 749 894 = ((\sqrt(5) -1)/2), euler_gamma ...?

thanks for info!

Salvo