# Numerically solving a system of two equation, one containing a log function

I am trying to solve those equations:

eqns =
-1796853 + 19321 x + 83018.53984692502 x (-8649 + x^2) +
39.56247732409712 x (-8649 + x^2)^2 +
0.005059047659697752 x (-8649 + x^2)^3 +
10.329634791516803 x ((1000 +
1.7850911998308758 y) Sqrt[-101.94940899999999 x^2 + \
(1000 + 1.7850911998308758 y)^2] -
101.94940899999999 x^2 Log[(
0.09903931860948798 (1000 + 1.7850911998308758 y +
Sqrt[-101.94940899999999 x^2 + (1000 +
1.7850911998308758 y)^2]))/x]) == 0 &&
611524 y +
0.1205783688509235 (-101.94940899999999 x^2 + (1000 +
1.7850911998308758 y)^2)^(3/2) == 0 // Simplify;


I have already used some conditions to avoid for negative values inside the Log function as indicated on another post How to solve this system with logarithms? but it did not work for my case:

cons =
And @@ Cases[eqns, Log[z_] :> z > 0, Infinity] //
Simplify[#, Element[{x, y}, Reals]] &

sol = NSolve[eqns && cons, {x, y}, Reals]


It just returns me the NSolve function without solving it.

Any help will be appreciated.

• NMinimize[Abs[expr1]+Abs[expr2],{x,y}] finds a small minimum but logargument/.solution is negative. NMinimize[{Abs[expr1]+Abs[expr2],logargument>0},{x,y}] finds a huge minimum but logargument/.solution is positive. Is it possible there is no solution for positive logargument?
– Bill
Commented Dec 5, 2020 at 23:20
• I'll investigate what you pointed out, maybe I made some mistake in deriving those eqs (physical solutions in the model I'm working with require for positive logargument). On the other hand I expect that NSolve response for the case of no solutions to be the empty set "{}". Thank you Bill. Commented Dec 6, 2020 at 0:58
• Your "cons" defines a function, but it is used without argument. Commented Dec 6, 2020 at 8:57

Clear["Global"]

eqns = -1796853 + 19321 x + 83018.53984692502 x (-8649 + x^2) +
39.56247732409712 x (-8649 + x^2)^2 +
0.005059047659697752 x (-8649 + x^2)^3 +
10.329634791516803 x ((1000 +
1.7850911998308758 y) Sqrt[-101.94940899999999 x^2 + \
(1000 + 1.7850911998308758 y)^2] -
101.94940899999999 x^2 Log[(0.09903931860948798 (1000 +
1.7850911998308758 y +
Sqrt[-101.94940899999999 x^2 + (1000 +
1.7850911998308758 y)^2]))/x]) == 0 &&
611524 y +
0.1205783688509235 (-101.94940899999999 x^2 + (1000 +
1.7850911998308758 y)^2)^(3/2) == 0 //
Rationalize[#, 0] & // Simplify;

ContourPlot[Evaluate[List @@ eqns], {x, -100, 100}, {y, -120, 40}]


sol = FindRoot[eqns, {x, 95}, {y, -10}, WorkingPrecision -> 20]

(* {x -> 92.986023667945379060, y -> -5.9811971865340859795} *)

eqns /. sol

(* True *)
`
• Thank you for your attention Bob. Commented Dec 7, 2020 at 19:02