GDXMRW: Problem with the import of sets with nonnumeric contents

Dear all,

I have encountered a problem when importing sets from Matlab when the names of the setmember are nonumeric (in this case /t1*t3/…).

In the attached example the sets will be imported. However, the 3-D array (as a function of theses sets) I try to import will not be. In case I comment the UELs and assign values to the set instead it work but obviously I do not get the intended set names. Can anyone help me please?


Regards


\

array.m (902 Bytes)
interfacetest3.gms (588 Bytes)

Yannic,

If you look at the GDX file (use the GAMS IDE to do this, or just dump it with gdxdump) produced by your array.m file, you’ll see that the parameter A is indexed by the labels 1, 2, 3, etc, but you declare the parameter as mETx1(i,k,j) where the labels in i, k, and j are NOT in 1, 2, 3, etc. When you $load the parameter the non-matching elements are thrown away. You might try using $loaddc instead: this results in an error if the GDX data doesn’t match the declared domain of the parameter. The load still doesn’t work, but the mismatch in data and domain results in an error, not ignored data.

The GAMS Data Utilities Models library (again, look in the GAMS IDE) contains an example showing multiple ways to load data from Matlab into a GAMS model. Have a look at gdxmrw_tr1 and gdxmrw_tr2 for two ways to load Matlab data into the transport model.

-Steve

On Mon, Nov 17, 2014 at 12:46 PM, Yannic Vaupel wrote:

Dear all,

I have encountered a problem when importing sets from Matlab when the names of the setmember are nonumeric (in this case /t1*t3/…).

In the attached example the sets will be imported. However, the 3-D array (as a function of theses sets) I try to import will not be. In case I comment the UELs and assign values to the set instead it work but obviously I do not get the intended set names. Can anyone help me please?


Regards


\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com

Dear Steve,

thank you for your help!

Adding

Ain.uels={{‘t1’,‘t2’,‘t3’},{‘A’,‘B’},{‘A’,‘B’,‘C’,‘D’}};

to the array.m file obviously did the trick.

Regards,
Yannic


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.