HW 31 Discussion * The improved accuracy of the values in the table did not seem to affect the accuracy of the integral approximations. * We have 7 digits in the data, so the best we can do is a 6 or 7 digits (or a relative error of 10^(-6), 10^(-7)) * Recall the error estimate from the notes (page 7). The absolute error between the y values in the table and the y values obtained from the cubic spline are less than h^4 * max | f''''(x) |/24 * For this problem, h is the difference in the x-coordinates in the table. This is h = 2.727272e-01 The exact function is in the hw31fun.m file. Computing and plotting the 4th derivative of this reveals that the maximum of this is about 52.7. The error in the y values obtained from the spline is guaranteed to be less than (2.727272e-01)^4*52.7/24 = 0.01216 This is not great and this is reflected in the calculations for HW 31. IMPORTANT!!!! ************************************************************************ The spacing of the x-coordinates is what is limiting the accuracy of our approximations. The conclusion is if you need more accuracy than this, then you need more raw data. ************************************************************************ This is one of the reasons that computers dedicated to various scientific simulations keep getting bigger and bigger. Computer models that incorporate more effects (say including pressure, temperature, dew point, pollutants, chemical reactions, and the mass of clouds in a weather simulation) will be more accurate than a model that just includes pressure, temperature and dew point. A more complex model requires more variables and more equations which leads to the need for more memory and storage space. More accuracy in the computed solutions ultimately requires finer spacing in the grid points. This is not bad for one-dimensional problems. It starts to become a concern for two dimensions and is one of the primary factors of concern for three-dimesional problems. * Results Trapezoidal rule applied to raw data relative error = -2.364762546621578e-02 Create spline, grow the table and apply trapezoidal rule relative error = 1.445224131550613e-04 Apply Simpson's rule to the grown table relative error = 1.357486298435793e-03 Integrate the spline relative error = 1.354507674463709e-03 * Suprisingly, the trapezoidal rule applied to the grown table is most accurate (by 1 order of magnitde over the Simpson's and spline integration) * Simpson's and spline integration errors are almost identical.