Excel

advertisement
L13 Optimization using Excel
• See revised schedule
read 8(1-4) + Excel “help” for Mar 12
•
•
•
•
•
Test Answers
Review: Convex Prog. Prob.
Worksheet modifications
Excel optimization
Summary
1
Trendline in Excel
Excel help
“trendline”
for Wed
2
Theorem 4.9
Given:
ConstraintSet
S  {x | hi (x )  0, for i  1 to p;
g j (x )  0, j  1 to m}
S is convex if:
1. hi are linear
2. gj are convex i.e. Hg PD or PSD
When f(x) and S are convex=
“convex programming problem”
3
“Sufficient” Theorem 4.10, pg 165
The first-order KKT conditions are Necessary
and Sufficient for a GLOBAL minimum….if:
1. f(x) is convex
Hf(x) Positive definite
2. x is defined as a convex feasible set S
Equality constraints must be linear
Inequality constraints must be convex
HINT: linear functions are convex!
4
Worksheet Modifications
•
•
•
•
•
•
•
Naming cells
Inserting shapes
Inserting MS Equation “object”
Recording macros
Attaching a macro to a shape
Creating a SOLVER hot button
Visual basic, tools/references/solver
5
Excel Applications
Figure 6.1 Excel worksheet for finding roots of 2x/3 – sin x :
(a) worksheet; (b) worksheet with formulas showing.
6
Solver parameters
Figure 6.2 A Solver Parameters dialog box to
define the problem.
7
Figure 6.3 A Solver Results dialog box and the final worksheet.
8
Figure 6.4 A Solver Answer Report for roots of 2x/3 – sin x = 0.
9
Figure 6.5 Worksheet and Solver Parameters dialog box for
KKT conditions for Example 4.31.
10
Figure 6.6 Solver Results for KKT conditions for Example 4.31.
11
KKT system of NL EQNs
Prob 4.59 and 4.122
12
Figure 6.7 Excel worksheet and Solver Parameters
dialog box for unconstrained problem.
13
Constrained Optimization
Prob. 4.69 and 4.122
Min f ( x1 , x2 )  ( x1  3)2  ( x2  3)2
subject t o h  x1  3 x2  1
g  x1  x2  4
14
Graphical Solution
x1  3.25
x2  0.75
  1.25
u  0.75  0
s00
f  5.125
1
2
15
Figure 6.8 Excel worksheet for the linear programming problem.
16
Figure 6.9 Solver Parameters dialog box for the linear programming problem.
17
Figure 6.10 Solver Results dialog box for the linear programming problem.
18
Figure 6.11 Answer Report from Solver for linear programming problem.
19
Figure 6.12 Sensitivity Report from Solver for the linear programming problem.
20
Figure 6.13 Excel worksheet for the spring design problem.
21
Summary
• KKT pt from a Convex Prog. Prob. Is a
global min!
• Use modifications for “ease of use”
• Pay attention to layout
– Design variables
– Parameters
– Analysis/Performance “Variables”
– Objective function
– Constraints
• May need multiple starting points
22
Download