Vous êtes sur la page 1sur 7

CS-409 / CS-505 NUMERICAL ANALYSIS

PROJECT # 2 Report

Serhat CAN 11895

In this project, interpolation will be applied to several given functions. There is a specified error criteria, which should be met after the given function is interpolated well enough. Interpolation begins with three given points for each function, every other testing point is added if the absolute error is bigger than error criteria for the current comparison of interpolated and the original function. For the mentioned purpose, MATLAB is used. Basically, I partitioned the certain sections of the code, such as the provided function and interpolation are created as function files. Program takes lower and upper limits as inputs for functions and testing, outputs the maximum final error, order of the final interpolating polynomial, interpolation coefficients and centers and finally the plots of original and interpolated functions embedded in a single graph for original and testing limits.

OBTAINED DATA
A. Part 1 ( ) ] ] 2.779633806193615e-05 8

Bounds of Function: [ Bounds of Testing: [ Maximum Value of Final Error: Order of the Final Interpolating Polynomial: Interpolation Centers: 4 12 20 6.832 16.975999 5.024

18.832

9.392

14.608

2 0.183012701892219 -0.003563025588093 Interpolation Coefficients: 0.000225036254723 -0.000009804950811 0.000001124721066 -0.000000051201310 -0.000000000254999

As it can be seen, interpolated functions for given range [

] align with the

original function so well. But when we increase the bounds and test for new data, divergence of the interpolation is clear.

B. Part2 ( ) Bounds of Function: [ Bounds of Testing: [ Maximum Value of Final Error: Order of the Final Interpolating Polynomial: Interpolation Centers: 0 2.5 5 4.18 0.95 3.425 0.355 4.74 1.68 0.13 4.495 ] ] 2.916371355343728e-05 10

Interpolation Coefficients:

-0.777002415718611

2.503853694493572

3.268976708765044

0.695212647491652

0.149229373303081

0.017773231975971

0.003370324676826

0.000367447714504

0.000032010117819

0.000003862567294

Compared to previous part, this time the interpolated function is better at tracking the original function. In fact they are almost the same function.

C. Part3 ( ) Bounds of Function: [ Bounds of Testing: [ Maximum Value of Final Error: Order of the Final Interpolating Polynomial: Interpolation Centers: 1 7 13 3.484 11.02 ] ] 2.631282345705310e-05 4

Interpolation Coefficients:

0.087155742747658

0.081070115600565

-0.002134574207191

-0.000093885680710

0.000001385597530

Again the interpolation worked and the function can track its original one well enough so that increasing the bound of limit does not diverged it.

D. Part4 ( )

( ) ] ] 9.144907004543512e-06

Bounds of Function: [ Bounds of Testing: [ Maximum Value of Final Error:

Order of the Final Interpolating Polynomial:

Interpolation Centers:

2.5

0.999847741535795 Interpolation Coefficients: -0.000529703245469 -0.000138768452011

Compared two previous two graphs, like in the first one, we see a divergence in the testing graph. Withing the original limits, interpolating function tracks the original well, but when the testing points are widened, divergence is clear. Anoter interesting fact is that when the interpolated function involves a square root, divergence occurs after the initial limits.

Vous aimerez peut-être aussi