exam3_sol - (c) The cubic spline through the four points...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CE 335 Exam 3 Solutions 1] (a) The function v = aP b can be transformed to make it linear in the unknown parameters log(a) and b: log(v) = log(a) + b log(P). The coefficient matrix X of the linearized problem has ones in the first column and log(P i ) in the second column, and the right-hand side column vector y has entries log(v i ). With this notation, the system of normal equations can be written as X T Xz = X T y , where the elements of the vector z are the unknown parameters log(a) and b. Written out, the system is 4 log(a) - 7.71 b = -1.05 -7.71 log(a) + 35.19 b = 3.64 (b) P = [0.01 0.03 0.5 3]'; v = [0.62 0.68 0.85 0.98]'; X = [ones(4, 1) log(P)]; y = log(v); z = X \ y; a = exp(z(1)); b = z(2); 2] (a) Newton form of the interpolating polynomial is (using t = T - 294 for simplicity) r(t) = 2 + t - t(t - 1)/4 + t(t - 1)(t - 2)/12 at T = 295.5, t = 1.5 and r(t) = 2 + 1.5 - 1.5/8 - 1.5/48 = 3.28 (b) t = 0:3; r = [2 3 3.5 4]; p = polyfit(t, r, 3); r_find = polyval(p, 1.5);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (c) The cubic spline through the four points will have three segments, each different cubic polynomials and in general not the same as the interpolating cubic polynomial through the four points. With not-a-knot end conditions, the first and second and second and third segments will have the same cubic polynomial, so all three segments will have a single cubic polynomial. Because this polynomial interpolates all four points and the interpolating cubic polynomial is unique, this must be the same as the interpolating polynomial. 3] (a) f(0) = 0, f(2.5) = 0.794, f(5) = 0.893, f(7.5) = 0.935, f(10) = 0.958 composite trapezoid rule with 2 segments: T 2 = 10 * (f(0) + 2f(5) + f(10)) / 4 = 6.86 composite trapezoid rule with 4 segments: T 4 = 10 * (f(0) + 2f(2.5) + 2f(5) + 2f(7.5) + f(10)) / 8 = 7.75 (b) We can combine T 2 and T 4 to cancel out the lowest-order error term (Romberg integration): T = (4T 4 - T 2 )/3 = 8.05...
View Full Document

Ask a homework question - tutors are online