Equation solution using minimization

I have an equation F[x,y]=0. I need to plot y as a function of x. Due to the properties of the function F[x,y], it is impossible to just use ContourPlot for this problem. Also, FindRoot (I don’t know why) doesn’t work in this situation.

However, NMinimize[…,Method → “NelderMead”] works well. I need to find all y_i for every x_i starting from some point {x_0,y_0} which I know a priori. I can do it step by step by hand and it takes a lot of time, but due to my low knowledge in Mathematica to date I can’t automotize this process.

So, please, could anyone help me to to write such a code in Mathematica:

  1. put starting point {x_0,y_0}.

  2. for i from 1 to N

    do

    x_i=x_{i-1}+deltaX,

    NMinimize[{F[x_i, y_i] y_{i-1}-deltaY < y_i < y_{i-1}+deltaY}, {y_i}, Method → “NelderMead”]

    (so, for every x_i we find y_i and look for y_{i+1} in the vicinity of y_i;
    deltaX is just a step, deltaY is a small constant (much less then y_i)
    )

  3. Plot the points {y_i,x_i}.

For example, two steps of this algorithm:

{x_0,y_0}=(0,0)

x_1=0+0.05

NMinimize[{F[x_1, y_1] 0-0.1 < y_i < 0+0.1}, {y_i}, Method → “NelderMead”]

we get y_1=0.05.

x_2=0.05+0.05

NMinimize[{F[x_2, y_2] 0.05-0.1 < y_i < 0.05+0.1}, {y_i}, Method → “NelderMead”]

we get y_1=0.75.

…

It seems to be effectively impossible to evaluate in those ranges without either huge error (at machine precision) or else internal overflows. I think this is from negative radicals giving imaginaries making trigs into hyperbolics. Behaves better for Abs[y]>3. Those ranges do not likely have roots though. Is there some reason to expect real-valued zeros?

Dear Daniel, thank you for your response!

Firstly, the most interesting area for me is 0<y<4, 0<x<5.

Secondly, there is a physical reason to expect real-valued zeros because this equation describes waves in a dispersive media WITHOUT any absorption, damping. X is a wave vector, y is frequency. Moreover, I know asymptotic behavior of the solution of this equation when parameters a->inb, b is finite and when b->inf a is finite. These solutions are described by other equations which are simply solved in Mathematica (using ContourPlot).

But I can’t solve this equation using ContourPlot (in some cases ContourPlot gives a solution, but it is wrong). Also, when I use FindRoot I receive very strange (sometimes even unphysical) solutions. As I know after looking through literature, it is possible to find solutions by Nelder-Mead minimization procedure “While no exact solution exists for the dispersion relations… in the real frequency domain…To obtain the complex wave vectors, numerical solution of … was accomplished through implementation of a two-dimensional unconstrained Nelder-Mead minimization algorithm”. In that article authors have considered absorptive media, but I firstly would like to consider non absorptive media, that’s why I expect real-valued zeros.