Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

nonlinear optimization - Linearize non-linear constraint (product of two continuous variables)

I have a problem with linearizing a constraint because of the product of two continuous variables.

Suppose that the non-linear constraint is A = b + x1 x2 : A,x1,x2 are non-negative continuous variables.

How can I linearize this constraint?

I tried to reformulate it by creating two new continuous variables (y1 and y2) where y1 = 1/2 (x1 + x2) and y2= 1/2 (x1 - x2). In this case, the constraint also becomes non-linear.

What should I do?

question from:https://stackoverflow.com/questions/65840341/linearize-non-linear-constraint-product-of-two-continuous-variables

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is no exact way to linearize w=x*y if x and y are continuous.

  • The reformulation z1 = 1/2 (x + y) and z2 = 1/2 (x - y) gives w = z1^2 - z2^2. This is indeed still non-linear, but this is easier to handle when using a piecewise linear approximation.
  • You can use McCormick envelopes (https://optimization.mccormick.northwestern.edu/index.php/McCormick_envelopes). But this gives just an approximation. To get more precision, split the range in segments.
  • Sometimes (in special cases) a logarithmic transform can help.
  • Some solvers can handle this quadratic expression directly.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...