Search found 3 matches

by Sajjad.gh
7 months ago
Forum: Syntax
Topic: problem in using ord
Replies: 1
Views: 7206

problem in using ord

i tried to save i th term of a parameter in a scalar but gams says Uncontrolled set entered as constant. can anybody help me? here is my code sets i /1*3/ j/1*3/; scalar counter /1/ a /0/ b /0/; parameters dinf(i) /1*3 0/ ; a= dinf(i)$(ord(i) = counter); display a
by Sajjad.gh
7 months ago
Forum: Modeling
Topic: define new equation in each loop iteration
Replies: 3
Views: 11706

Re: define new equation in each loop iteration

Look at a TSP example (https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_tsp1.html) in the GAMS model library where a sub-tour elimination constraint gets added in every iteration. You will need to overestimate the number of iterations (cc) and use a loop though. Good luck. -Michael This code ...
by Sajjad.gh
7 months ago
Forum: Modeling
Topic: define new equation in each loop iteration
Replies: 3
Views: 11706

define new equation in each loop iteration

Hi
I have a model that should add new constrain to last constrains in each loop iteration. also the number of loop iterations is unknown so it's a while loop. how can i handle it in GAMS?