30
GOALSEEK Part of Standard Excel Installation Finds the root of a scalar function 0 ) ( x f 0 ) ( x f Recall that root-finding methods (e.g., bisection method, Newton’s method) rely on a change in sign of the objective function Any f(x) function used in GOALSEEK should have a well defined sign change

GOALSEEK

  • Upload
    kineks

  • View
    24

  • Download
    0

Embed Size (px)

DESCRIPTION

Part of Standard Excel Installation Finds the root of a scalar function. GOALSEEK. Recall that root-finding methods (e.g., bisection method, Newton’s method) rely on a change in sign of the objective function Any f(x) function used in GOALSEEK should have a well defined sign change. - PowerPoint PPT Presentation

Citation preview

Page 1: GOALSEEK

GOALSEEK Part of Standard Excel Installation Finds the root of a scalar function 0)( xf 0)( xf• Recall that root-finding methods (e.g.,

bisection method, Newton’s method) rely on a change in sign of the objective function

• Any f(x) function used in GOALSEEK should have a well defined sign change

Page 2: GOALSEEK

GOALSEEK - EXAMPLE Use Excel’s GOALSEEK feature to find the root of f(x)

= x – cos(x) between 0 and 1.

-1.2-1

-0.8-0.6-0.4-0.2

00.20.40.6

0 0.2 0.4 0.6 0.8 1 1.2

x

x - c

os(x

)

Page 3: GOALSEEK

GOALSEEK - EXAMPLE Make use of named ranges in Excel

Create solution variable cell “xval” and target cell “fofx”

Page 4: GOALSEEK

Highlight cells that will be

named. Under Formulas Tab select Create

from Selection

Page 5: GOALSEEK

GOALSEEK - EXAMPLE Input the function into the “target cell”

Use the named variable Type “=xval – cos(xval)” into the target cell

Page 6: GOALSEEK

EXAMPLE 1 - SOLUTION

Page 7: GOALSEEK

GOALSEEK - EXAMPLE Put an initial guess in the variable cell

0.5 is the middle of the interval, so use it Now invoke the GOALSEEK function You can use the named ranges in the GOALSEEK

dialog box, or point and click

Page 8: GOALSEEK

GOALSEEKGoal Seek found on Data Tab

under “What-If Analysis”

Page 9: GOALSEEK

EXAMPLE 1 - SOLUTION

Page 10: GOALSEEK

GOALSEEK - EXAMPLE

Then click “OK”

Page 11: GOALSEEK

EXAMPLE 1 - SOLUTION

Page 12: GOALSEEK

SOLVER Solver is an “add-in” to Excel It is not installed by default SOLVER will find a particular value, the

maximum, or the minimum of a scalar function of a vector

)],,,,(min[)],,,,(max[0),,,,(

321

321

321

n

n

n

xxxxfxxxxf

xxxxf

Page 13: GOALSEEK

SOLVER Uses a gradient-based method (like Newton’s

method) to find the root or the max/min Works very well for functions that have a well-

defined minimum (or maximum), like a quadratic form (a parabola)

Page 14: GOALSEEK

FINDING THE ADD-INS IN EXCEL 2000

Go to Excel

Options

Page 15: GOALSEEK

FINDING THE ADD-INS IN EXCEL

Go to Add-Ins Tab on left

and click Go at bottom

Page 16: GOALSEEK

FINDING THE ADD-INS IN EXCEL

Make sure Solver Add-

In is checked and click

ok

Page 17: GOALSEEK

FINDING THE SOLVER ADD-INNow go to Data tab

and click on Solver on

the far right

Page 18: GOALSEEK

SOLVER - EXAMPLE Find the minimum of

0 2 4 6 8 10 12

0

5

10

150

10

20

30

40

50

XY

(X-5

)2 +(Y

-5)2

f(x,y)=(x-5)2 + (y-5)2

Page 19: GOALSEEK

SOLVER - EXAMPLE Use named ranges to establish variables for ‘xval’

and ‘yval’ Use named range to create a target cell ‘fxy’

Page 20: GOALSEEK

EXAMPLE 2: CREATING NAMED RANGES

Page 21: GOALSEEK

SOLVER - EXAMPLE Put initial guesses for xval, yval in their cells (use

(0,0)) Type the formula into the target cell (“=(xval-

5)^2 + (yval-5)^2”)

Page 22: GOALSEEK

EXAMPLE 2: SETTING UP THE SPREADSHEET

Page 23: GOALSEEK

SOLVER - EXAMPLE Invoke the SOLVER function

Page 24: GOALSEEK

MICROSOFT HELP ON “SOLVER” Define and solve a problem by using

Solver On the Data Tab, click Solver (far right). If the Solver command is not on the Data Tab,

you need to install the Solver add-in. In the Set Target Cell box, enter a cell reference

or name for the target cell. The target cell must contain a formula.

Page 25: GOALSEEK

EXAMPLE 2: INVOKING THE SOLVER FUNCTION

Solver is found on

far right of Data tab

Page 26: GOALSEEK

MICROSOFT HELP ON “SOLVER” To have the value of the target cell be as large as

possible, click Max. To have the value of the target cell be as small as

possible, click Min. To have the target cell be a certain value, click

Value of, and then type the value in the box. In the By Changing Cells box, enter a name or

reference for each adjustable cell, separating nonadjacent references with commas. The adjustable cells must be related directly or indirectly to the target cell. You can specify up to 200 adjustable cells.

Page 27: GOALSEEK

EXAMPLE 2: THE SOLVER DIALOG BOX

Page 28: GOALSEEK

MICROSOFT HELP ON “SOLVER” To have Solver automatically propose the

adjustable cells based on the target cell, click Guess.

In the Subject to the Constraints box, enter any constraints you want to apply.

Click Solve.

To keep the solution values on the worksheet, click Keep Solver Solution in the Solver Results dialog box.

Page 29: GOALSEEK

EXAMPLE 2: THE SOLVER SOLUTION

Page 30: GOALSEEK

MICROSOFT HELP ON “SOLVER” To restore the original data, click Restore

Original Values. Tips

You can interrupt the solution process by pressing ESC. Microsoft Excel recalculates the worksheet with the last values found for the adjustable cells.