Sie sind auf Seite 1von 21

Schedule

Week Date Topic


Introduction to Numerical Methods and Type of Errors
Nonlinear Equations

Classification of Topic
Measuring errors, Binary representation, Propagation of errors and Taylor series
Bisection Method Newton-Raphson Method Lagrange Interpolation Newton's Divided Difference Method Newton's Forward and Backward Divided Difference Least squares Gaussian Jordan Gaussian Seidel

1
2

9 Feb. 2010
14 Feb. 2010

3
4

21 Feb. 2010
28 Feb. 2010 Interpolation

5
6 7 8 9 10 11 12

7 March 2010
14 March 2010 Differentiation 21 March 2010 Regression 28 March 2010 Systems of Linear
Equations

11 April 2010 18 April 2010 25 April 2010 2 May 2010


Integration Ordinary Differential Equations

Composite Trapezoidal and Simpson Rules Euler's Method Runge-Kutta 2nd and4th order Method

Interpolation
Newton's Forward Divided Difference

What is Interpolation ?
Given (x0,y0), (x1,y1), (xn,yn), find the value of y at a value of x that is not given such that the differences(x i 1 x i )are now constant h .
x
x0
(x 0 )

x1 x 0 h

x 2 x 0 2h .. x n x 0 nh

f (x ) y 0 f

y 1 f (x 0 h ) y 2 f (x 0 2h ).. y n f (x 0 nh )

Interpolants
Polynomials are the most common choice of interpolants because they are easy to: Evaluate Differentiate, and Integrate.

Linear interpolation: Given ( x 0 , y 0 ), ( x1 , y1 ), pass a linear interpolant through the data


The equation of a straight line

f (x 1 ) f (x o ) f 1 (x ) f (x o ) (x o sh x o ) (h ) f 1 (x ) f (x o ) f (x o ) Such that s x x 0 ,and represented the first difference h and it is called delta.

To maximise a catch of bath in lake, it is suggested to throw the line to the depth of the thermocline. The characteristic feature of this area is the sudden change in temperature (T ). We are given the temperature , depth z(m) data for a lake in table1
T
0

Example

Depth z

m
-5 -4 -3 -2

18.3 18.5 18.8 19

19.4
19.4

-1
0

Table 1 Temperature vs. depth for a lake.

Figure 1 Temperature vs. depth of a lake.

Using the given data, we see the largest change in temperature is between z =-3 m and z =-4 m. Determine the value of the temperature at z =-3.5 m. using Newton's forward divided method of interpolation and a first order polynomial.
z T(z)
18.5 0.3

z0 z1

-4

-3

18.8

T1 (z ) T (z 0 ) s T (z 0 ) 18.5 0.3s s

3.5 (4) 0.5 1

T1 (3.5) 18.8 0.3(0.5) 18.5 0.15 18.65

Quadratic Interpolation (contd)


Using the given data, we see the largest change in temperature is between z =-4 m, z =-3 m and z=-2. Determine the value of the temperature at z =-3.5 m using Newton's forward divided method of interpolation of a second order polynomial.
z T(z) 18.5 0.3

2T

z0 z1 z2

-4

-3 -2

18.8 0.2 19

-0.1

s (s 1) 2 0.1s (s 1) T 2 (z ) T (z 0 ) s T (z 0 ) T (z 0 ) 18.5 0.3s 2! 2! T 2 (3.5) 18.5 0.3(0.5) 0.1(0.5)(0.5) 18.5 0.15 0.0125 18.6625 2

The absolute relative approximate error a obtained the result from the first order and the second order polynomial is
18.6625 18.65 x 100 0.06% 18.6625

For the third order polynomial interpolation Given (x0,y0), (x1,y1), (x2,y2), (x3,y3)

Cubic Interpolation (contd)

s (s 1) 2 s (s 1)(s 2) 2 f 3 (x ) f (x 0 ) s f (x 0 ) f (x 0 ) f (x 0 ) 2! 3!
Using the given data, we see the largest change in temperature is between z =-4 m, z =-3 m, z=-2m and z=-1m. Determine the value of the temperature at z =-3.5 m using Newton's forward divided method of interpolation of a cubic order polynomial.

T(z)
18.5

T
0.3

2T

3T

z0 z1 z2 z3

-4 -3

18.8 0.2

-0.1 -0.3

-2
-1

19 0.4
19.4

0.2

0.1(0.5)(0.5) 0.3(0.5)(0.5)(1.5) T 3 (3.5) 18.5 0.3(0.5) 18.64375 2 6


The absolute relative approximate error a obtained the result from the second order and the third order polynomial is
a
18.64375 18.6625 x 100 0.1% 18.64375

Comparison Table
Order of Polynomial to Newtons forward T(z=-3.5) Absolute Relative Approximate Error 1 2 3 18.65 ---------18.6625 0.0669 % 18.64375 0.1%

General Form
For the n+1 order polynomial Newton's forward interpolation
Given (x0,y0), (x1,y1), (x2,y2),. (xn,yn)
f n (x ) f (x 0 ) s (s 1)(s 2)....(s k 1) k f (x 0 ) k! k 1 s (s 1) 2 s (s 1)(s 2)....(s n 1) n f (x 0 ) s f (x 0 ) f (x 0 )..... f (x 0 ) 2! n!
n

Newton's backward Divided Difference

Linear interpolation: Given ( x 0 , y 0 ), ( x1 , y1 ), pass a linear interpolant to backward divided difference is

f 1 (x ) f (x n ) s f (x n )
x xn , the inverted delta symbol which s h

Such that

is called nabla.

in the same example the linear polynomial Newton's backward divided difference is
z T(z) 18.5 0.3 18.8

T (z )

z0 z1

-4 -3

f 1 (x ) f (x n ) s f (x n )
3.5 (3) s 0.5 1 T1 (3.5) 18.8 0.3(0.5) 18.8 0.15 18.65

in the same example the second order polynomial Newton's backward divided difference is
z T(z) 18.5 0.3

T (z ) 2T (z )

z0 z1 z2

-4

-3

18.8 0.2

-0.1

-2

19

s (s 1) 2 f 2 (x ) f (x n ) s f (x n ) f (x n ) 2!
(0.5)(0.5)(0.1) T 2 (3.5) 19 0.2(0.5) 2 19 0.1 0.0125 18.8875

The absolute relative approximate error a obtained the result


from the first order and the second order polynomial is

18.8875 18.65 x 100 1.25% 18.8875

in the same example the third order polynomial Newton's backward divided difference is
z T(z) 18.5

T (z ) 2T (z ) 3T (z )
0.3

z0 z1 z2 z3

-4 -3 -2

18.8 0.2 19

-0.1 -0.3 0.2

0.4
-1 19.4

(0.5)(0.5)(0.2) (0.5)(0.5)(1.5)(0.3) T 3 (3.5) 19 0.4(0.5) 2 6 19 0.2 0.025 0.01875 18.79375

Comparison Table
Order of Polynomial T(z=-3.5) Absolute Relative Approximate Error 1 18.65 ---------2 18.8875 1.25 % 3 18.79375 0.4%

Since the value z=-3.5 is near the first of the table, to get the corresponding value of z we must to use Newton's forward interpolation.

General Form
For the n+1 order polynomial Newton's backward interpolation
Given (x0,y0), (x1,y1), (x2,y2),. (xn,yn)
s (s 1)(s 2)....(s k 1) k f (x n ) k! k 1 s (s 1) 2 s (s 1)(s 2)....( s n 1) n f (x n ) s f (x n ) f (x n )..... f (x n ) 2! n!
n

f n (x ) f (x n )

Das könnte Ihnen auch gefallen