MGE2GP - Converts MPSGE Models to GEMPACK

MPSGE is a non-algebraic language for the formulation of applied general equilibrium models. MPSGE representations of models are very compact. One of the aims of MPSGE is to allow rapid prototyping of models. The MPSGE language was developed by Tom Rutherford. MPSGE stands for Mathematical Programming System for General Equilibrium modeling.

MGE2GP is a program which you can use to convert MPSGE models to GEMPACK. You can write down your model in MPSGE format, then run the program MGE2GP to convert your model to GEMPACK TAB and Command files. You can then carry out simulations with your model using the GEMPACK windows programs.

The program MGE2GP and the syntax of MPSGE models are documented in the paper:

"Solving MPSGE Models Using GEMPACK"

by Laurent Cretegny, Mark Horridge, Ken Pearson and Thomas Rutherford.

This paper is a detailed user guide for this program MGE2GP. You can download this paper (see below).

Current Version of MGE2GP

This is Version 1.1 (July 2004).

The software and example models available from this site were last updated on 14 July 2004.

Changes Since Last Version

Since version 1 (June 2004),

Download the program MGE2GP

Download the file MGE2GP.ZIP (340K) and put it into the directory in which you have installed GEMPACK (or into some other directory on your PATH). Unzip the program MGE2GP.EXE from this zip file. This is the program you use to convert MPSGE models in .MGE files to GEMPACK.

Download the documentation for MGE2GP

Download the PDF file MGE2GP.PDF (510K) and put it into a suitable new directory - perhaps C:\MGE2GP .

This document

To read this document you will need to download the Adobe Acrobat Reader (which is available at no cost) if you do not already have it.

Download the example models

Download the file GPMGEEX1.ZIP (25K) and put it into the directory in which you put the MGE2GP documentation. Unzip the different files from this zip file. You will see various .MGE, .HAR and .CMF files. [For example, SJMGE.MGE, SJMGE.HAR and SJMGE.CMF for the SJMGE model.] See sections 2,4 and 5 of the associated documentation for details about these models.

Download the files for the MINIMAL model

Download the file MINLMGE.ZIP (35K) and download the file MINIMAL-MGE.ZIP (10K). These are the files for the MINIMAL model (see section 6.1 of the associated documentation). Put these files into the directory in which you put the MGE2GP documentation. Unzip the different files from this zip file. You will see various .MGE, .HAR, .TAB and .CMF files. You can work through section 6.1 of the associated documentation with these files.

Download GAMS versions of the example models

Download the file GPMGEGM1.ZIP (25K) and put it into the directory in which you put the MGE2GP documentation and example models. Unzip the different files from this zip file. You will see various .GMS and .GDX files. [For example, SJMGE.GMS and SJMGE.GDX for the SJMGE model.] If you have GAMS available, you can use these files to solve the example models via GAMS/MPSGE. [For example, use the command "gams sjmge" to solve the SJMGE model.]

Note that the .GDX files contain the data for these models in GDX format. The .HAR files for the example models (as supplied in GPMGEEX1.ZIP - see above) were produced using the tool GDX2HAR from these .GDX files.

Which versions of GEMPACK can you use with MGE2GP?

You need Release 8, or later, of GEMPACK.

You can use either a Source-Code Version, an Executable-Image Version or the Demonstration Version of GEMPACK.

If you don't have any version of GEMPACK, you can download and install the Demonstration Version of GEMPACK. With this version you can solve several of the example models supplied with MGE2GP. [Section 1.2 of the MGE2GP documentation (see above) gives details.]

If you have a Source-Code Version of GEMPACK you will probably need to install bug fixes before working with the TAB files produced by MGE2GP. See the "Fixes" section later in this page.

If you have an Executable-Image Version of GEMPACK and you want to work with MGE2GP, you will probably need to obtain a new version of TABLO.EXE. Please contact Ken Pearson about this.

The program MGE2GP supplied on this web page only runs on Windows PCs. If you want to use it on other machines (eg Unix machines) with GEMPACK, please contact Ken Pearson.

Fixes for the TABLO "NOT" Bug

If you have a Source-code Version or an Executable-Image Version of GEMPACK which is prior to Release 8.0-005 (June 2004), you will need to install TABLO bug fixes, as described below, in order to successfully work with the TABLO Input files produced by the program MGE2GP.

Source code archive

An archive of source code and examples used to develop MGE2GP may be found here.