Reading for Session 2

advertisement
4. APPROXIMATION OF FUNCTIONS
POLYNOMIAL INTERPOLATION
Given an array of 𝑛 distinct values 𝑥𝑖 , 𝑖 = 1, 2, … , 𝑛, and an array of values 𝑦𝑖 , there
exists a unique polynomial 𝑝(𝑛−1) (𝑥) of degree (𝑛 − 1) such that 𝑝(𝑛−1) (𝑥𝑖 ) = 𝑦𝑖 , 𝑖 =
1, 2, … , 𝑛.
A polynomial 𝑝(𝑛−1) (𝑥) can be written down as
𝑝(𝑛−1) (𝑥) = 𝑎𝑛−1 𝑥 𝑛−1 + 𝑎𝑛−2 𝑥 𝑛−2 + ⋯ + 𝑎0 ,
and is determined by the 𝑛 coefficients, 𝑎𝑛−1 , 𝑎𝑛−2 , … , 𝑎0 , of the powers of 𝑥.
The requirements that 𝑝(𝑛−1) (𝑥𝑖 ) = 𝑦𝑖 , 𝑖 = 1, 2, … , 𝑛, result in a system of 𝑛
equations for 𝑎𝑛−1 , 𝑎𝑛−2 , … , 𝑎0 :
𝑎𝑛−1 𝑥1𝑛−1 + 𝑎𝑛−2 𝑥1𝑛−2 + ⋯ + 𝑎0 = 𝑦1
𝑎𝑛−1 𝑥2𝑛−1 + 𝑎𝑛−2 𝑥2𝑛−2 + ⋯ + 𝑎0 = 𝑦2 .
…………………………………………
{𝑎𝑛−1 𝑥𝑛𝑛−1 + 𝑎𝑛−2 𝑥𝑛𝑛−2 + ⋯ + 𝑎0 = 𝑦𝑛
The matrix of this system is
𝑥1𝑛−1 𝑥1𝑛−2 … 1
𝑛−1 𝑛−2 … 1
(𝑥2 𝑥2 … ).
… … …
𝑛−1 𝑛−2 … 1
𝑥𝑛 𝑥𝑛
Its determinant, called the Vandermonde determinant, is nonzero whenever the points
𝑥𝑖 are pairwise distinct.
METHOD OF LEAST SQUARES
Generally, the equations 𝑝(𝑥𝑖 ) = 𝑦𝑖 , 𝑖 = 1, 2, … , 𝑛 cannot be satisfied simultaneously
by a polynomial 𝑝(𝑥) whose degree is less than (𝑛 − 1). Among such ‘insufficient’
polynomials, some can be identified that provide the best approximation to the
data, according to a certain criterion.
Consider a polynomial 𝑝(𝑘) (𝑥) = 𝑎𝑘 𝑥 𝑘 + 𝑎𝑘−1 𝑥 𝑘−1 + ⋯ + 𝑎0 of degree 𝑘 < 𝑛 − 1,
and let 𝑑𝑖 denote the deviation, at the point 𝑥𝑖 , of the value of the polynomial from
the respective given value, 𝑦𝑖 :
𝑑𝑖 = 𝑝(𝑘) (𝑥𝑖 ) − 𝑦𝑖 = (𝑎𝑘 𝑥𝑖𝑘 + 𝑎𝑘−1 𝑥𝑖𝑘−1 + ⋯ + 𝑎0 ) − 𝑦𝑖 .
In the Method of Least Squares, a polynomial 𝑝(𝑥) is defined to be the best
approximation to the data if it minimizes the quantity
Φ = 𝑑12 + 𝑑22 + ⋯ 𝑑𝑛2 .
71
Given the degree 𝑘 of the polynomial 𝑝(𝑘) (𝑥), Φ is a function of the coefficients,
𝑎𝑘 , 𝑎𝑘−1 , … , 𝑎0 :
2
Φ(𝑎𝑘 , 𝑎𝑘−1 , … , 𝑎0 ) = ∑𝑛𝑖=1[(𝑎𝑘 𝑥𝑖𝑘 + 𝑎𝑘−1 𝑥𝑖𝑘−1 + ⋯ + 𝑎0 ) − 𝑦𝑖 ] .
If Φ attains a minimum at a point (𝑎𝑘 , 𝑎𝑘−1 , … , 𝑎0 ) in 𝑅𝑘+1 , then, necessarily,
Φ𝑎𝑘 = Φ𝑎𝑘−1 = ⋯ = Φ𝑎0 = 0,
which gives a system of (𝑘 + 1) equations for 𝑎𝑘 , 𝑎𝑘−1 , … , 𝑎0 .
(1)
(1)
For the best linear approximation, 𝑝(1) (𝑥) = 𝑎1 𝑥 + 𝑎0 , the system is
{
(∑𝑛𝑖=1 𝑥𝑖2 )𝑎1(1) + (∑𝑛𝑖=1 𝑥𝑖 )𝑎0(1) = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖
(∑𝑛𝑖=1 𝑥𝑖 )𝑎1(1) + 𝑛𝑎0(1) = ∑𝑛𝑖=1 𝑦𝑖
(2)
(2)
(2)
For the best quadratic approximation, 𝑝(2) (𝑥) = 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0 , the system is
(∑𝑛𝑖=1 𝑥𝑖4 )𝑎2(2) + (∑𝑛𝑖=1 𝑥𝑖3 )𝑎1(2) + (∑𝑛𝑖=1 𝑥𝑖2 )𝑎0(2) = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖2
{ (∑𝑛𝑖=1 𝑥𝑖3 )𝑎2(2) + (∑𝑛𝑖=1 𝑥𝑖2 )𝑎1(2) + (∑𝑛𝑖=1 𝑥𝑖 )𝑎0(2) = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖
(∑𝑛𝑖=1 𝑥𝑖2 )𝑎2(2) + (∑𝑛𝑖=1 𝑥𝑖 )𝑎1(2) + 𝑛𝑎0(2) = ∑𝑛𝑖=1 𝑦𝑖
(3)
(3)
(3)
(3)
For the best cubic approximation, 𝑝(3) (𝑥) = 𝑎3 𝑥 3 + 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0 , the system
is
(∑𝑛𝑖=1 𝑥𝑖6 )𝑎3(3) + (∑𝑛𝑖=1 𝑥𝑖5 )𝑎2(3) + (∑𝑛𝑖=1 𝑥𝑖4 )𝑎1(3) + (∑𝑛𝑖=1 𝑥𝑖3 )𝑎0(3) = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖3
(3)
(3)
(3)
(3)
(∑𝑛𝑖=1 𝑥𝑖5 )𝑎3 + (∑𝑛𝑖=1 𝑥𝑖4 )𝑎2 + (∑𝑛𝑖=1 𝑥𝑖3 )𝑎1 + (∑𝑛𝑖=1 𝑥𝑖2 )𝑎0 = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖2
(∑𝑛𝑖=1 𝑥𝑖4 )𝑎3(3) + (∑𝑛𝑖=1 𝑥𝑖3 )𝑎2(3) + (∑𝑛𝑖=1 𝑥𝑖2 )𝑎1(3) + (∑𝑛𝑖=1 𝑥𝑖 )𝑎0(3) = ∑𝑛𝑖=1 𝑦𝑖 𝑥𝑖
{
(∑𝑛𝑖=1 𝑥𝑖3 )𝑎3(3) + (∑𝑛𝑖=1 𝑥𝑖2 )𝑎2(3) + (∑𝑛𝑖=1 𝑥𝑖 )𝑎1(3) + 𝑛𝑎0(3) = ∑𝑛𝑖=1 𝑦𝑖
TAYLOR POLYNOMIALS
For a function 𝑓 that is 𝑛 times differentiable, the nth degree Taylor polynomial
about an interior point 𝑥0 of the domain of 𝑓 is defined by
𝑇𝑛 (𝑥) = 𝑓 (𝑥0 ) + 𝑓′(𝑥0 )(𝑥 − 𝑥0 ) +
𝑓′′(𝑥0 )
2
(𝑥 − 𝑥0 )2 + ⋯ +
𝑓(𝑛) (𝑥0 )
𝑛!
(𝑥 − 𝑥0 )𝑛 .
The difference, 𝑅𝑛 (𝑥) = 𝑓(𝑥) − 𝑇𝑛 (𝑥), called the nth remainder, is given by
𝑅𝑛 (𝑥) =
𝑓(𝑛+1) (𝑐)
(𝑛+1)!
(𝑥 − 𝑥0 )𝑛+1 ,
where 𝑐 lies between 𝑥0 and 𝑥 (Lagrange’s form of the remainder).
For a particular 𝑥, the sequence {𝑇𝑛 (𝑥)} may or may not converge to 𝑓(𝑥). The set of
points at which the convergence occurs may consist of the single point, 𝑥0 , or, on
the other extreme, of all real 𝑥. If it is neither of the two, then the points of
convergence necessarily fill an interval of a certain radius 𝑟𝑐 (radius of
convergence), centered at 𝑥0 .
72
Generally, Taylor polynomials represent well the local differential properties of a function,
but not its global behavior. Even if the sequence {𝑇𝑛 (𝑥)} converges to 𝑓(𝑥) at all real 𝑥,
a particular Taylor polynomial, 𝑇𝑛 (𝑥), may be a poor approximation to the function
𝑓(𝑥) as a whole.
SPLINE INTERPOLATION
Suppose that given are (𝑛 + 1) values of 𝑥: 𝑥0 , 𝑥1 , … , 𝑥𝑛 , and as many values of 𝑦:
𝑦0 , 𝑦1 , … , 𝑦𝑛 . In the method of spline interpolation, a separate polynomial of degree
𝑘 < 𝑛 is constructed on each of the intervals, [𝑥𝑖−1 , 𝑥𝑖 ], in such a way as to satisfy
certain consistency conditions at the points, 𝑥0 , 𝑥1 , … , 𝑥𝑛 .
In Cubic Spline Interpolation, a cubic polynomial 𝑠𝑖 (𝑥) is constructed on each
interval:
𝑠1 (𝑥) = 𝑎1 + 𝑏1 (𝑥 − 𝑥0 ) + 𝑐1 (𝑥 − 𝑥0 )2 + 𝑑𝑖 (𝑥 − 𝑥0 )3 , 𝑥0 ≤ 𝑥 ≤ 𝑥1 ,
𝑠2 (𝑥) = 𝑎2 + 𝑏2 (𝑥 − 𝑥1 ) + 𝑐2 (𝑥 − 𝑥1 )2 + 𝑑2 (𝑥 − 𝑥1 )3 , 𝑥1 ≤ 𝑥 ≤ 𝑥2 ,
…………………………………………………………………………………
𝑠𝑛 (𝑥) = 𝑎𝑛 + 𝑏𝑛 (𝑥 − 𝑥𝑛−1 ) + 𝑐𝑛 (𝑥 − 𝑥𝑛−1 )2 + 𝑑𝑛 (𝑥 − 𝑥𝑛−1 )3 , 𝑥𝑛−1 ≤ 𝑥 ≤ 𝑥𝑛 .
Each polynomial, 𝑠𝑖 (𝑥), is required to take on the given values of 𝑦 at the endpoints
of its interval of definition: 𝑠𝑖 (𝑥𝑖−1 ) = 𝑦𝑖−1 , 𝑠𝑖 (𝑥𝑖 ) = 𝑦𝑖 , which yields 2𝑛 equations
for the coefficients of the polynomials:
𝑎𝑖 = 𝑦𝑖−1
} 𝑖 = 1, 2, … , 𝑛.
(1)
𝑎𝑖 + 𝑏𝑖 ℎ𝑖 + 𝑐𝑖 ℎ𝑖 2 + 𝑑𝑖 ℎ𝑖 3 = 𝑦𝑖 , ℎ𝑖 = 𝑥𝑖 − 𝑥𝑖−1
Another 2(𝑛 − 1) relations follow from the requirement that at each interior point
𝑥𝑖 , the two neighboring polynomials have equal first and second derivatives:
𝑠′𝑖 (𝑥𝑖 ) = 𝑠′𝑖+1 (𝑥𝑖 )
} 𝑖 = 1, 2, … , 𝑛 − 1,
𝑠′′𝑖 (𝑥𝑖 ) = 𝑠′′𝑖+1 (𝑥𝑖 )
or
𝑏𝑖 + 2𝑐𝑖 ℎ𝑖 + 3𝑑𝑖 ℎ𝑖2 = 𝑏𝑖+1
} , 𝑖 = 1, 2, … , 𝑛 − 1.
𝑐𝑖 + 3𝑑𝑖 ℎ𝑖 = 𝑐𝑖+1
(2)
Two more relations are needed to determine the problem. As such, the conditions
can be imposed that 𝑠1 (𝑥) and 𝑠𝑛 (𝑥) have zero second derivatives at the endpoints,
𝑥0 and 𝑥𝑛 , respectively. This gives
𝑐1 = 0
}
𝑐𝑛 + 3𝑑𝑛 ℎ𝑛 = 0
(3)
Together, equations (1), (2), (3) form a system of 4𝑛 equations for the 4𝑛 unknowns,
𝑎𝑖 , 𝑏𝑖 , 𝑐𝑖 , 𝑑𝑖 , 𝑖 = 1, 2, … , 𝑛.
73
EXERCISE 1. Construct an interpolation polynomial for the data:
i
𝑥
𝑦
1
0.0
10.0
2
1.0
–5.0
3
2.0
4.0
4
3.0
–3.0

 According to the number of data points (four), the interpolation polynomial
