简体   繁体   中英

Minimize complex linear multivariable function in java

I need to minimize a complex linear multivariable function under some constraints .

Let x be an array of complex numbers of length L .

a[0], a[1], ..., a[L-1] are complex coefficients and

F is the complex function F(x)= x[0]*a[0] + x[1]*a[1] + ... + x[L-1]*a[L-1] that has to be minimized.

b[0], b[1], ..., b[L-1] are complex coefficients and there is a constraint

1 = complexConjuate(x[0])*x[0] + complexConjuate(x[1])*x[1] + ... + complexConjuate(x[L-1])*x[L-1] that has to be fulfilled.

I already had a detailed look at http://math.nist.gov/javanumerics/ and went through many documentations. But I couldn't find a library which does minimization for complex functions.

You want to minimize a differentiable real-valued function f on a smooth hypersurface S . If such a minimum exists - in the situation after the edit it is guaranteed to exist because the hypersurface is compact - it occurs at a critical point of the restriction f|S of f to S .

The critical points of a differentiable function f defined in the ambient space restricted to a manifold M are those points where the gradient of f is orthogonal to the tangent space T(M) to the manifold. For the general case, read up on Lagrange multipliers .

In the case where the manifold is a hypersurface (it has real codimension 1) defined (locally) by an equation g(x) = 0 with a smooth function g , that is particularly easy to detect, the critical points of f|S are the points x on S where grad(f)|x is collinear with grad(g)|x .

Now the problem is actually a real (as in concerns the real numbers) problem and not a complex (as in concerning complex numbers) one.

Stripping off the unnecessary imaginary parts, we have

  • the hypersurface S , which conveniently is the unit sphere, globally defined by (x|x) = 1 where (a|b) denotes the scalar product a_1*b_1 + ... + a_k*b_k , the gradient of g at x is just 2*x
  • a real linear function L(x) = (c|x) = c_1*x_1 + ... + c_k*x_k , the gradient of L is c independent of x

So there are two critical points of L on the sphere (unless c = 0 in which case L is constant), the points where the line through the origin and c intersects the sphere, c/|c| and -c/|c| .

Obviously L(c/|c|) = 1/|c|*(c|c) = |c| and L(-c/|c|) = -1/|c|*(c|c) = -|c| , so the minimum occurs at -c/|c| and the value there is -|c| .

Each complex variable x can be considered as two real variables, representing the real and imaginary part, respectively, of x .

My recommendation is that you reformulate your objective function and constraint using the real and imaginary parts of each variable or coefficient as independent components.

According to the comments, you only intend to optimize the real part of the objective function, so you can end up with a single objective function subject to optimization.

The constraint can be split into two, where the "real" constraint should equal 1 and the "imaginary" constraint should equal 0.

After having reformulated the optimization problem this way, you should be able to apply any optimization algorithm that is applicable to the reformulated problem. For example, there is a decent set of optimizers in the Apache Commons Math library, and the SuanShu library also contains some optimization algorithms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM