[AMPL 2069] infeasible problem

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

[AMPL 2069] infeasible problem

Ali Baharev

With the feas.mod Minos concludes that the problem is feasible, the
solution vector is also given.
I add variable bounds which is (at least should be) consistent with
the solution vector but Minos states the problem is now infeasible.

Is it my fault? How can i identify what went wrong?

Any help is greatly appreciated.

-----------------------------------------------------------------------------------------
feas.mod

var x1 >= 1e-006, <= 0.999998;
var x2 >= 1e-006, <= 0.05;
var x3 >= 1e-006, <= 0.999998;
var y1 >= 1e-006, <= 0.527515;
var y2 >= 0.00800423, <= 0.114479;
var y3 >= 0.402686, <= 0.991995;
var lambda >= 0.01, <= 0.5;

#==============================================================================

#var sum_Gx1 >= 0.439223, <= 0.999999;
#var sum_Gx2 >= 0.18521, <= 1.20175;
#var sum_Gx3 >= 0.982453, <= 1.02168;
#var sum_tauGx1 >= 1.78242e-006, <= 1.23346;
#var sum_tauGx2 >= -0.736177, <= 0.650648;
#var sum_tauGx3 >= -0.0730391, <= 0.029223;
#var dx1 >= 1, <= 2.27675;
#var dx2 >= 0.832122, <= 5.39927;
#var dx3 >= 0.978782, <= 1.01786;
#var rx1 >= 1e-006, <= 2.27674;
#var rx2 >= 8.32122e-007, <= 0.269963;
#var rx3 >= 9.78782e-007, <= 1.01786;
#var sx1 >= 1.78242e-006, <= 2.80827;
#var sx2 >= -3.97482, <= 3.51302;
#var sx3 >= -0.0743436, <= 0.0297449;
#var px1 >= 1.78242e-012, <= 6.39371;
#var px2 >= -1.07306, <= 0.948388;
#var px3 >= -0.0756712, <= 0.0302761;
#var ln_gx1 >= -7.83745, <= 4.17512;
#var ln_gx2 >= -10.1001, <= 6.54572;
#var ln_gx3 >= -3.08853, <= 3.2223;
#var sum_Gy1 >= 0.442163, <= 0.760684;
#var sum_Gy2 >= 0.191731, <= 0.77832;
#var sum_Gy3 >= 0.959825, <= 1.00863;
#var sum_tauGy1 >= 0.489688, <= 1.26108;
#var sum_tauGy2 >= -0.126338, <= 0.645441;
#var sum_tauGy3 >= -0.0338515, <= 0.0669083;
#var dy1 >= 1.31461, <= 2.26161;
#var dy2 >= 1.28482, <= 5.21564;
#var dy3 >= 0.991447, <= 1.04186;
#var ry1 >= 1.31461e-006, <= 1.19303;
#var ry2 >= 0.010284, <= 0.597079;
#var ry3 >= 0.399242, <= 1.03352;
#var sy1 >= 0.643747, <= 2.85206;
#var sy2 >= -0.658932, <= 3.36638;
#var sy3 >= -0.0352684, <= 0.0697089;
#var py1 >= 8.46274e-007, <= 3.4026;
#var py2 >= -0.393434, <= 2.01;
#var py3 >= -0.0364504, <= 0.0720452;
#var ln_gy1 >= -5.76301, <= 3.32538;
#var ln_gy2 >= -5.22691, <= 5.07692;
#var ln_gy3 >= -1.96739, <= 2.0046;

#==============================================================================

var sum_Gx1;
var sum_Gx2;
var sum_Gx3;

var sum_tauGx1;
var sum_tauGx2;
var sum_tauGx3;

var dx1;
var dx2;
var dx3;

var rx1;
var rx2;
var rx3;

var sx1;
var sx2;
var sx3;

var px1;
var px2;
var px3;

var sum_Gy1;
var sum_Gy2;
var sum_Gy3;

var sum_tauGy1;
var sum_tauGy2;
var sum_tauGy3;

var dy1;
var dy2;
var dy3;

var ry1;
var ry2;
var ry3;

var sy1;
var sy2;
var sy3;

var py1;
var py2;
var py3;

var ln_gx1;
var ln_gx2;
var ln_gx3;

var ln_gy1;
var ln_gy2;
var ln_gy3;

#==============================================================================

param z1 = 0.148;
param z2 = 0.052;
param z3 = 0.800;

param alpha12 = 0.30;
param alpha13 = 0.30;
param alpha23 = 0.48;

param tau12 = -0.61259;
param tau13 = -0.07149;
param tau21 =  0.71640;
param tau23 =  0.90047;
param tau31 =  2.74250;
param tau32 =  3.51307;

param G12 = exp(-alpha12*tau12);
param G13 = exp(-alpha13*tau13);
param G21 = exp(-alpha12*tau21);
param G23 = exp(-alpha23*tau23);
param G31 = exp(-alpha13*tau31);
param G32 = exp(-alpha23*tau32);

subject to

C01: x1 + x2 + x3 = 1;

C02: sum_Gx1 =     x1 + G21*x2 + G31*x3;
C03: sum_Gx2 = G12*x1 +     x2 + G32*x3;
C04: sum_Gx3 = G13*x1 + G23*x2 +     x3;

C05: sum_tauGx1 = tau21*G21*x2 + tau31*G31*x3;
C06: sum_tauGx2 = tau12*G12*x1 + tau32*G32*x3;
C07: sum_tauGx3 = tau13*G13*x1 + tau23*G23*x2;

C08: dx1 = 1/sum_Gx1;
C09: dx2 = 1/sum_Gx2;
C10: dx3 = 1/sum_Gx3;

C11: rx1 = x1*dx1;
C12: rx2 = x2*dx2;
C13: rx3 = x3*dx3;

C14: sx1 = sum_tauGx1*dx1;
C15: sx2 = sum_tauGx2*dx2;
C16: sx3 = sum_tauGx3*dx3;

C17: px1 = rx1*sx1;
C18: px2 = rx2*sx2;
C19: px3 = rx3*sx3;

C20: ln_gx1 = -    px1 - G12*px2 - G13*px3                 +
G12*tau12*rx2 + G13*tau13*rx3 + sx1;
C21: ln_gx2 = -G21*px1 -     px2 - G23*px3 +
G21*tau21*rx1                 + G23*tau23*rx3 + sx2;
C22: ln_gx3 = -G31*px1 - G32*px2 -     px3 + G31*tau31*rx1 +
G32*tau32*rx2                 + sx3;

C23: y1 + y2 + y3 = 1;

C24: sum_Gy1 =     y1 + G21*y2 + G31*y3;
C25: sum_Gy2 = G12*y1 +     y2 + G32*y3;
C26: sum_Gy3 = G13*y1 + G23*y2 +     y3;

C27: sum_tauGy1 = tau21*G21*y2 + tau31*G31*y3;
C28: sum_tauGy2 = tau12*G12*y1 + tau32*G32*y3;
C29: sum_tauGy3 = tau13*G13*y1 + tau23*G23*y2;

C30: dy1 = 1/sum_Gy1;
C31: dy2 = 1/sum_Gy2;
C32: dy3 = 1/sum_Gy3;

C33: ry1 = y1*dy1;
C34: ry2 = y2*dy2;
C35: ry3 = y3*dy3;

C36: sy1 = sum_tauGy1*dy1;
C37: sy2 = sum_tauGy2*dy2;
C38: sy3 = sum_tauGy3*dy3;

C39: py1 = ry1*sy1;
C40: py2 = ry2*sy2;
C41: py3 = ry3*sy3;

C42: ln_gy1 = -    py1 - G12*py2 - G13*py3                 +
G12*tau12*ry2 + G13*tau13*ry3 + sy1;
C43: ln_gy2 = -G21*py1 -     py2 - G23*py3 +
G21*tau21*ry1                 + G23*tau23*ry3 + sy2;
C44: ln_gy3 = -G31*py1 - G32*py2 -     py3 + G31*tau31*ry1 +
G32*tau32*ry2                 + sy3;

C45: ln_gx1 + log(x1) = ln_gy1 + log(y1);
C46: ln_gx2 + log(x2) = ln_gy2 + log(y2);
C47: ln_gx3 + log(x3) = ln_gy3 + log(y3);

C48: lambda*x1 + (1-lambda)*y1 = z1;
C49: lambda*x2 + (1-lambda)*y2 = z2;
#    lambda*x3 + (1-lambda)*y3 = z3;

data;

var x1 := 0.11673;
var x2 := 0.03707;
var x3 := 0.84620;
var y1 := 0.15447;
var y2 := 0.05509;
var y3 := 0.79044;
var lambda := 0.17150;

-----------------------------------------------------------------------------------------------------------
solution vector:
x1 = 0.116727
x2 = 0.0370726
x3 = 0.8462
y1 = 0.154474
y2 = 0.0550901
y3 = 0.790436
lambda = 0.171504
sum_Gx1 = 0.5183
sum_Gx2 = 0.334073
sum_Gx3 = 0.98952
sum_tauGx1 = 1.04073
sum_tauGx2 = 0.464648
sum_tauGx3 = 0.0131418
dx1 = 1.92938
dx2 = 2.99336
dx3 = 1.01059
rx1 = 0.225212
rx2 = 0.110972
rx3 = 0.855162
sx1 = 2.00796
sx2 = 1.39086
sx3 = 0.013281
px1 = 0.452217
px2 = 0.154346
px3 = 0.0113574
ln_gx1 = 1.2145
ln_gx2 = 1.49433
ln_gx3 = 0.1182
sum_Gy1 = 0.546087
sum_Gy2 = 0.387124
sum_Gy3 = 0.984016
sum_tauGy1 = 0.983967
sum_tauGy2 = 0.400577
sum_tauGy3 = 0.0209153
dy1 = 1.83121
dy2 = 2.58315
dy3 = 1.01624
ry1 = 0.282874
ry2 = 0.142306
ry3 = 0.803276
sy1 = 1.80185
sy2 = 1.03475
sy3 = 0.0212551
py1 = 0.509697
py2 = 0.147251
py3 = 0.0170737
ln_gy1 = 0.934318
ln_gy2 = 1.09824
ln_gy3 = 0.186371
----------------------------------------------------------------------------------------------------
infeas.mod (should be same as feas.mod except the variable bounds)

var x1 >= 1e-006, <= 0.999998;
var x2 >= 1e-006, <= 0.05;
var x3 >= 1e-006, <= 0.999998;
var y1 >= 1e-006, <= 0.527515;
var y2 >= 0.00800423, <= 0.114479;
var y3 >= 0.402686, <= 0.991995;
var lambda >= 0.01, <= 0.5;

#==============================================================================

var sum_Gx1 >= 0.439223, <= 0.999999;
var sum_Gx2 >= 0.18521, <= 1.20175;
var sum_Gx3 >= 0.982453, <= 1.02168;
var sum_tauGx1 >= 1.78242e-006, <= 1.23346;
var sum_tauGx2 >= -0.736177, <= 0.650648;
var sum_tauGx3 >= -0.0730391, <= 0.029223;
var dx1 >= 1, <= 2.27675;
var dx2 >= 0.832122, <= 5.39927;
var dx3 >= 0.978782, <= 1.01786;
var rx1 >= 1e-006, <= 2.27674;
var rx2 >= 8.32122e-007, <= 0.269963;
var rx3 >= 9.78782e-007, <= 1.01786;
var sx1 >= 1.78242e-006, <= 2.80827;
var sx2 >= -3.97482, <= 3.51302;
var sx3 >= -0.0743436, <= 0.0297449;
var px1 >= 1.78242e-012, <= 6.39371;
var px2 >= -1.07306, <= 0.948388;
var px3 >= -0.0756712, <= 0.0302761;
var ln_gx1 >= -7.83745, <= 4.17512;
var ln_gx2 >= -10.1001, <= 6.54572;
var ln_gx3 >= -3.08853, <= 3.2223;
var sum_Gy1 >= 0.442163, <= 0.760684;
var sum_Gy2 >= 0.191731, <= 0.77832;
var sum_Gy3 >= 0.959825, <= 1.00863;
var sum_tauGy1 >= 0.489688, <= 1.26108;
var sum_tauGy2 >= -0.126338, <= 0.645441;
var sum_tauGy3 >= -0.0338515, <= 0.0669083;
var dy1 >= 1.31461, <= 2.26161;
var dy2 >= 1.28482, <= 5.21564;
var dy3 >= 0.991447, <= 1.04186;
var ry1 >= 1.31461e-006, <= 1.19303;
var ry2 >= 0.010284, <= 0.597079;
var ry3 >= 0.399242, <= 1.03352;
var sy1 >= 0.643747, <= 2.85206;
var sy2 >= -0.658932, <= 3.36638;
var sy3 >= -0.0352684, <= 0.0697089;
var py1 >= 8.46274e-007, <= 3.4026;
var py2 >= -0.393434, <= 2.01;
var py3 >= -0.0364504, <= 0.0720452;
var ln_gy1 >= -5.76301, <= 3.32538;
var ln_gy2 >= -5.22691, <= 5.07692;
var ln_gy3 >= -1.96739, <= 2.0046;

