拉格朗日乘子法
\[min \quad f = 2x_1^2+3x_2^2+7x_3^2 \\s.t. \quad 2x_1+x_2 = 1 \\ \quad \quad \quad 2x_2+3x_3 = 2
\]
\]
\[min \quad f = 2x_1^2+3x_2^2+7x_3^2 +\alpha _1(2x_1+x_2- 1)+\alpha _2(2x_2+3x_3 - 2)
\]
\]
\[\dfrac{\partial f}{\partial x_1}=4x_1+2\alpha_1=0\Rightarrow x_1=-0.5\alpha_1 \\ \dfrac{\partial f}{\partial x_2}=6x_2+\alpha_1+2\alpha_2=0\Rightarrow x_2=-\dfrac{\alpha_1+2\alpha_2}{6} \\ \dfrac{\partial f}{\partial x_3}=14x_3+3\alpha_2=0\Rightarrow x_3=-\dfrac{3\alpha_2}{14}
\]
\]
KKT条件
\[min \quad f = x_1^2-2x_1+1+x_2^2+4x_2+4 \\s.t. \quad x_1+10x_2 > 10 \\ \quad \quad \quad 10 x_1-10x_2 < 10
\]
\]
\[s.t. \quad 10-x_1-10x_2 <0 \\ \quad \quad \quad 10x_1-x_2 - 10<0
\]
\]
\[L(x,\alpha) = f(x) + \alpha_1g1(x)+\alpha_2g2(x)\\ =x_1^2-2x_1+1+x_2^2+4x_2+4+ \alpha_1(10-x_1-10x_2 ) +\\\alpha_2(10x_1-x_2 - 10)
\]
\]
\[L(x,\alpha,\beta) = f(x) + \sum\alpha_ih_i(x)+\sum\beta_ig_i(x)
\]
\]
(1) L对各个x求导为零;
(2) h(x)=0;
(3) \( \beta_ig_i(x)=0 \)
\[min \quad f = x_1^2-2x_1+1+x_2^2+4x_2+4 \\s.t. \quad 10-x_1-10x_2 <0 \\ \quad \quad \quad 10x_1-x_2 - 10<0
\]
\]
\[L(x,\alpha)= x_1^2-2x_1+1+x_2^2+4x_2+4+\\\alpha_1(10-x_1-10x_2)+\alpha_2(10x_1-x_2 - 10)
\]
\]
\[\dfrac{\partial L}{\partial x_1}=2x_1-2-\alpha_1+10\alpha_2=0\Rightarrow x_1=0.5(\alpha_1-10\alpha_2+2) \\ \dfrac{\partial L}{\partial x_2}=2x_2+4-10\alpha_1-\alpha_2=0\Rightarrow x_2=0.5(10\alpha_1+\alpha_2-4)
\]
\]
\[\alpha_1*g_1(x)=\alpha_1*(10-x_1-10x_2)=0\\\alpha_2*g_2(x)=\alpha_2*(10x_1-x_2 - 10)=0
\]
\]
\[α1=58/101,α2=4/101
\]
\]
\[x1=110/101=1.08;x2=90/101=0.89
\]
\]