## Search found 250 matches

4 hours ago
Forum: Syntax
Topic: How to loop the matrix
Replies: 8
Views: 152

### Re: How to loop the matrix

set loopnr Loop number /1*100/;; parameter loopcount /1/; parameter results(loopnr, *,*); while((smax(heatx, bestns1(heatx)) < 10), bestns1(heatx)\$(r(heatx) ne 1)=bestns1(heatx)+1; ns1.fx(heatx)=bestns1(heatx); solve exchanger1 using minlp minimizing z1; loopcount = loopcount + 1; results(loopnr, "...
1 day ago
Forum: Syntax
Topic: How to loop the matrix
Replies: 8
Views: 152

### Re: How to loop the matrix

Hi As you don't loop over a set, it is difficult to write a parameter with all the results directly. I would do it like this: set loopnr Loop number /1*100/;; parameter loopcount /1/; parameter results(loopnr, *,*); while(... solve model loopcount = loopcount + 1; results(loopnr, "Mincl")\$(loopnr.va...
2 days ago
Forum: Syntax
Topic: How to loop the matrix
Replies: 8
Views: 152

### Re: How to loop the matrix

Hi
You should send me a model version that actually solves, or has no solution, but doesn't stop because of having negative numbers in the log function by initializing the model properly.
Or send the model that runs indefinitely
Cheers
Renger
2 days ago
Forum: Syntax
Topic: How to loop the matrix
Replies: 8
Views: 152

### Re: How to loop the matrix

Hi You have to be clear about your stopping condition: does the while loop have to stop as soon as one of the bestns1(heatx) is above 10? Or if all bestns1 are equal to 9? Let us assume it is the first stopping criterion, then you probably would change the code like this: while(smax(heatx, bestns1(h...
2 days ago
Forum: Syntax
Topic: How to store the words in a set?
Replies: 2
Views: 67

### Re: How to store the words in a set?

Hi I have the feeling that you might want to dig in the documentation on GAMS a little more (but I can be wrong). What do you mean by storing? In an excel or text file? You can just save the sets to an excel file (see the documentation on gdxxrw). You could also read those "words" from an Excel shee...
1 week ago
Forum: Solvers
Topic: fixing a non square system in CNS
Replies: 2
Views: 115

### Re: fixing a non square system in CNS

Hi If you have your equations cast in the typical Arrow-Debreu-Format with zero-profit conditions, market clearing conditions and income definitions, the only thing you can do is to map your variables to these equations (e.g. respectively production level, prices and incomes) and see if the number o...
1 week ago
Forum: Syntax
Topic: I need help with a if sentence
Replies: 1
Views: 47

### Re: I need help with a if sentence

Hi Note that you can't use variables in \$-conditions in your equations as shown in the last error "Endogenous '\$- control operations not allowed " The dimension error is caused by FM2_2.L>0. Here you forgot to add the dimensions of FM2_2, but again, endogenous \$-control operations are not allowed. Y...
2 weeks ago
Forum: Syntax
Topic: GAMS CPU time
Replies: 4
Views: 113

### Re: GAMS CPU time

Hi Luca

There is an option "profile" to have a closer look at the time used by Gams. You can find more information Profile option and here McCarl.

Hope this helps
Cheers
Renger
2 weeks ago
Forum: Syntax
Topic: Error: Real number expected
Replies: 2
Views: 182

### Re: Error: Real number expected

Hi

I assume that you use the options in your model file and not in a separate opt-file.
You should then write these options like:

mymodel.optcr = option_relativeGap;

where mymodel is the model name of the model you are trying to solve.

Hope this helps;
Cheers
Renger
2 weeks ago
Forum: Tools
Topic: Gams and eigenvectors
Replies: 2
Views: 113

### Re: Gams and eigenvectors

Hi Luca The definition of an eigenvector is Ax = lx, where A is the matrix for which you want to know the eigenvectors and eigenvalues. So it makes sense to have the eigenvectors in the columns. evec gives you all the eigenvectors as columns. You can check it out yourself by using the example from e...