分段函数线性化建模

Modeling piecewise linear functions

Piecewise linear functions can be modeled using variables that satisfy what is known as a special order set (SOS) constraint of type 2. Consider the following example of a continuous piecewise linear function: 

 

\begin{displaymath}z = \left\{ \begin{array}{rl}3+4x & \mbox{for } 0 \leq x \l......q 3 \\6+x & \mbox{for } 3 \leq x \leq 7.\end{array} \right.\end{displaymath}

 

 

The variable x is restricted to lie between 0 and 7.

 

We introduce four nonnegative continuous variables x1, x2, x3, and x4. We require 

 

x = 0x1 + 2x1 + 3x2 + 7x3,(1)

 

 

so the coefficients are the endpoints of the three intervals in the function. We also require 

 

 

 

 

x1+x2+x3+x4 = 1,(2)

 

 

the same method we used for modeling a variable that takes a number of distinct values. Here, x is continuous, so we allow the xi to be continuous. We can now define z as 

 

 

 

 

z = 3x1+11x2+9x3+13x4(3)

 

 

so the coefficients are the values of z at the breakpoints.

 

The calculated value of z is not accurate if, for example, x1=0.5 and x4=0.5. The restriction we need to impose is that at most two of the xi can be nonzero, and the two nonzero xi must be adjacent. This is known as a SOS-2 constraint, that is, a special order set of type 2 constraint.

The SOS-2 restriction can be modeled using binary variables yi$i=1,\ldots,4$:

 

 

\begin{displaymath}\begin{array}{rcll}x_i & \leq & y_i & i = 1, \ldots ,4 \\...... \\y_1 + y_4 & \leq & 1 \\y_2 + y_4 & \leq & 1.\end{array}\end{displaymath}

 

 

 

转自     John Mitchell    mitchj@rpi.edu

联系我:ligong15 AT foxmail.com

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值