Professional Documents
Culture Documents
Goal Seek
A Brown Bag discussion for N81
26 Sept 2012
THIS PRESENTATION IS
UNCLASSIFIED
Purpose
This Talk promises to:
(re)introduce some powerful tools in Excel
Optimization centric functions
Goal seek
Solver
References
Albright, S. C. (2007) VBA for modelers
Thompson Brookstone.
Walkenbach, J Microsoft Excel 2010
Bible Wiley.
Ragsdale, C. Decision Analysis with
Spreadsheets
Balakrishnan, N. Managerial Decision
Modeling with Spreadsheets
Frontline Systems: www.solver.com
By Changing
Solving
The hard way: Break out your stochs
textbook, and try to formulate this as
a Markov Chain
The Easy way: Q.xls and Goal Seek!
dt
dB
B
dt
Given
, find
the value of
that results in 70 blue
survivors when the Red side is
eliminated.
Approach 1
TOO EASY! Just solve:
1
B (t )
2
1
R (t )
2
B0 R0
R0 B0
B t
e
R
R t
e
B
BR
1
2
BR
B0 R0
R0 B0
t BR
t BR
Approach II
Use Goal Seek!
Summary
Goal seek is ideal in situations where
you want answers, not proofs!
DISCLAIMERS:
You will not know if there are multiple
solutions
You will not get any sensitivity analysis
Named Cells
Sometimes, you want to use cells,
but D$3$ can become cumbersome
to type.
Also, you might want to be able to
understand the formulae without an
interpreter.
Naming Cells is very handy for this!
How to?
Use the Name box!
Naming Cells
Name Box
Which is easier to
understand?
Formula Auditing
Sometimes, you want to know what
the goezintas for a particular
answer are. Theres a great function
for this: Formula Auditing
Formulas -> Formula Auditing
Example
SUMPRODUCT()
Sometimes you have data in two
columns, and you wish to find the
total the product of the two sides.
Such as finding the expectation and
variance of a discrete variable manually
Tallying up costs by aircraft type
SUMPRODUCT() II
Takes two arrays, X and Y as inputs
Must be equally sized
X
Y
ii
i
SUMXMY2()
Sometimes you want to find the
squared Euclidian distance between
two points or sets of points.
Such as distance between ships in the
example we will work later
Or OLS (Ordinary Least Squares)
SUMXMY2:
Why did they name it that? I dont know!
SUM of X Minus Y Squared (2)
SUMXMY2() II
Takes two arrays, X and Y and returns
the sum of square differences (i.e.
squared Euclidian measure)
(X
i
Yi )
Block 1: Solver
What is it: an optimization package. Can handle LP,
MIP, NLP. Its not anyones favorite package, but its
the one we have.
Goods: Graphical interface with spreadsheets can
make formulation more visually appealing
Bads: There are some problems where it fails to
converge. Limits on number of variables, and
number of Integer/Binary variables
Others: Some important things under the hood that
should be considered (upcoming slides)
For Nerds: Ive never used Evolutionary Solver
mode.
Invoking Solver
To use Solver, it must be installed
Why? Because Bill Gates Hates you,
thats why!
Switch to Spreadsheet
Some Pointers
I like to use color:
Objective function GREEN
Constraints RED
Variables BLUE
Sensitivity Report
Solutions:
A. Upgrade solver
B. Use MATLAB solver
C. Ask us (NPS) for help.
Practical Example:
Optimum placement of Ships
http://puzzlor.editme.com/Relief-Miss
ion
Problem Description
Given the map shown and the ability to
place two ships, what is the optimum
placement to minimize the maximum
distance to a target?
Real-world applications:
Ballistic Missile Defense
Medical Facility Placement
Logistics Hubs
Others?
min z
X ,Y , Z
s.t.
Z ( X xi ) (Y-yi )
2
0 X 10
0 Y 10
Formulation
min Z
X ,Y , Z , S
s.t.
Z ( X 1 xi ) 2 (Y1 yi ) 2 (1 S ) * BigPen i
Z ( X 2 xi ) 2 (Y2 yi ) 2 ( S ) * BigPen
S [0,1]
Summary
Today we talked about:
Excel Practice, generally
Goal Seek: A useful way for getting answers
but Proofs
Excel Functions:
Named cells are infinitely better than R$2$:D$2$,
etc.
SUMPRODUCT()
SUMXMY2()
Solver
Practical Applications.
Point of Contact
CDR Harrison Schramm
hcschram@nps.edu
schrammhc@nps.navy.smil.mil
831.656.2358
After April, 2013
BE922