# Matrix Formualtion of Interpolating Using Variational Methods, Lecture Notes - Advanced Calculus, Study notes for Calculus. University of California (CA) - UCLA

## Calculus

Description: Matrix Formulation, Mesh Points, Debugging, Example, Infinite Spline
Showing pages  1  -  2  of  5
Matrix Formulation of Variational Method
Interpolation
March 03, 2006
1 Matrix formulation
1.1 Unequally-spaced mesh points
Recall the matrix formulation of the diﬀerential equation considered last
lecture,
2
h0
1
h0
1
h0
2
h0+2
h1
1
h1
.........
1
hn2
2
hn2+2
hn1
1
hn1
1
hn1
2
hn1
Y0(x0)
Y0(x1)
.
.
.
Y0(xn1)
Y0(xn)
= 3
1
h2
0
1
h2
0
1
h2
0
1
h2
01
h2
1
1
h2
1
.........
1
h2
n2
1
h2
n21
h2
n1
1
h2
n1
1
h2
n1
1
h2
n1
Y(x0)
Y(x1)
.
.
.
Y(xn1)
Y(xn)
where hj=xj+1 xj, for j { 0, . . . , n 1}. This is general formulation
for non-uniform node spacing.
1.2 Equally-spaced mesh points
Suppose that the mesh points are uniformly spaced, so that hi=hj=
h, i, j. The matrix simpliﬁes by multiplying by h. Note that all of the
1
diagonal elements in the interior of the second coeﬃcient matrix become 0.
Multiplying by the resulting matrix of coeﬃcients of Y(x),
2 1
1 4 1
.........
1 4 1
1 2
Y0(x0)
Y0(x1)
.
.
.
Y0(xn1)
Y0(xn)
=3
h
Y(x0) + Y(x1)
Y(x0) + Y(x2)
.
.
.
Y(xn2) + Y(xn)
Y(xn1) + Y(xn)
(1)
2 Debugging examples
2.1 Three points, symmetric about the center
We take the three nodes to be
(0,0) (1,1) (2,0)
In this case, we expect the interpolating polynomials to take an arch shape.
2.1.1 Construct the coeﬃcient matrices
First, identify the values of the function,
Y(x0) = 0 Y(x1) = 1 Y(x2) = 0
Substituting these values into (1),
2 1
141
1 2
Y0(x0)
Y0(x1)
Y0(x2)
=3
1
1
0
1
Solving the system yields,
Y0(x0)
Y0(x1)
Y0(x2)
=
3
2
0
3
2
This result is consistent with what we would expect by symmetry.
2