使用期限永久
许可形式单机和网络版
原产地美国
介质下载
适用平台windows,linux
科学软件网是一个以引进国研软件,提供软件服务的营业网站,网站由北京天演融智软件有限公司创办,旨在为国内高校、科研院所和以研发为主的企业事业单位提供的科研软件及相关软件服务。截止目前,科学软件网已经取得数百家国际软件公司达成合作,代理销售科研软件达一千余种,软件涵盖领域包括经管,仿真,地球地理,生物化学,工程科学,排版及网络管理等。同时,还提供培训、课程(包含40款软件,80门课程)、实验室解决方案和项目咨询等服务。
A GAMS Tutorial by Richard E. Rosenthal
1 Introduction
The introductory part of this book ends with a detailed example of the use of GAMS for formulating, solving, and analyzing
a small and simple optimization problem. Richard E. Rosenthal of the Naval Postgraduate School in Monterey, California
wrote it. The example is a quick but complete overview of GAMS and its features. Many references are made to other parts
of the 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) 1. ] It is a 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
These results indicate, for example, that it is optimal to send nothing from Seattle to Topeka, but if you insist on sending one
case it will add .036 $K (or $36.00) to the optimal cost. (Can you prove that this figure is correct from the optimal shipments
and the given data?)
Introduction
1 Motivation
Substantial progress was made in the 1950s and 1960s with the development of algorithms and computer codes to solve
large mathematical programming problems. The number of applications of these tools in the 1970s was less then expected,
however, because the solution procedures formed only a small part of the overall modeling effort. A large part of the time
required to develop a model involved data preparation and transformation and report preparation. Each model required many
hours of analyst and programming time to organize the data and write the programs that would transform the data into the
form required by the mathematical programming optimizers. Furthermore, it was difficult to detect and eliminate errors
because the programs that performed the data operations were only accessible to the specialist who wrote them and not to the
analysts in charge of the project.
1. A GAMS model is a collection of statements in the GAMS Language. The only rule governing the ordering of
statements is that an entity of the model cannot be referenced before it is declared to exist.
2. GAMS statements may be laid out typographically in almost any style that is appealing to the user. Multiple lines per
statement, embedded blank lines, and multiple statements per line are allowed. You will get a good idea of what is
allowed from the examples in this tutorial, but precise rules of the road are given in the next Chapter.
3. When you are a beginning GAMS user, you should terminate every statement with a semicolon, as in our examples.
The GAMS compiler does not distinguish between upper-and lowercase letters, so you are free to use either.
4. Documentation is crucial to the usefulness of mathematical models. It is more useful (and most likely to be accurate)
if it is embedded within the model itself rather than written up separately. There are at least two ways to insert
documentation within a GAMS model. First, any line that starts with an asterisk in column 1 is disregarded as a
comment line by the GAMS compiler. Second, perhaps more important, documentary text can be inserted within
specific GAMS statements. All the lowercase words in the transportation model are examples of the second form of
documentation.
5. As you can see from the list of input components above, the creation of GAMS entities involves two steps: a declaration
and an assignment or definition. Declaration means declaring the existence of something and giving it a name.
Assignment or definition means giving something a specific value or form. In the case of equations, you must make the
declaration and definition in separate GAMS statements. For all other GAMS entities, however, you have the option of
making declarations and assignments in the same statement or separately.
6. The names
科学软件网为全国大多数高校提供过产品或服务,销售和售后团队,确保您售后无忧!
http://www.kxrjsoft.com.cn