[AMPL 16091] Error message ' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 16091] Error message ' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

fangli3
Hello, 

i have trouble in below constrains and got error 

Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.

The logic is: when loads reach its maximum number which is less than 5000, let charge_demand equals to the cost at that time, while if peak load exceed 5000,  charge_demand obeys another rate structure, which give different number. 

Could anyone help me with this problem? Thanks in advance. 

var charge_demand >=0;

var load2_sum {l in L} >=0;

var load2_max;


subject to maxDemand_2 {l in L}: load2_sum[l]==load2_max && load2_max <= 5000 ==> charge_demand = load2_max/1000 * demand_charge[l,1]; 
subject to maxDemand_3 {l in L}: load2_sum[l]==load2_max && load2_max > 5000 ==> charge_demand = (load2_max-5000)/1000 * demand_charge[l,2];


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16093] Error message ' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

AMPL mailing list
Indicator constraint must be in the following form:

<binary-var> = 0 ==> constraint
<binary-var> = 1 ==> constraint

AMPL might be throwing error because the variables are not binary variable.

--
Paras Tiwari
[hidden email]
{#HS:554890792-4497#}
On Wed, Apr 4, 2018 at 10:34 PM UTC, <[hidden email]> wrote:
Hello,

i have trouble in below constrains and got error

' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

The logic is: when loads reach its maximum number which is less than 5000, let charge_demand equals to the cost at that time, while if peak load exceed 5000, charge_demand obeys another rate structure, which give different number.

Could anyone help me with this problem? Thanks in advance.

var charge_demand >=0;

var load2_sum {l in L} >=0;

var load2_max;


subject to maxDemand_2 {l in L}: load2_sum[l]==load2_max && load2_max <= 5000 ==> charge_demand = load2_max/1000 * demand_charge[l,1];
subject to maxDemand_3 {l in L}: load2_sum[l]==load2_max && load2_max > 5000 ==> charge_demand = (load2_max-5000)/1000 * demand_charge[l,2];


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16125] Error message ' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

fangli3
Thanks Paras. 

Could you give me some ideas on how to implement the constraints in a right way? 


On Wednesday, April 4, 2018 at 4:05:51 PM UTC-7, AMPL Google Group wrote:
Indicator constraint must be in the following form:

<binary-var> = 0 ==> constraint
<binary-var> = 1 ==> constraint

AMPL might be throwing error because the variables are not binary variable.

--
Paras Tiwari
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="942w5KNSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...
{#HS:554890792-4497#}
On Wed, Apr 4, 2018 at 10:34 PM UTC, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="942w5KNSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@...> wrote:
Hello,

i have trouble in below constrains and got error

' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

The logic is: when loads reach its maximum number which is less than 5000, let charge_demand equals to the cost at that time, while if peak load exceed 5000, charge_demand obeys another rate structure, which give different number.

Could anyone help me with this problem? Thanks in advance.

var charge_demand >=0;

var load2_sum {l in L} >=0;

var load2_max;


subject to maxDemand_2 {l in L}: load2_sum[l]==load2_max && load2_max <= 5000 ==> charge_demand = load2_max/1000 * demand_charge[l,1];
subject to maxDemand_3 {l in L}: load2_sum[l]==load2_max && load2_max > 5000 ==> charge_demand = (load2_max-5000)/1000 * demand_charge[l,2];


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="942w5KNSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ampl+uns...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="942w5KNSBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">am...@....
Visit this group at <a href="https://groups.google.com/group/ampl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/ampl&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/ampl&#39;;return true;">https://groups.google.com/group/ampl.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16127] Error message ' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

AMPL mailing list
Below is the way you could implement your constraints:

param L:=2;
var charge_demand >=0;
var load2_sum {l in 1..L} >=0;
var z binary;
var load2_max;

subject to c1: z=0 ==> load2_max<=5000;
subject to c2: z=1 ==> load2_max>=5000;
subject to c3{i in 1..L}: load2_sum[i]<=load2_max;
subject to c4{l in L}: z=0==>1000*charge_demand <= load2_max *demand_charge[l,1] ;
subject to c5{l in L}: z=1==>1000*charge_demand <= (load2_max-5000)*demand_charge[l,2];


You need to change the equality constraints into inequality constraint. I have used <=, alternatively, you could use >=.

Thanks,
Paras

--
Paras Tiwari
[hidden email]
{#HS:554890792-4497#}
On Mon, Apr 9, 2018 at 11:10 PM UTC, Zeyad Kassem' Via Ampl Modeling Language <[hidden email]> wrote:
Thanks Paras.

Could you give me some ideas on how to implement the constraints in a right way?



On Wed, Apr 4, 2018 at 11:05 PM UTC, AMPL Google Group <[hidden email]> wrote:
Indicator constraint must be in the following form:

<binary-var> = 0 ==> constraint
<binary-var> = 1 ==> constraint

AMPL might be throwing error because the variables are not binary variable.

--
Paras Tiwari
[hidden email]


On Wed, Apr 4, 2018 at 10:34 PM UTC, Zeyad Kassem' Via Ampl Modeling Language <[hidden email]> wrote:
Hello,

i have trouble in below constrains and got error

' Gurobi 7.5.0: logical constraint _slogcon[1] is not an indicator constraint.'

The logic is: when loads reach its maximum number which is less than 5000, let charge_demand equals to the cost at that time, while if peak load exceed 5000, charge_demand obeys another rate structure, which give different number.

Could anyone help me with this problem? Thanks in advance.

var charge_demand >=0;

var load2_sum {l in L} >=0;

var load2_max;


subject to maxDemand_2 {l in L}: load2_sum[l]==load2_max && load2_max <= 5000 ==> charge_demand = load2_max/1000 * demand_charge[l,1];
subject to maxDemand_3 {l in L}: load2_sum[l]==load2_max && load2_max > 5000 ==> charge_demand = (load2_max-5000)/1000 * demand_charge[l,2];


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.