Lecture 12
Lecture 12
Conjugate Gradient
Similar to steepest descent, but slightly different way of choosing
direction of next step:
x r +1 = x r + r sr
s0 = g0
sr +1 = gr +1 + r +1sr
{
new term
r is chosen to minimize h( x r +1 ). This yields grt +1gr = 0
Here we allow a further step in the sr direction. One choice
(Fletcher - Reeves) for r +1 is
gr2+1
r +1 = 2
gr
Winter Semester 2006/7 Computational Physics I Lecture 12 1
Newton-Raphson
1
For an extremum, we have b + C = 0 = C b
or x r +1 = x r H( x r ) 1 g( x r )
x r +1 = x r H( x r ) 1 g( x r )
1
i.e., the search direction is s = H( x r ) g( x r ) and = 1
This converges quickly (if you start with a good guess), but the
penalty is that the Hessian needs to be calculated (usually
numerically)
Again, convergence is when s is sufficiently small
Further properties: 1 f
h(at) H
a a
1 t
h H (bf )
b b
h(t t 0 ) H ( f )e 2ift 0
h(t)e 2if t H( f f 0 )
0
1
fc Nyquist frequency
2
10 Hz sampling 5 Hz sampling
Conditions are:
Sine wave with f=4 Hz, phase offset =0.1 i.e.,
h(t) = sin( + 2ft) = sin(0.1 + 8t)
so we have
8it
e + e 8it 2ift e
8it
e 8it 2ift
H( f ) = sin(0.1) e dt + cos(0.1) e dt
2 2
sin(0.1) 2it( f + 4 ) 2it( f 4 ) cos(0.1) 2it( f + 4 ) 2it( f 4 )
= e +e dt + e e dt
2 2
sin(0.1) cos(0.1)
= [ ( f + 4) + ( f 4)] + [ ( f + 4) ( f 4)]
2 2
Winter Semester 2006/7 Computational Physics I Lecture 12 11
Discrete Fourier Transform
Note H n = HN n [
e 2ik( N n ) / N = e 2ik e 2ikn / N = e 2ikn / N ]
In particular H N / 2 = HN / 2
*
* Get the discrete Fourier components
*
Do n=0,63
Hn(n,1)=0.D0
Hn(n,2)=0.D0
Do k=0,63
Hn(n,1)=Hn(n,1)
& +amplitude(k,1)*dcos(twopi*k*n/64.)
& -amplitude(k,2)*dsin(twopi*k*n/64.) amplitude(k,1) real components
Hn(n,2)=Hn(n,2) amplitude(k,2) imaginary components
& +amplitude(k,1)*dsin(twopi*k*n/64.)
& +amplitude(k,2)*dcos(twopi*k*n/64.)
Enddo
Write (11,*) N,Hn(N,1),Hn(N,2)
Enddo
W 2kj
= e ( )
2i / 8 2(4 k2 + 2k1 + k0 ) j
= e 2i(k 2
+ k1 / 2+ k0 / 4 )
= e 2i(k / 2+ k
1 0
/4)
= W 2 j(2k + k
1 0
)
3 3
2 j(2k1 + k0 )
F(ke 1 ,k0 ) W f2 j F(ko1 ,k0 ) W 2 j( 2k + k ) f 2 j +1
1 0
j=0 j=0
Winter Semester 2006/7 Computational Physics I Lecture 12 18
Fast Fourier Transform
j=0 j=0
W 4 j(2k1 + k0 )
= e ( )
2i / 8 (8k1 + 4 k0 ) j
= W 2 jk 0
F eoeooeoe... = f n
Answer: reverse pattern of e,o. Assign e=0, o=1, and the binary
value gives n.
eee eee 000 0
examples
oeo eoe 010 2
Winter Semester 2006/7 Computational Physics I Lecture 12 21
Some examples
Discrimination of Olives According to Fruit Quality Using Fourier Transform Raman Spectroscopy and Pattern
Recognition Techniques
Barbara Muik, Bernhard Lendl, Antonio Molina-Díaz, Domingo Ortega-Calderón,# and María José Ayora-Cañada*
Department of Physical and Analytical Chemistry, University of Jaén, Paraje las Lagunillas s/n, E-23071 Jaén,
Spain; Institute of Chemical Technologies and Analytics, Vienna University of Technology, Getreidemarkt 9/164,
A-1060 Wien, Austria; and CIFA Venta del Llano, IFAPA, Ctra. Bailén-Motril km 18.5, E-23620 Mengíbar, Jaén,
Spain
The fastest known algorithms for the multiplication of large integers or polynomials are based on the discrete
Fourier transform: the sequences of digits or coefficients are interpreted as vectors whose convolution needs to
be computed; in order to do this, they are first Fourier-transformed, then multiplied component-wise, then
transformed back.