[Fwd: Re: How can regions be modeled in which different objective functions apply?]
Andrew Makhorin <[email protected]>
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <1506609071.5083.0.camel@corvax> |
-------- Forwarded Message -------- From: Thomas Schwabhäuser <[email protected]> To: [email protected] Subject: Re: How can regions be modeled in which different objective functions apply? Date: Thu, 28 Sep 2017 16:11:54 +0200 Dear Optimizers -- It was not even hard to figure out that the quoted Problem is equivalent to var X{i in 0..1}; var Y{j in 0..1}; maximize energy: ObjF; s.t. AllRegions{i in I,j in I}: ObjF <= ObjF[i,j]; s.t. EachRegion{i in I,j in I}: ObjF[i,j] = F[i,j,X[i,j],Y[i,j]]; s.t. Region1X: X[0,0] <= S; s.t. Region1Y: Y[0,0] <= T; s.t. Region2X: X[1,0] >= S; s.t. Region2Y: Y[1,0] <= T; s.t. Region3X: X[0,1] <= S; s.t. Region3Y: Y[0,1] >= T; s.t. Region4X: X[1,1] >= S; s.t. Region4Y: Y[1,1] >= T; provided F[i,j,x,y] dispatches to/is replaced by the functions F[x,y], G[x,y], H[x,y], andK[x,y] according to the Indices i and j which are assumed to take the value 0 or 1. This variant uses 8 variables X[i,j] and Y[i,j] each pair (X,Y) is bound to the desired region above or below the thresholds. However, once the maximum energy is determined we do not necessarily need to tell for which values of X and Y the objective function takes its maximum but at least for which combination of i and j the maximum was found. * Could anybody tell how to find the right values of i and j, please? 2017-09-28 11:02 GMT+02:00 Thomas Schwabhäuser <[email protected]>: Dear All -- I need to find the maximum energy which is given by 4 GMPL expressions F[x,y], G[x,y], H[x,y], K[x,y], say. These expressions apply to different regions determined by thresholds S and T. According to Re: [Help-glpk] Multiple LP problem solving I was going to solve the following Problem: maximize Energy: ObjF; subject to Region1: x >= S or y >= T or ObjF <= F[x,y] ; subject to Region2: x <= S or y >= T or ObjF <= G[x,y]; subject to Region3: x >= S or y <= T or ObjF <= H[x,y]; subject to Region4: x <= S or y <= T or ObjF <= K[x,y]; Unfortunately the Messages when parsing this are Reading model section from models\RLMF.mod... models\Regions.mod:79: syntax error in constraint statement Context: ...ize Energy : Z ; subject to Region1 : XM >= Thresh_M or 1. Can somebody explain this error? 2. I suspect a logical or is not allowed in constraints. Is that true? 3. If so, could anybody propose an alternative? Thanks, Thomas -- Mit freundlichen Grüßen Thomas Schwabhäuser, Melittastrasse 9, 70597 Stutttgart Tel. + 49 (0) 711 - 76 22 41, Cel. + 49 (0) 171 - 491 50 96 [email protected] http://www.cip.mathematik.uni-stuttgart.de/~schwabts/ _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk