## Equality constraint not enforced

Problems with modeling
pecenak21
User
Posts: 24
Joined: 3 years ago

### Equality constraint not enforced

Hello, I have a simple equation which states a variable X is exactly equal to another variable Y (e.g X =E= Y). Specifically my equation is as follows:

Code: Select all

``````EQ_TOTAL_COST_CO2_2(nodes)..
dv_total_annual_co2(nodes)
=E=
pdv_total_annual_co2_taxable(nodes);``````
However, it seems this equation is not being enforced, even though it shows up in the .lst file and is being solved.
image (39).png (4.91 KiB) Viewed 311 times
When I look at the solution display statement, they are not equal:
image (40).png (5.44 KiB) Viewed 311 times
I have also tried using matching =L= and =G=, and the solution is the same. (e.g. X=L= Y and X=L= Y). If I perturb the model inputs, the same behavior occurs, even though X and Y take on different magnitudes.

Any ideas here? What else can I provide to help debug? We are using GAMS V35 solved using CPLEX.
Zack

dirkse
Moderator
Posts: 185
Joined: 5 years ago
Location: Fairfax, VA

### Re: Equality constraint not enforced

Zack,

You haven't sent the .log or .lst files from your run, so I can only guess what happened. The output you send is consistent with an infeasible model. If your model is infeasible, the solver will stop short of computing a solution, and this will be evident in the .log and .lst files.

You might ask why the solver can't as least get a simple constraint like x =E= y satisfied and do that first. But there could be additional constraints, just as simple or even more so:

x =G= y + 7
y =G= 2;

or

x =E= 3;
y =E= 8;

So in general, you cannot expect much in the way of "partial feasibility" if the solver determines the model is not feasible.

-Steve

pecenak21
User
Posts: 24
Joined: 3 years ago

### Re: Equality constraint not enforced

Hi Steve,

Thanks for the response, but that is the shocking part - The model isn't infeasible. Attached is the log file. I am not attaching the .lst yet, as it is 70MB and might need to share directly with you.
The model actually solves with zero gap:
Here is the log file. Ignore the first solve, the display is from the second solve (the one shown above).
Main.log
Zack

dirkse
Moderator
Posts: 185
Joined: 5 years ago
Location: Fairfax, VA

### Re: Equality constraint not enforced

Zack,

Yes, the log shows that your models are solved properly.

I suggest you contact GAMS directly via support@gams.com (or with a phone call) to pursue this matter. It's possible we may need a reproducible example that we can run here in order to resolve this issue. If you can provide that easily, that is likely to be the easiest and most direct path towards a resolution. If not, there are other less convenient ways to proceed.

Regards,

-Steve

bussieck
Moderator
Posts: 808
Joined: 5 years ago

### Re: Equality constraint not enforced

Zack,

The relative infeasibiliy of the constraint you show in this thread is 1e-4 and you ask for 1e-6 (in the simplex algorithm). Since Cplex' B&C uses the simplex algorithm (by default) in the nodes, we should get this required accuracy. Nevertheless, the log indicates, that a heuristic found the "optimal" solution (a "+" in the line indicates that) and since you suppress the "solveFinal" Cplex might only have gotten the accuracy for the scaled solution. With well scaled models this should be fine, but if the model is badly scaled (you already know about the dataCheck=2) the unscaling might introduce larger infeasibilities. The solveFinal=1 should address this (or in some cases declare the integer solution as infeasible which is another indication for a badly scaled model).

Can you try running with solveFinal=1 and see how the feasibily (of the constraint in question) changes?

-Michael