#==============================================================================

#var sum_Gx1;
#var sum_Gx2;
#var sum_Gx3;

#var sum_tauGx1;
#var sum_tauGx2;
#var sum_tauGx3;

#var dx1;
#var dx2;
#var dx3;

#var rx1;
#var rx2;
#var rx3;

#var sx1;
#var sx2;
#var sx3;

#var px1;
#var px2;
#var px3;

#var sum_Gy1;
#var sum_Gy2;
#var sum_Gy3;

#var sum_tauGy1;
#var sum_tauGy2;
#var sum_tauGy3;

#var dy1;
#var dy2;
#var dy3;

#var ry1;
#var ry2;
#var ry3;

#var sy1;
#var sy2;
#var sy3;

#var py1;
#var py2;
#var py3;

#var ln_gx1;
#var ln_gx2;
#var ln_gx3;

#var ln_gy1;
#var ln_gy2;
#var ln_gy3;

#==============================================================================

param z1 = 0.148;
param z2 = 0.052;
param z3 = 0.800;

param alpha12 = 0.30;
param alpha13 = 0.30;
param alpha23 = 0.48;

param tau12 = -0.61259;
param tau13 = -0.07149;
param tau21 =  0.71640;
param tau23 =  0.90047;
param tau31 =  2.74250;
param tau32 =  3.51307;

param G12 = exp(-alpha12*tau12);
param G13 = exp(-alpha13*tau13);
param G21 = exp(-alpha12*tau21);
param G23 = exp(-alpha23*tau23);
param G31 = exp(-alpha13*tau31);
param G32 = exp(-alpha23*tau32);

subject to

C01: x1 + x2 + x3 = 1;

C02: sum_Gx1 =     x1 + G21*x2 + G31*x3;
C03: sum_Gx2 = G12*x1 +     x2 + G32*x3;
C04: sum_Gx3 = G13*x1 + G23*x2 +     x3;

C05: sum_tauGx1 = tau21*G21*x2 + tau31*G31*x3;
C06: sum_tauGx2 = tau12*G12*x1 + tau32*G32*x3;
C07: sum_tauGx3 = tau13*G13*x1 + tau23*G23*x2;

C08: dx1 = 1/sum_Gx1;
C09: dx2 = 1/sum_Gx2;
C10: dx3 = 1/sum_Gx3;

C11: rx1 = x1*dx1;
C12: rx2 = x2*dx2;
C13: rx3 = x3*dx3;

C14: sx1 = sum_tauGx1*dx1;
C15: sx2 = sum_tauGx2*dx2;
C16: sx3 = sum_tauGx3*dx3;

C17: px1 = rx1*sx1;
C18: px2 = rx2*sx2;
C19: px3 = rx3*sx3;

C20: ln_gx1 = -    px1 - G12*px2 - G13*px3                 +
G12*tau12*rx2 + G13*tau13*rx3 + sx1;
C21: ln_gx2 = -G21*px1 -     px2 - G23*px3 +
G21*tau21*rx1                 + G23*tau23*rx3 + sx2;
C22: ln_gx3 = -G31*px1 - G32*px2 -     px3 + G31*tau31*rx1 +
G32*tau32*rx2                 + sx3;

C23: y1 + y2 + y3 = 1;

