Forgot password?
 Register account
View 1207|Reply 4

[不等式] 6-variables inequality

[Copy link]

7

Threads

2

Posts

69

Credits

Credits
69

Show all posts

jhsinutopia Posted 2025-5-17 21:55 |Read mode
$x_1, x_2, x_3, x_4, x_5, x_6 \inR, \sum_{i=1}^{6} x_i =4 , \sum_{i=1}^{6} x_i^2 =11$
$\max{\left(6x_1 x_2 x_3 x_4 x_5 x_6 + \sum_{i=1}^{6} x_i^3 -\sum_{i=1}^{6} x_i^4 \right)}=?$

3159

Threads

7941

Posts

610K

Credits

Credits
63770
QQ

Show all posts

hbghlyj Posted 2025-5-18 04:20
$$
f(x)=6x_1x_2x_3x_4x_5x_6+\sum_{i=1}^6x_i^3-\sum_{i=1}^6x_i^4,
$$
约束条件为
$$
g_1(x)=\sum_{i=1}^6x_i-4=0,\quad g_2(x)=\sum_{i=1}^6x_i^2-11=0.
$$
拉格朗日函数
$$
\mathcal{L}=6\,P +\sum_{i=1}^6x_i^3 - \sum_{i=1}^6x_i^4
- \lambda\Bigl(\sum_{i=1}^6x_i-4\Bigr)
- \mu\Bigl(\sum_{i=1}^6x_i^2-11\Bigr),
$$其中记$P=x_1x_2x_3x_4x_5x_6$。

根据拉格朗日乘数法,当极值点$(x^*,\lambda^*,\mu^*)$处满足
$$
\nabla_{x,\lambda,\mu}\mathcal{L}=0.
$$
对每个$x_i$求偏导得$\frac{\partial P}{\partial x_i}=\frac{P}{x_i}$
$$
\frac{\partial\mathcal{L}}{\partial x_i}
=6\,\frac{P}{x_i}+3x_i^2-4x_i^3
-\lambda -2\mu\,x_i=0,
\quad i=1,\dots,6.
$$
对$\lambda,\mu$求偏导对应即是原约束条件。
由上式可见,每个$x_i$都满足同一方程
$$
6\frac{P}{x}+3x^2-4x^3=\lambda+2\mu x.
$$
因此 $x_i$ 最多取 4 个不同的值。

结论:最大值为 $19.625$,在 $x_i$ 中有 4 个取 $1.5$,2 个取 $-1$ 时达到

3159

Threads

7941

Posts

610K

Credits

Credits
63770
QQ

Show all posts

