HP Forums
Non-linear system of eqtns - 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: Non-linear system of eqtns (/thread-2947.html)



Non-linear system of eqtns - Offroad - 01-27-2015 08:16 PM

Dear friends,

WOuld you be kind enough as to teach me how to solve systems of equations like this one and larger using the Prime?

z*y - x^2 + y = -53
x^2 + y^2 - z = 47
x*y - x + z = -11

initial guess would be {x,y,z}={1,5,0}

Thank you


RE: Non-linear system of eqtns - Han - 01-27-2015 08:57 PM

purge(x,y,z);
eq1:=z*y - x^2 + y = -53;
eq2:=x^2 + y^2 - z = 47;
eq3:=x*y - x + z = -11;
soln:=fsolve([eq1,eq2,eq3],[x,y,z]=[1,5,0]);

Now check your answer:

subst(eq1,[x,y,z]=soln);
subst(eq2,[x,y,z]=soln);
subst(eq3,[x,y,z]=soln);

In each of these three cases, the left hand side should equal the right hand side (or be very close).

Finally, delete the variable 'soln' and the three equations (if you no longer need them):

purge(soln,eq1,eq2,eq3);

EDIT: forgot to mention this should be done in CAS view.


RE: Non-linear system of eqtns - Maro - 01-27-2015 09:04 PM

or simply use the Solve App ...


RE: Non-linear system of eqtns - Han - 01-27-2015 09:08 PM

(01-27-2015 09:04 PM)Maro Wrote:  or simply use the Solve App ...

The solve app works just as well. Do keep in mind that it requires you to restrict your variables to either the built-in global variables, or variables which you have created yourself prior to running the app. It also limits you to 10 equations.

If your system is simple, use the solve app. If you have more than 10 equations, then use fsolve in the CAS view.


RE: Non-linear system of eqtns - Offroad - 01-27-2015 09:48 PM

So simple. Thank you very much. I just ordered mine online.