Professional Documents
Culture Documents
Curve Fitting
Curve Fitting
Curve Fitting
Mike Renfro
Part I
Relevance of Interpolation
Relevance of Interpolation
For example, the specific heat property of a given material can be
found via calorimetry experiments, but is not a constant for all
possible temperatures.
Relevance of Interpolation
Interpolation provides a way for us to make close estimates of the
material’s specific heat at other temperatures, in this case, by
fitting a series of simple compatible curves to each segment of the
original data.
Problem 1
Problem 2
Terminology
fi (x) = f (xi−1 )
Mike Renfro Curve Fitting, Interpolation
Step Function Spline
Introduction
Linear Spline
Spline Interpolation
Quadratic Spline
Linear Spline
i 0 1 2 3 4
xi 2.0 3.0 6.5 8.0 12.0
f (xi ) 14.0 20.0 17.0 16.0 23.0
Use the results to estimate the value of f at x = 7.0.
x = 7.0 lies on the interval [6.5, 8.0].
Use i = 3, xi−1 = 6.5, xi = 8.0, f (xi−1 ) = 17.0, and
f (xi ) = 16.0.
The spline equation becomes
f (x3 ) − f (x2 )
f3 (x) = f (x2 ) + (x − x2 )
x3 − x2
Quadratic Spline
fi (x) = ai + bi x + ci x 2 , i = 1, 2, · · · , n
fi (x = xi ) = ai + bi xi + ci xi2 = f (xi ), i = 1, 2, · · · , n − 1
Warning: the x values are known here, the a, b, and c values are
the unknowns!
Second, the first and last quadratic functions must pass through
the endpoints x0 and xn , respectively:
f1 (x = x0 ) = a1 + b1 x0 + c1 x02 = f (x0 )
fn (x = xn ) = an + bn xn + cn xn2 = f (xn )
The above equations provide 2 conditions, making the total so far
2n.
Finally, we need one more condition, and have some leeway in the
condition we can select. One common condition is to specify that
the second derivative (curvature) of the last quadratic function is
zero at xn :
fn00 (x = xn ) = 2cn = 0
cn = 0
The first and last functions must pass through the endpoints x0
and xn
f1 (x0 ) = a1 + 2b1 + 4c1 = 14
f4 (x4 ) = a4 + 12b4 + 144c4 = 23
b1 + 6c1 − b2 − 6c2 = 0
b2 + 13c2 − b3 − 13c3 = 0
b3 + 16c3 − b4 − 16c4 = 0
Finally, set the second derivative at x4 to 0
c4 = 0
1 3 9 0 0 0 0 0 0 0 0 0 a1 20
0 0 0 1 6.5 42.25 0 0 0 0 0 0 b1 17
0 0 0 0 0 0 1 8 64 0 0 0 c1
16
0 0 0 1 3 9 0 0 0 0 0 0 a2
20
0 0 0 0 0 0 1 6.5 42.25 0 0 0
b2
17
0 0 0 0 0 0 0 0 0 1 8 64 c2
16
1
=
2 4 0 0 0 0 0 0 0 0 0
a3
14
0 0 0 0 0 0 0 0 0 1 12 144 b3
23
0
1 6 0 −1 −6 0 0 0 0 0 0
c3
0
0 0 0 0 1 13 0 −1 −13 0 0 0 a4
0
−1 −16
0 0 0 0 0 0 0 1 16 0 b4 0
0 0 0 0 0 0 0 0 0 0 0 1 c4 0