Hi, Im currently learing GAMS for a Project, I started off with a strong simplification of the Model wich I managed to implement,
however all they solvers Ive tried so far either produce no solution at all or completely weird ones (Binary values of 0.182 …).
The Idea of the Model is to try to keep the water temperature of a pool above a certain treshold during a timeset with fluctuating energy price. A Binary Variable h(t) Signals wheter the heater is on at the certain time. The Goal is to compute the minimum price to keep your water “warm” and to know when to turn the heater on/off from this solution. The Water temperature is modeled in the equation temperature(t) wich computes the temp(t+1) (of the next timestep) out of the current temp(t) and h(t).
So far Im not sure whether I’ve described my Model wrong (syntax) or If I’ve simply tried out all the wrong solvers so far. I hope you know of a solution. Code below.
Thanks in Advance!
Code:
Sets
t time /0,1,2,3,4,5,6,7,8,9/;
*Energy price
Parameters
price(t) Energy Price
/0 8
1 8
2 1
3 8
4 8
5 8
6 8
7 8
8 8
9 8/;
Variables
k cost,
temp(t) Water temperature;
Binary Variable h(t);
*Heater on/off
Equations
cost Cost function,
temperature(t) watertemperature function,
mint(t) minimum temperature;
cost .. k =e= sum(t,price(t)*h(t));
temperature(t) .. temp(t)+ 10*h(t)- 1 * (1-h(t)) =e= temp(t+1) ;
mint(t).. temp(t) =g= 26;
Model test /all/;
temp.fx('0') = 30;
Solve test using rmip minimizing k;