Hi, everyone.

I want to express the row of a set in my code.for example, I get a multi-dimension set and I hope to write the row of the set.

I want to write the red part.

thank you so much

Hi

Use the same logic for i and k for b(j,i,k):

```
b(j,i,k)$(ord(i) ne ord(k) .....)
```

Cheers

Renger

Hi,

Thank you so much for your help.

Maybe a misunderstand existing in my text, I try it as your advice, the correct answer is b(j,i,k)$(ord(i) = ord(k))=no;it can realize my target.

Due to I am a beginner and no experience in GAMS, I have other questions in my study.

How can realize the following aim.

3.png

As a previous statement. I have declared the node and its parentnode and now I do not know how to control the sign ‘B’ in a general form or how to declare it.

Thanks again.

regards

Hi, everyone.

The last email maybe has an error and I want to realize the following aim. But no idea in my mind.

,

how can I control the sign B.

thanks again.

Hi,

Now I have a question about the row of sets.

I get a set-a like fig11, now I need to use the result of set a and set b, but how can I express the row of a and b?

I try it like fig14 but it is wrong, could you help me?

thanks.

Hi

From your question, it is not clear for me what you are trying to do. Please submit the code that produces the error and write what you want to achieve with your equation that produces an error.

Cheers

Renger

Hi Renger,

Thank you for your reply.

in my case, I want to express the relationship between the node and its parent nodes.

In previous work, I have got the matrix like fig 1.now I need to write the constraint between the node and its parent nodes, for example, in fig 1, I want to give the constraint of j and the element of j is {a,b,c,d,e}, and its parent node is B ,

its element is {a.b a.c a.d a.e b.c b.d b.e c.d c.e…}, I want to write the general constraint.

now I put B as a set, so when I express B, the error is listed as the attachments.

regards

Hi

Your equation should read

```
cons10(j,n)..
a0(j,n) =G= 0;
```

Note, that you always should correct the first error that appears in your code and don’t pay too much attention to the errors that follow as they are often caused by the first error. In your case, equation eqt is missing the “…”.

Furthermore, it is easer for the person who wants to help you to provide the code that causes the error (instead of including screenshots). You can either attach a file or put the code in a code block (the </> symbol in the editor.

Cheers

Renger

Hi Renger,

Thank you for your reply.

I try to modify the code as your advice, but the errors still exist.

You have the same kind of problem in equation eqt: you use a lot of indices on the RHS, but z has no indices, nor has the equation itself. You should have the same number of dimensions/indices on both sides and in the equation name.

Examples

```
Eq1(j) z(j) =e= a(j)*f;
```

```
Eq2.. p =e= sum(j, b(j));
```

```
Eq3.. t =e= h("1");
```

Cheers

Renger

Hi,Renger.

Thanks so much for your advice.

I have solved the problem of the equation. but now another problem exists in my case.

I want to write a multi-dimension set element is greater than 0, the set is got from the mapping between the set.

regards.

Hello, everyone.

Too many errors appear in my code.

I have to ask for advice.

j is set and belongs to b and c, and b and c is multi-dimension sets.

could you help me? I have a really difficulty for this problem.

thank you.