You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

约束不可微时非线性函数极小化:双不等式约束求解方法问询

Alright, let's tackle this problem step by step. The tricky part here is that our constraint (g(x,y) = y - |x| = 0) isn't differentiable at (x=0), which breaks standard methods like Lagrange multipliers that rely on smoothness. The fix is to split the absolute value into two differentiable subproblems, each bounded by inequality constraints, then solve each case and take the minimum.

Split the Non-Differentiable Constraint into Two Subproblems

The absolute value function (|x|) only causes issues at (x=0), so we can split our problem into two regions where (|x|) is differentiable, using inequality constraints to define each region's bounds.


Subproblem 1: (x \geq 0)

In this region, (|x| = x), so our original equality constraint (y = |x|) simplifies to the differentiable (y = x). We use the inequality constraint (x \geq 0) to lock this region in.

Here's the formal model for this subproblem:

Minimize (f(x,y) = (x - x_0)^2 + (y - y_0)^2)
Subject to:

  • (g_1(x,y) = y - x = 0)
  • (h_1(x,y) = -x \leq 0) (this is just another way to write (x \geq 0))

Solve with KKT Conditions

We set up the Lagrangian function:

L(x,y,λ,μ) = (x - x₀)² + (y - y₀)² + λ(y - x) + μ(-x)

Take partial derivatives and set them to zero:

  • (\frac{\partial L}{\partial x} = 2(x - x_0) - λ - μ = 0)
  • (\frac{\partial L}{\partial y} = 2(y - y_0) + λ = 0)
  • Complementary slackness: (\mu(-x) = 0) (either (\mu=0) or (x=0))

Combine with the constraint (y = x) and analyze two cases:

  1. Interior solution ((\mu=0), (x>0)):
    Substitute (y=x) into the derivative equations, and we get:
    (x = y = \frac{x_0 + y_0}{2})
    This is valid only if (x \geq 0). Since our original point ((x_0,y_0)) is in the fourth quadrant ((x_0>0, y_0<0)), this translates to (|x_0| \geq |y_0|).

  2. Boundary solution ((x=0)):
    If (x=0), then (y=0) (from (y=x)), and the objective value is (x_0^2 + y_0^2).


Subproblem 2: (x \leq 0)

In this region, (|x| = -x), so our equality constraint becomes the differentiable (y = -x). We use the inequality constraint (x \leq 0) to define this region.

Formal model:

Minimize (f(x,y) = (x - x_0)^2 + (y - y_0)^2)
Subject to:

  • (g_2(x,y) = y + x = 0)
  • (h_2(x,y) = x \leq 0)

Solve with KKT Conditions

Set up the Lagrangian:

L(x,y,λ,μ) = (x - x₀)² + (y - y₀)² + λ(y + x) + μ(x)

Take partial derivatives and set to zero:

  • (\frac{\partial L}{\partial x} = 2(x - x_0) + λ + μ = 0)
  • (\frac{\partial L}{\partial y} = 2(y - y_0) + λ = 0)
  • Complementary slackness: (\mu x = 0) (either (\mu=0) or (x=0))

Combine with (y = -x) and analyze cases:

  1. Interior solution ((\mu=0), (x<0)):
    Substitute (y=-x) into the derivative equations, and we get:
    (x = \frac{x_0 - y_0}{2}), (y = -\frac{x_0 - y_0}{2})
    This is valid only if (x \leq 0). For our fourth-quadrant point, this means (|x_0| < |y_0|).

  2. Boundary solution ((x=0)):
    Again, (x=0) gives (y=0), with objective value (x_0^2 + y_0^2).


Combine Results to Find the Minimum

Since ((x_0,y_0)) is in the fourth quadrant:

  • If (|x_0| \geq |y_0|): The minimum comes from Subproblem 1's interior solution, with objective value (\frac{(x_0 - y_0)^2}{2})
  • If (|x_0| < |y_0|): The minimum comes from Subproblem 2's interior solution, with objective value (\frac{(x_0 + y_0)^2}{2})
  • If (|x_0| = |y_0|): Both interior solutions reduce to ((0,0)), so the objective value is the same either way.

By splitting the problem into two regions bounded by inequality constraints, we avoid the non-differentiable point at (x=0) and can use standard optimization tools to find the solution.


内容的提问来源于stack exchange,提问作者user319373

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:31:18