Hi,
I would like a variable T to be defined in such a way that it takes the following values : T(1) to T(10)
The thing is, my problem requires using two sets in a specific way :
Is it possible to use sets B (1 to 4) and C (1 to 3) so that I can write something like T( B+3*(C1) ) and finally have T(1) to T(10) ?
If it is possible, I don't know how I would have to define my variable T and the associated set T(?) ?
If not, is there another trick that could be useful ?
Thank for the help !
Sim
Is it possible to use sets and variables this way ?

 User
 Posts: 96
 Joined: 1 year ago
Re: Is it possible to use sets and variables this way ?
hmm. I didn't really understand how the requirement arose, but,just in case:
you are aware of this notation, right ?
you are aware of this notation, right ?
Code: Select all
set setForT /1*10/;
variable T(setForT);
Re: Is it possible to use sets and variables this way ?
Yes I know this one.
The requirement comes from a discretization method called "orthogonal collocation on finite elements".
I have E elements in time and N collocation points in each element. The problem is at the bounds between elements. I could write my variables this way : T(E,N).
But There would be redundant variables and equations at each bounds.
Thus, I try to write it in another way to reduce the global size of my problem.
Sim
The requirement comes from a discretization method called "orthogonal collocation on finite elements".
I have E elements in time and N collocation points in each element. The problem is at the bounds between elements. I could write my variables this way : T(E,N).
But There would be redundant variables and equations at each bounds.
Thus, I try to write it in another way to reduce the global size of my problem.
Sim