Scenario Generation By Loop In Gmas

Dear All,

I have 5 set as follow :

D Index for DA price scenarios /d1, d2/
A Index for price differences between DA and AM /a1, a2/
L Index for scenarios modeling wind production in between DA and AM /l1, l2/
W Index for scenarios modeling wind production after AM /w1, w2/
K Index for scenarios representing imbalance price ratios /k1, k2/;

I need to generate scenario tree by loop before solving my problem .

The initial value for my parameters :

Parameter P_0(L,W)
/
l1.w1 100
l1.w2 50
l2.w1 0
l2.w2 40/

lambdaD_0(D) Day-ahead market prices
/ d1 0
d2 0 /

MAvsMD_0(A) Price difference between day-ahead and adjustment markets
/ a1 -10
a2 3 /

I write this code for generate scenario tree and solve :

  • MODEL

MODEL WindProdProblem /ALL/;
OPTION iterlim = 1e8;
OPTION reslim = 1e10;


set d01 /dd1*dd2/

parameter lambdaD(d01)
/
dd1 50
dd2 20
/


set L01 /ll1ll2/
set W01 /ww1
ww2/ ;
Parameter P(L01,W01) Wind power production
/
ll1.ww1 100
ll1.ww2 50
ll2.ww1 0
ll2.ww2 40/


set A01/aa1,aa2/

MAvsMD(A01) Price difference between day-ahead and adjustment markets
/ aa1 -10
aa2 3 / ;


loop((d01,L01,W01,A01),
lambdaD_0(D)= lambdaD(d01);
P_0(L,W)=P(L01,W01) ;
MAvsMD_0(A)=MAvsMD(A01);
*
OPTION iterlim = 1e8;
OPTION reslim = 1e10;

Option lp=cplex;
WindProdProblem.optcr=0;
SOLVE WindProdProblem USING lp MAXIMIZING z;


);

The allocated value to parameters and results are completely wrong.


Please,guide me how re-write my code in loop section .


Thank you very much for your kind reply.

Regards
Mehrdad


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/d/optout.

Hi Mehrdad



In order to understand what is going on in the loop, you should report your parameters (either for every loop or collect them in a parameter):

display lambdaD_0, P_0, MAvsMD_0;



This will help you to find out, if your assignment is matching with your ideas on what they should be.

Cheers

Renger




\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: Mittwoch, 11. Juni 2014 09:45
To: gamsworld@googlegroups.com
Subject: Scenario Generation By Loop In Gmas



Dear All,



I have 5 set as follow :



D Index for DA price scenarios /d1, d2/

A Index for price differences between DA and AM /a1, a2/

L Index for scenarios modeling wind production in between DA and AM /l1, l2/

W Index for scenarios modeling wind production after AM /w1, w2/

K Index for scenarios representing imbalance price ratios /k1, k2/;



I need to generate scenario tree by loop before solving my problem .



The initial value for my parameters :



Parameter P_0(L,W)

/

l1.w1 100

l1.w2 50

l2.w1 0

l2.w2 40/



lambdaD_0(D) Day-ahead market prices

/ d1 0

d2 0 /



MAvsMD_0(A) Price difference between day-ahead and adjustment markets

/ a1 -10

a2 3 /



I write this code for generate scenario tree and solve :


\

  • MODEL

MODEL WindProdProblem /ALL/;

OPTION iterlim = 1e8;

OPTION reslim = 1e10;


\


set d01 /dd1*dd2/



parameter lambdaD(d01)

/

dd1 50

dd2 20

/


set L01 /ll1*ll2/

set W01 /ww1*ww2/ ;

Parameter P(L01,W01) Wind power production

/

ll1.ww1 100

ll1.ww2 50

ll2.ww1 0

ll2.ww2 40/


set A01/aa1,aa2/



MAvsMD(A01) Price difference between day-ahead and adjustment markets

/ aa1 -10

aa2 3 / ;


loop((d01,L01,W01,A01),

lambdaD_0(D)= lambdaD(d01);

P_0(L,W)=P(L01,W01) ;

MAvsMD_0(A)=MAvsMD(A01);

OPTION iterlim = 1e8;

OPTION reslim = 1e10;



Option lp=cplex;

WindProdProblem.optcr=0;

SOLVE WindProdProblem USING lp MAXIMIZING z;





);



The allocated value to parameters and results are completely wrong.





