loop and variables

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

loop and variables

Post by Archiver »



hi
i want to use a loop statement for calculating a parameter from a
variable as below:

parameter Vlim;
Variable V;

...some equations about V and other variables then

loop(i,Vlim(i)=1.05$(V(i)>1.05));

at the end this error will appear at output:

141 Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
143 A suffix is missing
257 Solve statement not checked because of previous errors

can you help me with this
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: loop and variables

Post by Archiver »


Hi Alireza,
When you solve an optimization problem with GAMS, the variables has more than one value (the actual value, the marginal, upper bound and lower bound), if you want to use the value of V, then you must put the corresponding suffix:

V.l
".l" =level of the variable
".up"=upper bound
".lo"=lower bound
".m"= marginal

hope this help
Best regards

2009/5/23 Alireza


hi
i want to use a loop statement for calculating a parameter from a
variable as below:

parameter Vlim;
Variable V;

...some equations about V and other variables then

loop(i,Vlim(i)=1.05$(V(i)>1.05));

at the end this error will appear at output:

141 Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
143 A suffix is missing
257 Solve statement not checked because of previous errors

can you help me with this




--
Daniel Andrés Navia López
Ingeniero Civil Químico
Mg.Sc.Ciencias de la Ingeniería, Mención Ingeniería Química
626752875

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Post Reply