Hi guys,

First post

I’m new to solvers beyond the embedded one in Excel, now moving towards commerical solvers.

The model below runs in GAMS 24.9 as MIP and deals with the Unit Commitment problem. I however have a problem of the balancing constraints not working properly and GAMS promts me with an infeasible solution.

The problem

Consider scheduling of a power plant where it is to be determined which hours of a 24-h day it is most profitable of running your plant, hence the use of Mixed Integers LP. The power plant produces heat and power as cogeneration (This early model does not take co-gen into consideration, we assume it is the same size) and heat is flowing to your storage tank which has a set of constraints - not running full; not running low. From the storage heat is flowing to the customers as deterministic demand.

I seem to have a working objective function and my status variables are working as well. My lowtes/hightes constraints are however sideways; I can not seem to get the constraints balanced correct so heat is subtracted hourly and heat produced in added hourly. It is also assummed that an hourly level in the storage is the hour before subtracted demand and added production for the next hour.

In advance, thank you

/Jesper

```
Sets
t Scheduling (24hrs)
/ period-0*period-23 /
Parameter
demand(t) heat consumption hourly in MWh per h
/ period-0 1,
period-1 2,
period-2 3,
period-3 4,
period-4 5,
period-5 6,
period-6 7,
period-7 8,
period-8 9,
period-9 10,
period-10 11,
period-11 12,
period-12 13,
period-13 14,
period-14 15,
period-15 16,
period-16 17,
period-17 18,
period-18 19,
period-19 20,
period-20 21,
period-21 22,
period-22 23,
period-23 24 /
spotprice(t) electricity price hourly DKK per MWh
/ period-0 236,
period-1 234,
period-2 236,
period-3 246,
period-4 265,
period-5 322,
period-6 403,
period-7 424,
period-8 429,
period-9 451,
period-10 449,
period-11 418,
period-12 418,
period-13 394,
period-14 382,
period-15 391,
period-16 422,
period-17 464,
period-18 489,
period-19 472,
period-20 404,
period-21 338,
period-22 294,
period-23 252 /
marginalprice(t) running cost of unit hourly DKK per MWh
/ period-0 300,
period-1 300,
period-2 300,
period-3 300,
period-4 300,
period-5 300,
period-6 300,
period-7 300,
period-8 300,
period-9 300,
period-10 300,
period-11 300,
period-12 300,
period-13 300,
period-14 300,
period-15 300,
period-16 300,
period-17 300,
period-18 300,
period-19 300,
period-20 300,
period-21 300,
period-22 300,
period-23 300 /
initlev(t) initial storage level at hour-1
/ period-0 20 /
pel(t) electrical production from unit
/ period-0*period-23 6 /
mintes(t) minimim storage in tes hourly
/ period-0*period-23 2 /
maxtes(t) maximum storage in tes hourly
/ period-0*period-23 20 /
Variables
status(t) binary status variable for on or off running of ngen hourly
teslvl(t) balance level in tes hourly
profit total profit of running ngen
binary variable status
positive variable teslvl(t);
Equations
profitfn profit maximization of running ngen - the objective function
lowtes(t) lower limit on tes level
hightes(t) higher limit on tes level;
profitfn.. profit =e= sum(t, (pel(t) * (spotprice(t) - marginalprice(t)))) ;
lowtes(t).. mintes(t) =g= (teslvl(t-1) + (pel(t) * status(t)) - demand(t) + initlev(t)) ;
hightes(t).. maxtes(t) =l= (teslvl(t-1) + (pel(t) * status(t)) - demand(t) + initlev(t)) ;
model unitproblem1 / all / ;
solve unitproblem1 using MIP maximizing profit;
display status.L, teslvl.L, profit.L;
```