Model doesn't follow restrictions(equations) that i've set, but somehow it found optimal solution

Dear forum members,

Hello, I’m currently working on a power Bottom-up model using MCP(mixed complementary problem) methods. I properly set every inequality(or equality) restrictions and matched all variables and equations as well.

However, somehow my model doesn’t follow the restrictions that i’ve set before, but model status shows me “optimal”. Whenever I check lst. file, demand equation(it restrict to meet all domestic generation equals to domestic demand) is infeasible, which means generation is captured as 0, and demand is loaded properly as I’ve set. Here, generation is endogenous variable and demand is exogenous.

Also, electricity price, which is also endogenously decided in the model, is 0 as well. It can’t be, because electricity price is dual variable of ‘demand equation’.

I can’t understand why my model automatically find optimal generation and keep showing 0 values.

Hi,

Can you share your model and output files and provide the names of the problematic variables and equations?

Best,

Fred

Unfortunately, new user can’t upload file :confused: But i’ll provide main equation code that i’m using.

EQ_ZPC_GEN(n,tech,tss,lr)$(Flag2(tss) and ns(n) )..

                vc(n,tech,tss)-subsidy(n,tech,tss,lr)\*time(lr)

                -lambda(n,tss,lr) \* (1 - selfg(tech,n))

                + mu_mxr(n,tss,tech,lr) - mu_mnr(n,tss,tech,lr)

                + sigma_out(n,tss,tech,lr)$(str(tech))

* -(phi(n,tss,tech,lr) / st_eff(n,tech,lr)$(str(tech)))

                - (phi(n,tss,tech,lr) / st_eff(n,tech,lr)) $ str(tech)

                + **sum**((c,gas)$(map_c_n(c,n)), pi_emit(c,gas,tss) \* emiRate_n(n,tech,gas,tss)) \* time(lr)

                +(gamma_up(n,tss,tech,lr)-gamma_up(n,tss,tech,lr+1))

                +(gamma_down(n,tss,tech,lr+1)-gamma_down(n,tss,tech,lr))

                =G=  0  ;

EQ_MRC_Demand(n,tss,lr)$(Flag2(tss)

* and demandR(lr,n,tss)

and ns(n))..

                  + **sum**(tech,(GEN(n,tech,tss,lr) )\*(1-selfg(tech,n)))         !  hourly output with discharge  

                  + **sum**(l(n2,n),  FL(l,tss,lr)\*eff_trans)                     !  inflow net of transmission loss

                  - **sum**(l(n,n2),  FL(l,tss,lr))                               !  outflow

                  - **sum**(str,STORE(n,str,tss,lr))

* - CURtailCPM(n,tss,lr) ! + storage +curtail

                  - demandR(lr,n,tss)/(1-TransLoss(n))           ! Total Demand 

                    =E= 0 ;

Main problem is : model doesn’t follow the Demand equation ; always shows LHS = 0 , ****Infes 53.8933 when I check .lst file, demand equation part.

You are looking at the equation listing. This is not the solution. The equation listing is useful for debugging as it expands the generated equations an provides info on the input point. If you do not set variable levels before the solve, it is no surprise (and no problem) that some equations have the INFES marker.

To check the solution in the lst, please look at the solution report.

I hope this helps!

Fred

Thanks, I understand why checking equation listing is kinda unnecessary right now.

Solve summary shows me “SOLVER STATUS 1 Normal Completion” and “MODEL STATUS 1 Optimal”, so I found my model got optimal solution somehow.

However, when I checked result gdx file, which shows final values, I found that all GEN values are 0 and also lambda has 0 values for almost all simulation years. It still doesn’t make sense, cause GEN doesn’t meet demand, and lambda(electricity price) is also zero. How can this happen? I don’t understand that model doesn’t meet demand-supply balance equation but tell me “optimal state”.

Thanks for your help in advance,

Youngin

It is hard to help without being able to reproduce. I changed some forum setting such that you should be able to attach files now. Can you please share everything required to reproduce plus output (lst or gdx with pointers to specicifc varaible/equation levels that you think are incorrect?

Thanks!

MCP_result_2.xlsx (1.9 MB)

I attached excel file, which include main variables and demand parameter value.

You can check pivot table as well.

All data included in the excel file is final optimal value from the model.

You’ll easily find that generation is much less than demand, which is main issue here.

Thanks for your help.

Best regards,

Youngin Gwon

Please share what is required to reproduce.