## Search found 272 matches

1 day ago
Forum: Tools
Topic: 3 question about documentation code
Replies: 1
Views: 44

### Re: 3 question about documentation code

Hi
The extension "py" stands for a script in Python (see the documentation on using Python in Gams code).
You can use macros, but they are not as powerful as using python code.
Cheers
Renger
3 days ago
Forum: Modeling
Topic: Need Help with constraint for a Facility Location model
Replies: 1
Views: 40

### Re: Need Help with constraint for a Facility Location model

Hi ToSan

THis would probably be the constraint you are looking for:

Code: Select all

``````OnlyOneI(i)..
sum(s, akt(i,s)) =l= 1;
``````
At every i there can only be one or zero plants.

Cheers
Renger
3 days ago
Forum: Syntax
Topic: Equations Defined over the Domain of Dynamic Sets
Replies: 2
Views: 40

### Re: Equations Defined over the Domain of Dynamic Sets

Hi In equation 5 you defined your equation over c(nd,nd): these are only the diagonal elements (which are not part of the mapping). Use c(nd,nf) and the equation appears. This is probably due to the confusion resulting from the definition of a parameter, set, variable over a double index of the same...
4 days ago
Forum: Syntax
Topic: Help with gams, gdx and xlsx
Replies: 6
Views: 93

### Re: Help with gams, gdx and xlsx

Hi Jarenka Why don't you add rdim=5 cdim=1 to your call to read this data? Otherwise, reformulate your question and attach code and the excel sheet. Cheers Renger PS. This is a new question, so better start always a new topic. If you add a reaction to an existing topic, it will not be shown under th...
6 days ago
Forum: Syntax
Topic: Conditionalize Variable Attribute
Replies: 2
Views: 77

### Re: Conditionalize Variable Attribute

Hi Leo You could try working with a subset: set r region /GER,FRA/; set ra(r) /GER,FRA/; variable INVE(*,r); if( INVE.UP("windOn","FRA")\$card(ra) >1) =50; ); display INVE.UP; In your model code, you probably have to define the equations over the main set r and put a \$ra(r) behind the equations. Hope...
1 week ago
Forum: API
Topic: gams_job.interrupt() does not work in Python 3.6
Replies: 3
Views: 252

### Re: gams_job.interrupt() does not work in Python 3.6

Hi

Take a look at this topic: viewtopic.php?f=10&t=10592&p=25161#p25161.
Test the footnote first!
Hope this helps
CHeers
Renger
1 month ago
Forum: Solvers
Topic: the solver found no feasible solution
Replies: 1
Views: 229

### Re: the solver found no feasible solution

Hi
I don't think the model will only solve with DICOPT. Either your model is not correct or the description is not correct.
You could ask the authors for the code.
Cheers
Renger
1 month ago
Forum: Syntax
Topic: Bad dimension error when using gdxxrw
Replies: 3
Views: 184

### Re: Bad dimension error when using gdxxrw

Hi Sarah
It looks like you haven't defined AC yet. If I define the parameter PARAMETER ZIMSAM2(*, *) instead of PARAMETER ZIMSAM2(AC,ACP), the import runs fine.
Did you define/import AC before you want to import ZIMSAM2?
Hope this helps
Cheers
Renger
1 month ago
Forum: Modeling
Topic: How to use loop to run model several times when some random data is being imported from excel.
Replies: 2
Views: 151

### Re: How to use loop to run model several times when some random data is being imported from excel.

Hi If you want, for example, loop over 10 sets of random data, you could define your data indexed over your loop and read all of them before the loop. set iteration /1*10/, sectors /s1*s20/; parameter randSectors(sectors, iteration) Random data for sectors; ** Pseudo code * Read your data from Excel...
3 months ago
Forum: API
Topic: Python Embedded in Gams - Import Python Package
Replies: 13
Views: 2699

### Re: Python Embedded in Gams - Import Python Package

Hi Clemens Here are my steps on my Windows machine to get the embedded code working with: Install the python distribution of your liking (as long as it is version 3.6.x; not one of the versions 3.7 or 3.5) Adjust your path by adding the path to the python3.dll (in my case: C:\Python36\python-3.6.8.a...