Hi everybody!

I am completely newby in Gams and never did any programming before… I have to make a model to complete my thesis and I am encountering difficulties in solving some errors.

Please, I really need your help and I already apologize as I am pretty sure the solution to my problem must be straightforward to most of you, but still, i can’t see it…

Here is the thing:

set

n countries /E, P, A, F, B/

t technologies /PFC, SPP/

h hours /1*24/;

alias (n,m);

Table

C1(t,n) Generation costs

E P A F B

PFC 27 47 34 29 25

SPP -96 0 0 0 0

;

Table

K(t,n) Generation capacities (MW)

E P A F B

PFC 9 15 39 0 12

SPP 471 1 3 14 0

;

Table

kd(t,n) generation coeff

E P A F B

PFC 0.85 0.85 0.85 0.85 0.85

SPP 0.3 0.3 0.3 0.3 0.3

;

Parameter

RR_C(t) Ramp rate Committed capacity in % of capacity

/PFC 50

SPP 0 /

;

Table

Cap(n,m) Interconnexion capacities

E P A F B

E 1400

P 3000 468

A 3850 1000

F 1400 900 1300

B 468 400

;

Table

D(n,h) Consumption level / hour

1 2 etc until 24

E 26229 24935

P 10591 9961

A 62403 60023

F 72078 72017

B 11001 10541

variables

x1(t,n,h) production of technology t in country n to country n in hour h

x2(t,n,m,h) production of technology t in country n to country m in hour h

TotCost total cost to minimize

;

equations

k1 Function to minimize

k2(t,n,h) production capacity contraint

k3(n,m,h) line capacity constraint

k4(h) equilibrium constraint

k5E(n,h) national equilibrium in country E

k5A(n,h) national equilibrium in country A

k5F(n,h) national equilibrium in country F

k5P(n,h) national equilibrium in country P

k5B(n,h) national equilibrium in country B

k6(t,n,h) positive production

k7(t,n,m,h) positive export

h1 (t,n,h) production in h1

h2 (t,n,h) production in h2

;

k1 … TotCost =e= Sum(n,Sum(h,Sum(t,x1(t,n,h)*C1(t,n)))) + Sum(m,Sum(h,Sum(n,Sum(t,x2(t,n,m,h)*C1(t,n)))))

;

k2(t,n,h) … kd(t,n)*K(t,n) - x1(t,n,h) - Sum(m,x2(t,n,m,h))=g=0

;

k3(n,m,h) … Cap(n,m) - Sum(t,x2(t,n,m,h)) =g=0

;

k4 (h) … Sum(n,D(n,h)) - Sum(n,Sum(t,x1(t,n,h))) - Sum(m,Sum(n,Sum(t,x2(t,n,m,h)))) =e=0

;

k5E(“E”,h) … D(“E”,h) - Sum(t,x1(t,“E”,h))- Sum(n,Sum(t,x2(t,n,“E”,h))) =e=0

;

k5A(“A”,h) … D(“A”,h) - Sum(t,x1(t,“A”,h))- Sum(n,Sum(t,x2(t,n,“A”,h))) =e=0

;

k5F(“F”,h) … D(“F”,h) - Sum(t,x1(t,“F”,h))- Sum(n,Sum(t,x2(t,n,“F”,h))) =e=0

;

k5P(“P”,h) … D(“P”,h) - Sum(t,x1(t,“P”,h))- Sum(n,Sum(t,x2(t,n,“P”,h))) =e=0

;

k5B(“B”,h) … D(“B”,h) - Sum(t,x1(t,“B”,h))- Sum(n,Sum(t,x2(t,n,“B”,h))) =e=0

;

k6(t,n,h)… x1(t,n,h) =g=0

;

k7(t,n,m,h) … x2(t,n,m,h) =g=0

;

h1 (t,n,“1”) … kd(t,n)*K(t,n) - x1(t,n,“1”) - Sum(m,x2(t,n,m,“1”))=g=0
;
h2 (t,n,“2”) … x1(t,n,“2”) + sum(m,x2(t,n,m,“2”)) =l= x1.l(t,n,“1”) + sum(m,x2.l(t,n,m,“1”))+ RR_C(t)*(((k(t,n)*kd(t,n) - x1.l(t,n,“1”) - sum(m,x2.l (t,n,m,“1”)))))

;

model test / all /

;

solve test minimizing TotCost using lp

;

ERROR MESSAGE :

489 model test / all /

490 ;

491 solve test minimizing TotCost using lp

492 ;

**** $66,256

**** The following LP errors were detected in model test:

**** 66 equation h2… symbol “x1” has no values assigned

**** 66 equation h2… symbol “x2” has no values assigned

What did I do wrong with those x1&2 ?

notes:

Here, h1 must represent the generation capacities that equalizes the Demand in the 1st hour.

then I try to constrain the ramping capacities called next hour according to their ramping flexibility.

I must add, the problem occures when I am running the model including h2 in the equations. The step before, the programme seems to run normally.

THANK YOU SO MUCH IF YOU CAN HELP ME !

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/groups/opt_out.