Economic dispatch

Hi people,
I am doing economic dispatch of sources. Program was compilated
without errors. But offered results seem
strange! As you can see (below) for contracted amount of power at
time
window 3, the program computed the negative value of power for
source
1 (what is physical nonsense). In spite of bounds (power limits) are
treated as variables P.up(n,t) = Par(n,“up_bound”); P.lo(n,t) =
Par(n,“lo_bound”); with specified lower and upper bounds according
to
table Par(n, head). Whats more the status of model is “infeasible”.
That means that program did not respect the bounds
(feasible region). Why it happened? How to treat this problem? Thank
you in advance for your warm help.
Kindly, Jan

Here is source code:
Sets
n “number of generators” /14/
t “number of time windows” /1
3/
head “head of table” /up_bound, lo_bound, prize, fix_cost, dep_cost/;
Parameters P_doh(t) contracted amount of power
/1 3510, 2 2720, 3 510/
Table Par(n,head) “generators parameters”
up_bound lo_bound prize fix_cost
dep_cost
1 1200 0 97.98e-3
10 14.4625e-3
2 1800 900 129.44e-3 30
50.575e-3
3 200 0 58.6e-3
0 0
4 5000 0 0
0 1500e-3;
Variables
P(n,t) power of n-th generator in time t
Z profit from selling energy;
P.up(n,t) = Par(n,“up_bound”);
P.lo(n,t) = Par(n,“lo_bound”);
Equations
Obj objective function
GenLow(n,t) lower bound
GenUp(n,t) upper bound
SysBal(t) power balance equation;
Obj…0=e=sum((n,t),Par(n,“prize”)*P(n,t)-
Par(n,“dep_cost”)*P(n,t)-Par(n,“fix_cost”))-Z;
GenLow(n,t) … P(n,t) =g= Par(n,“lo_bound”);
GenUp(n,t) … P(n,t) =l= Par(n,“up_bound”);
SysBal(t)… sum((n),P(n,t))-P_doh(t)=e=0;
Model VPP “controling OZE” /all/;
solve VPP using mip maximizing Z;

Here are results:
VAR P power of n-th generator in time t

LOWER LEVEL UPPER MARGINAL

1.1 . 1200.000 1200.000 EPS
1.2 . 1200.000 1200.000 EPS
1.3 . -390.000 1200.000 1.000 INFES
2.1 900.000 1800.000 1800.000 EPS
2.2 900.000 1520.000 1800.000 .
2.3 900.000 900.000 1800.000 2.000 INFES
3.1 . 200.000 200.000 EPS
3.2 . . 200.000 EPS
3.3 . . 200.000 2.000 INFES
4.1 . 310.000 5000.000 .
4.2 . . 5000.000 EPS
4.3 . . 5000.000 2.000 INFES

LOWER LEVEL UPPER MARGINAL

---- VAR Z -INF 780.000 +INF .

Z profit from selling energy

**** REPORT SUMMARY : 0 NONOPT
5 INFEASIBLE (INFES)
SUM 780.000
MAX 390.000
MEAN 156.000
0 UNBOUNDED
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 4 Infeasible
**** OBJECTIVE VALUE 780.0000

\

Its working but my question is
How these two works??
costfn… cost =e= sum((i,cg), gendata(i,cg)*power(p(i),pexp(cg)));

demcons… sum(i, p(i)) =e= demand ;


On Saturday, 19 October 2013 16:06:48 UTC+5:30, abhishek khanna wrote:

Hi All,

I have created the following code which is not giving any output.

