HP Forums
fsolve different in Home and 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: fsolve different in Home and CAS? (/thread-3905.html)



fsolve different in Home and CAS? - salvomic - 05-18-2015 08:21 PM

hi,
in a program of mine I'm trying this line
Code:
fsolve(ΣLIST(MAKELIST((flows(I)/X^(I-1)),I,1,SIZE(flows))),X)-1;
(thanks Cyrille and akmon).
Trying with this list
flows:={-79000, 14000, 11000, 10000, 10000, 10000, 9100, 9000, 4500, 100000}

In CAS I get [-1.01369... 0.137197...] (for the program I need only the second, but both are interesting to know)
in Home I get "Error: Bad argument type"

Are the Home/CAS settings relevant or there is a difference for fsolve in the two?

Or the error was generated by ΣLIST or MAKELIST or ...SIZE? Smile

Salvo


RE: fsolve different in Home and CAS? - Helge Gabert - 05-18-2015 08:43 PM

Yes, fsolve is a CAS function. I just tried a simple numerical problem in Home, and fsolve doesn't work there. Not sure if nSolve did work in Home at one time - - but that function is gone with the newest update.

In Home, try FNROOT.


RE: fsolve different in Home and CAS? - salvomic - 05-18-2015 08:45 PM

(05-18-2015 08:43 PM)Helge Gabert Wrote:  Yes, fsolve is a CAS function. I just tried a simple numerical problem in Home, and fsolve doesn't work there. Not sure if nSolve did work in Home at one time - - but that function is gone with the newest update.

In Home, try FNROOT

thank you Helge,
so now I think to mage the program for IRR in #CAS version, but then I must solve another question: why in a #CAS program EDITLIST doesn't seem to update a list?


RE: fsolve different in Home and CAS? - Helge Gabert - 05-18-2015 08:55 PM

Yes, in CAS, EDITLIST doesn't store the new value(s). Either store the individual entries, e.g., MYLIST(5):=22, or store the entire list again, once you exit EDITLIST, because the new values will be echoed to the screen (with STO ->).


RE: fsolve different in Home and CAS? - salvomic - 05-18-2015 08:58 PM

(05-18-2015 08:55 PM)Helge Gabert Wrote:  Yes, in CAS, EDITLIST doesn't store the new value(s). Either store the individual entries, e.g., MYLIST(5):=22, or store the entire list again, once you exit EDITLIST, because the new values will be echoed to the screen (with STO ->).

so, in a #CAS program is EDITLIST useless?
There is no way to update a list (or a matrix) in such a program?

Salvo


RE: fsolve different in Home and CAS? - Helge Gabert - 05-18-2015 09:00 PM

Yes, I'd say don't use EDITLIST in a CAS program, just overwrite the new elements of the lists directly. That works!


RE: fsolve different in Home and CAS? - salvomic - 05-18-2015 09:02 PM

(05-18-2015 09:00 PM)Helge Gabert Wrote:  Yes, I'd say don't use EDITLIST in a CAS program, just overwrite the new elements of the lists directly. That works!

ok!