help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [Fwd: How can regions be modeled in which different obje


From: Andrew Makhorin
Subject: Re: [Help-glpk] [Fwd: How can regions be modeled in which different objective functions apply?]
Date: Wed, 04 Oct 2017 14:59:13 +0300

> From: Thomas Schwabhäuser <address@hidden>
> To: address@hidden
> Subject: How can regions be modeled in which different objective
> functions apply?
> Date: Thu, 28 Sep 2017 11:02:48 +0200
> 
> 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?

Yes, because your constraints are non-linear while glpk allows only
linear constraints and objective.

>      3. If so, could anybody propose an alternative?
> 
>  

A common technique to model non-linearities is to use binary variables.
However, if the objective is piecewise linear and convex (in case of
minimization) or concave (in case of maximization), sometimes it can be
modeled without binary variables. 

See also https://en.wikibooks.org/wiki/GLPK/Modeling_tips .





reply via email to

[Prev in Thread] Current Thread [Next in Thread]