Write a program that computes the specific weight of water for a given temperatu
ID: 3881016 • Letter: W
Question
Write a program that computes the specific weight of water for a given temperature using the data from Appendix A. Such a program could be part of a more comprehensive program to be written later. The following options could be used: a. Enter the table data for specific weight as a function of temperature into an array. Then, for a specified temperature, search the array for the corresponding specific weight. Interpolate temperatures between values given in the table. b. Include data in both SI units and U.S. Customary System units. c. Include density. d. Include checks in the program to ensure that the specified temperature is within the range given in the tables (i.e., above the freezing point and below the boiling point). e. Instead of using the table look-up approach, use a curve-fit technique to obtain equations of the properties of water versus temperature. Then compute the desired property value for any specified temperature. Use a spreadsheet to display the values of specific weight and density of water from Appendix A. Then create curve-fit equations for specific weight versus temperature and density versus temperature using the Trendlines feature of the spreadsheet chart. Add this equation to the spreadsheet to produce computed values of specific weight and density for any given temperature. Compute the percent difference between the table values and the computed values. Display graphs for specificExplanation / Answer
temp = 0:5:100;
sp_wt = [9.81 9.81 9.81 9.81 9.79 9.78 9.77 9.75 9.73 9.71 9.69 9.67 9.65 9.62 9.59 9.56 9.53 9.50 9.47 9.44 9.40];
density = [1000 1000 1000 1000 998 997 996 994 992 990 988 986 984 981 978 975 971 968 965 962 968];
x = input('Enter temp: ');
index = floor(x/5) + 1;
y_sp_wt = sp_wt(index) + (sp_wt(index + 1) - sp_wt(index)) * (x - temp(index))/5 ;
y_density = density(index) + (density(index + 1) - density(index)) * (x - temp(index))/5 ;
fprintf('sp-wt = %d KiloNewton per cubic meter density = %d kg per cubic meter ', y_sp_wt, y_density)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.