has degree three: 𝑝(𝑥) = 𝑎3 𝑥 3 + 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0 .
 In a (4 × 4) block of cells, place the Vandermonde matrix for the given 𝑥𝑖 :
𝑥13
𝑥23
𝑉=
𝑥33
3
(𝑥4
𝑥12
𝑥22
𝑥32
𝑥42
𝑥1
𝑥2
𝑥3
𝑥4
1
1
1
1)
 Use the Excel MINVERSE function to find the inverse of 𝑉.
 Use the Excel MMULT function to solve the system of equations,
𝑎3
𝑦1
𝑎2
𝑦2
𝑉 (𝑎 ) = (𝑦 ),
1
3
𝑎0
𝑦4
by left-multiplying the column of 𝑦𝑖 by 𝑉 −1 .
 Check that the third-degree polynomial with coefficients as computed
actually takes on the given value, 𝑦𝑖 , at each point, 𝑥𝑖 .
 Produce a chart to illustrate that the interpolation polynomial passes through
the data points.
Remark. In the Excel chart presented, the range of values of 𝑥 is extended
somewhat beyond the data range, [𝑥1 , 𝑥4 ]. Although it is possible to consider the
interpolation polynomial on an extended range, it should be kept in mind that,
generally, the interpolation polynomial departs from the underlying function
rapidly as 𝑥 departs from the data range. 
EXERCISE 2.
A. Use the method of least squares to construct the best linear, quadratic, and cubic
approximations to the data (𝑛 = 10):
i
x
y
1
1.1
3.8
2
2.05
3.5
3
3.1
3.7
4
3.9
7.2
5
5.1
11.1

