Hi
is it possible that AMPL gives the message of finding optimal solution while not satisfying the constraint? I am trying to solve a problem via AMPL in MATLAB. I am seeing that AMPL finds the optimal solution but clearly some of the constraint are not satisfied.
This is one of the constraint that I have :
subject to p_inj {k in BUS , p in Time : bus_type[k] == 2 || bus_type[k] ==3}:
0 <= bus_p_inj[k,p] <= bus_p_gen_max[k] ;
at the end of solving problem I checked some variables and constraint
ampl.display('bus_p_inj;')
ampl.eval('expand p_inj;')
The results that I got are as follows:
bus_p_inj [34,*]
: 1 2 3 4 :=
34 5.08048 5.08 5.08 5.08
subject to p_inj[34,1]:
0 <= bus_p_inj[34,1] <= 5.08;
subject to p_inj[34,2]:
0 <= bus_p_inj[34,2] <= 5.08;
subject to p_inj[34,3]:
0 <= bus_p_inj[34,3] <= 5.08;
subject to p_inj[34,4]:
0 <= bus_p_inj[34,4] <= 5.08;
as you can see constraint p_inj[34,1] is not satisfied. I tried it with two different solver, IPOPT and GUROBI and both of them give me the exact same answer.
I know by provided details it is hard to say what exactly goes on in the system, but I wonder if you have any guess?
I attached the ampl file that I wrote. also I should mention that I run this file over different parameters, for some of them all the constraints are satisfied but for some other constraint p_inj[34,1] is not satisfied.
Thanks,
Mahraz