





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A part of the computer methods lecture series, specifically focusing on optimization techniques. It covers three methods: newton's method, random search, and golden section search. The motivation behind optimization, provides examples, and discusses the advantages and disadvantages of each method. It also includes sample code for random search.
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






NOTE: The unit on differential equations will not be available online. We will use notes on the board only.
Topics: numerical optimization
What?
Find x where or
Why?
Given: , Find x where y is minimum
analytical solution: ==>
Given: , Find x where y is minimum
Depends on the range we’re interested in...
Having lots of local maxima and minima means having lots of zero slope cases. An exact solution would be a big pain...
Recall the Newton method for finding a root of an equation
, where
We can use a similar approach to find a min or max of
The min / max occurs where the slope is zero So if we find the root of the derivative, we find the max / min location
Find roots of using Newton
find the maximum of this function
we’ll need these
for x = [0,3]
we can use central difference to replace the analytical derivatives.
to find where the max occurs...
find the root of the function’s derivative
Illustration of the code
Example: same equation over a larger range Finding roots of derivative (Newton) leaves us with lots of minima and maxima (if Newton can even find them all) Random Search can simply pick through and I.D. the biggest maximum Since it compares all the f(x) values anyway.
needs numbers to get a good look
Note that we’ve zoomed in
first iteration second iteration
local
global? (^) global?
Similar to the bisection method
Q1: Where should we place the two internal points? Let’s see if we can pick some ‘efficient’ points
Set the following conditions: (1) L = L1 + L (2) R = L/L2 = L2/L
substitute (1) into (2) ==> 1 + R = 1/R
solve for R (R is called the Golden Ratio, named by ancient Greeks)
R = (sqrt(5)-1)/2 =.
So if the range is [0 , 1]
X1 = 1 - R =.
xmn x1^ x2^ xmx xmn x1^ x2 xmx look inside red range for second iteration
L
L
L
xmn x1 x2 xmx
So if we set the tolerance to. the final x guess is within .001 of the x location of the actual maximum A few iterations
xmn (^) x1 x2 xmx xmn
xmx
x1 x
xmn x2 x
xmx
xmx
x
xmn
x
A working algorithm
( (^5) − 1 )