74
6
6.2
14.0
7
7.1
22.2
8
8.05
25.9
9
9.0
33.1
10
9.9
28.5
 Expand the data table by adding rows for the quantities, 𝑥 2 , 𝑥 3 , 𝑥 4 , 𝑥 5 , 𝑥 6 , 𝑦𝑥,
𝑦𝑥 2 , 𝑦𝑥 3 , which should be computed for each 𝑖. (Equivalently, the data and
their derivative quantities can be arranged by the column.)
 Get the sum of each row.
(1) (1)
 Define the system of equations for the coefficients, 𝑎1 , 𝑎0 , of the best linear
approximation.
o In a (2 × 2) block of cells, place the matrix of the system,
∑ 𝑥𝑖2
∑ 𝑥𝑖
∑ 𝑥𝑖
𝑛
o In a column of height 2, place the right-hand sides of the equations of the
system,
∑ 𝑦𝑖 𝑥𝑖
∑ 𝑦𝑖
 Use the Excel MINVERSE function to find the inverse of the matrix.
 Use the Excel MMULT function to multiply the right-hand side column, on
the left, by the inverse matrix and thus find the required coefficients,
(1) (1)
𝑎1 , 𝑎0 .
 Apply the Excel SLOPE function to the data to verify that it gives the same
(1)
value for the coefficient of 𝑥, 𝑎1 .
 Apply the Excel INTERCEPT function to the data to verify that it gives the
