Dear All,

I hope you are doing well. I have some problem related to the model of 2 scheme electricity prices. to simplify, consider the system consists of load, PV, generator and connect to utility grid. The price of electricity is cheap if consume less than 4 and more expensive, otherwise.

Here is my code. After I run, it say a suffix is missing.

Your help would be greatly appreciated. I am looking forward to hearing from you.

set t /1*3/

parameters P_pv(t)/

1 3

2 4

3 2/;

parameters P_gen(t)/

1 3

2 3

3 3/;

parameters P_load(t)/

1 10

2 10

3 10/;

- electricity price

parameters C_grid1(t)/

1 1

2 1.2

3 1.1/;

parameters C_grid2(t)/

1 2.3

2 2.5

3 2.8/;

positive variable P_grid, C_grid

equation obj, c1;

obj(t)… z =e= C_grid(t)*P_grid(t);

c1(t)… P_grid(t) + P_gen(t) + P_pv(t) =e= P_load(t);

model x /all/;

loop (t,

if ( Pmg_in(t)<4,

c_grid(t)= c_grid1(t);

solve x minimizie z using lp;

else

c_grid(t)=c_grid2(t);

solve x minimize z using lp;

);

);