Hi,

I need to transform a Piecewise Linear Functions in a Convex Predicate. In attachment there is a tex file with the function and my transformation in a convex predicate. Using that convex predicate in a milp, the milp does not found solution. So in attachment there is my .c file with the function that create the MILP and an output with a milp with random valute. The function in the examples is repeated two times, but it does not matter.

I don't know where is my mistake. It's impossible for me find it.

Thank you for your help.
Cheers
Simone

Attachment: Piecewise-Linear-Functions.tex
Description: Binary data

Attachment: function.c
Description: Binary data

Maximize
 obj: 0.5 Z.1 + 0.5 Z.2

Subject To
 r.1: + 5.6 U.1   -1 Z.1 + 72.8 Y.1.1 <= 56
 r.2:   -5.6 U.1 + 1 Z.1   -15.8 Y.1.1 <= 1
 r.3: + 1 U.1 + 10 Q.1 <= 10
 r.4:   -1 U.1 + 1 Q.2 <= 0
 r.5: - 1 Q.1 - 1 Q.2 - 1 Y.1.1 <= -1
 r.6: + 5.6 U.1   -1 Z.1 + 72.8 Y.1.2 <= 56
 r.7:   -5.6 U.1 + 1 Z.1   -15.8 Y.1.2 <= 1
 r.8: + 1 U.1 + 9 Q.3 <= 10
 r.9: -1 U.1 + 2 Q.4 <= 0
 r.10: - Q.3 - Q.4 - Y.1.2 <= -1
 r.11: + 5.6 U.1   -1 Z.1 + 72.8 Y.1.3 <= 56
 r.12:   -5.6 U.1 + 1 Z.1   -15.8 Y.1.3 <= 1
 r.13: -8 Y.1.3 + 1 U.1 <= 2
 r.14: + 11.2 U.1   -1 Z.2 + 128.8 Y.1.1 <= 112
 r.15:   -11.2 U.1 + 1 Z.2   -15.8 Y.1.1 <= 1
 r.16: + 1 U.1 + 10 Q.1 <= 10
 r.17:   -1 U.1 + 1 Q.2 <= 0
 r.18: - 1 Q.1 - 1 Q.2 - 1 Y.1.1 <= -1
 r.19: + 0 U.1   -1 Z.2 + 28 Y.1.2 <= 0
 r.20: + 0 U.1 + 1 Z.2   -27 Y.1.2 <= 1
 r.21: + 1 U.1 + 9 Q.3 <= 10
 r.22: -1 U.1 + 2 Q.4 <= 0
 r.23: - Q.3 - Q.4 - Y.1.2 <= -1
 r.24: + 5.6 U.1   -1 Z.2 + 72.8 Y.1.3 <= 56
 r.25:   -5.6 U.1 + 1 Z.2   -15.8 Y.1.3 <= 1
 r.26: -8 Y.1.3 + 1 U.1 <= 2
 r.27: Y.1.1 + Y.1.2 + Y.1.3 = 1 

Bounds
 0 <= Z.1 <= 1
 0 <= Z.2 <= 1
 0 <= U.1 <= 10
 0 <= Y.1.1 <= 1
 0 <= Q.1 <= 1
 0 <= Q.2 <= 1
 0 <= Y.1.2 <= 1
 0 <= Q.3 <= 1
 0 <= Q.4 <= 1
 0 <= Y.1.3 <= 1

Generals
 Z.1
 Z.2
 U.1

Integer
 Y.1.1
 Y.1.2
 Y.1.3
 Q.1
 Q.2
 Q.3
 Q.4

End
_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to