Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algorithm for multidimensional optimization / root-finding / something

I have five values, A, B, C, D and E.

Given the constraint A + B + C + D + E = 1, and five functions F(A), F(B), F(C), F(D), F(E), I need to solve for A through E such that F(A) = F(B) = F(C) = F(D) = F(E).

What's the best algorithm/approach to use for this? I don't care if I have to write it myself, I would just like to know where to look.

EDIT: These are nonlinear functions. Beyond that, they can't be characterized. Some of them may eventually be interpolated from a table of data.

like image 630
avalys Avatar asked Sep 03 '25 16:09

avalys


2 Answers

There is no general answer to this question. A solver finding the solution to any equation does not exist. As Lance Roberts already says, you have to know more about the functions. Just a few examples

  • If the functions are twice differentiable, and you can compute the first derivative, you might try a variant of Newton-Raphson
  • Have a look at the Lagrange Multiplier Method for implementing the constraint.
  • If the function F is continuous (which it probably is, if it is an interpolant), you could also try the Bisection Method, which is a lot like binary search.

Before you can solve the problem, you really need to know more about the function you're studying.

like image 138
Martijn Avatar answered Sep 05 '25 12:09

Martijn


As others have already posted, we do need some more information on the functions. However, given that, we can still try to solve the following relaxation with a standard non-linear programming toolbox.

min k
st.
A + B + C + D + E = 1
F1(A) - k = 0
F2(B) - k = 0
F3(C) -k = 0
F4(D) - k = 0
F5(E) -k = 0

Now we can solve this in any manner we wish, such as penalty method

min k + mu*sum(Fi(x_i) - k)^2 st
A+B+C+D+E = 1

or a straightforward SQP or interior-point method.

More details and I can help advise as to a good method.

m

like image 23
SplittingField Avatar answered Sep 05 '25 12:09

SplittingField