2D function minimization algorithm or C / C ++ library

I need to minimize it 2D function f(x,y). I already have minimization 1-Dwith Brent Method(like a bisexual search to find the root.) I thought the version 2Dwould be a fairly simple, common problem that would have many good algorithms and libraries, but I didn’t find paradise. I think I just used it Downhill Simplex from Numerical Recipes, but I thought it might be easier for a simple 2Dor convenient library.

For those interested, here are a few more details:

I am really trying to find a line that minimizes the point between two 1D functions, AKA is a bitant. 1D functions usually look like parabolas, and at some point they intersect. The intersection point gives X points to a minimum, and I want to find a line tangent to parabolas that minimizes Y on this X.

So, I really am minimizing g( f1(x1), f2(x2) ).

Unfortunately, I no longer have information about f1 () and f2 (). Functions are selected or even provided by the user. If the user provides data, I get the functions as a set of points. I can do the interpolation to get a pretty good numerical derivative at any point on the line, but more on that. Minimization was considered the previous developer - the most common way to search for a binagent. I'm still trying to find out if he was right.

+3
source share
3 answers

I understand what you want minimize g(f1(x),f2(y)) = h(x,y). Downhill Simplex may be a good solution to your problem, as it is easy to implement if you have NR. Another possible method could be Breiden. However, since you have derivatives, you can use algorithms that also display this information. E.g. The conjugate gradient method is implemented in NR (or at least NR3).

, grad(h), , grad(h)[1] grad(h)[2] , grad(h) = 0 , . , , , f1 f2 (, ).

+1

, .

.

, X1 Z1(X1), 1 X. Z2(X2). Z(X1, X2).

Z1(X1) = Y1(X1) + Y1'(X1).(X1 - X)

Z2(X2) = Y2(X2) + Y2'(X2).(X2 - X)

Z(X1, X2) = ((X1 - X).Y2(X2) - (X2 - X).Y1(X1)) / (X1 - X2)

Z1(X1) = Z2(X2) = Z(X1, X2), , , X.

+1

The Gnu Science Library has the minimization functions that I need, so I integrate it. The answers were pretty good, but they were not the best solution in my case. Largely because I did not clearly articulate the problem.

+1
source

All Articles