## Search found 421 matches

4 days ago
Forum: Syntax
Topic: Sum of the dynamic set
Replies: 2
Views: 46

### Re: Sum of the dynamic set

Hi Sue
Could you write out examples of the equation you want in point 1. It is not clear to me.
Point 2: You could use a set defining which elements you don't want (e.g. set src(nt) /n3/; and write the equation q4(nt)\$(not src(nt)).

Cheers
Renger
4 days ago
Forum: Syntax
Topic: Sum of Rows = Sum of Columns
Replies: 5
Views: 122

### Re: Sum of Rows = Sum of Columns

Hi
The problem is that you use both i and j in two different ways: as an index for the equation and as summation index.
You need an alias:

Code: Select all

``````alias(i,ai), (j,aj);
eq6(i,j).. sum(ai, Q(ai,j)) =e= sum(aj, Q(i,aj));
``````
This resolves the confusion on what to do with "i" and "j".
Cheers
Renger
1 week ago
Forum: Modeling
Topic: Sensitivity analysis using R
Replies: 1
Views: 101

### Re: Sensitivity analysis using R

Hi
I would do all the computation in Gams, save the results in gdx and use R to do the analysis and graphs.
You can generate random numbers in Gams and use loops (for each parameter you are changing one loop).

Cheers
Renger
1 week ago
Forum: Modeling
Topic: Problem with constraint in MCP
Replies: 4
Views: 184

### Re: Problem with constraint in MCP

Hi
It would be easier if you would paste your code in your post (use the button </> so it is formatted correctly).
Cheers
Renger
1 week ago
Forum: Modeling
Topic: How do I run sensitivity Analysis for a stochastic model
Replies: 2
Views: 584

### Re: How do I run sensitivity Analysis for a stochastic model

Hi You could use a nested loop for every parameter you want to do sensitivity analysis. Assume you use P1 and P2 for this and assume they can take the following three values 0.005, 0.01, and 0.0015. set n /1*3/ Set for the number of values; parameter P1s(n) Possible values P1, P2s(n) Possible values...
1 week ago
Forum: Syntax
Topic: Storing solution
Replies: 2
Views: 162

### Re: Storing solution

Hi YOu could do as follows: alias(i,ai), (j,aj); parameter frequency(i,j,ai,aj) Frequency of solutions; frequency(i,j,ai,aj)\$(ord(i) = 1) = sum(k\$(not sameas(i,ai) and not sameas(j,aj)), report(k,i,j)*report(k,ai,aj)) ; display frequency; this gives you index = 1 3 4 1.2 1.000 3.000 2.2 4.000 2.000 ...
1 week ago
Forum: Modeling
Topic: How to write this subsets
Replies: 4
Views: 154

### Re: How to write this subsets

Hi Thanks for the clarification. I think you can use mappings. These are multidimensional sets that assign elements of one set to another set. Afterwards you can use the mappings in your equations and assignments. Take a look here mappings . set P index set of products /p1*p3 L index set of producti...
1 week ago
Forum: API
Topic: Python 3.7
Replies: 1
Views: 158

### Python 3.7

Hi I am setting up my new laptop. I have the following questions with regard to Gams-Python (Gams 30'Beta): When I try to install the Python 3.7 with "python setup.py install", in the API3.7 directory, I get the error message "Fatal error: Trying to install GAMS Python API 3.7 using Python. I have t...
1 week ago
Forum: Modeling
Topic: How to write this subsets
Replies: 4
Views: 154

### Re: How to write this subsets

Hi
Cheers
Renger
2 weeks ago
Forum: Modeling
Topic: Formulation of a constriaint equation.
Replies: 1
Views: 165

### Re: Formulation of a constriaint equation.

Hi
I assume that the problem is in the c' not equal to c. You can do this with an if condition:

Code: Select all

``````
equation eq_sum(c,s)
alias(c, cc);

eq_sum(c,sc)
....   - sum(cc\$(not sameas(cc,c), ...

``````
Cheers
Renger