The density of liquid water is tabulated at four temperatures

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics

Computational Physics, Ch Where a function vanishes, and what lies between the points

Problem

The density of liquid water ρ\rho is tabulated at four temperatures, equally spaced by 10 ∘C10\,^\circ\mathrm{C}. Treat these four readings as exact.
TT (∘C^\circ\mathrm{C})0102030
ρ\rho (kg m−3\mathrm{kg\,m^{-3}})999.84999.70998.21995.65
((a)) Construct the Lagrange interpolating cubic through all four points and use it to estimate ρ\rho at T=15 ∘CT = 15\,^\circ\mathrm{C}. ((b)) A natural cubic spline is to be built through the same four points, with natural end conditions M0=M3=0M_0 = M_3 = 0, where Mi=S′′(xi)M_i = S''(x_i) is the spline's second derivative at node ii. Using the equal spacing h=10 ∘Ch = 10\,^\circ\mathrm{C}, write down the tridiagonal system satisfied by the two interior second derivatives M1M_1 and M2M_2 (at T=10 ∘CT=10\,^\circ\mathrm{C} and T=20 ∘CT=20\,^\circ\mathrm{C}), and solve it by a forward elimination (a Thomas sweep) followed by back-substitution. ((c)) Evaluate the spline's cubic piece on [10,20][10,20] at T=15 ∘CT = 15\,^\circ\mathrm{C} and compare the result with part (a). ((d)) Evaluate the first derivative of the spline piece on [0,10][0,10] at T=10 ∘CT=10\,^\circ\mathrm{C} from the left, and the first derivative of the piece on [10,20][10,20] at T=10 ∘CT=10\,^\circ\mathrm{C} from the right, and confirm that they agree.

Browse the problem library