Loading...
Searching...
No Matches
GAMS Transfer Matlab

Introduction

GAMS Transfer is a package to maintain GAMS data outside a GAMS script in a programming language like Python or Matlab. It allows the user to add GAMS symbols (Sets, Parameters, Variables and Equations), to manipulate GAMS symbols, read symbols from a GDX file or write them to one. While keeping those operations as simple as possible for the user, GAMS Transfer's main focus is the highly efficient transfer of data between GAMS and the target programming language. In order to achieve this, symbol records – the actual and potentially large-scale data sets – are stored in native data structures of the corresponding programming languages, e.g., dataframes, tables or (sparse) matrices. The benefits of this approach are threefold:

  • The user is usually very familiar with these data structures.
  • These data structures come with a large tool box for various data operations.
  • Optimized methods for reading from and writing to GDX can transfer the data as a bulk –- resulting in the high performance of this package.

Using GAMS Transfer Matlab or ...?

...GAMS Matlab API?

Both, the GAMS Matlab API and GAMS Transfer Matlab allow to exchange data from Matlab with GAMS. However, GAMS Transfer Matlab focuses on data exchange and for this is much more efficient. Moreover, it offers a richer set of features to read and write GDX files. On the contrary, the GAMS Matlab API can manage GAMS jobs which GAMS Transfer Matlab cannot do. In summary, if you are only using the GAMS Matlab API for data exchange, consider using GAMS Transfer Matlab instead.

...GDXMRW?

GDXMRW has been deprecated since GAMS 38 and may be removed in a future GAMS release. Please migrate to GAMS Transfer Matlab instead. While the purpose of these two is similar, GAMS Transfer Matlab offers more features, a more user-friendly interface and is actively maintained.

Using the GAMS Transfer Matlab Documentation

If you are new to GAMS Transfer Matlab, have a look at Getting Started. This section explains how to install GAMS Transfer Matlab and shows a first exmaple that covers the most important operations. It's a good starting point to discover GAMS Transfer Matlab. For more details, refer to the manual for: (1) Container, (2) Symbols and (3) Records. Good advice: Read the documentation in this order as it will guide you from more general topics like Container to more detailed topics like Records Format. Note that at the bottom of each of the three, you can find a list of GAMS Transfer Matlab classes that belong to the corresponding topic. Those class documentations document each method and property of the classes and give a good overview of what the class is capable of. Finally, once installed, it is also possible to get help from within Matlab. Simply run:

help GAMSTransfer