HP Forums

Full Version: fsolve different in Home and CAS?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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?
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 ->).
(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
Yes, I'd say don't use EDITLIST in a CAS program, just overwrite the new elements of the lists directly. That works!
(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!
Reference URL's