GAMS interfacing with Matlab

Hello,

I would like to interface GAMS with Matlab. I’ve visited the GAMS wiki and followed the instructions but I continue to get the error that “The Matlab path is not pointing to a proper GAMS system.” I have tried setting the path several times. Has anybody had this problem before? Does anyone have suggestions on how to get Matlab to point to the correct GAMS path so that it can read wgdx and rgdx and I can use it with Matlab?

Any suggestions are appreciated.

Thanks,
Anjuli

\

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.

Hello,

I’ve managed to get Matlab to point to the correct path, but now I get a new error: Found M-script rgdx.m but should have found a MEX-file. Any ideas on how to get the MEX-file, or what this means? This is rather new to me. Thanks for your help.

Anjuli


On Thu, Mar 12, 2015 at 2:05 PM, Anjuli Jain Figueroa wrote:

Hello,

I would like to interface GAMS with Matlab. I’ve visited the GAMS wiki and followed the instructions but I continue to get the error that “The Matlab path is not pointing to a proper GAMS system.” I have tried setting the path several times. Has anybody had this problem before? Does anyone have suggestions on how to get Matlab to point to the correct GAMS path so that it can read wgdx and rgdx and I can use it with Matlab?

Any suggestions are appreciated.

Thanks,
Anjuli




\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu


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.

Hello,

It seems the missing MEX file had to do with having different versions of GAMS and MATLAB. One was 32-bit, the other 64-bit. Nonetheless, now that they are both 64-bit, i still have problems. I get a “Microsoft Visual C++ Runtime error” when Matlab calls GAMS. If I run GAMS separately it works but when it is run from Matlab it gives this error. Any thoughts? I’ve also tried testing the wgdx nd rgdx per the wiki instructions, but to no success.

Thank you very much in advance.

On Thu, Mar 12, 2015 at 4:44 PM, Anjuli Jain Figueroa wrote:

Hello,

I’ve managed to get Matlab to point to the correct path, but now I get a new error: Found M-script rgdx.m but should have found a MEX-file. Any ideas on how to get the MEX-file, or what this means? This is rather new to me. Thanks for your help.

Anjuli


On Thu, Mar 12, 2015 at 2:05 PM, Anjuli Jain Figueroa wrote:

Hello,

I would like to interface GAMS with Matlab. I’ve visited the GAMS wiki and followed the instructions but I continue to get the error that “The Matlab path is not pointing to a proper GAMS system.” I have tried setting the path several times. Has anybody had this problem before? Does anyone have suggestions on how to get Matlab to point to the correct GAMS path so that it can read wgdx and rgdx and I can use it with Matlab?

Any suggestions are appreciated.

Thanks,
Anjuli




\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu



\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu


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.

Anjuli,

Instead of using the GDXMRW gams() function, you can just use Matlab’s system() function, for example like this:

rc = system ('gams myModel.gms lo=2 solver=path");

The C++ Runtime error message looks relevant to the rgdx/wgdx failures. There are some hints in the Wiki about this:

http://support.gams-software.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageinvalid_mex-file_wgdxmexw64the_specified_module_could_not_be_found

-Steve

On Thu, Mar 12, 2015 at 8:03 PM, Anjuli Jain Figueroa wrote:

Hello,

It seems the missing MEX file had to do with having different versions of GAMS and MATLAB. One was 32-bit, the other 64-bit. Nonetheless, now that they are both 64-bit, i still have problems. I get a “Microsoft Visual C++ Runtime error” when Matlab calls GAMS. If I run GAMS separately it works but when it is run from Matlab it gives this error. Any thoughts? I’ve also tried testing the wgdx nd rgdx per the wiki instructions, but to no success.

Thank you very much in advance.

On Thu, Mar 12, 2015 at 4:44 PM, Anjuli Jain Figueroa wrote:

Hello,

I’ve managed to get Matlab to point to the correct path, but now I get a new error: Found M-script rgdx.m but should have found a MEX-file. Any ideas on how to get the MEX-file, or what this means? This is rather new to me. Thanks for your help.

Anjuli


On Thu, Mar 12, 2015 at 2:05 PM, Anjuli Jain Figueroa wrote:

Hello,

I would like to interface GAMS with Matlab. I’ve visited the GAMS wiki and followed the instructions but I continue to get the error that “The Matlab path is not pointing to a proper GAMS system.” I have tried setting the path several times. Has anybody had this problem before? Does anyone have suggestions on how to get Matlab to point to the correct GAMS path so that it can read wgdx and rgdx and I can use it with Matlab?

Any suggestions are appreciated.

Thanks,
Anjuli




\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu



\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu


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 Steven,

The call you suggested from Matlab worked.
rc = system ('gams myModel.gms lo=2 solver=path")

I did have to make sure all the path and environmental variables were set correctly and that I used the latest version and same 64 bit versions for both GAMS and Matlab.

Thanks for your help.

Anjuli

On Fri, Mar 13, 2015 at 7:57 AM, Steven Dirkse wrote:

Anjuli,

Instead of using the GDXMRW gams() function, you can just use Matlab’s system() function, for example like this:

rc = system ('gams myModel.gms lo=2 solver=path");

The C++ Runtime error message looks relevant to the rgdx/wgdx failures. There are some hints in the Wiki about this:

http://support.gams-software.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#error_messageinvalid_mex-file_wgdxmexw64the_specified_module_could_not_be_found

-Steve

On Thu, Mar 12, 2015 at 8:03 PM, Anjuli Jain Figueroa wrote:

Hello,

It seems the missing MEX file had to do with having different versions of GAMS and MATLAB. One was 32-bit, the other 64-bit. Nonetheless, now that they are both 64-bit, i still have problems. I get a “Microsoft Visual C++ Runtime error” when Matlab calls GAMS. If I run GAMS separately it works but when it is run from Matlab it gives this error. Any thoughts? I’ve also tried testing the wgdx nd rgdx per the wiki instructions, but to no success.

Thank you very much in advance.

On Thu, Mar 12, 2015 at 4:44 PM, Anjuli Jain Figueroa wrote:

Hello,

I’ve managed to get Matlab to point to the correct path, but now I get a new error: Found M-script rgdx.m but should have found a MEX-file. Any ideas on how to get the MEX-file, or what this means? This is rather new to me. Thanks for your help.

Anjuli


On Thu, Mar 12, 2015 at 2:05 PM, Anjuli Jain Figueroa wrote:

Hello,

I would like to interface GAMS with Matlab. I’ve visited the GAMS wiki and followed the instructions but I continue to get the error that “The Matlab path is not pointing to a proper GAMS system.” I have tried setting the path several times. Has anybody had this problem before? Does anyone have suggestions on how to get Matlab to point to the correct GAMS path so that it can read wgdx and rgdx and I can use it with Matlab?

Any suggestions are appreciated.

Thanks,
Anjuli




\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu



\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu


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


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.



\

Anjuli Jain Figueroa, EIT

MS Technology and Policy
Massachusetts Institute of Technology
ajainf@mit.edu


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.