Please help with a loop
Posted: Thu Oct 16, 2014 2:44 pm
I am trying to do a simple example and I am New to GAMS.
I want to do a simple Power flow example in order to expand it later, i want GAMS to minimize the cost by choosing the cheapest generators.
My problem is that I want the load to change for every hour for my system, here is a 3 hour example and the error is marked in red.
Can you please help me and explain what i must do different?
HERE IS MY CODE:
Set t hours per day / t1, t2, t3 / ;
L(t) Load for each
t3 8/ ;
Cost_diesel in â‚¬ per kWh / 2 /
Cost_pv in â‚¬ / 1.1 /
X_g Diesel generator,
X_pv Domestic PV generation ,
Z Total cost of grid operation in â‚¬ per kWh for on hour;
Load_Balance Maintane a stable grid,
OBJ Objective equation total cost of grid operation in â‚¬ per kWh ;
Load_balance.. X_g + X_pv -L(t) =E= 0 ;
149 Uncontrolled set entered as constant
OBJ.. Z =E= (X_g*Cost_diesel) + (X_pv*Cost_pv);
* Upper bounds
X_g.UP = 10 ;
X_pv.UP = 2 ;
* Lower bounds
X_g.lo = 0 ;
X_pv.lo = 0 ;
* Initial point
X_g.l = 0 ;
X_pv.l = 0 ;
* Load(s).l = 0 ;
MODEL pflow / ALL / ;
OPTION LIMROW = 100;
OPTION LIMCOL = 100;
loop(t, SOLVE pflow USING LP MINIMIZING Z) ;
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.