Computational Physics - Department of Physics

(Axel Boer) #1
104 4 Non-linear Equations

-100

-50

0

50

100

0 1 2 3 4 5

f(E)[MeV]


|E|[MeV]

f(E)
Eq. ()

Fig. 4.3Plot off(E)Eq. (4.8) as function of energy |E|. The pointcis determined by where the straight line
from(a,f(a))to(b,f(b))crosses thex−axis.

the root. Bisection always halves the interval, while the secant method can sometimes spend
many cycles slowly pulling distant bounds closer to a root. We illustrate the weakness of this
method in Fig. 4.4 where we show the results of the first three iterations, i.e., the first point
isc=x 1 , the next iteration givesc=x 2 while the third iterations ends withc=x 3. We may
risk that one of the endpoints is kept fixed while the other oneonly slowly converges to the
desired solution.

-20

0

20

40

60

80

100

120

140

0 0.2 0.4 0.6 0.8 1 1.2 1.4

f(x)

x

f(x) = 25 x^4 −x^2 / 2 − 2
c=x 1
c=x 2
c=x 3

Fig. 4.4Plot off(x) = 25 x^4 −x^2 / 2 − 2. The various straight lines correspond to the determination of the point
cafter each iteration.cis determined by where the straight line from(a,f(a))to(b,f(b))crosses thex−axis.
Here we have chosen three values forc,x 1 ,x 2 andx 3 which refer to the first, second and third iterations
respectively.
Free download pdf