excel solver(规划求解) 的用法及例子

Solve Linear Programming Problems

Check that Solver is installed Open Excel Click on the ‘tools’ menu If Solver is listed, then go to Formulation. Otherwise, Solver needs to be installed, as follows: Again under ‘tools’ click ‘Add-ins..’. The window that appears lists the available add-ins, Click the box next to Solver so that it contains a tick, click ok. Solver should now appear under the ‘tools’ menu

Formulation

Whenever we formulate a worksheet model of a linear program, we perform the following steps (Par. problem as an example, see appendix):

Step 1: Enter the data in the worksheet

Cells B7:C10 show the production requirements per unit for each product. Cells B5:C5 show the profit contributions per unit for the two products. Cells F7:F10 show the number of hours available in each department. Step 2: Specify cell locations for the decision variables Cells B4:C4.

Step 3: Select a cell and enter a formulation for computing the objective value function. Cell D5: =B4*B5+C4*C5 or SUMPRODUCT($B$4:$C$4,$B5:$C5)

Step 4: Select a cell and enter a formulation for computing the left-hand side of each constraint. Cell D7:=B4*B7+C4*C7 or SUMPRODUCT($B$4:$C$4,$B7:$C7) (copy from Cell D5) Cell D8:=B4*B8+C4*C8 or SUMPRODUCT($B$4:$C$4,$B8:$C8) (copy from Cell D5) Cell D9:=B4*B9+C4*C9 or SUMPRODUCT($B$4:$C$4,$B9:$C9) (copy from Cell D5)

Cell D10:=B4*B10+C4*C10 or SUMPRODUCT($B$4:$C$4,$B10:$C10) (copy from Cell D5)

Tips:

(1) SUMPRODUCT function requires specifying two cell ranges of equal size, separated by a comma, such as SUMPRODUCT($B$4:$C$4,$B5:$C5). The SUMPRODUCT function computes the products of the first entries in each range, second entries in each range, and so on. It then sums these products.

(2) The $ symbol in the cells keeps that cell reference fixed when we copy the formula. This is especially convenient since the formula for calculating the sum of the left-hand-side value for each constrain also follows the same structure as the objective function.

Excel Solution

The following steps show how Solver can be used to obtain the optimal solution to the Par, Inc., problem. Step 1: Select the Tools pull-down menu. Step 2: Select the Solver option.

Step 3: When the Solver Parameters dialog box appears. Enter D5 into the Set Cell box Select the Equal to: Max option

Enter B4:C4 into the By Changing Variable Cells box. Select Add .

Step 4: When the Add Constraint dialog box appears: Enter D7:D10 in the Cell Reference box Select

Enter F7:F10 into the Constraint box Click OK

Step 5: When the Solver Parameters dialog box reappears: Choose Options .

Step 6: When the Solver Options dialog box appears,

Select Assume Linear Models and Assume Non-negative Click OK .

Step 7: When the Solver Parameters dialog box reappears: Choose Solve .

Step 8: When the Solver Results dialog box appears:

Select Keep Solver Solution, and choose Answer and Sensitivity from Reports box.

The following table shows Excel layout for the Par. problem.

The answer report for the Par. problem is:

Answer the following questions: 1.

a. Which constraints are binding? Which are not binding?

b. What is the range of optimality for the objective function coefficient associated with standard

bags?

c. What is the range of optimality for the objective function coefficient associated with deluxe bags?

d. After the production, how many hours remain in finishing, and inspection and packaging

department?

e. What would be the impact on the production plan and profit if the objective function coefficient

associated with standard bags were to change to 12?

f. What would be the impact on the production plan and profit if the number of sewing department

were to decrease to 500?

g. What would be the impact on the production plan and profit if the objective function coefficient

associated with standard bags were to change to 9 while at the same time the objective function coefficient associated with deluxe bag were to change to 8?

2. Solve M&D Problem. (Answer: Obj=800)

3. Solve PM Problem. (Answer: Obj=216,300)

4. Solve MSA Problem. (Answer: Obj=15,166)

