Search found 639 matches
- 5 years ago
- Forum: Syntax
- Topic: How to loop the matrix
- Replies: 14
- Views: 8435
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")$...
- 5 years ago
- Forum: Syntax
- Topic: How to loop the matrix
- Replies: 14
- Views: 8435
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
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
- 5 years ago
- Forum: Syntax
- Topic: How to loop the matrix
- Replies: 14
- Views: 8435
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...
- 5 years ago
- Forum: Syntax
- Topic: How to store the words in a set?
- Replies: 2
- Views: 2490
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 ...
- 5 years ago
- Forum: Solvers
- Topic: fixing a non square system in CNS
- Replies: 2
- Views: 3648
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...
- 5 years ago
- Forum: Syntax
- Topic: I need help with a if sentence
- Replies: 1
- Views: 2070
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 ...
- 5 years ago
- Forum: Syntax
- Topic: GAMS CPU time
- Replies: 4
- Views: 4142
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
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
- 5 years ago
- Forum: Syntax
- Topic: Error: Real number expected
- Replies: 2
- Views: 4637
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
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
- 5 years ago
- Forum: Tools
- Topic: Gams and eigenvectors
- Replies: 2
- Views: 3268
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...
- 5 years ago
- Forum: Modeling
- Topic: Shock in Loop cause domain errors
- Replies: 3
- Views: 3187
Re: Shock in Loop cause domain errors
Hi Qiaomin
Two links that might be of help: Cheers
Renger
Two links that might be of help: Cheers
Renger