lab_9 interpolation mathimatica

6
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 n is the order of the polynomial required 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:

Upload: nidhalsaada

Post on 13-Sep-2015

213 views

Category:

Documents


0 download

DESCRIPTION

Lab_9 Interpolation Mathimatica

TRANSCRIPT

Lab 2: Root Finding Using Solver

Lab 9: InterpolationObjective: to find a function that satisfy all the data pointsProcedure: 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 n is the order of the polynomial requiredThe 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 interpolationStep by step solution:Step 1:First try to plot the data to see the trend of this data as follows:

Step 2:Interpolat this data using the InterpolatingPolynomial command as follows:

Using the interpolation

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

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

Applications: F(x ,y) is given below for x = 0.1,...,0.6 and y = 1.2, 1.4, 1.6:

Use Interpolation command to find f(0.33,1.33)

This is the way to get a value of the function at any point

Interpolation curve

Interpolatingpolynomial curve

This is the order of the function between points ( the default is third order

The interpolation command

Notes here the curve pass all the points in a smooth manner

This is the InterpolatingPolynomial command. Notes the capital letters

This is the command of plotting data. Notes the capital letter at the beginning