Professional Documents
Culture Documents
Exp 11 Forward Interpolation
Exp 11 Forward Interpolation
Objectives:
1. To study Newton’s Forward Difference Interpolation Formulae
Theory:
If a set of tabular values (xi,yi) , i.e. i=0,1,2……,n satisfy the relation y=f(x) where the explicit
nature of f(x) is not known, it is required to find a simpler function ∅(𝑥) ,such that boyj f(x) &
∅(𝑥) agree at the set of tabulated points. Such a process is called interpolation. If ∅(𝑥) is a
polynomial then the process is called polynomial interpolation
Newton’s Forward difference interpolation formula is useful for interpolation near the beginning
of a set of tabular values which is described as,
𝑝 (𝑝−1) 𝑝 (𝑝−1)(𝑝−2) 𝑝 (𝑝−1)…….(𝑝−𝑛+1)
𝑦𝑛 (𝑥) = 𝑦0 + 𝑝∆𝑦0 + ∆2 𝑦0 + ∆3 𝑦0 + ⋯ + ∆𝑛 𝑦0 …..(i)
2! 3! 𝑛!
Algorithm :
1. Start
2. Read the tabulated data of x and y in matrix form
3. Calculate values ∆𝑖 𝑦0 by conducting a loop , i.e. i=0,1,2…,n
4. Calculate values p , p (p-1) ,…. . p (p-1)… (p-n+1) by conducting another loop
5. Apply the main formula (i)
6. Solve
7. stop
1|Page
Used Commands & their functions:
n=length(x) ;
h=x(2)-x(1);
p=(s-x(1))/h;
del(1)=y(1)
for i=1:n-1
for j=2:n
y(j-1)=y(j)-y(j-1);
end
del(i+1)=y(1); %determining various values of del^(i)y , i.e i= 0,1,2,……,n
end
term(1)=1;
m=p
q=1
for i=1:n-1
term(i+1) =m*q/factorial(i) ); %determining values of product of p
m=m*q;
q=p-i;
end
2|Page
sum=0;
for i=1:n
sum=sum+del(i)*term(i); ); %applying newton’s main formula
end
double(sum)
del =
24 96 120 48
ans = 60
3|Page