Tutorial Gams

Submitted by: Submitted by

Views: 302

Words: 9466

Pages: 38

Category: Other Topics

Date Submitted: 08/21/2011 01:28 PM

Report This Essay

A GAMS TUTORIAL

by Richard E. Rosenthal

Naval Postgraduate School Monterey, California USA

2.1. INTRODUCTION This tutorial gives an example which is an a quick but complete overview of GAMS and its features. Many references are made to the GAMS User’s Guide book, but they are only to tell you where to look for more details; the material here can be read profitably without reference to the rest of the book. The example is an instance of the transportation problem of linear programming, which has historically served as a 'laboratory animal' in the development of optimization technology. [See, for example, Dantzig (1963) .] It is good choice for illustrating the power of algebraic modeling languages like GAMS because the transportation problem, no matter how large the instance at hand, possesses a simple, exploitable algebraic structure. You will see that almost all of the statements in the GAMS input file we are about to present would remain unchanged if a much larger transportation problem were considered. In the familiar transportation problem, we are given the supplies at several plants and the demands at several markets for a single commodity, and we are given the unit costs of shipping the commodity from plants to markets. The economic question is: how much shipment should there be between each plant and each market so as to minimize total transport cost? The algebraic representation of this problem is usually presented in a format similar to the following.

Indices: i = plants j = markets Given Data: ai = supply of commodity of plant i (in cases) bj = demand for commodity at market j (cases) cij = cost per unit shipment between plant i and market j ($/case)

Decision Variables: xij = amount of commodity to ship from plant i to market j (cases), where x ij ≥ 0, for all i, j Constraints: Observe supply limit at plant i: Satisfy demand at market j: Objective Function: Minimize

j

x ij ≤ ai , for all i (cases) ≥ b j , for all j (cases)

∑x

i...