5. Solve Whole Wood Problem. (Answer: Obj=0.05)

Solve Linear Programming Problems

Check that Solver is installed Open Excel Click on the ‘tools’ menu If Solver is listed, then go to Formulation. Otherwise, Solver needs to be installed, as follows: Again under ‘tools’ click ‘Add-ins..’. The window that appears lists the available add-ins, Click the box next to Solver so that it contains a tick, click ok. Solver should now appear under the ‘tools’ menu

Formulation

Whenever we formulate a worksheet model of a linear program, we perform the following steps (Par. problem as an example, see appendix):

Step 1: Enter the data in the worksheet

Cells B7:C10 show the production requirements per unit for each product. Cells B5:C5 show the profit contributions per unit for the two products. Cells F7:F10 show the number of hours available in each department. Step 2: Specify cell locations for the decision variables Cells B4:C4.

Step 3: Select a cell and enter a formulation for computing the objective value function. Cell D5: =B4*B5+C4*C5 or SUMPRODUCT($B$4:$C$4,$B5:$C5)

Step 4: Select a cell and enter a formulation for computing the left-hand side of each constraint. Cell D7:=B4*B7+C4*C7 or SUMPRODUCT($B$4:$C$4,$B7:$C7) (copy from Cell D5) Cell D8:=B4*B8+C4*C8 or SUMPRODUCT($B$4:$C$4,$B8:$C8) (copy from Cell D5) Cell D9:=B4*B9+C4*C9 or SUMPRODUCT($B$4:$C$4,$B9:$C9) (copy from Cell D5)

Cell D10:=B4*B10+C4*C10 or SUMPRODUCT($B$4:$C$4,$B10:$C10) (copy from Cell D5)

Tips:

(1) SUMPRODUCT function requires specifying two cell ranges of equal size, separated by a comma, such as SUMPRODUCT($B$4:$C$4,$B5:$C5). The SUMPRODUCT function computes the products of the first entries in each range, second entries in each range, and so on. It then sums these products.

(2) The $ symbol in the cells keeps that cell reference fixed when we copy the formula. This is especially convenient since the formula for calculating the sum of the left-hand-side value for each constrain also follows the same structure as the objective function.

Excel Solution

The following steps show how Solver can be used to obtain the optimal solution to the Par, Inc., problem. Step 1: Select the Tools pull-down menu. Step 2: Select the Solver option.

Step 3: When the Solver Parameters dialog box appears. Enter D5 into the Set Cell box Select the Equal to: Max option

Enter B4:C4 into the By Changing Variable Cells box. Select Add .

Step 4: When the Add Constraint dialog box appears: Enter D7:D10 in the Cell Reference box Select

Enter F7:F10 into the Constraint box Click OK

Step 5: When the Solver Parameters dialog box reappears: Choose Options .

Step 6: When the Solver Options dialog box appears,

Select Assume Linear Models and Assume Non-negative Click OK .

Step 7: When the Solver Parameters dialog box reappears: Choose Solve .

Step 8: When the Solver Results dialog box appears:

Select Keep Solver Solution, and choose Answer and Sensitivity from Reports box.

The following table shows Excel layout for the Par. problem.

The answer report for the Par. problem is:

Answer the following questions: 1.

a. Which constraints are binding? Which are not binding?

b. What is the range of optimality for the objective function coefficient associated with standard

bags?

c. What is the range of optimality for the objective function coefficient associated with deluxe bags?

d. After the production, how many hours remain in finishing, and inspection and packaging

department?

e. What would be the impact on the production plan and profit if the objective function coefficient

associated with standard bags were to change to 12?

f. What would be the impact on the production plan and profit if the number of sewing department

were to decrease to 500?

g. What would be the impact on the production plan and profit if the objective function coefficient

associated with standard bags were to change to 9 while at the same time the objective function coefficient associated with deluxe bag were to change to 8?

2. Solve M&D Problem. (Answer: Obj=800)

3. Solve PM Problem. (Answer: Obj=216,300)