Please,guide me how re-write my code in loop section .





Thank you very much for your kind reply.



Regards

Mehrdad


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/d/optout.


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/d/optout.

Hi Mehrdad,

Scenario-tree generation is not matter of GAMS programming. As long as I know, there is no general rule, so you should come up with a procedure on the paper that is precise for your problem, since the only person who knows in detail about your problem is either you or your adviser,others can hardly help you.

It would be better for you to ask your question in forums like or-exchange.com (I don’t know if it is right to talk about that website here or not!), because there are general discussions about operations research not only GAMS related issues.

Good Luck with your project.

Best,


On Wed, Jun 11, 2014 at 3:44 AM, Mehrdad Tahmasebi wrote:

Dear All,

I have 5 set as follow :

D Index for DA price scenarios /d1, d2/
A Index for price differences between DA and AM /a1, a2/
L Index for scenarios modeling wind production in between DA and AM /l1, l2/
W Index for scenarios modeling wind production after AM /w1, w2/
K Index for scenarios representing imbalance price ratios /k1, k2/;

I need to generate scenario tree by loop before solving my problem .

The initial value for my parameters :

Parameter P_0(L,W)
/
l1.w1 100
l1.w2 50
l2.w1 0
l2.w2 40/

lambdaD_0(D) Day-ahead market prices
/ d1 0
d2 0 /

MAvsMD_0(A) Price difference between day-ahead and adjustment markets
/ a1 -10
a2 3 /

I write this code for generate scenario tree and solve :

  • MODEL

MODEL WindProdProblem /ALL/;
OPTION iterlim = 1e8;
OPTION reslim = 1e10;


set d01 /dd1*dd2/

parameter lambdaD(d01)
/
dd1 50
dd2 20
/


set L01 /ll1ll2/
set W01 /ww1
ww2/ ;
Parameter P(L01,W01) Wind power production
/
ll1.ww1 100
ll1.ww2 50
ll2.ww1 0
ll2.ww2 40/


set A01/aa1,aa2/

MAvsMD(A01) Price difference between day-ahead and adjustment markets
/ aa1 -10
aa2 3 / ;


loop((d01,L01,W01,A01),
lambdaD_0(D)= lambdaD(d01);
P_0(L,W)=P(L01,W01) ;
MAvsMD_0(A)=MAvsMD(A01);
*
OPTION iterlim = 1e8;
OPTION reslim = 1e10;

Option lp=cplex;
WindProdProblem.optcr=0;
SOLVE WindProdProblem USING lp MAXIMIZING z;


);

The allocated value to parameters and results are completely wrong.


Please,guide me how re-write my code in loop section .


Thank you very much for your kind reply.

Regards
Mehrdad


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/d/optout.



\

Babak Saleck Pay
Ph.D Student of Systems Modeling and Analysis
Department of Statistical Sciences and Operations Research
Virginia Commonwealth University
4156 Grace Harris Hall
1015 Floyd Ave.
Richmond, VA

\

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/d/optout.

Dear BOB,

Many thanks for your guide.

All the best…
Mehrdad


On Wed, Jun 11, 2014 at 7:29 PM, Bob Pay wrote:

Hi Mehrdad,

Scenario-tree generation is not matter of GAMS programming. As long as I know, there is no general rule, so you should come up with a procedure on the paper that is precise for your problem, since the only person who knows in detail about your problem is either you or your adviser,others can hardly help you.

It would be better for you to ask your question in forums like or-exchange.com (I don’t know if it is right to talk about that website here or not!), because there are general discussions about operations research not only GAMS related issues.

Good Luck with your project.

Best,


On Wed, Jun 11, 2014 at 3:44 AM, Mehrdad Tahmasebi wrote:

Dear All,

I have 5 set as follow :

D Index for DA price scenarios /d1, d2/
A Index for price differences between DA and AM /a1, a2/
L Index for scenarios modeling wind production in between DA and AM /l1, l2/
W Index for scenarios modeling wind production after AM /w1, w2/
K Index for scenarios representing imbalance price ratios /k1, k2/;

I need to generate scenario tree by loop before solving my problem .

The initial value for my parameters :

Parameter P_0(L,W)
/
l1.w1 100
l1.w2 50
l2.w1 0
l2.w2 40/

lambdaD_0(D) Day-ahead market prices
/ d1 0
d2 0 /

