Ν = 6; M = Ν/2; prec = 20; c = 0.3 + 0.002*I; workprec = 200;
solu = Flatten[(Λ[#1] & ) /@ Range[M] /.
NSolve[Table[-Product[(Λ[δ] - Λ[γ] + I*c)/(Λ[δ] - Λ[γ] - I*c), {δ, 1, M}] ==
((Λ[γ] - 1 - I*(c/2))/(Λ[γ] - 1 + I*(c/2)))^Ν*((Λ[γ] - I*(c/2))/
(Λ[γ] + I*(c/2))), {γ, M}], Table[Λ[γ], {γ, M}],
WorkingPrecision -> workprec]];
ListPlot[Transpose[{Re[solu], Im[solu]}]]
While plotting the solutions to these equations, one gets
You can see that there are pair solutions of the form $\Re[\Lambda]\pm \Im[\Lambda]$ i.e. the ones which have the same real parts but the imaginary part is positive and negative (nearly equal). But there also solutions that do not come in such pairs.
I am interested in only those solutions which do not come in pairs. One way I can do is find all solutions and select the ones that do not come in pair but the problem is that it is very slow to do it that way. I have to eventually run this program for $N=100$ but it is struggling at $N=6$.
My question is:
How do I make the program search the solutions which have $|\Im(\Lambda)|<0.002$. The goal is to search the solutions only in this narrow window (where most of the non-paired solution lie) so that the program is faster. I do not care about missing some solutions or having pair solutions-- all I am looking for is making the program fast by not searching too many pair solutions so that I can scale the program to $N=100$ or above.
If you run this program, it might take quite a bit of time to get result
Update 1:
Following Michael's comment, I tried
Ν = 6; M = Ν/2; prec = 20; c = 0.3 + 0.002*I; workprec = 200;
solu = Flatten[(Λ[#1] & ) /@ Range[M] /.
NSolve[Table[-Product[(Λ[δ] - Λ[γ] + I*c)/(Λ[δ] - Λ[γ] - I*c), {δ, 1, M}] ==
((Λ[γ] - 1 - I*(c/2))/(Λ[γ] - 1 + I*(c/2)))^Ν*((Λ[γ] - I*(c/2))/
(Λ[γ] + I*(c/2)))&& Abs[Im[Λ[γ]]]<0.002, {γ, M}], Table[Λ[γ], {γ, M}],
WorkingPrecision -> workprec]];
ListPlot[Transpose[{Re[solu], Im[solu]}]]
This indeed printed the solutions that I wanted but this is not any faster. I could not get even N=8 in a reasonable time.
NSolve[{eqn1, eqn2,..., Abs[Im[lambda]] < 0.002},...]
. Restricting sometimes speeds it up, sometimes not so much. It doesn't search for roots the way one searches one's house for lost keys. $\endgroup$N=6
. Same goes forE
, for example. These symbols have special meanings in Mathematica, and it's best to stay away from these. $\endgroup$\[CapitalNu]
which is different from Mathematica commandN
. $\endgroup$