|
3 |
edited tags
|
||
|
Post Closed as "off topic" by Andreas Blass, Andres Caicedo, Robert Israel, Tony Huynh, David Roberts
|
||||
|
|
||||
|
2 | deleted 278 characters in body | ||
|
Hi, I am trying to minimize the following energy function subject to two-sided inequalities: E = x1+x2 k1 <= x1 <= k2 k3 <= x2 <= k4 k5 <= x1-x2 <= k6 The ki's are constants and the inequalities create a convex region. I turned Is this how you turn the above equation to a problem into standard form:? E = x1+x2 x1-x2+x3 = k6 x1-x2-x4 = k5 k1 <= x1 <= k2 k3 <= x2 <= k4 in Matlab I use linprog to solve the above linear optimization: f = [1 1 0 0] A = [1 -1 1 0 ; 1 -1 0 -1] b = [k6;k5] Aeq = [] Beq = [] lb = [k1 k3 0 0] ub = [k2 k4inf inf] linprog(f,A,b,Aeq,Beq,lb,ub) and the answer doesn't make sense. It's always x1 = k1 and x2 = k2. |
||||
|
1 |
|
||

