Description
The speci c heat capacity of a substance corresponds to the amount of heat needed per unit mass to increase its temperature by one unit. This home-work asks you to estimate the the speci c heat capacity C(T ) (in Joule / (Kelvin Mole)) of graphite, a crystalline form of the atom carbon, as a func-tion of temperature T (in Kelvin) by employing polynomial interpolation.
A chemist measures (in the units speci ed in the previous paragraph) the speci c heat capacity, as well as the rate-of-change in the speci c heat capacity (i.e., the derivative of the speci c heat capacity), of graphite at various temperatures in the interval [300; 600]. The data is provided together with this homework; see specheat data.mat. This data consists of 25 triplets of the form (Tj ; Cj ; Dj ) for j = 1; : : : ; 25, where Tj represents the temperature, Cj is the measured speci c heat capacity, Dj is the measured derivative of the speci c heat capacity at temperature Tj . A plot of the data is given in Figure 1 below.
-
16
0.04
14
0.035
0.03
12
0.025
10
0.02
8
0.015
300
350
400
450
500
550
600
300
350
400
450
500
550
600
Figure 1: The plot of the data (Tj ; Cj ; Dj ) for j = 1; : : : ; 25, where the horizontal axis is the temperature, whereas the vertical axis corresponds to the speci c heat capacity on the left, and its derivative on the right. (Left) (Tj ; Cj ) for j = 1; : : : ; 25. (Right) (Tj ; Dj ) for j = 1; : : : ; 25.
1
As discussed in class there exists a unique polynomial C(T ) of degree n 1 such that
C(Tkj ) = Ckj for j = 1; : : : ; n;
where k1; : : : ; kn 2 f1; : : : ; 25g are distinct integers. For instance, the unique polynomial C(T ) of degree 5 such that C(T4j ) = C4j for j = 1; : : : ; 6 is plotted below, where the interpolation points are marked with black crosses.
-
18
16
14
12
10
8
300
350
400
450
500
550
600
Figure 2: The blue curve is the graph of the unique polynomial C(T ) of degree
5 such that C(T4j ) = C4j for j = 1; : : : ; 6.
In all parts below, you can use the Matlab routines discussed in class and made available on the course webpage. In each part, you must include the print-outs of the Matlab commands you used, and/or the Matlab routines you implemented, in addition to what is asked in the question.
-
Find the cubic polynomial through the points
(T6; C6); (T12; C12); (T18; C18); (T24; C24)
using the Vandermonde matrix based approach, in particular by solving a linear system whose coe cient matrix is a Vandermonde matrix.
Provide a plot of the cubic polynomial that you computed, similar to the plot in Figure 2. Provide also precisely the coe cients of the polynomial you computed.
-
Find the polynomial of degree 7 through the points
(T3j ; C3j ) j = 1; : : : ; 8
2
using the Lagrange interpolation. Again provide a plot of the computed poly-nomial (similar to Figure 2), as well as the coe cients of the polynomial.
-
Hermite interpolation involves not only the interpolation of the function values, but also the interpolation of the derivatives. For instance, there exists a
-
unique polynomial C(T ) of degree 2n 1 such that
C(Tkj ) = Ckj and C0(Tkj ) = Dkj for j = 1; : : : ; n;
(0.1)
where again k1; : : : ; kn 2 f1; : : : ; 25g are distinct integers.
Devise a generalization of the Vandermonde matrix based approach discussed in the class for Hermite interpolation so that the polynomial C(T ) satis es (0.1) for a speci ed integer n and speci ed k1; : : : ; kn 2 f1; : : : ; 25g. In particular, you must set up a linear system
Ax = b
where A is a 2n 2n Vandermonde-like matrix, then solve the linear system using the command x = Anb in Matlab.
Implement your method in Matlab. Then use it to nd the unique polynomial C(T ) of degree 5 such that
C(T8j ) = C8j and C0(T8j ) = D8j
for j = 1; 2; 3. Provide the plot of the computed C(T ) following the practice in Figure 2. Additionally, provide the plot of C0(T ) again following the practice in Figure 2, but by employing the data points for the derivatives, i.e., by employing the points on the right-hand side of Figure 1 rather than the left-hand side. Also include the coe cients of the computed polynomial.
-
It is also possible to perform Hermite interpolation using the Newton form. De ning x1; : : : ; x2n by x2j 1 = x2j = Tkj , it can be shown that the polynomial of degree 2n 1 satisfying (0.1) can be expressed as
C(T ) = c1 + c2 2(T ) + c3 3(T ) + + cn n(T )
where c1 = f(x1) and
j (T ) = (T x1)(T x2) : : : (T xj 1); cj = f[x1; x2; : : : ; xj ]
for j = 2; 3; : : : ; n.
The divided di erences are still de ned nearly as discussed in the class, that is, for j > i, we have
-
f[xi; : : : ; xj ] :=
f[xi+1; : : : ; xj ]
f[xi; : : : ; xj 1]
and f[xi] := f(xi)
xj
xi
3
with the only exception
f[xi; xi+1] :=
8
>f0(xi)
<
f(xi+1) f(xi)
>
: xi+1 xi
if xi = xi+1;
if xi 6= xi+1:
Implement the Newton form in Matlab. Use it to nd the unique polynomial C(T ) of degree 9 such that
C(T5j ) = C5j and C0(T5j ) = D5j
for j = 1; 2; 3; 4; 5. Once again provide the plots of the computed C(T ) and C0(T ), as well as the coe cients of C(T ).
4