I’m new in Gams and I want to write the following problem.

I have to optimize the revenue of my pumped storage hydro power plant by changing the MPP (maximum purchasing price, which is the maximum price at which I decide to buy electricity from the national grid system, pumping up water from the lower reservoir to the upper one) and the MSP (minimum selling price, which is the minimum price at which I decide to sell electricity to the national grid system, using water in the turbines and letting it move from the upper reservoir to the lower one).

I have the physical constraint related to the fact that I can’t have more water than the maximum available one in my upper reservoir; translating this in energy terms, i.e. stored_energy(h) <= maximum_stored_energy

I can’t able to let the model work properly because I’m making some mistakes for sure, even if the solver runs.

So, if someone wants to help me I appreciate a lot.

I attach the complete mathematical model in a file word and the model itself written in gams in a gams file.

new3.gms (2.23 KB)

Model_buy_sell.docx (14.7 KB)