HP Forums
Question about solve function for system of non linear equations - 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: Question about solve function for system of non linear equations (/thread-1537.html)



Question about solve function for system of non linear equations - Rich - 06-04-2014 09:37 PM

Hi,

Is there a better way to solve a system of equations on the Prime.

When entering:
solve([1=a*b 1=a*(-b^2+1)^.5], [a b])

I am getting an error:

"[b, SQRT(-b^2+1)] is not rational w.r.t. b Error Bad Argument Value" (the SQRT was an actual square root symbol)

I am able to do the example in the user manual without any issues but the above system of equations is giving me an error.

Of course doing it by hand i can get {[a = 0.7071067812, b= 1.414213562]}

Thanks...


RE: Question about solve function for system of non linear equations - Rich - 06-04-2014 09:39 PM

... actually testing out and using fsolve instead of solve gave me the right answer. nSolve gave me the hour glass for a while...

: (

I keep on forgetting that fsolve is for numeric results, it would be nice to have that in the drop down list in the CAS menu for those of us who are absent minded : (


RE: Question about solve function for system of non linear equations - CR Haeger - 06-05-2014 12:15 AM

(06-04-2014 09:39 PM)Rich Wrote:  ... actually testing out and using fsolve instead of solve gave me the right answer. nSolve gave me the hour glass for a while...

: (

I keep on forgetting that fsolve is for numeric results, it would be nice to have that in the drop down list in the CAS menu for those of us who are absent minded : (

Hmm can you show the fsolve() equation that worked? I get an hourglass then reboot with: fsolve([a*b=1,a*(1-b^2)^0.5=1],[a,b],[1,1])

I do use fsolve() often enough that I made it a USER key.


RE: Question about solve function for system of non linear equations - Rich - 06-05-2014 12:35 AM

Oh sure, no problem,

fsolve([1=a*b 1=a*(-b^2+1)^.5], [a b])

Where [] indicates a matrix with separated elements by pressing , (comma), so the commas are not shown in my equation above. Image attached.

[attachment=748]

I want to setup user keys, but i really wish it was available to assign to "soft menu" keys like in the 50g, otherwise i might forget what key is what. This is probably one of my top request to have in the Prime, that an undo key, and maybe a better way to store equations.


RE: Question about solve function for system of non linear equations - parisse - 06-05-2014 05:44 AM

This was implemented recently in giac (exact solving I mean, fsolve works), so you'll have to wait for an update on the Prime...