Professional Documents
Culture Documents
Newton's Forward Interpolation Formula
Newton's Forward Interpolation Formula
Program - 2
Aim: To implement Newton’s Forward Interpolation formula.
Problem: To find the value of f(x) corresponding to the given value of x in the predefined
interval.
x 0 2 4 7 10 12
f(x) 20 20 12 7 6 6
Principle:
Consider a function, y=f(x)
Evaluating the function value for x=x0+ph
where
x0 - initial value of x
y0 - initial value of function f(x)
Output:
h=
l=
10
fp =
ans =
0 20 0 -8 11 -10 6 0 0 0
2 20 -8 3 1 - 4 0 0 0 0
4 12 -5 4 -3 0 0 0 0 0
7 7 -1 1 0 0 0 0 0 0
10 6 0 0 0 0 0 0 0 0
12 6 0 0 0 0 0 0 0 0
Mapping:
Programming in MATLAB needs the conceptual knowledge and logical thinking for obtaining
the solution for a given problem. Hence the program maps with CO-1, PO-1, PO-5, PO-9, and
PO-10, PO-12.
Method -II
Program - 2
Aim: To implement Newton’s Forward and Backward Interpolation formula.
x 0 2 4 6
f(x) 5 29 125 341
n=
xg =
1.5000
x1= 0
y1= 5
x2= 2
y 2 = 29
x3= 4
y 3 = 125
x4= 6
y 4 = 341
u=
0.7500
y=
5 24
29 0
125 0
341 0
y=
5 24
29 96
125 0
341 0
y=
5 24
29 96
125 216
341 0
y=
5 24 72
29 96 0
125 216 0
341 0 0
y=
5 24 72
29 96 120
125 216 0
341 0 0
y=
5 24 72 48
29 96 120 0
125 216 0 0
341 0 0 0