Reference no: EM131557235
The figure below illustrates a thermocline, or region of strong temperature gradient in a stratified fluid. Oceans exhibit this type of behavior. The depth of the thermocline is defined as the location at which the curvature of the depth-temperature curve goes to zero (d2T/dz2 = 0, an in inflection point). The temperature gradient at this location determines the heat transfered between the ocean surface and the ocean floor according to Fourier s law, q = -kdT/dzwhere q is the heat flux density in W/m2 and k is the thermal conductivity in W/mK.
Note that the data should be plotted as shown in the figure with depth on the vertical axis, but that the curve t should be done for temperature as a function of depth (not depth as a function of temperature).
For this problem, assume these data are exact.
![1420_Figure.jpg](https://secure.expertsmind.com/CMSImages/1420_Figure.jpg)
Depth, m
|
|
0
|
100
|
300
|
400
|
500
|
700
|
1000
|
1250
|
1500
|
1750
|
Temperature,
|
C
|
22
|
21.9
|
20.8
|
19.1
|
16.4
|
10
|
6.2
|
5.1
|
4.6
|
4.4
|
(a) By solving a linear system (Vandermonde matrix), find the polynomial that passes through all data points. Plot the polynomial curve. On the same graph, plot the data points. Predict the thermocline depth using the interpolation results. You may want to use the MATLAB function roots for finding the inflection point, or you may wish to use fzero. Note any difficulties you have with this calculation. Estimate the temperature gradient at this location.
(b) What is the minimum-order polynomial that could reasonably be used to predict the thermocline depth? (Hint: you are looking for an in inflection point.) For this order polynomial, find the least-squares curve t using the MATLAB function polyfit. Plot the polynomial curve and the data points. Predict the thermocline location. Estimate the temperature gradient at this location.
(c) Use the MATLAB function spline to interpolate the data as cubic splines. You can call the function by typing
>>f = spline(x,y,xi);
wherex is the vector of depth locations, y is the vector of temperatures and xi is a vector of depths at which the interpolation is to be completed. fwill be a vector of interpolated temperatures. Plot the curve and the data points. To estimate the second derivative, you need to unmake the partial-polynomial form. To do this, type
>>pp = spline(x,y);
The resulting vector can be "unmade" by typing
>>[breaks,coef,L,K] = unmkpp(pp);
The matrix, coef, will be an N*4 matrix where N is the number of intervals. The rows of the matrix are the cubic polynomial coe¢ cients for the corresponding interval. For example, the cubic describing the second interval is given by
f2(x) = coef(2,1)(x -x2)3 + coef(2,2)(x- x2)2 + coef(2,3)(x- x2) + coef(2,4)
Since you ought to be able to determine in which interval the inflection point will occur, you should be able to extract the depth where the second derivative reaches zero.
(d) Compare the thermocline depth predictions and the temperature gradient estimates from each of the three methods. Discuss, including other observations about the three approximations. Which do you think is likely to give the most physically realistic result?
(e) With the help of the MATLAB function csape, repeat parts (c) and (d) for end conditions corresponding to the natural ( "variational" ) spline and the default ( Lagrange ) spline and compare with results for the MATLAB default "not-a-knot" end condition. Comment on the differences. Which do you think is likely more correct and why?