Making parameter as index

Problems with syntax of GAMS
Post Reply
clar.tn
User
User
Posts: 2
Joined: 4 years ago

Making parameter as index

Post by clar.tn »

Hello,

so I have a parameter a(i) that is used in equations to find a variable b(i) and I want to make a table with datas from a(i) and b(i).
Is there a way to make for example a table called D(a(i), b(i))?
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Making parameter as index

Post by Renger »

Hi

I suppose you want the results as a table, then:

Code: Select all

parameter results(i,*) Results table;

results(i,"a") = A.L(i);
results(i,"b") = B.L(i);
display results;
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
clar.tn
User
User
Posts: 2
Joined: 4 years ago

Re: Making parameter as index

Post by clar.tn »

Hi Renger,

thanks! But what I'm trying to make is actually a table like a diagram with both axis that is a parameter or variable instead of set. Is there a way to make for example when a(1) is 0.1 then b(1) is 24, and when a(2) is 0.5 then b(2) is 28 in a table/diagram? (a is the x-axis and b is the y-axis) maybe like a function of b(a(i))?
Renger wrote: 4 years ago Hi

I suppose you want the results as a table, then:

Code: Select all

parameter results(i,*) Results table;

results(i,"a") = A.L(i);
results(i,"b") = B.L(i);
display results;
Cheers
Renger
Post Reply