29
Operations 343 Spreadsheet Modeling Week 15 •Quiz Review •Homework Review •Course Review •Lab session

Operations 343 Spreadsheet Modeling Week 15 Quiz Review Homework Review Course Review Lab session

Embed Size (px)

Citation preview

Operations 343 Spreadsheet Modeling

Week 15•Quiz Review

•Homework Review

•Course Review

•Lab session

Operations 343 Spreadsheet Modeling

Models•Models describe how we believe a process works•Descriptive model (customer waiting in line) describingaverage wait time, customer arrival rates, customer servicerate•What we really want: Optimization modelConsiders costs of speeding up service and/or costs oflosing customers due to long waits•Objective: maximize profit, subject to constraints(like limits on labor, resources, money)•Use Solver to find optimal solution

Operations 343 Spreadsheet Modeling

Types of Models

Production Mix models (like final project)Choosing ideal # of products based on revenues, cost ofgoods, and subject to constraints (labor, supplies)

Key is to formulate as a linear programming problemProfit = 6X1 + 2X2 + 4X3 + 3X4

where Xi is quantity of each product to manufactureand coefficients are the profit per product

Operations 343 Spreadsheet Modeling

General Model Format

Problem structure:

• Problem Input Data• Changing cells (production plan)• Constraints• Objective or target to max or min

Operations 343 Spreadsheet Modeling

Monet Prod. Mix ExampleMonet Product mix model

Input dataHourly wage rate $8.00Cost per oz of metal $0.50Cost per oz of glass $0.75

Frame type 1 2 3 4Labor hours per frame 2 1 3 2Metal (oz.) per frame 4 2 1 2Glass (oz.) per frame 6 2 1 2Unit selling price $28.50 $12.50 $29.25 $21.50

Production planFrame type 1 2 3 4

Frames produced 1000 800 400 0

<= <= <= <=Maximum sales 1000 2000 500 1000

Resource constraints Used AvailableLabor hours 4000 <= 4010Metal (oz.) 6000 <= 6000Glass (oz.) 8000 <= 10000

Simplified, optimal ProfitUsing Original equation 9200

Operations 343 Spreadsheet Modeling

Sensitivity Analysis

Sensitivity Analysis to understand what changes can bemade without changing optimal solution

andto find what changes have the greatest impact

Easiest form: Change your assumptions (inputs, constraints)and see what happens!

Operations 343 Spreadsheet Modeling

Sensitivity Reports

Report output provides•amount objective coefficients can change w/o changing

optimal solution•how the objective changes due to constraint changes

•Sensitivity Analysis is important - its your job as manager!•Make decisions about reallocating resources to achieve better results

Operations 343 Spreadsheet Modeling

Workforce Scheduling ModelsPost Office scheduling model

Number starting their five-day shift on various days

Mon 7Tue 3Wed 1Thu 8Fri 0Sat 4Sun 0

Number working on various days (along top) who started their shift on various days (along side)Mon Tue Wed Thu Fri Sat Sun

Mon 7 7 7 7 7Tue 3 3 3 3 3Wed 1 1 1 1 1Thu 8 8 8 8 8Fri 0 0 0 0 0Sat 4 4 4 4 4Sun 0 0 0 0 0Available 19 14 15 19 19 16 13

>= >= >= >= >= >= >=Min required 17 13 15 19 14 16 11

Total employees 23

Also, dynamic workforce models - add/sub workers, overtime

Operations 343 Spreadsheet Modeling

Production Process models

Like product mix, but some of the production is usedto manufacture products, rather than sold

•Account for units used in production•Solve with two sets of changing cells

Production and sales plan Units of products used (along side) to make products (along top)

Product A Product B Product C Product A Product B Product C Total used

Units produced 10 10 10 Product A 0 20 0 20

Product B 0 0 10 10Units used in production 20 10 0 Product C 0 0 0 0

Units leftover and sold 5 5 5

Operations 343 Spreadsheet Modeling

Pricing models

•Goal is to capture the maximum profit - where the number of units sold varies with price.•Solver problem: maximizing profit as units and price vary Price is the changing cell•Demand (or units) changes based on price and elasticity of the demand curve•Profit is (Price - Costs) * Demand

Operations 343 Spreadsheet Modeling

Profit Model solution

Linear demand: D = a - b * PConstant elasticity demand: D = aPb

Use known price versus demand dataPlot an XY (Scatter) chartAdd Trendline (Power trendline option)Obtain demand equation from the chart outputPlug in to the Solver model and solve

Operations 343 Spreadsheet Modeling

Non-Linear Problems

A

B

C

D

E

Global maxima/minima versus local maxima/minimaSolver can get “Stuck” on local max/min

Operations 343 Spreadsheet Modeling

NLP Problems

Max: Solver works for concave functions, or ln(f(x)) concaveand, constraints are linearMin: Solver works for convex functions and linear constraints

Otherwise, Solver may find local max/min.Recommended to try various starting values in the changingcells

Related: IF(), MAX(), MIN() or ABS() that depend onchanging cell values creates NLP problems

Operations 343 Spreadsheet Modeling

Integer Programming

Changing cells constrained to integer valuesSpecial case: binary values of 0 or 1

Solver uses “branch and bound” method to optimize

Worst case: Solved by enumerating all possible solutions

Example: Capital Budgeting problems

•Uncheck Assume Linear Model (all the both may work)•Round off problems yielding non-integer results

Operations 343 Spreadsheet Modeling

Capital Budgeting model

Tatham capital budgeting model

Input data on potential investments

Investment 1 2 3 4 5 6 7

