简体   繁体   English

最小化java中复杂的线性多变量函数

[英]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 . x是长度为L的复数数组。

a[0], a[1], ..., a[L-1] are complex coefficients and a [0],a [1],...,a [L-1]是复系数和

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. F是复函数F(x)= x [0] * a [0] + x [1] * a [1] + ... + x [L-1] * a [L-1]必须最小化。

b[0], b[1], ..., b[L-1] are complex coefficients and there is a constraint b [0],b [1],...,b [L-1]是复系数,存在约束

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

I already had a detailed look at http://math.nist.gov/javanumerics/ and went through many documentations. 我已经详细了解了http://math.nist.gov/javanumerics/并浏览了许多文档。 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 . 您希望最小化平滑超曲面S上的可微分实值函数f 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 . 如果存在这样的最小值 - 在编辑之后的情况下保证存在,因为超曲面是紧凑的 - 它发生在fS的限制f|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. 一个微函数的临界点f在限制在歧管周围的空间中定义的M是那些点,其中梯度f正交于切空间T(M)到歧管。 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 . 在歧管是超曲面(它具有实际的维数1)的情况下,由方程g(x) = 0定义(局部),具有平滑函数g ,这是特别容易检测的, f|S的临界点是在S上的点x ,其中grad(f)|xgrad(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 超曲面S ,其方便地是单位球面,通过全局定义的(x|x) = 1 ,其中(a|b)表示标量积a_1*b_1 + ... + a_k*b_k ,梯度gx是只需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 一个实线性函数L(x) = (c|x) = c_1*x_1 + ... + c_k*x_kL的梯度是c独立于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| 因此球上有两个临界点L (除非c = 0在这种情况下L是常数),通过原点和c线与球相交的点, c/|c| and -c/|c| -c/|c| .

Obviously L(c/|c|) = 1/|c|*(c|c) = |c| 显然L(c/|c|) = 1/|c|*(c|c) = |c| and L(-c/|c|) = -1/|c|*(c|c) = -|c| L(-c/|c|) = -1/|c|*(c|c) = -|c| , so the minimum occurs at -c/|c| ,所以最小值出现在-c/|c| and the value there is -|c| 和那里的值-|c| .

Each complex variable x can be considered as two real variables, representing the real and imaginary part, respectively, of x . 每个复变量x可以被认为是两个实数变量,分别代表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. 约束可以分为两个,其中“实际”约束应该等于1而“虚构”约束应该等于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. 例如, Apache Commons Math库中有一组不错的优化器, SuanShu库也包含一些优化算法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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