some generic questions on MILP: a model for biorefineries (question 1)

Dear all,

Im new in GAMS, and setting up a model for the production of ethanol (etoh) in biorefineries. I have some questions I not yet found out about. Can anyone help me? here we go:

Question 1. I have 4 sets j, k, g, t (resp. products, technologies, grids, and time) . one formula is P(j,k,g,t) that is a certain production of type j of techn k, in grid g, for time t. Production type j consists of etoh, electricity, and DDGS. I want to define a formula specific for one product, etoh, for example: P(“etoh”, k,g,t) =g= 0. How should I formulate that in my GAMS? If I do it like the example between quotes, it gives the error “185 Set identifier or ‘*’ expected”.
or another example

278 xP(“etoh”,k,g,t)… P(“etoh”,k,g,t) =e= sum(i, Pf(i,k,g,t))
**** $150 $148$653 $8,409
with errors
150 Symbolic equations redefined
148: Dimension different - The symbol is referenced with more/less indices as declared
135: Incompatible operands for relational operator
653 The left side of an equation cannot be a set expression
8 : ‘)’ expected

another example:
248 cddgs1(“ddgs”,k,g,t)… P(“ddgs”,k,g,t) =e= 0 (ddgs is a product type, an identifier within the set ‘j’)
**** $148$653$409
148: Dimension different - The symbol is referenced with more/less indices as declared
653 The left side of an equation cannot be a set expression

another example:
258 xcetoh1(“etoh”,k,g,t)… P(“etoh”,k,g,t) =l= sum(p, þ(p,k,g,t) * 3 * ER(p))
**** $140 $148$653 $119,148,8,654,409
140 Unknown symbol
148: Dimension different - The symbol is referenced with more/less indices as declared
653 The left side of an equation cannot be a set expression
etc etc

I will post the other questions in another mail
Thank you all very much in advance for helping me

greetings,

bendjy


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/ZJNVkg_4gkkJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Benjamin


Here a small example:



set i /1*3/;



equation

test(i);



parameter t(i);



test(i)… t(i)$(sameas(i,“1”)) =E=1;



or define the equation not over an index



equation test;



test … t(“1”) =E= 1;



Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von ibn yamin (benjamin visser)
Gesendet: Mittwoch, 16. Januar 2013 14:37
An: gamsworld@googlegroups.com
Betreff: some generic questions on MILP: a model for biorefineries (question 1)



Dear all,



Im new in GAMS, and setting up a model for the production of ethanol (etoh) in biorefineries. I have some questions I not yet found out about. Can anyone help me? here we go:



Question 1. I have 4 sets j, k, g, t (resp. products, technologies, grids, and time) . one formula is P(j,k,g,t) that is a certain production of type j of techn k, in grid g, for time t. Production type j consists of etoh, electricity, and DDGS. I want to define a formula specific for one product, etoh, for example: P(“etoh”, k,g,t) =g= 0. How should I formulate that in my GAMS? If I do it like the example between quotes, it gives the error “185 Set identifier or ‘*’ expected”.

or another example



278 xP(“etoh”,k,g,t)… P(“etoh”,k,g,t) =e= sum(i, Pf(i,k,g,t))

**** $150 $148$653 $8,409

with errors

150 Symbolic equations redefined

148: Dimension different - The symbol is referenced with more/less indices as declared

135: Incompatible operands for relational operator

653 The left side of an equation cannot be a set expression

8 : ‘)’ expected



another example:

248 cddgs1(“ddgs”,k,g,t)… P(“ddgs”,k,g,t) =e= 0 (ddgs is a product type, an identifier within the set ‘j’)

**** $148$653$409

148: Dimension different - The symbol is referenced with more/less indices as declared

653 The left side of an equation cannot be a set expression



another example:

258 xcetoh1(“etoh”,k,g,t)… P(“etoh”,k,g,t) =l= sum(p, þ(p,k,g,t) * 3 * ER(p))

**** $140 $148$653 $119,148,8,654,409

140 Unknown symbol

148: Dimension different - The symbol is referenced with more/less indices as declared

653 The left side of an equation cannot be a set expression

etc etc



I will post the other questions in another mail

Thank you all very much in advance for helping me



greetings,



bendjy


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/ZJNVkg_4gkkJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Benjamin

As Tom Rutherford pointed out to me, my first solution will, of course, not work (I replied to fast…).

If you have the equation

test(i) x(i)$sameas(i,“1”) =E= 1;

this will result in equations for all other elements of i that will look like 0 =E= 1.
This is because I put the -condition in the equation. Gams will now write down an equation for every i and only in the first case put in the x(i), otherwise a zero. Of course, you could also add the same -condition on the right hand side (1$$sameas(i,“1”) , but it would be better to use the second solution where you have an equation not indexed over i.

Cheers and sorry for the partly wrong answer
Renger


On Wednesday, January 16, 2013 2:36:36 PM UTC+1, benjamin visser wrote:

Dear all,

Im new in GAMS, and setting up a model for the production of ethanol (etoh) in biorefineries. I have some questions I not yet found out about. Can anyone help me? here we go:

Question 1. I have 4 sets j, k, g, t (resp. products, technologies, grids, and time) . one formula is P(j,k,g,t) that is a certain production of type j of techn k, in grid g, for time t. Production type j consists of etoh, electricity, and DDGS. I want to define a formula specific for one product, etoh, for example: P(“etoh”, k,g,t) =g= 0. How should I formulate that in my GAMS? If I do it like the example between quotes, it gives the error “185 Set identifier or ‘*’ expected”.
or another example

278 xP(“etoh”,k,g,t)… P(“etoh”,k,g,t) =e= sum(i, Pf(i,k,g,t))
**** $150 $148$653 $8,409
with errors
150 Symbolic equations redefined
148: Dimension different - The symbol is referenced with more/less indices as declared
135: Incompatible operands for relational operator
653 The left side of an equation cannot be a set expression
8 : ‘)’ expected

another example:
248 cddgs1(“ddgs”,k,g,t)… P(“ddgs”,k,g,t) =e= 0 (ddgs is a product type, an identifier within the set ‘j’)
**** $148$653$409
148: Dimension different - The symbol is referenced with more/less indices as declared
653 The left side of an equation cannot be a set expression

another example:
258 xcetoh1(“etoh”,k,g,t)… P(“etoh”,k,g,t) =l= sum(p, þ(p,k,g,t) * 3 * ER(p))
**** $140 $148$653 $119,148,8,654,409
140 Unknown symbol
148: Dimension different - The symbol is referenced with more/less indices as declared
653 The left side of an equation cannot be a set expression
etc etc

I will post the other questions in another mail
Thank you all very much in advance for helping me

greetings,

bendjy


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/QoAYWcOP4WMJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

thanks for your reaction renger… Im trying to get it right… but millions of other error messages pop up. Im looking into it to get it done.

kind regard.

benjamin


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/XNWf1vwxVJ8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Benjamin

Don’t get upset about the million errors. Usually the first one, causes those others. This does not mean you have a million errors.

So always try to correct the first error you encounter and then run the model and keep going until no errors appear anymore.

So don’t try to correct all the errors at once, but only one at the time.

Renger



Von: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] Im Auftrag von benjamin visser
Gesendet: Samstag, 19. Januar 2013 15:30
An: gamsworld@googlegroups.com
Betreff: Re: some generic questions on MILP: a model for biorefineries (question 1)




thanks for your reaction renger… Im trying to get it right… but millions of other error messages pop up. Im looking into it to get it done.



kind regard.



benjamin


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/XNWf1vwxVJ8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.