Question :
Table 1: Generator Characteristics
Unit PminMW PmaxMW A€/(MW)2h B€/MWh C€/h
A 30 150 0.15 4 1620
B 50 200 0.06 0.4 3000
C 150 440 0.025 0.1 3960
D 200 555 0.013 0.75 4500
Note: The values of A, B & C correspond to the coefficients of the quadratic cost
function: Hourly cost = A× P + B× P + C
2
If all units are on-line, and the system demand is 600 MW and later 750 MW
determine the optimal economic dispatch and the associated cost (€/h) for each
demand level by (i) solving a Lagrangian function, and (ii) developing an economic
dispatch program using the GAMS modelling language.
Comment on how the answers compare, and how the constraints impact on the
answers obtained.
GAMS hint: The problem, as defined, is non-linear due to the quadratic cost
functions, which can create numerous problems for optimisation solvers, and, most
importantly, it may be uncertain whether a globally (rather than locally) optimal
solution has been obtained. In order to avoid such problems, and reduce the
computation time, it is common practice to linearise the cost curves. Depending on
the degree of non-linearity, the curves can be approximated by a single line or
multiple linear segments. You may choose, without penalty, to represent the cost
curve of each unit by a single straight line, i.e. not piecewise linear.




sets i generators / p1*p4 /
genchar generator characteristics / a,b,c,upplim,lowlim /
cg(genchar) cost categories / a,b,c /

alias (i,j) ;

table gendata(i,genchar) generator cost characteristics and limits

a b c upplim lowlim
p1 0.15 4 1620 150 30
p2 0.06 0.4 3000 200 50
p3 0.025 0.6 3960 440 150
p4 0.013 0.75 4500 555 200

parameter pexp(cg) exponent for cost function / a 2, b 1, c 0/;

scalar demand total power demand in MW / 600 / ;

variables
p(i) power generation level in MW
cost total generation cost - the objective function
variables p;

p.up(i) = gendata(i,“upplim”) ;
p.lo(i) = gendata(i,“lowlim”) ;

equations
costfn total cost calculation
demcons total generation must equal demand ;


costfn… cost =e= sum((i,cg), gendata(i,cg)*power(p(i),pexp(cg)));

demcons… sum(i, p(i)) =e= demand ;

model test /all/ ;

solve test minimizing cost using nlp ;

thanks
AK

\

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.

Dear Abhishek Khanna:
If I understand well, you want to linearize the cost operation curve of the generators. You can try with the next code, but is necessary use a binary variables.
The figure shows the non linear cost curve, linearized in three sections
Imágenes integradas 1
The restrictions are:
curve(i)=e=a*u(i)+[(C(b)-C(a))/(b-a)]*p1(i)+[(C(c)-C(b))/(c-b)]p2(i)+[(C(d)-C(c))/(d-c)]p3(i)
p(i)=e=p1(i)+p2(i)+p3(i)+a
u(i)
w1(i)
(b-a)

Hi All,

I have created the following code which is not giving any output.

Question :
Table 1: Generator Characteristics
Unit PminMW PmaxMW A€/(MW)2h B€/MWh C€/h
A 30 150 0.15 4 1620
B 50 200 0.06 0.4 3000
C 150 440 0.025 0.1 3960
D 200 555 0.013 0.75 4500
Note: The values of A, B & C correspond to the coefficients of the quadratic cost
function: Hourly cost = A× P + B× P + C
2
If all units are on-line, and the system demand is 600 MW and later 750 MW
determine the optimal economic dispatch and the associated cost (€/h) for each
demand level by (i) solving a Lagrangian function, and (ii) developing an economic
dispatch program using the GAMS modelling language.
Comment on how the answers compare, and how the constraints impact on the
answers obtained.
GAMS hint: The problem, as defined, is non-linear due to the quadratic cost
functions, which can create numerous problems for optimisation solvers, and, most
importantly, it may be uncertain whether a globally (rather than locally) optimal
solution has been obtained. In order to avoid such problems, and reduce the
computation time, it is common practice to linearise the cost curves. Depending on
the degree of non-linearity, the curves can be approximated by a single line or
multiple linear segments. You may choose, without penalty, to represent the cost
curve of each unit by a single straight line, i.e. not piecewise linear.




sets i generators / p1*p4 /
genchar generator characteristics / a,b,c,upplim,lowlim /
cg(genchar) cost categories / a,b,c /

alias (i,j) ;

table gendata(i,genchar) generator cost characteristics and limits

a b c upplim lowlim
p1 0.15 4 1620 150 30
p2 0.06 0.4 3000 200 50
p3 0.025 0.6 3960 440 150
p4 0.013 0.75 4500 555 200