(1)
same value for the zeroth term, 𝑎0 .
(2) (2) (2)
 Define the system of equations for the coefficients, 𝑎2 , 𝑎1 , 𝑎0 , of the best
quadratic approximation.
o In a (3 × 3) block of cells, place the matrix of the system,
∑ 𝑥𝑖4
∑ 𝑥𝑖3
∑ 𝑥𝑖2
∑ 𝑥𝑖3
∑ 𝑥𝑖2
∑ 𝑥𝑖
∑ 𝑥𝑖2
∑ 𝑥𝑖
𝑛
o In a column of height 3, place the right-hand sides of the equations of the
system,
∑ 𝑦𝑖 𝑥𝑖2
∑ 𝑦𝑖 𝑥𝑖
∑ 𝑦𝑖
 Use the Excel MINVERSE function to find the inverse of the matrix.
75
 Use the Excel MMULT function to multiply the right-hand side column, on
the left, by the inverse matrix and thus find the required coefficients,
(2) (2) (2)
𝑎2 , 𝑎1 , 𝑎0 .
(3) (3) (3) (3)
 Define the system of equations for the coefficients, 𝑎3 , 𝑎2 , 𝑎1 , 𝑎0 , of the
best cubic approximation.
o In a (4 × 4) block of cells, place the matrix,
∑ 𝑥𝑖6
∑ 𝑥𝑖5
∑ 𝑥𝑖4
∑ 𝑥𝑖3
∑ 𝑥𝑖5
∑ 𝑥𝑖4
∑ 𝑥𝑖3
∑ 𝑥𝑖2
∑ 𝑥𝑖4
∑ 𝑥𝑖3
∑ 𝑥𝑖2
∑ 𝑥𝑖
∑ 𝑥𝑖3
∑ 𝑥𝑖2
∑ 𝑥𝑖
𝑛
o In a column of height 4, place the right-hand sides of the equations,
∑ 𝑦𝑖 𝑥𝑖3
∑ 𝑦𝑖 𝑥𝑖2
∑ 𝑦𝑖 𝑥𝑖
∑ 𝑦𝑖
 Use the Excel MINVERSE function to find the inverse of the matrix.
 Use the Excel MMULT function to multiply the right-hand side column, on
