This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ME 218: ENGINEERING COMPUTATIONAL METHODS
SOLUTIONS TO HOMEWORK #5
Problem 1:
Q = kPa Linearizing this function by taking the logarithms (base 10) on both sides: log(Q) = log(k) + a*log(P), which is of the form: y = mx + c, where y = log(Q), m = a, x = log(P) and c = log(k). Rewriting the data set: Q 94 118 147 180 230 P 10 16 25 40 60 log Q 1.973128 2.071882 2.167317 2.255273 2.361728 log P 1 1.20412 1.39794 1.60206 1.778151 The linear least squares equations are given as: m∑ x 2 + c∑ x = ∑ Yx m∑ x + c ∑1 = ∑ Y
2 m ∑ x c = ∑x This system of simultaneous equations can be solved as follows: ∑ x ∑ Yx N ∑Y −1 From the data set: Σx = Σlog(P) = 6.983 Σx2 = Σ [log(P)]2 = 10.133
N = no. of data points = 5 ΣYx = Σ [log(P)*log(Q)] = 15.310 ΣY = Σlog(Q) = 10.829 m 10.133 6.983 15.310 ∴ = 5 10.829 c 6.983 m 2.628 − 3.67 15.310 0.489 or, = = c − 3.67 5.326 10.829 1.482 Hence, a = m = 0.489 and k = 10c = 101.482 = 30.365 −1 Problem 2:
The data has been given for the years 1985 onwards. Now, instead of using the true value of the year (i.e., 1987 say), it is better to use another index with smaller values for the year. In this case, I have chosen the index to be the difference of the year from the base year of 1985. The reason this is a better formulation is because the quadratic involves a summation over the 4th power of the year. It is easy to see that 1987 raised to the 4th power is an astronomically high figure and hence, even minor truncation or round off errors in the calculation of the coefficients of the 4th power term can eventually lead to drastic variation in the final answer.
Year 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 Expenditure (billion $) 731 782 833 886 956 1049 1159 1267 1367 1436 Year Index 0 1 2 3 4 5 6 7 8 9 Plotting the curves in EXCEL for the given expenditure and the year index: • • Linear ( y = mx + c) y = Expenditure and x = Year Index Quadratic (y = ax2 + bx + c) y = Expenditure and x = Year Index 1600 1400 1200 1000 Series1 800 600 400 200 0 0 2 4 6 8 10 Linear (Series1) Poly. (Series1) y = 3.9583x 2 + 46.327x + 725.32 y = 81.952x + 677.82 The answers are: • y = 81.952x + 677.82 (Linear) Substituting x = 10 for the year 1995, y = 1497.3 Thus, the linear case gives a projected expenditure of $1497.3 billion in 1995 • y = 3.9583x2 + 46.327x + 725.32 (Quadratic) Substituting x = 10 for the year 1995, y = 1584.4 Thus, the quadratic case gives a projected expenditure of $1584.4 billion in 1995. It is easy to see that for the given actual value of $1505 billion for 1995, the linear case gives the more accurate projection, since 1505 – 1497 < 1505 – 1584. ...
View
Full
Document
 Fall '08
 Unknown

Click to edit the document details