MAvsMD_0(A) Price difference between day-ahead and adjustment markets
/ a1 -10
a2 3 /

I write this code for generate scenario tree and solve :

  • MODEL

MODEL WindProdProblem /ALL/;
OPTION iterlim = 1e8;
OPTION reslim = 1e10;


set d01 /dd1*dd2/

parameter lambdaD(d01)
/
dd1 50
dd2 20
/


set L01 /ll1ll2/
set W01 /ww1
ww2/ ;
Parameter P(L01,W01) Wind power production
/
ll1.ww1 100
ll1.ww2 50
ll2.ww1 0
ll2.ww2 40/


set A01/aa1,aa2/

MAvsMD(A01) Price difference between day-ahead and adjustment markets
/ aa1 -10
aa2 3 / ;


loop((d01,L01,W01,A01),
lambdaD_0(D)= lambdaD(d01);
P_0(L,W)=P(L01,W01) ;
MAvsMD_0(A)=MAvsMD(A01);
*
OPTION iterlim = 1e8;
OPTION reslim = 1e10;

Option lp=cplex;
WindProdProblem.optcr=0;
SOLVE WindProdProblem USING lp MAXIMIZING z;


);

The allocated value to parameters and results are completely wrong.


Please,guide me how re-write my code in loop section .


Thank you very much for your kind reply.

Regards
Mehrdad


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/d/optout.



\

Babak Saleck Pay
Ph.D Student of Systems Modeling and Analysis
Department of Statistical Sciences and Operations Research
Virginia Commonwealth University
4156 Grace Harris Hall
1015 Floyd Ave.
Richmond, VA

\

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/d/optout.

\

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/d/optout.

Dear Renger,

Thank you.


On Wed, Jun 11, 2014 at 1:12 PM, Renger van Nieuwkoop wrote:

Hi Mehrdad



In order to understand what is going on in the loop, you should report your parameters (either for every loop or collect them in a parameter):

display lambdaD_0, P_0, MAvsMD_0;



This will help you to find out, if your assignment is matching with your ideas on what they should be.

Cheers

Renger




\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Mehrdad Tahmasebi
Sent: Mittwoch, 11. Juni 2014 09:45
To: gamsworld@googlegroups.com
Subject: Scenario Generation By Loop In Gmas



Dear All,



I have 5 set as follow :



D Index for DA price scenarios /d1, d2/

A Index for price differences between DA and AM /a1, a2/

L Index for scenarios modeling wind production in between DA and AM /l1, l2/

W Index for scenarios modeling wind production after AM /w1, w2/

K Index for scenarios representing imbalance price ratios /k1, k2/;



I need to generate scenario tree by loop before solving my problem .



The initial value for my parameters :



Parameter P_0(L,W)

/

l1.w1 100

l1.w2 50

l2.w1 0

l2.w2 40/



lambdaD_0(D) Day-ahead market prices

/ d1 0

d2 0 /



MAvsMD_0(A) Price difference between day-ahead and adjustment markets

/ a1 -10

a2 3 /



I write this code for generate scenario tree and solve :


\

  • MODEL

MODEL WindProdProblem /ALL/;

OPTION iterlim = 1e8;

OPTION reslim = 1e10;


\


set d01 /dd1*dd2/



parameter lambdaD(d01)

/

dd1 50

dd2 20

/


set L01 /ll1*ll2/

set W01 /ww1*ww2/ ;

Parameter P(L01,W01) Wind power production

/

ll1.ww1 100

ll1.ww2 50

ll2.ww1 0

ll2.ww2 40/


set A01/aa1,aa2/



MAvsMD(A01) Price difference between day-ahead and adjustment markets

/ aa1 -10

aa2 3 / ;


loop((d01,L01,W01,A01),

lambdaD_0(D)= lambdaD(d01);

P_0(L,W)=P(L01,W01) ;

MAvsMD_0(A)=MAvsMD(A01);

OPTION iterlim = 1e8;

OPTION reslim = 1e10;



Option lp=cplex;

WindProdProblem.optcr=0;

SOLVE WindProdProblem USING lp MAXIMIZING z;





);



The allocated value to parameters and results are completely wrong.





Please,guide me how re-write my code in loop section .





Thank you very much for your kind reply.



Regards

Mehrdad


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/d/optout.


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/d/optout.

\

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/d/optout.