Vous êtes sur la page 1sur 3

Lagrange Interpolation

Sample
X Function Points Interpolation
5.000
-16 -3.372 #VALUE!
-15 -2.699 -2.699 #VALUE! Sample Function
-14 -2.167 #VALUE! Interpolation
-13 -1.282 #VALUE! 4.000
Points
-12 -1.328 -1.328 #VALUE!
-11 -0.996 #VALUE!
-10 -0.708 #VALUE!
3.000
-9 -0.448 #VALUE!
-8 0.177 #VALUE!
-7 0.027 0.027 #VALUE!
-6 -0.120 #VALUE! 2.000
-5 0.048 #VALUE!
-4 0.189 #VALUE!
-3 0.156 #VALUE! 1.000
-2 0.029 #VALUE!
-1 0.967 #VALUE!
0 0.104 #VALUE!
1 0.011 #VALUE! 0.000
2 0.325 #VALUE!
-16
-15
-14
-13
-12
0
-9
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6
7
8
109

14
15
-11

112
13
1
-1

3 0.116 0.116 #VALUE!


4 0.147 #VALUE! -1.000
5 0.915 #VALUE!
6 1.166 #VALUE!
7 0.545 0.545 #VALUE!
8 1.149 #VALUE! -2.000
9 1.360 #VALUE!
10 2.023 #VALUE!
11 1.732 1.732 #VALUE! -3.000
12 2.353 #VALUE!
13 2.744 #VALUE!
14 3.385 3.385 #VALUE!
15 4.375 #VALUE! -4.000

NumPoints 7

Tu use this spreadsheet, just select points in column C by inserting a =Bn, n being the row number
You can change the sample function. This is a simple y=ax3 function with a bit of added noise
To modify the spreadsheet code, go to the VB editor. Please note that named ranges are used.
You will also notice that arrays are redefined at each function call which makes calculations very inefficient.
For details about Lagrange Interpolation, see for instance the Wolfram MathsWorld web site.
4
5
6
7
8
109
1
112
13
14
15
attenuator 10
-15 -3.274133
-14 -2.697916
-13 -2.004127
-12 -0.99225
-11 -0.536404
-10 -0.958203
-9 -0.492518
-8 -0.381806
-7 -0.276625
-6 0.433446
-5 0.295938
-4 0.038063
-3 0.17464
-2 0.52457
-1 0.84389
0 0.15843
1 0.009604
2 0.153791
3 0.917901
4 0.70542
5 0.202691
6 0.846962
7 1.014252
8 0.537332
9 1.51474
10 1.036047
11 1.463097
12 1.729089
13 2.205158
14 3.091478
15 3.633803