Search found 639 matches

by Renger
6 years ago
Forum: Solvers
Topic: Gams to excel
Replies: 2
Views: 3454

Re: Gams to excel

Hi

There is no way, as far as I know, to send your model to the Excel solver. The only thing you can do is send the data from Gams to Excel by using gdxxrw.

Cheers
Renger
by Renger
6 years ago
Forum: Syntax
Topic: gams programming problem
Replies: 2
Views: 3113

Re: gams programming problem

Hi You should loop over num1 and then over subs to get your code running. dspt should then be defined as dspt(num1): parameter dspt distillation point ; loop(num1, loop(subs, if(Data(num1,subs)=0 and Data(num1,subs+1)=0 , dspt(num1)=ord(subs) ; elseif(Data(num1,subs)=0 and Data(num1,subs+1)>0)and or...
by Renger
6 years ago
Forum: Syntax
Topic: Domain filtering
Replies: 3
Views: 3903

Re: Domain filtering

Hi Yamaz

See my reply in this post from last week: viewtopic.php?f=2&t=10156#p23277

Cheers
Renger
by Renger
6 years ago
Forum: Syntax
Topic: Error 170 Domain violation for element
Replies: 1
Views: 7859

Re: Error 170 Domain violation for element

Hi
Just write k-1 without the quotation marks. Note that you have to start at the second element of k, so you can add a $-restriction on the function:
function(i,j,k)$(ord(k) > 1) .. x(i,j,k-1) - x(i,j,k) =l= s(i,j,k)
Cheers
Renger
by Renger
6 years ago
Forum: Modeling
Topic: A change in endogenous variables in general equilibrium
Replies: 4
Views: 5315

Re: A change in endogenous variables in general equilibrium

Hi Veronna No, this is not the way: you can easily change parameters in the model and rerun the model. If you fix a variable, you, in fact, drop the equation from the model, and this is not what you want (you want that even with the fixed variable, the complementary equation should be fine). If you ...
by Renger
6 years ago
Forum: Modeling
Topic: A change in endogenous variables in general equilibrium
Replies: 4
Views: 5315

Re: A change in endogenous variables in general equilibrium

Hi You are on the right track. First, run the benchmark that replicates your data (usually, all prices are equal to 1). This is also a good test to see if you have errors in the model). Then do a counterfactual and compare the results. parameter results(*,i) Results for the sectors * PD0 is the benc...
by Renger
6 years ago
Forum: Syntax
Topic: Error 70 The dimensions of the equ.var pair do not conform
Replies: 3
Views: 5465

Re: Error 70 The dimensions of the equ.var pair do not conform

Hi Veronna It looks like you "coupled" the equations with the wrong variables because the dimension of the variable doesn't match the dimension of the equation. You should, therefore, check the dimension of the variable-equation pair. You could let the solver match all the variables to the...
by Renger
6 years ago
Forum: Modeling
Topic: Recalculating parameters based on model solution
Replies: 1
Views: 2606

Re: Recalculating parameters based on model solution

Hi This can be done in a loop (or a while loop, if you have a specific convergence criterium) Assuming that parameter a is a model parameter and AVAR is the solution of the model parameter apar; variable AVAR; set iterations iter /1*100/ loop(iter, solve yourmodel; apar = AVAR.L; ); Cheers Renger
by Renger
6 years ago
Forum: Syntax
Topic: Equation based on set number
Replies: 2
Views: 3074

Re: Equation based on set number

Hi This is not a problem for Gams. For i = 2, it writes the equation as Z1(i).. X_V_ce("2") =e= 0; If you want another formulation for this case, you could use the cardinality of set i (the number of elements): Z1(i).. X_V_ce(i) =e= X_V_ce(i+1)$(ord(i) ne card(i) + (.....)$(ord(i) eq card(...
by Renger
6 years ago
Forum: Syntax
Topic: Excel to gams
Replies: 2
Views: 3210

Re: Excel to gams

Hi Mayhar You use rdim=1 cdim=1 which implies a dimension of 2, but you define a as a(i), which has a dimension of 1 (i). So either you keep a(i) and write (note that I start at a2): parameter a(i) beginning of interval for jobs $call 'GDXXRW.exe indata1.xlsx par=a rng=Interval!a2 rdim=1 trace = 3' ...