Hi Helena
Gams helps with looking for the error. If I run your code I first get the following error:
8 ')' expected
And Gams tells me it is after 19).
So a closing parenthesis is missing (also repair the first error Gams encounters and don’t worry about the following errors)
After correcting this, I get
119 Number (primary) expected
Gams doesn’t understand the comma, it expects a number. Deleting the comma and after that replacing the “&” by “and”
And setting the parenthesis correct I get this
((ord(b)<=19) AND (ord(b)>=ord(c)))
Then Gams complains about b*c*100. These are sets and not numbers! So you can’t add or multiply these set elements with each other. Either use the extension .val to use the value of this set element (in this case this works fine, as you defined the set consisting of numbers) or use ord again. I am used to using ord, so it looks now looks like this:
eq1(a).. objective=e=sum(c$(ord(c)<=(ord(c)+d(a))),sum(b$
((ord(b)<=19) AND (ord(b)>=ord(c))),ord(b)*ord(c)*100));
Long story in two sentences:
. Use the errors reported by GAMS to debug your model
. Repeat debugging the first error in the listing and running the model again, until no errors are left..
Cheers
Renger
Von: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Im Auftrag von
Selina
Gesendet: Montag, 5. November 2012 00:24
An: gams...@googlegroups.com
Betreff: Re: summation with a lower bound and upper bound
I have the same question. Have you figure it out?
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/gamsworld/-/kVUCiFElshsJ.
To post to this group, send email to
gams...@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.