科学软件网提供软件和培训服务已有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
欢迎来到北京天演融智软件有限公司网站, 具体地址是北京市海淀区北京市海淀区上地东路35号院1号楼3层1-312-318、1-312-319,老板是赵亚君。
主要经营北京天演融智软件有限公司(科学软件网)主营产品PSCAD, CYME, SPSSPRO, Stata, Matlab,GAMS,Hydrus,GMS,Visual Modflow 等各学科软件,科学软件网有20多年的软件销售经验,提供专业销售和培训服务,还有更多的增值服务。目前,科学软件网提供的软件有数百种,软件涵盖的领域包括,经管,仿真,地球地理,生物化学,工程科学,排版及网络管理等各个学科。。
单位注册资金单位注册资金人民币 1000 - 5000 万元。
我们的产品优等,服务优质,您将会为选择我们而感到放心,我们将会为得到您认可而感到骄傲。