I ran some experiments using COUENNE solver for my NLP minimization problem. After that I linearized all non-linear parts, and solved the same problem with same objective function using CPLEX solver to improve CPU time.
Unfortunately, I am getting different objective value (almost double than COUENNE). Seems like my linearization is correct. What could be the possible reasons for different objective value?
Thanks in advance
Hi Bob,
Thanks for your reply. I am doing some scenario analysis and set 15 minutes as time limit for optimization.
For Couenne - I am getting optimal solutions for 27 customers out of 165.
For CPLEX - I am getting optimal solutions for all 165 customers with very low time (average solve time is less than 1 second for each customer), but objective values are increasing.
Since Couenne is not giving optimal solutions for all customers, Can I compare with CPLEX in this case? I am attaching the screenshots so that you can take a look. If you have any suggestions to overcome this problem, please let me know. I checked my linearization. I think it is correct. However, I will recheck it again.
I really appreciate your helps and suggestions.
Hi Bob,
Thanks for your reply. I think I figured out my error. My Y1bar is a variable in stage 1 and that is parameter in stage 2. I treated Y1bar in stage 2 as a variable again and then linearized. That’s why I got high objective values in CPLEX.
var Y1bar{1..nsample} >=0, <=50;
….
subject to LQ_11{j in 1..nsample}: Y1bar[j] >= -50*IY1[j];
subject to LQ_12{j in 1..nsample}: Y1bar[j] <= 50*IY1[j];
subject to LQ_13{j in 1..nsample}: Y1bar[j] >= Y1[j] -((1-IY1[j])*50);
subject to LQ_14{j in 1..nsample}: Y1bar[j] <= Y1[j] - (-50*(1- IY1[j]));
where Y1[j] is results from stage 1 and IY1[j] is binary variable.
subject to secondstage {i in 1..nsample, j in 1..nsample}:
-Y2[i,j] + 3.613077 * Y1bar[j] - 0.07653371* x2[8,j]* Y1bar[j] - 1.22007* x2[7,j]* Y1bar[j] - 0.3248128* x2[10,j]* Y1bar[j] - 0.6995695* x2[2,j] * Y1bar[j] + err2[i] = -16.12741;
Here- x2[8,j] , x2[7,j], x2[10,j], and x2[2,j] are decision variables in stage 2 and already defined before.
Could you please tell me how to use Y1bar[j] (that I got from LQ_11 to LQ_14 constraints) in secondstage constraint as parameter?
Again thank you so much for all of your helps.
Hi Bob,
I got a problem which is very similar (transferring r1 value from constraint 1 to other constraint (where decision variable is r2) as fixed value). Both r1 and r2 are in my objective function.
You said to solve two times and also used fix command. I created my .run file like following--
model mymodel.mod;
data mymodel.dat;
let nthpath :=1;
for {1..15} {
solve;
fix r1;
solve;
let nthpath := nthpath + 1;
}
The code is not running. I think my .run is not right. Please help me how to use two solve in .run file.
Thanks in advance.
Puja
--
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 ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Hi Victor,
Error is attached. “Constraint _scon[1] is not convex quadratic since it is an equality constraint.” - I know this error is happening because of non-linear term. That means, my fix command is not right. All I want is to transfer my r1 variable value as parameter into my other constraint (where r2 is variable). My objective function contains both r1 and r2. In my myresult.out file I should get 15 paths objective value. But I am getting only first objective value. Please help me to figure this. I am stuck with my .run file.
.run file:
reset;
model mymodel.mod;
data mymodel.dat;
option solver cplexamp;
option cplex_options 'timelimit=480';
option nl_comments 1;
let nthpath := 1;
for {1..15}{
solve;
let nthpath := nthpath + 1;
}
fix{j in 1..sample} r1[j];
let nthpath := 1;
for {1..15} {
solve;
display nthpath > myresult.out;
display obj > myresult.out;
let nthpath := nthpath + 1;
}
Thanks in advance.