I have written the following snippet in Mathematica to solve a system of 3 non-linear equations?
fr={-2.9*(10^(-15))/(x^4)+1.0/(x^2)-1.0/((y-x)^2)-1.0/((z-x)^2)==0,
-2.9*(10^(-15))/(y^4)+1.0/(y^2)+1.0/((y-x)^2)-1.0/((z-y)^2)==0,
-2.9*(10^(-15))/(z^4)+1.0/(z^2)+1.0/((z-x)^2)+1.0/((z-y)^2)};
fnprecise=SetPrecision[fr,32]
fnprecise[[1]]
sol=NSolve[fnprecise,{x,y,z},Reals,WorkingPrecision->2 $MachinePrecision]
But when I replace the solutions in the non-linear equations one by one; I get quite a bit large residues? Does any body know how can I increase the accuracy of my calculation?
{-2.9*(10^(-15))/(x^4)+1.0/(x^2)-1.0/((y-x)^2)-1.0/((z-x)^2)}/.sol[[1]]
{-2.9*(10^(-15))/(y^4)+1.0/(y^2)+1.0/((y-x)^2)-1.0/((z-y)^2)}/.sol[[1]]
{-2.9*(10^(-15))/(z^4)+1.0/(z^2)+1.0/((z-x)^2)+1.0/((z-y)^2)}/.sol[[1]]
{-2.9*(10^(-15))/(x^4)+1.0/(x^2)-1.0/((y-x)^2)-1.0/((z-x)^2)}/.sol[[2]]
{-2.9*(10^(-15))/(y^4)+1.0/(y^2)+1.0/((y-x)^2)-1.0/((z-y)^2)}/.sol[[2]]
{-2.9*(10^(-15))/(z^4)+1.0/(z^2)+1.0/((z-x)^2)+1.0/((z-y)^2)}/.sol[[2]]
{-2.9*(10^(-15))/(x^4)+1.0/(x^2)-1.0/((y-x)^2)-1.0/((z-x)^2)}/.sol[[3]]
{-2.9*(10^(-15))/(y^4)+1.0/(y^2)+1.0/((y-x)^2)-1.0/((z-y)^2)}/.sol[[3]]
{-2.9*(10^(-15))/(z^4)+1.0/(z^2)+1.0/((z-x)^2)+1.0/((z-y)^2)}/.sol[[3]]
the output of replacement is as follows:
{0.015625}
{0.00390625}
{0}
{0.015625}
{0.00390625}
{0}
{0}
{0}
{0.0136719}
As you can see, the residue of some replacements are still high, any hint on how to get lower residues? I mean increasing the accuracy of solutions. I want to make the residues extremely small. These are pretty big.
Thanks
fnprecise /. Equal -> Subtract /. sol
to check the residuals of the more precise solutionsol
on the more precise systemfnprecise
? $\endgroup$