Question: Please solve using MATLAB Here is the data from H2Odensity.dat: % Density of saturated liquid water % T(C) rho(kg/m^3) 0 999.9 5 1000.0 10 999.7
Please solve using MATLAB

Here is the data from H2Odensity.dat:
% Density of saturated liquid water % T(C) rho(kg/m^3) 0 999.9 5 1000.0 10 999.7 20 998.2 30 995.7 40 992.2 50 988.1 60 983.2 70 977.8 80 971.8 90 965.3 100 958.4
(Polynomial least squares fitting, 15 points) Download the data file H20density.dat posted on the course website. This file contains the measured values of the density of a saturated liquid water as a function of temperature. (a) Determine the coefficients of the least squares polynomial, pn, that fits the data for degrees n 0,1,2,3, & 4 (use temperature as the independent variable). Report these values. (b) For each polynomial pa(T) you obtain, also compute the maximum error as defined by 1KiKN where Ti is the temperature data, s the density data, and N is the number of data points in the data file. To compute the error, you can use the norm function. For example, err (n) norm(pn rho, inf) = - where pn is the polynomial you found evaluated at the data points T, and pi are the measured values of density. Report each of the four errors in your write-up. e) Make a nice plot of the data and the qth degre polynomial pa(T) that you found evaluated at several T values over the range of temperatures given. Include the original data in your plot and add a legend, axes labels and a title to your plot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
