about error 066

Solver related questions
Post Reply
kankanertan
User
User
Posts: 4
Joined: 1 week ago

about error 066

Post by kankanertan » 1 week ago

The symbol shown has not been defined or assigned
A wild shot:You may have spurious commas in the explanatory text of a declaration.
Check symbol reference list.


the error is in this sentence :'Solve GenUnitCom using lp minimizing z;'

but I have defined the symbol 'z', why the error is still there?

Thank you very much!

User avatar
Renger
Posts: 186
Joined: 2 years ago

Re: about error 066

Post by Renger » 1 week ago

Hi
Well, then as Gams tells you, you might have forgotten a semicolon, or your 'z' is not defined as a variable, or not used in an equation.
Please send your code if this doesn't solve the issue.
Cheers
Renger

kankanertan
User
User
Posts: 4
Joined: 1 week ago

Re: about error 066

Post by kankanertan » 1 week ago

I have defined 'z' as a variable and use it in an equation

this is some of my code


variable z;

.
.
.

Cost.. z =e= sum( (i,t) , a(i) * p(i,t) );

I dont konw how to send all my code or send an image to you.I am sorry.
Last edited by kankanertan on Mon Oct 08, 2018 8:54 am, edited 1 time in total.

User avatar
Renger
Posts: 186
Joined: 2 years ago

Re: about error 066

Post by Renger » 1 week ago

As Gams tells you there might be a semicolon forgotten somewhere in your code. I can't tell you where from the (correct) piece of code. Helpful would be to attach the whole model.
Cheers
Renger

kankanertan
User
User
Posts: 4
Joined: 1 week ago

Re: about error 066

Post by kankanertan » 1 week ago

This is all my code, I have checked it many times, Thank you very much for check it again!


set n /
$include NodeSet.inc
/;

set i /
$include GenSet.inc
/;


set j /
$include WindGenSet.inc
/;


set k /
$include LineSet.inc
/;


set l /
$include LoadSet.inc
/;


set t /
t1*t24
/;


set c /
c1*c5
/;




parameter KG(n, i) /
$include KG.inc
/;


parameter KWG(n, j) /
$include KWG.inc
/;


parameter KD(l, n) /
$include KD.inc
/;


parameter KL(k, n) /
$include KL.inc
/;

parameter KLT(k,n) /
$include KLT.inc
/;


parameter pMax(i) /
$include GenPMax.inc
/;


parameter pMin(i) /
$include GenPMin.inc
/;


parameter a(i) /
$include A.inc
/;


parameter injecto(j,t,c) /
$include inject.inc
/;


parameter X(k) /
$include X.inc
/;

parameter LMax(k) /
$include LMax.inc
/;


parameter LMin(k) /
$include LMin.inc
/;


parameter PrMIN(t) /
$include PrMIN.inc
/;


parameter PrMAX(t) /
$include PrMAX.inc
/;

parameter SU(i) /
$include SU.inc
/;


parameter SD(i) /
$include SD.inc
/;


parameter D(l,t) /
$include D.inc
/;

parameter p_0(i)
/1 100
2 200
3 100/ ;

parameter p0(i,t) ;

parameter inject(j,t);

parameter hdeta(i) /
$include hdeta.inc
/;

parameter ldeta(i) /
$include ldeta.inc
/;


parameter MaxdetaP(i)
/1 20
2 20
3 30/;

parameter MindetaP(i)
/1 -20
2 -20
3 -30/;

parameter pf(i,t,c);



variable p(i,t), Theta(n,t), f(k,t);

variable r(i,t);

Theta.fx('1',t) = 0;

variable z;

equations Cost, FlowEQ(n,t), LinePowerFlow(k,t);

equations MaxFlowO(k,t), MinFlowO(k,t);

equations Start(i,t),Stop(i,t),Start0(i,t),Stop0(i,t);

equations PPMAX(i,t), PPMIN(i,t);

equations PPRMIN(t), PPRMAX(i,t);

equations pcmax(i,t), pcmin(i,t);





Cost.. z =e= sum( (i,t) , a(i) * p(i,t) );

FlowEQ(n,t).. sum(i, KG(n, i) * p(i,t)) + sum(j, KWG(n,j) * inject(j,t)) =e= sum(k, KLT(k, n) * f(k,t)) + sum(l, KD(l,n) * D(l,t));

LinePowerFlow(k,t).. f(k,t) =e= X(k) * sum(n, KLT(k, n) * Theta(n,t));



PPMAX(i,t).. p(i,t) =l= pMax(i);

PPMIN(i,t).. p(i,t) =g= pMin(i);



MaxFlowO(k,t).. f(k,t) =l= LMax(k);

MinFlowO(k,t).. f(k,t) =g= LMin(k);



PPRMAX(i,t).. p(i,t)+ r(i,t) =l= pMax(i);

PPRMIN(t).. sum (i,r(i,t)) =g= PrMIN(t);


pcmax(i,t)..p(i,t) - p0(i,t) =l= MaxdetaP(i);
pcmin(i,t)..p(i,t) - p0(i,t) =g= MindetaP(i);




Start(i,t)$(ord(t)>1).. p(i,t) - p(i,t-1) =l= SU(i);
Start0(i,t)$(ord(t)=1).. p(i,t) - p_0(i) =l= SU(i);

Stop(i,t)$(ord(t)>1).. p(i,t-1) - p(i,t) =l= SD(i);
Stop0(i,t)$(ord(t)=1).. p_0(i) - p(i,t) =l= SD(i);


Model GenUnitCom /all/ ;

option lp=cplex;

option LimRow=1000;



loop
(
c,
inject(j,t) = injecto(j,t,c);

Solve GenUnitCom using lp minimizing z;

p0(i,t) = p.l(i,t);

pf(i,t,c) = p.l(i,t);
);

display Theta.l;



$title BMatrix(n, n)$Linen(k, n, n) = 1 / LineX(k);

User avatar
Renger
Posts: 186
Joined: 2 years ago

Re: about error 066

Post by Renger » 1 week ago

There migt be a problem with one of the include files.
Try the following: put a $exit after the equation with z, remove the inclusion of a and define it manually e.g. a(i) = random(0,10);
If the problem still exists, do the same for the other include files.
Cheers
Renger

kankanertan
User
User
Posts: 4
Joined: 1 week ago

Re: about error 066

Post by kankanertan » 1 week ago

Thank you very much, I'll try!

Post Reply