C24: sum_Gy1 =     y1 + G21*y2 + G31*y3;
C25: sum_Gy2 = G12*y1 +     y2 + G32*y3;
C26: sum_Gy3 = G13*y1 + G23*y2 +     y3;

C27: sum_tauGy1 = tau21*G21*y2 + tau31*G31*y3;
C28: sum_tauGy2 = tau12*G12*y1 + tau32*G32*y3;
C29: sum_tauGy3 = tau13*G13*y1 + tau23*G23*y2;

C30: dy1 = 1/sum_Gy1;
C31: dy2 = 1/sum_Gy2;
C32: dy3 = 1/sum_Gy3;

C33: ry1 = y1*dy1;
C34: ry2 = y2*dy2;
C35: ry3 = y3*dy3;

C36: sy1 = sum_tauGy1*dy1;
C37: sy2 = sum_tauGy2*dy2;
C38: sy3 = sum_tauGy3*dy3;

C39: py1 = ry1*sy1;
C40: py2 = ry2*sy2;
C41: py3 = ry3*sy3;

C42: ln_gy1 = -    py1 - G12*py2 - G13*py3                 +
G12*tau12*ry2 + G13*tau13*ry3 + sy1;
C43: ln_gy2 = -G21*py1 -     py2 - G23*py3 +
G21*tau21*ry1                 + G23*tau23*ry3 + sy2;
C44: ln_gy3 = -G31*py1 - G32*py2 -     py3 + G31*tau31*ry1 +
G32*tau32*ry2                 + sy3;

C45: ln_gx1 + log(x1) = ln_gy1 + log(y1);
C46: ln_gx2 + log(x2) = ln_gy2 + log(y2);
C47: ln_gx3 + log(x3) = ln_gy3 + log(y3);

C48: lambda*x1 + (1-lambda)*y1 = z1;
C49: lambda*x2 + (1-lambda)*y2 = z2;
#    lambda*x3 + (1-lambda)*y3 = z3;

data;

var x1 := 0.11673;
var x2 := 0.03707;
var x3 := 0.84620;
var y1 := 0.15447;
var y2 := 0.05509;
var y3 := 0.79044;
var lambda := 0.17150;

------------------------------------------------------------------------------------------------------
EOF

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2072] Re: infeasible problem

Michael Saunders-3

Ali,

With all the products and quotients and equality constraints,
your model is highly nonlinear and nonconvex, so much depends
on the starting point.

If you were able to provide the solution of feas.mod
as starting point to infeas.mod, Minos should quickly
give you the same optimal solution.

If you start infeas.mod with a more arbitrary starting point,
the first linearization of the nonlinear constraints could
be infeasible because of the tighter bounds you've added.
Minos doesn't have robust way of recovering from this.
Other solvers are not very happy either (but some do have a
methodical approach -- for example, Snopt switches to elastic
mode, which means the slacks on the nonlinear constraints
are now allowed to be infeasible, and a modified objective
pushes them back toward feasibility).

Note that Minos has default Feasibility tol = 1e-6.
Hence 1e-6 is not a good value for a lower bound on some
variably x if you're trying to keep x >= 0 in order to
avoid a singularity at x = 0.  In both models, some of your
lower bounds are 1e-6.  In infeas.mod, some of them are
even smaller (1e-7, 1e-12).

Michael


On Sat, 8 Nov 2008, Ali wrote:

>
> With the feas.mod Minos concludes that the problem is feasible, the
> solution vector is also given.
> I add variable bounds which is (at least should be) consistent with
> the solution vector but Minos states the problem is now infeasible.
>
> Is it my fault? How can i identify what went wrong?
>
> Any help is greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2100] Re: infeasible problem

Ali Baharev

Originally, I also tried the same problem with Ipopt but that returned
incorrect results, e.g.

ampl: display x1, x2, x3, lambda;
x1 = 0.143564
x2 = 0.049858
x3 = 0.806578
lambda = 0.0100001
Overall NLP error:  7.0e-9

The true solution is:

x1 = 0.116727
x2 = 0.0370726
x3 = 0.8462
lambda = 0.171504

I just multiplied all the constraints by 1.0e3 and now Ipopt runs perfectly :)

It was a scaling issue in case of Ipopt (as suspected).

Ali

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---