Beruflich Dokumente
Kultur Dokumente
Bisection Method
Example: f(x) = x^3+x^2-3x-3=0
starting values: a=1, b=2
tolerance: 0.0001
f(x) 1 1 -3 -3
ITERATION: x1 x2 f(x1) f(x3) f(x1)*f(x3) x3=(x1+x2)/2 F(x3)=tolerance
1 1.000000 2.000000 -4.000000 -1.875000 7.500000 1.500000 -1.875000
2 1.500000 2.000000 -1.875000 0.171875 -0.322266 1.750000 0.171875
3 1.500000 1.750000 -1.875000 -0.943359 1.768799 1.625000 -0.943359
4 1.625000 1.750000 -0.943359 -0.409424 0.386234 1.687500 -0.409424
5 1.687500 1.750000 -0.409424 -0.124786 0.051091 1.718750 -0.124786
6 1.718750 1.750000 -0.124786 0.022030 -0.002749 1.734375 0.022030
7 1.718750 1.734375 -0.124786 -0.051755 0.006458 1.726563 -0.051755
8 1.726563 1.734375 -0.051755 -0.014957 0.000774 1.730469 -0.014957
9 1.730469 1.734375 -0.014957 0.003513 -0.000053 1.732422 0.003513
10 1.730469 1.732422 -0.014957 -0.005728 0.000086 1.731445 -0.005728
11 1.731445 1.732422 -0.005728 -0.001109 0.000006 1.731934 -0.001109
12 1.731934 1.732422 -0.001109 0.001201 -0.000001 1.732178 0.001201
13 1.731934 1.732178 1.732056 0.000046
Exercise: 1. Use bisection method to find a root of f(x)=x^3 -3x^2-6x+8=0 near x=3.5
2. Use Newton's method to finf the root of f(x) = e^x -4x^2, near x= 0.7.
Pn (x )=f [0 ] +( x−x 0 )f [1 ]+( x−x 0 )( x−x 1 ) f [2 ]+.. .+(x −x 0 )( x− x1 ).. .( x−x n−1 )f [ n]
0 0 0 0
Pn (x )=f [0 ] +( x−x 0 )f [1 ]+( x−x 0 )( x−x 1 ) f [2 ]+.. .+(x −x 0 )( x− x1 ).. .( x−x n−1 )f [ n]
0 0 0 0
P4(x)= 22.000+8.4(x-3.2)+2.856(x-3.2)(x-2.7)-0.527(x-3.2)(x-2.7)(x-1)+0.256(x-3.2)(x-2.7)(x-1)(x-4.8)
a∑ x 2 + b ∑ xi = ∑ xi Y i
i
a ∑ xi + bN = ∑ Yi
Example:
x=T,0C y=R,ohm
s
20.5 765
32.7 826
51 873
73.2 942
95.7 1032
N=5
∑ xi 273.1 ∑ xi Y i 254932.5
∑ x i2 18607.27
∑ Yi 4438
a b k
18607.27 273.1 254932.5
273.1 5 4438
a= 3.394873
b= 702.1721
at T=100 R= 1041.659
at T=50 R= 871.9157
4)Find the least squares line that fits the following data.
x f(x)
1 5.04
2 8.12
3 10.64
4 13.18
5 16.2
6 20.04
7)(x-1)(x-4.8)