Since one expects an appropriate number of solutions it is reasonable to play with Solve
or Reduce
rather than with NSolve
, and such a conclusion is quite obvious for experienced users, but by no means there is a direct hint in documentation pages. There is a number of various issues related to distinction between symbolic and numeric capabilities of the system, I would recommend e.g. these posts to read carefully:
Issue with NSolve as well as Backslide in NSolve in V11.1?. Basically one could belive there should be one to one correspondence between Solve
and NSolve
results, however implementation reality appears to be slightly different, the former function is much more sophisticated and has had more updates than the latter and this is why sometimes they provide inequivalent results besides issues qualified as simple bugs. Moreover, even a specific usage of Solve
sometimes may seem quite unreasonable for an unexperienced users, nevertheless one can get much more with Solve
than with NSolve
.
To proceed further first we should evaluate Rationalize[{0.0625, 0.25 }]
and substitute exact values to the original system. Now we have:
system = {Sqrt[EAx^2 + 1/16 EAy^2] EBx + EAx Sqrt[ EBx^2 + 1/16 EBy^2] == 0,
1/4 Sqrt[EAx^2 + 1/16 EAy^2] EBy + 1/4 EAy Sqrt[EBx^2 + 1/16 EBy^2] == 0,
EAy - EBy == 0,
-1 + 4 EAx^2 + EAy^2 == 0,
-1 + 4 EBx^2 + EBy^2 == 0,
-8 + ct + EAx - EBx == 0};
Although there are $6$ equations for $5$ variables the system is not contradictory since the equations are not independent and can be reduced to a system of $5$ equations.
The warning returned by NSolve
appears to be false since it seems a reminiscence from what can be observed with
Reduce[system, {ct, EAx, EAy, EBx, EBy}];
Reduce::useq: The answer found by Reduce contains unsolved equation(s)
{0==-(1/2) Sqrt[1+12 EAx^2],0==-(1/2) Sqrt[1+12 EAx^2]}.
A likely reason for this is that the solution set depends on branch cuts of Wolfram
Language functions. >>
One can figure out that the problem with warning is not harmful. Evaluate Reduce[0 == -(1/2) Sqrt[1 + 12 EAx^2], EAx]
.
In fact, we get 6
solutions if we assume ct
is real and allowing different variables to be complex:
Solve[ Join[ system, {ct ∈ Reals}], {ct, EAx, EAy, EBx, EBy}]
When playing with the domain specification Reals
we can find only completely real solutions, there will be only two of them:
Solve[ system, {ct, EAx, EAy, EBx, EBy}, Reals]
{{ct -> 7, EAx -> 1/2, EAy -> 0, EBx -> -(1/2), EBy -> 0},
{ct -> 9, EAx -> -(1/2), EAy -> 0, EBx -> 1/2, EBy -> 0}}
If we don't specify the domain there will be more solutions than 6
,
ct /. Solve[system, {ct, EAx, EAy, EBx, EBy}] // Quiet
{ 7, 8, 8, 8, 8, 9,
8 - I/Sqrt[3], 8 - I/Sqrt[3], 8 + I/Sqrt[3], 8 + I/Sqrt[3]}
To summarize Reduce
is to reduce equations and logic statements yielding sometimes more than one expects, for a more detailed discussion see What is the difference between Reduce and Solve?.
eqs
, you can evenRationalize
them, and check with exactSolve
. ButSolve[Rationalize[eqs] /. ct -> 8, {EAx, EAy, EBx, EBy}, Reals]
returns{}
, so there are actually no solutions for this. Since you claim that you know that solutions exist forct == 8
, can you give the values of the other variables that solve the equations? $\endgroup$Solve[{Sqrt[EAx^2 + 1/16 EAy^2] (EBx) + (EAx) Sqrt[ EBx^2 + 1/16 EBy^2] == 0, 1/4 Sqrt[EAx^2 + 1/16 EAy^2] EBy + 1/4 EAy Sqrt[EBx^2 + 1/16 EBy^2] == 0, EAy - EBy == 0, -1 + 4 EAx^2 + EAy^2 == 0, -1 + 4 EBx^2 + EBy^2 == 0, -8 + ct + EAx - EBx == 0, ct \[Element] Reals}, {ct, EAx, EAy, EBx, EBy}]
$\endgroup$6
solutions wherect
is real, but another variables are not neccessarily real. See my answer. $\endgroup$