Matlab随笔之分段线性函数化为线性规划
eg:
10x, 0<=x<=500
c(x)=1000+8x, 500<=x<=1000
3000+6x, 1000<=x<=1500
解法一:
可引入0-1变量,令z1=1,z2=1,z3=1分别表示0<=x<=500,500<=x<=1000,1000<=x<=1500,则
500z2<=x1<=500z1,
500z3<=x2<=500z2,
x3<=500z3,
c(x)=10x1+8x2+6x3
解法二:(更具一般性)