The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Prime: fsolve with [..]
Message #1 Posted by Helge Gabert on 6 Oct 2013, 10:38 p.m.

I was pleasantly surprised that root finding for certain functions with fsolve and [interval] finds more than one solution with one call, e.g., fsolve(x^(3-4)-3,x,0..6) finds both roots, [1.57.. and 3]. This is in CAS view only. In Home view, any attempt to enter the interval (and changing x for X) gives an error message: two decimal separators in input!

One quirk: if the function is stored in, say, F7, in CAS view, executing fsolve(F7,'X',0..6) returns only one root (3), IF the Function app is the current app. If I switch to SOLVE as the current app, both roots are returned. ???

What object type is the interval [..]? Can that be tested for in a program?

      
Re: Prime: fsolve with [..]
Message #2 Posted by Helge Gabert on 6 Oct 2013, 11:00 p.m.,
in response to message #1 by Helge Gabert

Sorry, typo . . the function should read X^(4-X)-3 in F7 (or x^(4-x)-3 in CAS view).

      
Re: Prime: fsolve with [..]
Message #3 Posted by parisse on 7 Oct 2013, 6:35 a.m.,
in response to message #1 by Helge Gabert

Quote:

What object type is the interval [..]? Can that be tested for in a program?


It's a symbolic, if ii:=a..b then ii[0]=='..'
            
Re: Prime: fsolve with [..]
Message #4 Posted by Helge Gabert on 7 Oct 2013, 10:41 a.m.,
in response to message #3 by parisse

Thank you!

I hope that in a later revision, symbolic expressions can be passed as arguments to programs!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall