Posted on Categories:Operations Research, 数学代写, 运筹学

# 数学代写|运筹学代写Operations Research代考|The LINGO Modeling Language

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|运筹学代写Operations Research代考|The LINGO Modeling Language

LINGO is another popular modeling language that is featured in this book. The company that produces LINGO, LINDO Systems, also produces a widely used solver called LINDO as well as a spreadsheet solver, What’sBest. All three share a common set of solvers based on the simplex method and, in more advanced versions, on the kind of algorithmic techniques introduced in Secs. 4.9 and 7.4 as well. (We will discuss LINDO further in Sec. 4.8 and Appendix 4.1.) As mentioned earlier, the student version of LINGO is available to you through downloading from the website, www.lindo.com.

Like MPL, LINGO enables a modeler to efficiently formulate a huge linear programming model in a clear, concise way. It also can be used for a wide variety of other models.
LINGO uses sets as its fundamental building block. For example, in the Worldwide Corp. production planning problem, the sets of interest include the collections of products, plants, machines, and months. Each member of a set may have one or more attributes associated with it, such as the price of a product, the inventory capacity of a plant, the production rate of a machine, and the number of production days available in a month. These attributes provide data for the model. Some set attributes, such as production quantities and shipping quantities, can be decision variables for the model. As with MPL, the SUM operator is commonly used to write the objective function and each constraint type in a compact form. After completing the formulation, the model can be solved by selecting the Solve command from the LINGO menu or pressing the Solve button on the toolbar.

An appendix to this chapter describes LINGO further and illustrates its use on a couple of small examples. A supplement on the CD-ROM shows how LINGO can be used to formulate the model for the Worldwide Corp. production planning example. A LINGO tutorial on the CD-ROM provides the details needed for doing basic modeling with this modeling language. The LINGO formulations and solutions for the various examples in both this chapter and many other chapters also are included on the CD-ROM.

## 数学代写|运筹学代写Operations Research代考|Importing and Exporting Spreadsheet Data with LINGO

The above example was completely self-contained in the sense that all the data were directly incorporated into the LINGO formulation. In some other applications, a large body of data will be stored in some source and will need to be entered into the model from that source. One popular place for storing data is spreadsheets.

LINGO has a simple function, aOLE ( ), for retrieving and placing data from and into spreadsheets. To illustrate, let us suppose the data for our product-mix problem were originally entered into a spreadsheet as shown in Fig. A3.2. For the moment we are interested only in the shaded cells in columns A-B and E-H. The data in these cells completely describe our little product-mix example. We want to avoid retyping these data into our LINGO model. Suppose that this spreadsheet is stored in the file d:ldirfred7/wbest03i.xls. The only part of the LINGO model that needs to be changed is the DATA section as shown below.
DATA :
! Get the names of the machines;
Machine $=$ eOLE ( ‘d: \dirfred7 \wbest03i.xls’);
! Hours available on each machine;
ProdHoursAvail $=$ eOLE ( ‘d: \dirfred7\wbest03i.xls’);
! Get the names of the products;
Product $=$ aOLE ( ‘d: \dirfred7 \wbest03i.xls’);
! Profit contribution per unit;
Profit $=$ eOLE ( ‘d: \irfred7\wbest03i.xls’);
! Hours needed per unit of product;
ProdHoursUsed $=$ (aLE ( ‘d: \dirfred7 \wbest $\left.03 i \cdot x 1 s^{\prime}\right)$;
! Send the solution values back;
eOLE ( ‘d:\dirfred7 \wbest03i.xls’) = Produce;
ENDDATA

## 数学代写|运筹学代写Operations Research代考|The LINGO Modeling Language

LINGO是本书中介绍的另一种流行的建模语言。生产LINGO的公司LINDO Systems也生产一种被广泛使用的求解器LINDO，以及一种电子表格求解器What’sBest。这三者共享一组基于单纯形法的通用求解器，在更高级的版本中，基于第4.9和7.4节中介绍的算法技术。(我们将在第4.8节和附录4.1中进一步讨论LINDO。)如前所述，LINGO的学生版本可以从网站www.lindo.com下载。

LINGO使用集合作为其基本构建块。例如，在Worldwide Corp.的生产计划问题中，感兴趣的集合包括产品、工厂、机器和月份的集合。集合中的每个成员都可以有一个或多个与之相关的属性，例如产品的价格、工厂的库存容量、机器的生产率以及一个月可用的生产天数。这些属性为模型提供数据。一些集合属性，如生产数量和运输数量，可以作为模型的决策变量。与MPL一样，SUM操作符通常用于将目标函数和每个约束类型写成紧凑的形式。制定完成后，可以在LINGO菜单中选择Solve命令或按下工具栏上的Solve按钮求解模型。

## 数学代写|运筹学代写Operations Research代考|Importing and Exporting Spreadsheet Data with LINGO

LINGO有一个简单的函数aOLE()，用于从电子表格中检索和放置数据。为了说明，让我们假设我们的产品组合问题的数据最初输入到图A3.2所示的电子表格中。现在我们只对A-B和E-H列中的阴影单元格感兴趣。这些单元格中的数据完全描述了我们的小产品组合示例。我们希望避免将这些数据重新输入到LINGO模型中。假设这个电子表格存储在文件d:ldirfred7/wbest03i.xls中。LINGO模型中唯一需要更改的部分是DATA部分，如下所示。

！ 获取机器的名称;
$=$ eOLE (‘d: \dirfred7 \wbest03i.xls’);
！ 每台机器的可用小时数;
ProdHoursAvail $=$ eOLE (‘d: \dirfred7\wbest03 .xls’);
！ 获取产品名称;
Product $=$ aOLE (‘d: \dirfred7 \wbest03i.xls’);
！ 单位利润贡献率;

！ 每件产品所需工时;
ProdHoursUsed $=$ (aLE (‘d: \dirfred7 \wbest $\left.)3 I \cdot x 1 s^{\素数}\右)$;
！ 将解决方案的值发回;
eOLE (‘d:\dirfred7 \wbest03i.xls’) = Produce;
ENDDATA
aOLE()函数充当“管道承包商”。它允许数据从电子表格流到LINGO，再流回电子表格。所谓的对象链接和嵌入(OLE)是Windows操作系统的一个特性。LINGO利用这个特性在LINGO模型和电子表格之间建立了一个链接。上面对فOLE()的前五次使用说明，可以在赋值语句的右侧使用该函数从电子表格中检索数据。上面的最后一个用法说明了这个函数可以放在赋值语句的左边，将解的结果放到电子表格中。从图A3.2中注意到，最优解已被放回到电子表格的单元格E6:H6中。在电子表格中必须事先完成的一个简单但隐藏的步骤是为包含数据的各种单元格集合定义范围名称。可以在Excel中使用鼠标和“插入、名称、定义”菜单项来定义区域名称。例如，单元格集A9:A11的范围名称为Machine。类似地，单元格集E4:H4的范围名称为Product。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。