Search found 112 matches

by Renger
5 days ago
Forum: Modeling
Topic: logical errors for an economic model
Replies: 2
Views: 33

Re: logical errors for an economic model

[*]Hi Rodrigue If you use a benchmard data set, you should be able to reproduce this running your economic model. This is how you can debug your model: If you inititalize all your variables with the benchmark data (e.g. prices equal to 1, activitiy levels to 1, INCOME.L = SAM('LAB', 'HH') + SAM('CAP...
by Renger
1 month ago
Forum: Modeling
Topic: Objective Function with Domain
Replies: 2
Views: 243

Re: Objective Function with Domain

Hi
Just use a loop

loop(s,

solve mymodel using nlp maximizing OBJ;

results("OBJ",s) = OBJ.L;

);

display results;

Cheers
Renger
by Renger
2 months ago
Forum: Syntax
Topic: Error for constraint of sets
Replies: 3
Views: 246

Re: Error for constraint of sets

Show your objektive function...
by Renger
2 months ago
Forum: Syntax
Topic: Error for constraint of sets
Replies: 3
Views: 246

Re: Error for constraint of sets

Hi Urise This is not correct for several reasons and it is not clear to me what you want to achieve. Even if you would model it like this: set m /1*4/, n(m) /1*3/; notequalm(m,n) .. ord(m) - ord(n) =g= 1; nothing happens in the rest of your model. If you would have another equation eq1(m).. a(m) + b...
by Renger
2 months ago
Forum: Syntax
Topic: ERROR 125 existing
Replies: 3
Views: 263

Re: ERROR 125 existing

Hi Kenhoe

GAMS points you to the place where the error appears and you should only check the first error because the other errors are usually caused by the first error.

It is not K (emissions(K)), but

equations
emissions(k);

emissions(k)..
....

Cheers
Renger
by Renger
2 months ago
Forum: Syntax
Topic: ERROR 125 existing
Replies: 3
Views: 263

Re: ERROR 125 existing

Hi In your equation you have: EMISSION(J,K)$(ord(K) GT 1).. sum(J,f(J,K))=l=PDATA(K,'N'); Note, however, that your equation is defined over J and K and then you try to use J again for summing. THis won't work (how will GAMS keep track of which j to use for the equation itself and the sum?). The equa...
by Renger
2 months ago
Forum: Modeling
Topic: Division by zero error
Replies: 3
Views: 327

Re: Division by zero error

Hi Gams points you to the line 326: tx_o(i) = tax("tx_o",i)/(o0(i)) ; It therefore looks like you have a o0(i) that is for one or more i zero. I added the following code to find the zero values o0(i) = o0(i) + EPS; display i, o0; (I added EPS, as GAMS doesn't report 0. EPS is a very small value). An...
by Renger
2 months ago
Forum: Modeling
Topic: How to get Coefficient matrix or technology matrix
Replies: 2
Views: 280

Re: How to get Coefficient matrix or technology matrix

Hi
You should be more specific (at least post an example of a model), so people can help you.
Cheers
Renger
by Renger
2 months ago
Forum: Syntax
Topic: Assign Values to variables
Replies: 3
Views: 345

Re: Assign Values to variables

Hi Max

If you want to fix the starting point, you just write

Code: Select all

T_ti.FX("0") = 27; 
If you want to give it a starting point for the solver (GAMS assumes 0 if you don't do that):

Code: Select all

T_ti.L("0") = 27; 
Cheers
Renger
by Renger
2 months ago
Forum: Modeling
Topic: Division by zero error
Replies: 3
Views: 327

Re: Division by zero error

Hi You can add files: see below the window where you write your question. There is an "Attachment"-Tab. Furthermore, if you do post code, put it between code tags (the </> symbol will insert those tags on top of the writing window), so the format is saved. Cheers Renger PS. The administrator is usua...