使用期限*
许可形式单机和网络版
原产地美国
介质下载
适用平台windows,linux
科学软件网提供软件和培训服务已有19年,拥有丰富的经验,提供软件产品上千款,涵盖领域包括经管,仿真,地球地理,生物化学,工程科学,排版及网络管理等。同时还有的服务,现场培训+课程,以及本地化服务。
Data Entry by Tables
Optimization practitioners have noticed for some time that many of the input data for a large model are derived from relatively
small tables of numbers. Thus, it is very useful to have the table format for data entry. An example of a two-dimensional
table (or matrix) is provided in the transportation model:
Table d(i,j) distance in thousands of miles
new-york chicago topeka
seattle 2.5 1.7 1.8
san-diego 2.5 1.8 1.4 ;

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?)

Here are some points to remember.
• The power to create multiple equations with a single GAMS statement is controlled by the domain. For example, the
definition for the demand constraint will result in the creation of one constraint for each element of the domain j, as
shown in the following excerpt from the GAMS output.
DEMAND(new-york)..X(seattle,new-york) + X(san-diego,new-york)=G=325 ;
DEMAND(chicago).. X(seattle,chicago) + X(san-diego,chicago) =G=300 ;
DEMAND(topeka).. X(seattle,topeka) + X(san-diego,topeka) =G=275 ;
• The key idea here is that the definition of the demand constraints is exactly the same whether we are solving the
toy-sized example above or a 20,000-node real-world problem. In either case, the user enters one generic equation
algebraically, and GAMS creates the specific equations that are appropriate for the model instance at hand. (Using
some other optimization packages, something like the extract above would be part of the input, not the output.)
• In many real-world problems, some of the members of an equation domain need to be omitted or differentiated from the
pattern of the others because of an exception of some kind. GAMS can readily accommodate this loss of structure using
a powerful feature known as the dollar or 'such-that' operator, which is not illustrated here. The domain restriction
feature can be absolutely essential for keeping the size of a real-world model within the range of solvability.

A scalar is regarded as a parameter that has no domain. It can be declared and assigned with a Scalar statement
containing a degenerate list of only one value, as in the following statement from the transportation model.
Scalar f freight in dollars per case per thousand miles /90/;
If a parameter's domain has two or more dimensions, it can still have its values entered by the list format. This is very useful
for entering arrays that are sparse (having few non-zeros) and super-sparse (having few distinct non-zeros).
科学软件网不定期举办各类公益培训和讲座,让您有更多机会免费学习和熟悉软件。
http://turntech8843.b2b168.com