Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Mat h 190 (I nt ro t o Numerical Opt imizat ion)

Fibonacci Search
Goal: Minimize a unimodal funct ion ( ). f x
- Based on t he sequence of Fibonacci numbers { }
0
n
n
F

=

where
0 1 1 2
0, 1, ...,
n n n
F F F F F

= = = + .
- Assume: ( ) f x is unimodal on t he int erval
| |
0 0
, a b .
- Unlike t he golden Search, r is not const ant on each subint erval. The number of it erat ions is
predet ermined ( based on specified t olerances

or

) .
- The search is t erminat ed at t he
th
k

sub int erval if eit her
k k
b a <

or ( ) ( )
k k
f b f a < .
- As in t he golden rat io search, select a value
0
r such t hat
0
1
1
2
r < <
- I f
0 0
( ) ( ) f c f d s , minimum is in
| |
0 0
, a d ,
o Redefine:
1 0 1 0
, . a a b d = =
o search in t he new subint erval
| |
1 1 0 0
, [ , ] a b a d = .
- I f
0 0
( ) ( ) f c f d >

, minimum is in
| |
0 0
, c b ,
o Redefine:

1 0 1 0
, . a c b b = =
o search in t he new subint erval
| |
1 1 0 0
, [ , ] a b c b =
See figure 1 below.


Derivat ion.
- I f
0 0
( ) ( ) f c f d s

and only one funct ion evaluat ion is t o be made in
0 0
[ , ] a d t hen select
1
1
1
2
r < <

for t he sub int erval
| |
1 1 0 0
, [ , ] a b a d =
- Relabel:
1 0 1 0
, . d c b d = = .
- Then,

0 0 1 1
= (1) d c b d
- Choose
0
r

such t hat
o ( )
0 0 0 0 0
= (*) d a r b a

and ( )( )
0 0 0 0 0
= 1 (**) c a r b a
o Subt ract ing ( * ) and ( * * ) ,

( ) ( )
( ) ( )( )
( )( )
0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0
=
= 1
= 2 1 (2)
d c d a c a
d c r b a r b a
d c r b a




- Choose
1
r

such t hat
( )( )
1 1 1 1 1
= 1 (3) b d r b a
- Subst it ut ing (2) and ( 3) int o (1) ,
( )( ) ( )( )
0 0 0 1 1 1
2 1 = 1 (4) r b a r b a


- Also, since
| |
1 1
, a b has been shrunk by a fact or
0
r

,
( )
1 1 0 0 0
= (#) b a r b a
- Subst it ut ing (#) , Eq. ( 4) becomes
( )( ) ( ) ( )
( ) ( )
0 0 0 1 0 0 0
0 1 0
0
1
0
2 1 = 1 ( ) (5)
2 1 1 ( ) (6)
1
(7)
r b a r r b a
r r r
r
r
r

=

=

- For 4 n > ,

we have
1 2 n n n
F F F

= + .
- Subst it ut e
1
0
n
n
F
r
F

= int o Eq. (7) ,


1
1 2
1
1
1 1
1
n
n n n n
n
n n
n
F
F F F F
r
F
F F
F

= = =
- By induct ion, we can st art wit h
1
0
n
n
F
r
F

= , t hen
2
1
1
n
n
F
r
F

= and
1
, 1, 2, ..., 3.
n k
k
n k
F
r k n
F

= = .
- The int erior point s
k
c

and
k
d of t he
th
k subint erval can be comput ed as follows:
( )( ) 1
k k k k k
c a r b a = +

( )
k k k k k
d a r b a = +
- St op aft er n it erat ions, such t hat
0 0
n
b a
F

>
Pseudocode. Golden Search
function [ , ( )]=fibsearch( , , , ) xopt f xopt f a b tol

1) Set k= 0 and find n such t hat
0 0
n
b a
F

>

Evaluat e
1
,
n
n
F
r
F

= ( ) ( ) 1 c a r b a = +
and
( ) d a r b a = +

1, 2,..., 3. k n =


Set
( ), ( ), ( ), ( ) ya f a yb f b yc f c yd f d = = = =
.
2) I f
( ) ( ) f c f d >
go t o st ep 3 ; else go t o st ep 4;
3) I f
b c s
st op and out put d;
Ot herwise set
, , ( ) a c c d yc f d = = =

Evaluat e
( ) d a r b a = +
and
( ) yd f d =
;
Go t o st ep 5;

4) I f
d a s
st op and out put c;
Ot herwise set
, , ( ) b d d c yd f d = = =

Evaluat e
( ) c b r b a =
and
( ) yc f c =
;
Go t o st ep 5;

5) Set k= k+ 1 and
1
,
n k
n k
F
r
F

+
=

Go t o st ep 2.
Problem Set . Deadline: Aug 10, 2012
1) ( Group) .
- I mplement t he Met hod in Scilab.
- Find t he minmum of t he funct ion
2
( ) sin f x x x =

in t he int erval [ 0,1] . Use
4
10

= .
( See handout s for t he solut ion)
- I nclude in your out put a t abular result showing all t he different values for each it erat ion:
it erat ion a c d b

You might also like