representation for these constraints.
Thanks heaps!
Tommy
--
View this message in context: http://old.nabble.com/error-msg%3A-Constraint-_scon-1--is-not-convex-quadratic-since-it-is-an-equality-constraint.-tp32736044p32736044.html
Sent from the AMPL mailing list archive at Nabble.com.
Moreover an if-expression that has a formula involving variables following
the "if" is not a linear expression, and CPLEX is unable to handle nonlinear
= constraints. In fact the only nonlinear constraints that CPLEX can handle
are convex quadratic inequality constraints -- hence the seemingly strange
error message.
To express this sort of constraint in CPLEX, you have to introduce binary
(zero-one integer) variables. In particular if you can define a binary
variable U[p,q] to be constrained such that (Payload[p,q]=0) &&
(Payload[p,q+1]!=0) implies U[p,q] = 1, then you can introduce a constraint
subject to C3{p in V,q in 1..n-1}:
U[p,q] = 1 ==> Reversestop[p] = q+1;
where "==>" is the AMPL logical operator for "implies". Just how and
whether you can define and constrain U[p,q] in the desired way, depends on
how Payload is defined earlier in the model.
Bob Fourer
4...@ampl.com
subject to C3{p in V,q in 1..n-1}:
Payload[p,q]*M + Payload[p,q+1] <= Payload[p,q+1]*D[p,q];
subject to C4{p in V,q in 1..n-1}:
D[p,q] = 1 ==> Reversestop[p] = q+1;
subject to C5{p in V,q in 1..n-1}:
Payload[p,q+1]*M + Payload[p,q]<= Payload[p,q]*E[p,q];
subject to C6{p in V,q in 1..n-1}:
E[p,q] = 1 ==> Reversestart[p] = q+1;
There is no AMPL 5189 error msg anymore when I run it.
However, I still can not solve this problem with cplex solver. I got
following error msg when I run it.
ampl: solve;
CPLEX 12.3.0.0: IBM ILOG CPLEX Optimization Studio Preview Edition good for
85 more days.
The CPLEX Optimizers will solve problems up to 500 variables and 500
constraints.
QP Hessian is not positive semi-definite.
0 MIP simplex iterations
0 branch-and-bound nodes
No basis.
my whole script is as below, please help me figure out the reason, Is it
caused by logical constraints statements?
set U; #Unit scalar set
set V; #Unit scalar set
param P{U}; #original terrain profile
param Q{U}; #target terrain profile
param n>0; #num of pile divisions
param m>0; #maximum passes
param BS>0; #blade size
param DW>0; #dozer weight
param T{V}; #Passes penalizing factors
param M; #big M method param1
var Payload{p in V,q in U}; #blade payload matrix during movement
var Movements{p in V,q in U}; #dirt movements matrix during movement
var Reversestop{p in V} integer; #reverse path start scalar
var Reversestart{p in V} integer; #reverse path stop scalar
var D{p in V,q in U} binary;
var E{p in V,q in U} binary;
minimize Total_Cost:
sum {p in 1..m-1, q in U}
(T[p]*((DW+Payload[p,q])+DW*(Reversestart[p]-Reversestop[p+1])));
subject to C1{p in V,q in U}: 0<= Payload[p,q] <=BS;
subject to C2 {p in V,q in U}:
Payload[p,q] = sum{k in 1..q} Movements[p,k];
subject to C3{p in V,q in 1..n-1}:
Payload[p,q]*M + Payload[p,q+1] <= Payload[p,q+1]*D[p,q];
subject to C4{p in V,q in 1..n-1}:
D[p,q] = 1 ==> Reversestop[p] = q+1;
subject to C5{p in V,q in 1..n-1}:
Payload[p,q+1]*M + Payload[p,q]<= Payload[p,q]*E[p,q];
subject to C6{p in V,q in 1..n-1}:
E[p,q] = 1 ==> Reversestart[p] = q+1;
subject to C7{p in V}: sum{q in U} Movements[p,q]==0;
subject to C8{q in U}: sum{p in V} Movements[p,q]==P[q]-Q[q];
Thanks!
Tommy
> --
> You received this message because you are subscribed to the Google Groups
> "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to
> ampl+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ampl?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/error-msg%3A-Constraint-_scon-1--is-not-convex-quadratic-since-it-is-an-equality-constraint.-tp32736044p32756497.html
Thank you for your guidance! would you help check if my binary variables
expression sound?
prototype:
for p=1:m
for q=1:n
{ if Payload[p,q]=0 && Payload[p,q+1]>0, then Reversestop=q+1
if Payload[p,q]>0 && Payload[p,q+1]=0, then Reversestart=q+1
}
end
end
In AMPL:
var D{p in V,q in U} binary; #binary variables
var E{p in V,q in U} binary; #binary varaibles
subject to C3{p in V,q in 1..n-1}:
Payload[p,q]*M + (1-D[p,q])*BS + 0.01 <= Payload[p,q+1];
subject to C4{p in V,q in 1..n-1}:
D[p,q] = 1 ==> Reversestop[p] = q+1;
subject to C5{p in V,q in 1..n-1}:
Payload[p,q+1]*M + (1-E[p,q])*BS + 0.01 <= Payload[p,q];
subject to C6{p in V,q in 1..n-1}:
E[p,q] = 1 ==> Reversestart[p] = q+1;
unfortunately, when I run with it, AMPL with CPLEX comes out with below msg:
CPLEX 12.3.0.0: iisfind 1
Refine conflict on 212 members...
Iteration Max Members Min Members
1 159 0
2 133 0
3 120 0
4 113 0
5 110 0
6 83 0
7 43 0
8 23 0
9 13 0
10 11 0
11 10 0
12 4 0
13 4 1
14 4 2
15 4 3
16 4 4
IBM ILOG CPLEX Optimization Studio Preview Edition good for 84 more days.
The CPLEX Optimizers will solve problems up to 500 variables and 500
constraints.
CPLEX 12.3.0.0: integer infeasible.
0 MIP simplex iterations
0 branch-and-bound nodes
Returning an IIS of 2 variables and 2 constraints.
No basis.
suffix iis symbolic OUT;
Thank you!
Tommy
> --
> You received this message because you are subscribed to the Google Groups
> "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to
> ampl+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ampl?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/error-msg%3A-Constraint-_scon-1--is-not-convex-quadratic-since-it-is-an-equality-constraint.-tp32736044p32763105.html
Bob Fourer
4...@ampl.com
> -----Original Message-----
> From: am...@googlegroups.com [mailto:am...@googlegroups.com]
> On Behalf Of TommyChen
> Sent: Tuesday, November 01, 2011 9:18 PM
> To: am...@googlegroups.com
> Subject: RE: [AMPL 5193] error msg: Constraint _scon[1] is not convex
> quadratic since it is an equality constraint.
>
> --
> You received this message because you are subscribed to the Google Groups
> "AMPL Modeling Language" group.
> To post to this group, send email to am...@googlegroups.com.
> To unsubscribe from this group, send email to
> ampl+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ampl?hl=en.
>
>
>
--
View this message in context: http://old.nabble.com/error-msg%3A-Constraint-_scon-1--is-not-convex-quadratic-since-it-is-an-equality-constraint.-tp32736044p32800973.html