## Making parameter as index

Problems with syntax of GAMS
clar.tn
User
Posts: 2
Joined: 4 weeks ago

### Making parameter as index

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))?

Renger
Posts: 550
Joined: 3 years ago

### Re: Making parameter as index

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
Posts: 2
Joined: 4 weeks ago

### Re: Making parameter as index

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 weeks 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