You are on page 1of 5

Lab 9: Interpolation

Objective: to find a function that satisfy all the data points


Procedure: We have two types of interpolation in mathematica:
1- Polynomial interpolation which give us a smooth function that pass through all
data points. This type of interpolation can be done using this command:
(InterpolatingPolynomial[data1,x])
2- Interpolation by specifying the degree of the function. This type of
interpolation works between data points. This type of interpolation can be
done using this command:
(f3=Interpolation[data3,InterpolationOrdern])where
nistheorderofthepolynomialrequired
The procedure for each built-in function is illustrated using the following examples.
Example :Interpolate the following data:
data1={{1,1},{2,4},{3,7},{4,4},{5,1},{6,4},{7,9},{8,4}}

Using the polynomial interpolation


Step by step solution:
Step 1:First try to plot the data to see the trend of this data as follows:

This is the command of


plotting data. Notes the
capital letter at the
beginning

Step 2:Interpolat this data using the InterpolatingPolynomial command as


follows:

This is the
InterpolatingPolynomial

command. Notes the


capital letters

Notes here the curve


pass all the points in a
smooth manner

Using the interpolation


Step 1:Name your data with any name and then use the interpolation command as
follows:

The
interpolation
command
This is the order
of the function
between points
( the default is

Step 2:plot the interpolation , data points and the polynomialinterpolation curves to
see the difference between all curves as follows:

Interpolatingpolynomi
al curve

Interpolation
curve

This is the way to get a


value of the function at
any point

Applications: F(x ,y) is given below for x = 0.1,...,0.6 and y = 1.2, 1.4, 1.6:
x y 1.2 y 1.4 y 1.6
0.1
29
30
31
0.2
57
59
60
0.3
83
86
87
0.4
106
109
111
0.5
126
130
132
0.6
143
147
150

Use Interpolation command to find f(0.33,1.33)