How to solve an inconsistent constraints? (infeasible solution)

Problems with modeling
Post Reply
Zainab
User
User
Posts: 2
Joined: 2 years ago

How to solve an inconsistent constraints? (infeasible solution)

Post by Zainab »

Dears,
Got an infeasible solution for both constraint
Co_1(i).. sum((j,P1),x(i,j,P1)) =e= q(i);
Co_2(i,p,P1).. q(i)*Fra1(i,p)*t(i)+q(i)*Fra2(i,p)*1-t(i) =e= sum(j,x(i,j,P1));


parameter q(i) capacity of i /
1 350
2 600
/;


On the left side, it is written:
constraints 'Co_1(1)' and 'Co_2(1,P1,1)' are inconsistent.

How to solve this problem?

Regards,
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: How to solve an inconsistent constraints? (infeasible solution)

Post by abhosekar »

A good way is to check equation listing in the .lst file. If you don't see all the equations, you can use option limrow and set it to a large number.

option limrow=1000;

The error message says that there is no way both constraints can be true when i=1, p=P1 and P1=1

Hope this helps.

- Atharv
Zainab
User
User
Posts: 2
Joined: 2 years ago

Re: How to solve an inconsistent constraints? (infeasible solution)

Post by Zainab »

Thanks for your replied.

However, still getting infeasible solution. This might be a mistake once entering the codes. Please, if it is possible, can you see the model generally?
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: How to solve an inconsistent constraints? (infeasible solution)

Post by abhosekar »

I see that you are multiplying by 1-t(i) without parenthesis. In CO_2, do you intend to have (1-t(i)) instead as follows?

q(i)*Fra2(i,p)*(1-t(i))

I think this is a typo on your end.

If you need help, you need to provide as much information as you can (preferrably entire code). When typing code, please use code block so that the other users can easily copy.
Besides, did you follow my suggestion? Is the equation in the .lst file same as you want to have?
For me to even think of your constraints, you need to provide the sets (what is P1, what is i and p etc.)

Hope this helps.

- Atharv
Post Reply