the left, by the inverse matrix and thus find the required coefficients,
(3) (3) (3) (3)
𝑎3 , 𝑎2 , 𝑎1 , 𝑎0 .
 Plot a chart showing the data (using markers) and each of the three ‘best’
approximations (using lines of distinct styles).
B. Use the Excel charting tool to find the best linear, quadratic, and cubic
approximations to the data in Part A. 
 Excel has a built-in procedure that computes the best approximations of
polynomial types (and some other types) for given arrays of 𝑥 and 𝑦. To
employ this procedure:
o Create a chart of the “Scatter, markers only” type for the given arrays of 𝑥
and 𝑦.
o Right-click one of the markers on the chart. In the menu, select Add
Trendline. The Format Trendline dialog box will appear. In it:
 For Trend/Regression type, select “Linear” (default setting).
 Check “Display Equation on chart”.
76
 Press Close. As a result, a line representing the best linear
approximation will appear on the chart, with the equation of the line
typed in the plot area.
o The best quadratic and cubic approximations are created in a similar way.
The distinction is that for Trend/Regression type, “Polynomial” should be
selected here, and the order of the polynomial should be specified: 2 for
quadratic, 3 for cubic. In each case, check “Display Equation on chart”.
 Compare the chart created in this way with the chart in part A.
 Verify that the equations of the three ‘best’ approximation as given by Excel
match those found in part A.
EXERCISE 3. For the function, 𝑓 (𝑥) = (𝑥 − 1)(𝑥 − 2)𝑒 𝑥 , construct the Taylor
polynomials, 𝑇1 (𝑥), 𝑇2 (𝑥), 𝑇3 (𝑥), 𝑇4 (𝑥), about the point, 𝑥0 = 0.5.
 We have:
𝑓 (0.5) = 1.237;
𝑓 ′ (𝑥) = (𝑥 2 − 𝑥 − 1)𝑒 𝑥 , 𝑓 ′ (0.5) = −2.061;
𝑓 ′′ (𝑥) = (𝑥 2 + 𝑥 − 2)𝑒 𝑥 ; 𝑓 ′ ′(0.5) = −2.061;
𝑓′′′(𝑥) = (𝑥 2 + 3𝑥 − 1)𝑒 𝑥 ; 𝑓′′′(0.5) = 1.237;
𝑓 (4) (𝑥) = (𝑥 2 + 5𝑥 + 2)𝑒 𝑥 ; 𝑓 (4) (0.5) = 7.831.
 Substituting into the formula for Taylor polynomials and simplifying gives