parameter pexp(cg) exponent for cost function / a 2, b 1, c 0/;

scalar demand total power demand in MW / 600 / ;

variables
p(i) power generation level in MW
cost total generation cost - the objective function
variables p;

p.up(i) = gendata(i,“upplim”) ;
p.lo(i) = gendata(i,“lowlim”) ;

equations
costfn total cost calculation
demcons total generation must equal demand ;


costfn… cost =e= sum((i,cg), gendata(i,cg)*power(p(i),pexp(cg)));

demcons… sum(i, p(i)) =e= demand ;

model test /all/ ;

solve test minimizing cost using nlp ;

thanks
AK

\

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.

\

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.

Reply-to: gamsworld@googlegroups.com

hello dear friend

I want to start OPf simulation in GAMS.can you help me in this way.
I want any code in GAMS in field of OPF or ED.i want code to get any idea?

can you help me?

On Wednesday, October 23, 2013 11:47:27 AM UTC+3:30, Daniel Jimenez wrote:

Dear Abhishek Khanna:
If I understand well, you want to linearize the cost operation curve of the generators. You can try with the next code, but is necessary use a binary variables.
The figure shows the non linear cost curve, linearized in three sections
Imágenes integradas 1
The restrictions are:
curve(i)=e=a*u(i)+[(C(b)-C(a))/(b-a)]*p1(i)+[(C(c)-C(b))/(c-b)]p2(i)+[(C(d)-C(c))/(d-c)]p3(i)
p(i)=e=p1(i)+p2(i)+p3(i)+a
u(i)
w1(i)
(b-a)

Hi All,

I have created the following code which is not giving any output.

Question :
Table 1: Generator Characteristics
Unit PminMW PmaxMW A€/(MW)2h B€/MWh C€/h
A 30 150 0.15 4 1620
B 50 200 0.06 0.4 3000
C 150 440 0.025 0.1 3960
D 200 555 0.013 0.75 4500
Note: The values of A, B & C correspond to the coefficients of the quadratic cost
function: Hourly cost = A× P + B× P + C
2
If all units are on-line, and the system demand is 600 MW and later 750 MW
determine the optimal economic dispatch and the associated cost (€/h) for each
demand level by (i) solving a Lagrangian function, and (ii) developing an economic
dispatch program using the GAMS modelling language.
Comment on how the answers compare, and how the constraints impact on the
answers obtained.
GAMS hint: The problem, as defined, is non-linear due to the quadratic cost
functions, which can create numerous problems for optimisation solvers, and, most
importantly, it may be uncertain whether a globally (rather than locally) optimal
solution has been obtained. In order to avoid such problems, and reduce the
computation time, it is common practice to linearise the cost curves. Depending on
the degree of non-linearity, the curves can be approximated by a single line or
multiple linear segments. You may choose, without penalty, to represent the cost
curve of each unit by a single straight line, i.e. not piecewise linear.




sets i generators / p1*p4 /
genchar generator characteristics / a,b,c,upplim,lowlim /
cg(genchar) cost categories / a,b,c /

alias (i,j) ;

table gendata(i,genchar) generator cost characteristics and limits

a b c upplim lowlim
p1 0.15 4 1620 150 30
p2 0.06 0.4 3000 200 50
p3 0.025 0.6 3960 440 150
p4 0.013 0.75 4500 555 200

parameter pexp(cg) exponent for cost function / a 2, b 1, c 0/;

scalar demand total power demand in MW / 600 / ;

variables
p(i) power generation level in MW
cost total generation cost - the objective function
variables p;

p.up(i) = gendata(i,“upplim”) ;
p.lo(i) = gendata(i,“lowlim”) ;

equations
costfn total cost calculation
demcons total generation must equal demand ;


costfn… cost =e= sum((i,cg), gendata(i,cg)*power(p(i),pexp(cg)));

demcons… sum(i, p(i)) =e= demand ;

model test /all/ ;

solve test minimizing cost using nlp ;

thanks
AK

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

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.