SETS
t        /1*6/
;

SCALAR  Cost  /20/;
SCALAR  Pmax  /150/;
SCALAR  Pmin  /50/;
SCALAR  RU  /50/;
SCALAR  RD  /50/;

PARAMETER Price(t)
/1       25
2        17
3        23
4        10
5        26
6        20/;

VARIABLES
Profit
PG(t)
;

EQUATIONS
FO
MaxPower
MinPower
RUlimit
RDlimit
;

FO..             Profit =e= sum(t,(Price(t)-Cost)*PG(t));

MaxPower(t)..    PG(t) =l= Pmax;

MinPower(t)..    PG(t) =g= Pmin;

RUlimit(t)$(ord(t) gt 1)..
                 PG(t) =l= PG(t-1) + RU;

RDlimit(t)$(ord(t) gt 1)..
                 PG(t) =g= PG(t-1) - RD;

MODEL SelfSche /all/;

SOLVE SelfSche maximizing Profit using lp;