𝑇1 (𝑥) = 𝑓 (𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥 − 𝑥0 ) = −2.06𝑥 + 2.27;
𝑓′′(𝑥0 )
(𝑥 − 𝑥0 )2 = −1.03𝑥 2 − 1.03𝑥 + 2.01;
𝑇2 (𝑥) = 𝑓 (𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥 − 𝑥0 ) +
2
𝑓′′(𝑥0 )
′(
𝑓′′′(𝑥 )
0
(𝑥 − 𝑥0 )2 +
(𝑥 − 𝑥0 )3 =
𝑇3 (𝑥) = 𝑓 (𝑥0 ) + 𝑓 𝑥0 )(𝑥 − 𝑥0 ) +
2
3!
0.340𝑥 3 − 1.54𝑥 2 − 0.776𝑥 + 1.97
𝑓′′(𝑥0 )
𝑓′′′(𝑥0 )
(𝑥 − 𝑥0 )2 +
(𝑥 − 𝑥0 )3 +
𝑇4 (𝑥) = 𝑓 (𝑥0 ) + 𝑓 ′ (𝑥0 )(𝑥 − 𝑥0 ) +
𝑓 (4) (𝑥0 )
4!
2
(𝑥 − 𝑥0
)4
4
3!
3
2
= −0.538𝑥 − 0.736𝑥 − 0.733𝑥 − 1.05𝑥 + 2.00
 Plot a chart showing the function, 𝑓(𝑥), and the four Taylor polynomials for
it in an area containing the given point (𝑥0 = 0.5).
o Select different line styles for the five graphs to make them clearly
distinguishable in the chart.
 Observe how well or how poorly the Taylor polynomials represent the
function a) in a neighborhood around the point, 𝑥0 ; b) in distant regions.
EXERCISE 4. Perform the cubic spline interpolation for the data,
𝑖
𝑥
0
1
1
2.5
2
4
3
5.5
4
7
𝑦
–2
0.6
–2.8
1
1.5

77
 The system of equations for the unknown coefficients 𝑎1 , 𝑏1 , … , 𝑑4 in the
required spline interpolation is
1 0
0
0
2
1 ℎ1 ℎ1
ℎ13
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 1 2ℎ1 3ℎ12
0 0
1 3ℎ1
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
1
0
0
0
(0 0
0 0
0
0
0 0
0
0
1 0
0
0
1 ℎ2 ℎ22 ℎ23
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 −1 0
0
0 0 −1
0
0 1 2ℎ2 3ℎ22
0 0
1 3ℎ2
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
1 0
0
0
1 ℎ3 ℎ32 ℎ33
0 0
0
0
0 0
0
0
0 0
0
0
0 0
0
0
0 −1 0
0
0 0 −1
0
0 1 2ℎ3 3ℎ32
0 0
1 3ℎ3
0 0
0
0
0 0
0
0
0 0
0
0
𝑎1
𝑦0
0 0
0
0
𝑏1
𝑦1
0 0
0
0
𝑐1
𝑦1
0 0
0
0
𝑑1
𝑦2
0 0
0
0
𝑎2
𝑦2
0 0
0
0
𝑏2
𝑦3
1 0
0
0
𝑐2
𝑦3
1 ℎ4 ℎ42 ℎ43
𝑑2
𝑦4
0 0
0
0
𝑎3 = 0
0 0
0
0
𝑏3
0
𝑐3
0
0 0
0
0
𝑑
0
0 0
0
0
3
𝑎
0
4
0 −1 0
0
0
𝑏4
0 0 −1 0
0
𝑐
4
0 0
0
0
(
0)
(
𝑑
)
0 0
1 3ℎ3 ) 4
(In this example, ℎ𝑖 = 1.5 for all 𝑖.)
 To solve the system,
o Place the matrix in a (16 × 16) block of cells.
o Use the Excel MINVERSE function to find the inverse matrix.
o Use the Excel MMULT function to left-multiply the right-hand side
column by the inverse matrix.
Remark. The system of linear equations that arises in the construction of spline
interpolation belongs to the sparse category (one whose matrix contains many
zeros). Special computational methods exist for solving such systems. However,
if the number of data points is limited, as in this example, applying general
techniques does not create any difficulties. 
 Plot a chart showing the data and the spline interpolation constructed.

78
79
80
81
82
83
Download