hbghlyj Posted 2025-5-18 04:57
利用加边海森矩阵(bordered Hessian并检验其前 5 到 8 阶主子式的符号判别该驻点$x_1=\cdots=x_4=1.5,\quad x_5=x_6=-1$是局部极大值
math.stackexchange.com/questions/3261687/extr … dered-hessian-matrix
对于目标函数
$$f(x)=6P+\sum_{i=1}^6x_i^3-\sum_{i=1}^6x_i^4,\quad P=x_1x_2\cdots x_6,$$
以及两个等式约束
$$g_1(x)=\sum_{i=1}^6x_i-4=0,\quad g_2(x)=\sum_{i=1}^6x_i^2-11=0,$$
拉格朗日函数
$$\mathcal{L}(x,\lambda,\mu)=6P+\sum_{i=1}^6x_i^3-\sum_{i=1}^6x_i^4-\lambda\bigl(\sum x_i-4\bigr)-\mu\bigl(\sum x_i^2-11\bigr).$$
在驻点处计算到二阶的增量,其二次型由加边海森矩阵给出。记变量顺序为
$$(\lambda,\;\mu,\;x_1,\dots,x_6),$$
则加边海森矩阵(维度 $8\times8$)可写成块矩阵形式
$$B=\begin{pmatrix}0_{2\times2} & \bigl[\nabla g_1,\;\nabla g_2\bigr]^T\\\bigl[\nabla g_1,\;\nabla g_2\bigr] &\;\; \nabla^2_{xx}\mathcal L\end{pmatrix},$$
其中
  • $\nabla g_1=(1,1,1,1,1,1)^T$,$\nabla g_2=(2x_1,2x_2,\dots,2x_6)^T$;
  • $\nabla^2_{xx}\mathcal L$ 的对角元
    $$  \frac{\partial^2\mathcal L}{\partial x_i^2}  =-6\frac{P}{x_i^2}+6x_i-12x_i^2-2\mu,$$
    非对角元($i\neq j$)
    $$  \frac{\partial^2\mathcal L}{\partial x_i\partial x_j}  =6\,\frac{P}{x_i x_j}.$$
经前面一阶条件可解得驻点
$$x_1=\cdots=x_4=1.5,\quad x_5=x_6=-1$$
且相应的
$$P=(1.5)^4\cdot(-1)^2=5.0625,\quad\mu=7.375,\quad \lambda=-8.625.$$
判别极大值的符号准则
对于 $n$ 个自变量、$q=2$ 个等式约束,构造的加边海森矩阵 $B$ 维度为 $(n+q)\times(n+q)$。记其前 $k$ 阶主子式为
$$\Delta_k = \det\bigl(B_{1:k,\;1:k}\bigr),\qquad k=1,2,\dots,n+q.$$
有下列准则:
极大值,需要满足从 $k=2q+1$ 开始,
$$  (-1)^{q+k}\,\Delta_k>0,\quad k=2q+1,2q+2,\dots,q+n.$$
这里 $q=2$,因此要检查
$$ \Delta_5<0,\;  \Delta_6>0,\;  \Delta_7<0,\;  \Delta_8>0.$$

3159

Threads

7941

Posts

610K

Credits

Credits
63770
QQ

Show all posts

hbghlyj Posted 2025-5-18 05:43
  1. import sympy as sp
  2. x1, x2, x3, x4, x5, x6 = sp.symbols('x1 x2 x3 x4 x5 x6')
  3. mu = sp.Rational(59, 8)  # 7.375
  4. # Stationary values
  5. vals = {x1: sp.Rational(3,2), x2: sp.Rational(3,2), x3: sp.Rational(3,2),
  6.         x4: sp.Rational(3,2), x5: -1, x6: -1}
  7. P = x1*x2*x3*x4*x5*x6
  8. # Build H_xx
  9. H_xx = sp.zeros(6, 6)
  10. vars = [x1, x2, x3, x4, x5, x6]
  11. for i, xi in enumerate(vars):
  12.     for j, xj in enumerate(vars):
  13.         if i == j:
  14.             H_xx[i, j] = -6*P/xi**2 + 6*xi - 12*xi**2 - 2*mu
  15.         else:
  16.             H_xx[i, j] = 6*P/(xi*xj)
  17. # Top block
  18. top = sp.Matrix([
  19.     [0, 0, 1, 1, 1, 1, 1, 1],
  20.     [0, 0, 2*x1, 2*x2, 2*x3, 2*x4, 2*x5, 2*x6]
  21. ])
  22. # Bottom block
  23. bottom = sp.Matrix([
  24.     [1, 2*x1, *H_xx[0, :]],
  25.     [1, 2*x2, *H_xx[1, :]],
  26.     [1, 2*x3, *H_xx[2, :]],
  27.     [1, 2*x4, *H_xx[3, :]],
  28.     [1, 2*x5, *H_xx[4, :]],
  29.     [1, 2*x6, *H_xx[5, :]],
  30. ])
  31. # Full bordered Hessian
  32. B = sp.Matrix.vstack(top, bottom).subs(vals)
  33. # Leading principal minors Δ5..Δ8
  34. deltas = [sp.simplify(B[:k, :k].det()) for k in range(1, 9)]
  35. deltas[4], deltas[5], deltas[6], deltas[7]
Copy the Code
主子式为
  • $\Delta_5 = 0$
  • $\Delta_6 = 0$
  • $\Delta_7 = -\frac{341297975}{16}$
  • $\Delta_8 = \frac{63822721325}{16}$
根据上面的准则,证明了极大值。

3159

Threads

7941

Posts

610K

Credits

Credits
63770
QQ

Show all posts

hbghlyj Posted 2025-5-18 06:12

Mobile version|Discuz Math Forum

2025-5-31 10:40 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit