I have a function Il12i[-0.001, -0.001, w, 0, 1, 0, 0.1002] which is depends on 1 variable w and it is real if w > -3666 (this number I found from graphs). This function is very complicated numerical function as result of numeric integration, some algebraic system solution and NDSolve. I cannot put it here, because it takes something like 10 pages of text.
I need to solve something like this Abs[ Im[ Il12i[-0.001, -0.001, w, 0, 1, 0, 0.1002] ]] > 0
In other words I need to find point, where this function becomes complex.
NSolve does not work at all, as I understand from documentation for complicated function it is better to use FindRoot.
I tried something like this
FindRoot[Abs[Im[Il12i[-0.001, -0.001, w, 0, 1, 0, 0.1002]]] == 0.001, {w, -3700.0}]
but it gives me wrong result {w -> -3639.24} and error message "Encountered a singular Jacobian at the point {w} = {-3639.24}. Try \ perturbing the initial point(s). "
I found a little bit similar problem here HarmonicNumber problem and I understand that I can try to play with WorkingPrecision like this
FindRoot[Abs[Im[Il12i[-0.001, -0.001, w, 0, 1, 0, 0.1002]]] == 0.001, {w, -3700.0}, AccuracyGoal -> Infinity, PrecisionGoal -> 5, WorkingPrecision -> 10000]
but it did not helped.
I made a plot to understand how Im and Re of this function looks like and it it below
and I know that this equation has only one solution, I even know where it is approximately from graph (w=-3666), but I cannot find it :(.
My final goal to find many solutions of similar equations to find how this point where function becomes complex depends on parameters a, b, c like this Il12i[a, b, w, 0, 1, 0, c], this is why I cannot use solution from graph or I will need to make hundreds graphs with different parameters a, b, c.
UPDATE:
If I try to use this function in ^2, it is still complex and it is very similar and returns the same error. Here is the graph of normal function and ^2.
I prepared some numerical test data from this function and upload it here https://drive.google.com/open?id=0B8TaBGM8Qgp5ZHROUlRscjVKbVk
It can be loaded and returns the same error by this code
Get["C:\\data\\temp\\ccc\\1.zzz"]
Plot[{Im[IIINf[w]]}, {w, -3700, -3650}, PlotLegends -> {"Im"},
PlotStyle -> {Red}]
FindRoot[Abs[Im[IIINf[w]]] == 0.001, {w, -3700},
WorkingPrecision -> 1000]
Abs[expr] > 0
trySqrt[expr^2] > 0
. The derivatives will then exist and Mathematica may do better. $\endgroup$Il12i[w]^2 == 0
with FindRoot.. $\endgroup$Im[...]
is zero, hence that singular Jacobian. You might try constraining it, maybe useFindMinimum[{(Im[expr]-.001)^2,x<=-3667},{w,-3700}]
and see if that avoids the trouble zone. $\endgroup$