Investment cost $5,000 $2,500 $3,500 $6,000 $7,000 $4,500 $3,000NPV $16,000 $8,000 $10,000 $20,000 $22,000 $12,000 $8,000

NPV per investment dollar $3.200 $3.200 $2.857 $3.333 $3.143 $2.667 $2.667

Investment levels 1 0 1 1 0 0 0

Budget constraint

Amt invested Budget

$14,500 <= $15,000

Total NPV $46,000

Operations 343 Spreadsheet Modeling

Lockbox ModelsAnnual lost interest for origin/location pair

Lockbox locationCheck origin Los Angeles Chicago New York Atlanta

West $49,000 $147,000 $196,000 $196,000Midwest $105,000 $35,000 $87,500 $87,500

East $168,000 $105,000 $42,000 $105,000South $112,000 $70,000 $70,000 $28,000

Assignments and lockbox decisions

Locations of lockboxes (1 if located there, 0 if not)Los Angeles Chicago New York Atlanta

1 1 1 0

Assignments (1 if origin and lockbox location are paired, 0 if not)To lockbox location

Sent from Los Angeles Chicago New York Atlanta Sent? Required

West 1 0 0 0 1 = 1

Midwest 0 1 0 0 1 = 1East 0 0 1 0 1 = 1

South 0 1 0 0 1 = 1

<=

1 1 1 01 1 1 0

1 1 1 01 1 1 0

4 duplications of Locations range

Range names used:

InterestRate - B4UnitBoxCost - B5

LostInterestValues - B18:E21

Locations - B26:E26Assignments - B31:E34

NAssignedTo - F31:F34DupLocations - B36:E39

LostInterest - B42LockboxCost - B43

TotCost - B44

Operations 343 Spreadsheet Modeling

Either Or problems

Decision to make <100 products or >1000 products

Trick was to multiply constraint values by 0 or 1to indicate that we were producing units, or no units

Determining which product lines to produce AND

How much of each product

Operations 343 Spreadsheet Modeling

Product Mix with Binary Changing Cells

InputsType of car Compact Midsize LargeSteel (tons)/unit 1.5 3 5Labor hours/unit 30 25 40Minimum production (if any) 1000 1000 1000

Profit/unit $2,000 $3,000 $4,000

Production planType of car Compact Midsize Large

Produce at least minimum? 1 1 0

Min production 1000 1000 0<= <= <=

Units produced 10 100 0

<= <= <=Capacity 2000 2000 0

Constraints on resources Used AvailableSteel 315 <= 6000Labor hours 2800 <= 60000

Profit $320,000

Operations 343 Spreadsheet Modeling

Forecasting

•XY Scatterplots, and Add Trendline•Regression analysis•Multiple regression•Non-Linear regression (curve fitting)•(Used Add Trendline, and manipulating the data to turn a•non-linear data set into a linear dataset to solve with regression)•Data sources used to forecast markets, production quantities

Operations 343 Spreadsheet Modeling

Visual Basic for Applications

Create custom Excel applicationsExample 1: Restaurant run entirely using Excel. Example 2: $40M pharmaceutical division run entirely

using Excel VBA application)

Easy: Macros, translated into VBA codeInteresting:

Development of custom VBA subroutinesDevelopment of customer dialogs (user interfaces)

Operations 343 Spreadsheet Modeling

Subroutines and Functions

Subroutines (and functions) to hold program statements

sub routinename(optional parameters)end sub

function routinename (optional parameters) routinename = expressionend function

Operations 343 Spreadsheet Modeling

Variables

Variables hold data values

Defined using Dim variablename as type

Integer, Long, Single, Double, String, Boolean, Variant

ArraysDim arrayname(elements) as type

starts counting from zero, or use Option Base 1

Option Explicit to require Dim for all variables

Operations 343 Spreadsheet Modeling

Local, Global and Public/Private

•Variables defined within a subroutine are local to that routine•Variables defined at top of module are global to all routinesin the module•Variables can be made PUBLIC and accessible to routinesin other modules•Subroutines are PUBLIC by default; can be marked as PRIVATE

Operations 343 Spreadsheet Modeling

Program Statements

Assignment: Variable = expressionIf - Then … End IfIf - Then … ElseIf … End IfSelect Case statementFor - Next loopDo While … LoopDo Until … LoopDo … Loop While xDo … Loop Until x

Operations 343 Spreadsheet Modeling

Built-in Objects

•MsgBox - simple way to display output•InputBox - simple way to prompt and get string input•Range(“A1”) - used to read values of worksheet cells, or set new values•Range(“A1:B10”).Cells(row,col) - used to read values of worksheet cells, or set new values

Operations 343 Spreadsheet Modeling

User Forms

Create custom user interface dialog boxesFor input and selection (checkboxes, listboxes, radio buttons)Can incorporate graphical images into dialog boxes

Development of “event handler” code to process mouse clicksand implement the program features with VBA code

Can link worksheet buttons to subroutines or user forms

Operations 343 Spreadsheet Modeling

Error handling, strings, files

Introduced error handling concepts, On Error Goto/Resume

Introduced string handling functions to process typicalbusiness input data (InStr(), Left(), Mid(), Right(), Ucase())

Operations 343 Spreadsheet Modeling

Big Picture Summary

•Introduction to Modeling of business processes

•Introduction to Solver for finding optimal solutions

•Use of Excel statistical tools for operations andmarket forecasting

•Introduction to VBA for developing custombusiness applications using Excel

Operations 343 Spreadsheet Modeling

Future Options

Advanced modeling and simulation: Practical Management Science

Advanced Excel VBA programming:Excel 2000 Programming

Advanced Visual Basic programming:Numerous text books and training coursesavailable. VB is the most popular programminglanguage today