MATLAB and GAMS: Interfacing Optimization and Visualization Software (the GDXMRW utilities)


Authors: Michael C. Ferris (ferris@cs.wisc.edu), Steven Dirkse (sdirkse@gams.com), and Jagdish Ramakrishnan

Outline and Installation Procedure:

A link between GAMS and MATLAB is provided as part of the standard GAMS distribution. This software gives MATLAB users the ability to use all the optimization capabilities of GAMS, and allows visualization of GAMS models directly within MATLAB.

Complete installation procedures are provided in the documentation in the GAMS distribution or online at: (GDXMRW installation and documentation).

More details on troubleshooting installation and other support information can be accessed as part of the GAMS support Wiki: (Extended installation information and FAQ).

There are some tutorial videos available on Youtube Channel "GAMS Lessons":

From version 23.4 of GAMS onwards, all the Matlab/GAMS utilities (rgdx, wgdx, and gams) previously documented and made available online are fully integrated into the GAMS distribution, so no separate downloads are necessary. We recommend that you use the supported version of these utilities integrated into and documented in the GAMS distributions available for download here.



The following is for informational purposes only. The systems it describes are no longer supported, and no further help or debugging will be provided.

View this page in Romanian courtesy of azoft

Information for previous users only: deprecated versions

Older versions of this code that may work for previous versions of MATLAB and/or GAMS are documented as deprecated versions.



Simple instructions for people upgrading from previous versions

The new interface merges the read and write routines of GDXMRW and the original MATLAB/GAMS interface into one system with three routines:

Placeholders for the deprecated routines (from version 1 of GDXMRW) readgdx.m and writegdx.m are also provided but the user is encouraged to switch to the new, more efficient rgdx and wgdx routines. The routine "gams" is not backwards compatible: calls of the old form:

gams('qp', Q)

must be replaced by (for example)

sQ.name = 'Q'; sQ.val = Q; gams('qp',sQ);

(due to a change by Matlab in the mex interface). There is also a requirement for a "header" line in the GAMS file if you are using output parameters and some changes to the syntax within the GAMS file are needed.

From version 23.4 of GAMS onwards, the MATLAB facilities are provided within the GAMS distribution (download current GAMS distribution) for Windows, Mac and Linux platforms. Simpler installation procedures are provided in the documentation in the GAMS distribution or online at: (GDXMRW installation and documentation).