4. Solve MSA Problem. (Answer: Obj=15,166)

5. Solve Whole Wood Problem. (Answer: Obj=0.05)


相关内容

  • 利用Excel软件进行非线性拟合的非编程方法
  • 利用Excel软件进行非线性拟合的非编程方法 余亮 摘 要:一种在Excel软件中进行非线性拟合的方法,并通过实例说明了该方法的有效性和实用性. 关键词:数据分析 非线性曲线拟合 非线性规划 曲线拟合是数据分析和数据处理的重要工作之一.在利用数据对系统的物理和化学现象进行深入研究时,往往需要利用机理 ...

  • 3.1敏感性分析
  • 线性规划的what-if分析 1 线性规划的what-if分析  最优解只是针对某一特定的数学模型而言的.  数学模型中的参数经常是估计值或假设.  管理者关心:如果某些参数发生了变化,最优解或目标函 数值会发生什么变化?  如果最优解相对稳定,就会比较放心地应用最优解对应 的决策方案.  ...

  • [运筹学]知识点全总结
  • 一.线性规划:基本概念 1.下面的表格总结了两种产品A 和B 的关键信息以及生产所需的资源Q, R, S: 满足所有线性规划假设. (1)在电子表格上为这一问题建立线性规划模型: (2)用代数方法建立一个相同的模型: (3)用图解法求解这个模型. 5.普里默(Primo )保险公司引入了两种新产品: ...

  • 投资学-22-23期货与套期保值
  • 22-23期货及其套期保值 期货合约是买方和卖方的一个协议,双方同意在在未来的某一时期以事先商定的价格买入或卖出某种商品或金融资产.双方同意的价格叫做期货价格.交货日期叫做交割日期.买卖双方必须承担合约规定的条件和买卖的义务,如不能履约,即以违约论处. 22.1商品期货 期货合约的期限常常有3个月. ...

  • 数据模型决策
  • 数据. 数据.模型与决策数据的意义. 第一章 数据的意义.分类和来源数据. 第一节 数据.模型与决策的联系一.决策,是指从思维到作出决定的过程. 从管理学的角度说,决策可以表述为:为了达到某一预定目标,掌 握充分.必要的数据的前提下,本着一定的价值评判标准,运用逻辑和 数学推理方法,对几种可能采取的 ...

  • 含非阿基米德无穷小量DEA模型的研究综述
  • 第25卷第3期2010年6月 系统工程学报 JOURNALOFSYSTEMSENGINEERINC V01.25No.3Jun.2010 含非阿基米德无穷小量DEA模型的研究综述① 张宝成1,王万乐1,林卫峰2,杜 纲2,医噩2 (1.中国民航大学空中交通管理学院,天津300300:2.天津大学管理 ...

  • 最优投资组合实验
  • <证券投资分析>上机实验 上机实验要求: 第6,8,10,12周星期三1,2节实验课,共分为四项上机实验项目,上机完成实验内容: 具体内容与步骤: (一)数据收集:3-5项股票的价格,上证指数(至少1年时间跨度),K线图,上市公司财务数据 中国股市股票组合的适宜规模为5-10种股票 为了 ...

  • 常微分方程MATLAB解法
  • 实验四 求微分方程的解 一.问题背景与实验目的 实际应用问题通过数学建模所归纳而得到的方程,绝大多数都是微分方程,真正能得到代数方程的机会很少.另一方面,能够求解的微分方程也是十分有限的,特别是高阶方程和偏微分方程(组).这就要求我们必须研究微分方程(组)的解法,既要研究微分方程(组)的解析解法(精 ...

  • 机械系统动力学自动分析
  • ADAMS 是什么? 悬赏分:0 - 解决时间:2006-12-26 18:20 这是什么东西?(通俗一点) 提问者: 不知道me 知道 - 实习生 一级 最佳答案 简单说就是仿真, 预测机械系统的性能, 运动范围, 碰撞检测, 峰值载荷以及计算有限元的输入载荷等. ADAMS 软件简介 基于虚拟样 ...