Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Root-Finding Problem
Given computable f (x) C[a, b], problem is to find
for x [a, b] a solution to
f (x) = 0.
Solution r with f (r) = 0 is root or zero of f .
Maybe more than one solution; rearrangement sometimes needed: x2 = sin(x) + 0.5.
Bisection Algorithm
Input: computable f (x) and [a, b], accuracy level .
Initialization:
find [a1, b1] [a, b], with f (a1)f (b1) < 0, set i = 1.
Basic Bisection Algorithm:
1. Set ri = (ai + bi)/2;
2. If f (ai)f (ri) < 0, set bi+1 = ri, ai+1 = ai;
otherwise, set ai+1 = ri, bi+1 = bi;
3. If (bi+1 ai+1)/2 > , set i = i + 1 and go to step 1
4. Stop with r (bi+1 + ai+1)/2.
Notes:
careful algorithm checks for f (ri) = 0, limits i;
other stopping conditions possible, e.g. |f (ri)| < .
x sin(x).5
2.5
1.5
0.5
0.5
0.5
0.5
x
1.5
3
3
a)
2
1.5
-0.8125
-2.7682
-13.106
-1128.1
b)
2
2.25
1.8765
2.4857
1.6139
3.159
c)
2
2.0801
2.0924
2.0942
2.0945
2.0945
1.2
1.4
1.6
1.8
2.2
2.4
2.6
2.8
2.4
2.6
2.8
2.8
2.6
2.4
2.2
1.8
1.6
1.4
1.2
1.2
1.4
1.6
1.8
2.2
a)
2
0.70465
1.6288
0.91986
1.4084
1.0557
1.2979
1.1272
b)
2
1.1871
1.1947
1.1959
1.1960495
1.19607706
1.196081273
1.1960819169
a)
-0.5
-0.04115
-11.151
-0.13343
-2.7503
-0.04312
-10.596
-0.13413
b)
-0.5
0.14344
0.80184
1.1039
1.1802
1.1936
1.1957
1.1960
8
c)
-0.5
-0.25268
-0.45132
-0.30083
-0.42191
-0.32783
-0.40338
-0.34404
FP METHODS ANALYSIS
Existence and Uniqueness of Fixed Points
If g C[a, b] and g(x) [a, b] for x [a, b],
then g has at least one fixed point in [a, b].
Notes:
a) Linear convergence: if ei is the error at each step i, and
ei+1
lim |
| = S < 1,
i ei
the method has linear convergence with rate S.
b) FP convergence is usually linear, with |rn r| Ck n;
if k > 1/2, the bisection method is better.
c) Estimating k? Let en = rn r. Then for signed k,
rn2 = r + en2, rn1 r + ken2, rn r + k 2en2,
so signed k is k (rn rn1)/(rn1 rn2).
d) Taylor series analysis: from rn+1 = g(rn), near r
r + en+1 = g(r + en) = g(r) + eng 0(r) + e2ng 00(n)/2,
so en+1 eng 0(r), linear convergence with S = |g 0(r)|.
10