Matrix Formulation of Variational Method

Interpolation

Adrian Down

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

hn−2

2

hn−2+2

hn−1

1

hn−1

1

hn−1

2

hn−1

Y0(x0)

Y0(x1)

.

.

.

Y0(xn−1)

Y0(xn)

= 3

−1

h2

0

1

h2

0

−1

h2

0

1

h2

0−1

h2

1

1

h2

1

.........

−1

h2

n−2

1

h2

n−2−1

h2

n−1

1

h2

n−1

−1

h2

n−1

1

h2

n−1

Y(x0)

Y(x1)

.

.

.

Y(xn−1)

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(xn−1)

Y0(xn)

=3

h

−Y(x0) + Y(x1)

−Y(x0) + Y(x2)

.

.

.

−Y(xn−2) + Y(xn)

−Y(xn−1) + 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

##### Document information

Uploaded by:
deville

Views: 4127

Downloads :
0

Address:
Mathematics

University:
University of California (CA) - UCLA

Subject:
Calculus

Upload date:
05/10/2011