numerical method for engineers-chapter 20

Upload: mrbudakbaek

Post on 06-Apr-2018

286 views

Category:

Documents


5 download

TRANSCRIPT

  • 8/2/2019 Numerical Method for engineers-chapter 20

    1/46

    1

    CHAPTER 20

    20.1 A plot of log10kversus log10fcan be developed as

    y = 0.4224x - 0.83

    R2

    = 0.9532-0.6

    -0.4

    -0.2

    0

    0.2

    0.7 0.9 1.1 1.3 1.5 1.7 1.9 2.1 2.3

    As shown, the best fit line is

    83.0log422363.0log 1010 = kf

    Therefore, 2 = 100.83 = 0.147913 and 2 = 0.422363, and the power model is

    422363.00.147913xy =

    The model and the data can be plotted as

    y = 0.1479x0.4224

    R2

    = 0.9532

    0

    0.5

    1

    1.5

    0 20 40 60 80 100 120 140 160

    20.2 We can first try a linear fit

    y = 2.5826x + 1365.9

    R2

    = 0.9608

    1200

    1400

    1600

    1800

    -60 -30 0 30 60 90 120

    As shown, the fit line is somewhat lacking. Therefore, we can use polynomial regression to

    fit a parabola

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    2/46

    2

    y = 0.0128x2

    + 1.8164x + 1331

    R2

    = 0.9934

    1200

    1400

    1600

    1800

    -60 -30 0 30 60 90 120

    This fit seems adequate in that it captures the general trend of the data. Note that a slightly

    better fit can be attained with a cubic polynomial, but the improvement is marginal.

    20.3 This problem is ideally suited for Newton interpolation. First, order the points so that they

    are as close to and as centered about the unknown as possible.

    x0 = 20 f(x0) = 8.17

    x1 = 15 f(x1) = 9.03

    x2 = 25 f(x2) = 7.46

    x3 = 10 f(x3) = 10.1

    x4 = 30 f(x4) = 6.85

    x5 = 5 f(x5) = 11.3

    x6 = 0 f(x6) = 12.9

    The results of applying Newtons polynomial at T= 18 are

    Order f(x) Error

    0 8.17000 0.344

    1 8.51400 -0.018

    2 8.49600 -0.00336

    3 8.49264 0.00022

    4 8.49286 -0.00161

    5 8.49125 -0.00298

    6 8.48827

    The minimum error occurs for the third-order version so we conclude that the interpolation is

    8.4926.

    20.4 We can use MATLAB to solve this problem,

    >> format long>> T = [0 5 10 15 20 25 30];>> c = [12.9 11.3 10.1 9.03 8.17 7.46 6.85];>> p = polyfit(T,c,3)

    p =-0.00006222222222 0.00652380952381 -0.34111111111111

    12.88785714285715

    Thus, the best-fit cubic would be

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    3/46

    3

    32 20.000062220.006523810.3411111112.8878571 TTTc +=

    We can generate a plot of the data along with the best-fit line as

    >> Tp=[0:30];>> cp=polyval(p,Tp);

    >> plot(Tp,cp,T,c,'o')

    We can use the best-fit equation to generate a prediction at T= 8 as

    >> y=polyval(p,8)

    y =

    10.54463428571429

    20.5 The multiple linear regression model to evaluate is

    caTaao 210 ++=

    As described in Section 17.1, we can use general linear least squares to generate the best-fit

    equation. The [Z] and y matrices can be set up using MATLAB commands as

    >> format long>> t = [0 5 10 15 20 25 30];>> T = [t t t]';

    >> c = [zeros(size(t)) 10*ones(size(t)) 20*ones(size(t))]';>> Z = [ones(size(T)) T c];>> y = [14.6 12.8 11.3 10.1 9.09 8.26 7.56 12.9 11.3 10.1 9.03 8.177.46 6.85 11.4 10.3 8.96 8.08 7.35 6.73 6.2]';

    The coefficients can be evaluated as

    >> a=inv(Z'*Z)*(Z'*y)

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    4/46

    4

    a =13.52214285714285-0.20123809523809-0.10492857142857

    Thus, the best-fit multiple regression model is

    cTo 1428570.104928575238090.20123809571428513.5221428 =

    We can evaluate the prediction at T= 17 and c = 5 and evaluate the percent relative error as

    >> op = a(1)+a(2)*17+a(3)*5

    op =9.57645238095238

    We can also assess the fit by plotting the model predictions versus the data. A one-to-one

    line is included to show how the predictions diverge from a perfect fit.

    4

    8

    12

    16

    4 8 12 16

    The cause for the discrepancy is because the dependence of oxygen concentration on the

    unknowns is significantly nonlinear. It should be noted that this is particularly the case for

    the dependency on temperature.

    20.6 The multiple linear regression model to evaluate is

    caTaTaTaao 43

    32

    210 ++++=

    The Excel Data Analysis toolpack provides a convenient tool to fit this model. We can setup a worksheet and implement the Data Analysis Regression tool as

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    5/46

    5

    When the tool is run, the following worksheet is generated

    Thus, the best-fit model is

    cTTTos 10492857.0000043704.000574444.0336423.0027143.1432 +=

    The model can then be used to predict values of oxygen at the same values as the data.

    These predictions can be plotted against the data to depict the goodness of fit.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    6/46

    6

    Thus, although there are some discrepancies, the fit is generally adequate. Finally, the

    prediction can be made at T= 20 and c = 10,

    19754.8)10(10492857.0)20(000043704.0)20(00574444.0)20(336423.0027143.14 32 =+=sowhich compares favorably with the true value of 8.17 mg/L.

    20.7 (a) The linear fit is

    y = 1.05897x + 0.81793

    R2

    = 0.90583

    0

    20

    40

    60

    80

    0 20 40 60 80

    The tensile strength at t= 32 can be computed as

    34.704891381793.0)32(05897.1 =+=y

    (b) A straight line with zero intercept can be fit as

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    7/46

    7

    y = 1.07514x

    R2

    = 0.90556

    0

    20

    40

    60

    80

    0 20 40 60 80

    For this case, the tensile strength at t= 32 can be computed as

    34.40452)32(07514.1 ==y

    20.8 Linear regression with a zero intercept gives [note that T(K) = T(oC) + 273.15].

    y = 29.728x

    R2

    = 0.9999

    0

    5000

    10000

    15000

    0 100 200 300 400 500

    Thus, the fit is

    Tp 728.29=

    Using the ideal gas law

    n

    V

    T

    pR

    =

    For our fit

    728.29=T

    p

    For nitrogen,

    g/mole28

    kg1=n

    Therefore,

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    8/46

    8

    8.32428/10

    10728.29

    3=

    =R

    This is close to the standard value of 8.314 J/gmole.

    20.9 This problem is ideally suited for Newton interpolation. First, order the points so that they

    are as close to and as centered about the unknown as possible.

    x0 = 740 f(x0) = 0.1406x1 = 760 f(x1) = 0.15509

    x2 = 720 f(x2) = 0.12184

    x3 = 780 f(x3) = 0.16643

    x4 = 700 f(x4) = 0.0977

    The results of applying Newtons polynomial at T= 750 are

    Order f(x) Error 0 0.14060 0.007245

    1 0.14785 0.000534

    2 0.14838 -7E-05

    3 0.14831 0.00000

    4 0.14831

    Note that the third-order polynomial yields an exact result, and so we conclude that the

    interpolation is 0.14831.

    20.10 A program can be written to fit a natural cubic spline to this data and also generate the first

    and second derivatives at each knot.

    Option Explicit

    Sub Splines()Dim i As Integer, n As IntegerDim x(100) As Double, y(100) As Double, xu As Double, yu As DoubleDim dy As Double, d2y As DoubleDim resp As VariantRange("a5").Selectn = ActiveCell.RowSelection.End(xlDown).Selectn = ActiveCell.Row - nRange("a5").SelectFor i = 0 To nx(i) = ActiveCell.Value

    ActiveCell.Offset(0, 1).Selecty(i) = ActiveCell.ValueActiveCell.Offset(1, -1).Select

    Next iRange("c5").SelectRange("c5:d1005").ClearContentsFor i = 0 To nCall Spline(x(), y(), n, x(i), yu, dy, d2y)ActiveCell.Value = dy

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    9/46

    9

    ActiveCell.Offset(0, 1).SelectActiveCell.Value = d2yActiveCell.Offset(1, -1).Select

    Next iDoresp = MsgBox("Do you want to interpolate?", vbYesNo)If resp = vbNo Then Exit Do

    xu = InputBox("z = ")Call Spline(x(), y(), n, xu, yu, dy, d2y)MsgBox "For z = " & xu & Chr(13) & "T = " & yu & Chr(13) & _

    "dT/dz = " & dy & Chr(13) & "d2T/dz2 = " & d2yLoopEnd Sub

    Sub Spline(x, y, n, xu, yu, dy, d2y)Dim e(100) As Double, f(100) As Double, g(100) As Double, r(100) As Double,d2x(100) As DoubleCall Tridiag(x, y, n, e, f, g, r)Call Decomp(e(), f(), g(), n - 1)Call Substit(e(), f(), g(), r(), n - 1, d2x())Call Interpol(x, y, n, d2x(), xu, yu, dy, d2y)End Sub

    Sub Tridiag(x, y, n, e, f, g, r)Dim i As Integerf(1) = 2 * (x(2) - x(0))g(1) = x(2) - x(1)r(1) = 6 / (x(2) - x(1)) * (y(2) - y(1))r(1) = r(1) + 6 / (x(1) - x(0)) * (y(0) - y(1))For i = 2 To n - 2e(i) = x(i) - x(i - 1)f(i) = 2 * (x(i + 1) - x(i - 1))g(i) = x(i + 1) - x(i)r(i) = 6 / (x(i + 1) - x(i)) * (y(i + 1) - y(i))r(i) = r(i) + 6 / (x(i) - x(i - 1)) * (y(i - 1) - y(i))

    Next ie(n - 1) = x(n - 1) - x(n - 2)

    f(n - 1) = 2 * (x(n) - x(n - 2))r(n - 1) = 6 / (x(n) - x(n - 1)) * (y(n) - y(n - 1))r(n - 1) = r(n - 1) + 6 / (x(n - 1) - x(n - 2)) * (y(n - 2) - y(n - 1))End Sub

    Sub Interpol(x, y, n, d2x, xu, yu, dy, d2y)Dim i As Integer, flag As IntegerDim c1 As Double, c2 As Double, c3 As Double, c4 As DoubleDim t1 As Double, t2 As Double, t3 As Double, t4 As Doubleflag = 0i = 1DoIf xu >= x(i - 1) And xu

  • 8/2/2019 Numerical Method for engineers-chapter 20

    10/46

    10

    t3 = -c3t4 = c4dy = t1 + t2 + t3 + t4t1 = 6 * c1 * (x(i) - xu)t2 = 6 * c2 * (xu - x(i - 1))d2y = t1 + t2flag = 1

    Elsei = i + 1End IfIf i = n + 1 Or flag = 1 Then Exit Do

    LoopIf flag = 0 ThenMsgBox "outside range"End

    End IfEnd Sub

    Sub Decomp(e, f, g, n)Dim k As IntegerFor k = 2 To ne(k) = e(k) / f(k - 1)

    f(k) = f(k) - e(k) * g(k - 1)Next kEnd Sub

    Sub Substit(e, f, g, r, n, x)Dim k As IntegerFor k = 2 To nr(k) = r(k) - e(k) * r(k - 1)

    Next kx(n) = r(n) / f(n)For k = n - 1 To 1 Step -1x(k) = (r(k) - g(k) * x(k + 1)) / f(k)

    Next kEnd Sub

    Here is the output when it is applied to the data for this problem:

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    11/46

    11

    The plot suggests a zero second derivative at a little above z= 1.2 m. The program is set up toallow you to evaluate the spline prediction and the associated derivatives for as many cases as

    you desire. This can be done by trial-and-error to determine that the zero second derivative

    occurs at about z= 1.2315 m. At this point, the first derivative is 73.315 oC/m. This can be

    substituted into Fouriers law to compute the flux as

    scm

    cal01466.0

    cm100

    m

    m

    C315.73

    Ccms

    cal02.0

    2=

    =J

    20.11 This is an example of the saturated-growth-rate model. We can plot 1/[F] versus 1/[B] and

    fit a straight line as shown below.

    y = 0.008442x + 0.010246

    R2

    = 0.999932

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    0 2 4 6 8 10

    The model coefficients can then be computed as

    60128.97010246.0

    13 ==

    823968.0)008442.0(60128.973 ==

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    12/46

    12

    Therefore, the best-fit model is

    ][823968.0

    ][60128.97][

    F

    FB

    +=

    A plot of the original data along with the best-fit curve can be developed as

    0

    20

    40

    60

    80

    100

    120

    0 2 4 6 8 10

    20.12 Nonlinear regression can be used to estimate the model parameters. This can be done using

    the Excel Solver

    Here are the formulas:

    Therefore, we estimate k01 = 7,526.842 and E1 = 4.478896.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    13/46

    13

    20.13 Nonlinear regression can be used to estimate the model parameters. This can be done using

    the Excel Solver. To do this, we set up columns holding each side of the equation: PV/(RT)

    and 1 + A1/V+ A2/V. We then form the square of the difference between the two sides and

    minimize this difference by adjusting the parameters.

    Here are the formulas that underly the worksheet cells:

    Therefore, we estimate A1 = -237.531 and A2 = 1.192283.

    20.14 The standard errors can be computed via Eq. 17.9

    pn

    Ss rxy

    =/

    n = 15

    Model A Model B Model C

    Sr 135 105 100

    Number of model parameters fit (p) 2 3 5

    sy/x 3.222517 2.95804 3.162278

    Thus, Model B seems best because its standard error is lower.

    20.15 A plot of the natural log of cells versus time indicates two straight lines with a sharp break

    at 2. The Excel Trendline tool can be used to fit each range separately with the exponential

    model as shown in the second plot.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    14/46

    14

    -3

    -2

    -1

    0

    1

    2

    0 2 4 6

    y = 0.1000e1.1999x

    R2

    = 1.0000 y = 0.4951e0.4001x

    R2

    = 1.0000

    0

    2

    4

    6

    0 2 4 6 8

    20.16 This problem can be solved with Excel,

    20.17 This problem can be solved with a power model,

    21

    0aaWHaA =

    This equation can be linearized by taking the logarithm

    WaHaaA 10210101010 loglogloglog ++=

    This model can be fit with the Excel Data Analysis Regression tool,

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    15/46

    15

    The results are

    Therefore the best-fit coefficients are a0 = 101.86458 = 0.013659, a1 = 0.5218, and a2 = 0.5190.

    Therefore, the model is

    5190.05218.00.013659 WHA =

    We can assess the fit by plotting the model predictions versus the data. We have included the

    perfect 1:1 line for comparison.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    16/46

    16

    1.9

    2.1

    2.3

    1.9 2.1 2.3

    The prediction at H= 187 cm and W= 78 kg can be computed as

    008646.2)78(87)0.013659(1 5190.05218.0 ==A

    20.18 The Excel Trend Line tool can be used to fit a power law to the data:

    Note that although the model seems to represent a good fit, the performance of the lower-

    mass animals is not evident because of the scale. A log-log plot provides a better perspective

    to assess the fit:

    y = 3.3893x0.7266

    R2

    = 0.9982

    0.1

    1

    10

    100

    1000

    0.1 1 10 100 1000

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    17/46

    17

    20.19 For the Casson Region, linear regression yields

    99985.0180922.0065818.0 2 =+= r

    For the Newton Region, linear regression with zero intercept gives

    99992.0032447.0 2 == r

    On a Casson plot, this function becomes

    180131.0=

    We can plot both functions along with the data on a Casson plot

    0

    1

    2

    3

    4

    0 5 10 15 20

    180922.0065818.0 += 180922.0065818.0 +=

    180131.0 180131.0

    20.20 Recall from Sec. 4.1.3, that finite divided differences can be used to estimate the

    derivatives. For the first point, we can use a forward difference (Eq. 4.17)

    1725.0153204

    8.876.96=

    =

    d

    d

    For the intermediate points, we can use centered differences. For example, for the second

    point

    8647.0153255

    8.87176=

    =

    d

    d

    For the last point, we can use a backward difference

    2157.17714765

    33804258=

    =

    d

    d

    All the values can be tabulated as

    d/d87.8 153 0.1725

    96.6 204 0.8647

    176 255 1.6314

    263 306 1.7157

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    18/46

    18

    351 357 3.0196

    571 408 4.7353

    834 459 6.4510

    1229 510 7.7451

    1624 561 8.6078

    2107 612 10.3333

    2678 663 12.48043380 714 15.4902

    4258 765 17.2157

    We can plot these results and after discarding the first few points, we can fit a straight line as

    shown (note that the discarded points are displayed as open circles).

    y = 0.003557x + 2.833492

    R2

    = 0.984354

    0

    5

    10

    15

    20

    0 1000 2000 3000 4000

    Therefore, the parameter estimates are Eo = 2.833492 and a = 0.003557. The data along with

    the first equation can be plotted as

    0

    4000

    8000

    12000

    0 200 400 600 800

    As described in the problem statement, the fit is not very good. We therefore pick a point near

    the midpoint of the data interval

    )2107,612( ==

    We can then plot the second model

    )1(5.269)1(1

    2107 003557.0003557.0)612(003557.0

    =

    = ee

    e

    The result is a much better fit

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    19/46

    19

    0

    1000

    2000

    3000

    4000

    5000

    0 100 200 300 400 500 600 700 800

    20.21 The problem is set up as the following Excel Solver application. Notice that we have

    assumed that the model consists of a constant plus two bell-shaped curves:

    22

    22

    21

    21 )(

    2)(

    1)(axkaxk ekek

    cxf

    ++=

    The resulting solution is

    Thus, the retina thickness is estimated as 0.312 0.24 = 0.072.

    20.22 Simple linear regression can be applied to yield the following fit

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    20/46

    20

    y = 7.6491x - 1.5459

    R2

    = 0.8817

    0

    20

    40

    60

    80

    100

    0 2 4 6 8 10 12

    The shear stress at the depth of 4.5 m can be computed as

    875.325459.1)5.4(6491.7 ==

    20.23 (a) and (b) Simple linear regression can be applied to yield the following fit

    y = 0.7335x + 0.7167

    R2

    = 0.8374

    0

    1

    2

    3

    4

    0 0.5 1 1.5 2 2.5 3 3.5

    (c) The minimum lane width corresponding to a bike-car distance of 2 m can be computed as

    m1837.27167.0)2(7335.0 =+=y

    20.24 (a) and (b) Simple linear regression can be applied to yield the following fit

    y = 0.1519x + 0.8428

    R2

    = 0.894

    12

    16

    20

    24

    80 90 100 110 120 130 140 150

    (c) The flow corresponding to the precipitation of 120 cm can be computed as

    067.198428.0)120(1519.0 =+=Q

    (d) We can redo the regression, but with a zero intercept

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    21/46

    21

    y = 0.1594x

    R2

    = 0.8917

    12

    16

    20

    24

    80 90 100 110 120 130 140 150

    Thus, the model is

    PQ 1594.0=

    where Q = flow and P= precipitation. Now, if there are no water losses, the maximum flow,

    Qm, that could occur for a level of precipitation should be equal to the product of the annual

    precipitation and the drainage area. This is expressed by the following equation.

    =

    yr

    cm)km( 2 PAQm

    For an area of 1100 km2 and applying conversions so that the flow has units of m3/s

    d365

    yr

    s400,86

    d

    cm100

    m1

    km

    m10

    yr

    cmkm100,1

    2

    262

    = PQm

    Collecting terms gives

    PQm 348808.0=

    Using the slope from the linear regression with zero intercept, we can compute the fraction of

    the total flow that is lost to evaporation and other consumptive uses can be computed as

    543.0348808.0

    1594.0348808.0=

    =F

    20.25 The data can be computed in a number of ways. First, we can use linear regression.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    22/46

    22

    y = 0.2879x - 0.629

    R2

    = 0.9855

    0

    2

    4

    6

    8

    10

    12

    0 5 10 15 20 25 30 35 40

    For this model, the chlorophyll level in western Lake Erie corresponding to a phosphorus

    concentration of 10 mg/m3 is

    2495.2629.0)10(2879.0 ==c

    One problem with this result is that the model yields a physically unrealistic negative

    intercept. In fact, because chlorophyll cannot exist without phosphorus, a fit with a zero

    intercept would be preferable. Such a fit can be developed as

    y = 0.2617x

    R2

    = 0.9736

    0

    2

    4

    6

    8

    10

    12

    0 5 10 15 20 25 30 35 40

    For this model, the chlorophyll level in western Lake Erie corresponding to a phosphorus

    concentration of 10 mg/m3 is

    617.2)10(2617.0 ==c

    Thus, as expected, the result differs from that obtained with a nonzero intercept.

    Finally, it should be noted that in practice, such data is usually fit with a power model. Thismodel is often adopted because it has a zero intercept while not constraining the model to be

    linear. When this is done, the result is

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    23/46

    23

    y = 0.1606x1.1426

    R2

    = 0.9878

    0

    2

    4

    6

    8

    10

    12

    0 5 10 15 20 25 30 35 40

    For this model, the chlorophyll level in western Lake Erie corresponding to a phosphorus

    concentration of 10 mg/m3 is

    2302.2)10(1606.0 1426.1 ==c

    20.26

    46.010

    6.4

    ==m 4.11014

    ==n

    Use the following values

    x0 = 0.3 f(x0) = 0.08561

    x1 = 0.4 f(x1) = 0.10941

    x2 = 0.5 f(x2) = 0.13003

    x3 = 0.6 f(x3) = 0.14749

    MATLAB can be used to perform the interpolation

    >> format long

    >> x=[0.3 0.4 0.5 0.6];>> y=[0.08561 0.10941 0.13003 0.14749];

    >> a=polyfit(x,y,3)

    a =

    Columns 1 through 3

    0.00333333333331 -0.16299999999997 0.35086666666665

    Column 4

    -0.00507000000000

    >> polyval(a,0.46)

    ans =

    0.12216232000000

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    24/46

    24

    This result can be used to compute the vertical stress

    552795.1)14(6.4

    100==q

    189693.0)1221623.0(552795.1 ==z

    20.27 This is an ideal problem for general linear least squares. The problem can be solved with

    MATLAB:

    >> t=[0.5 1 2 3 4 5 6 7 9]';>> p=[6 4.4 3.2 2.7 2.2 1.9 1.7 1.4 1.1]';>> Z=[exp(-1.5*t) exp(-0.3*t) exp(-0.05*t)];>> a=inv(Z'*Z)*(Z'*p)

    a =4.00462.9213

    1.5647

    Therefore,A = 4.0046, B = 2.9213, and C= 1.5647.

    20.28 First, we can determine the stress

    418.347,265.10

    25000==

    We can then try to fit the data to obtain a mathematical relationship between strain and stress.

    First, we can try linear regression:

    y = 1.37124E-06x - 2.28849E-03

    R2

    = 0.856845

    -0.002

    0

    0.002

    0.004

    0.006

    0.008

    0.01

    0 2000 4000 6000 8000

    This is not a particularly good fit as the r2 is relatively low. We therefore try a best-fit

    parabola,

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    25/46

    25

    y = 2.8177E-10x2

    - 8.4598E-07x + 1.0766E-03

    R2

    = 0.98053

    0

    0.002

    0.004

    0.006

    0.008

    0.01

    0 2000 4000 6000 8000

    We can use this model to compute the strain as

    437210 104341.6100766.1)4178.2347(104598.8)4178.2347(108177.2 =+=

    The deflection can be computed as

    m0057907.0)9(104341.6 4 == L

    20.29 Clearly the linear model is not adequate. The second model can be fit with the ExcelSolver:

    Notice that we have reexpressed the initial rates by multiplying them by 1 106. We did thisso that the sum of the squares of the residuals would not be miniscule. Sometimes this will

    lead the Solver to conclude that it is at the minimum, even though the fit is poor. The solution

    is:

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    26/46

    26

    Although the fit might appear to be OK, it is biased in that it underestimates the low values

    and overestimates the high ones. The poorness of the fit is really obvious if we display the

    results as a log-log plot:

    1.E-06

    1.E-04

    1.E-02

    1.E+00

    1.E+02

    0.01 1 100

    v0

    v0mod

    Notice that this view illustrates that the model actually overpredicts the very lowest values.

    The third and fourth models provide a means to rectify this problem. Because they raise [S] topowers, they have more degrees of freedom to follow the underlying pattern of the data. For

    example, the third model gives:

    Finally, the cubic model results in a perfect fit:

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    27/46

    27

    Thus, the best fit is

    ][385.0

    ][1045.23

    35

    0S

    Sv

    +

    =

    20.30 As described in Section 17.1, we can use general linear least squares to generate the best-fit

    equation. We can use a number of different software tools to do this. For example, the [Z] and

    y matrices can be set up using MATLAB commands as

    >> format long>> x = [273.15 283.15 293.15 303.15 313.15]';>> Kw = [1.164e-15 2.950e-15 6.846e-15 1.467e-14 2.929e-14]';>> y=-log10(Kw);

    >> Z = [(1./x) log10(x) x ones(size(x))];

    The coefficients can be evaluated as

    >> a=inv(Z'*Z)*(Z'*y)Warning: Matrix is close to singular or badly scaled.

    Results may be inaccurate. RCOND = 6.457873e-020.

    a =1.0e+003 *5.180671875000000.013424560546880.00000562858582

    -0.03827636718750

    Note the warning that the results are ill-conditioned. According to this calculation, the best-fit

    model is

    276367.3800562859.0log42456.1367.5180

    log 1010 ++= aaa

    w TTT

    K

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    28/46

    28

    We can check the results by using the model to make predictions at the values of the original

    data

    >> yp=10.^-(a(1)./x+a(2)*log10(x)+a(3)*x+a(4))

    yp =

    1.0e-013 *0.011611933082420.029432357145510.068284617294940.146363305750490.29218444886852

    These results agree to about 2 or 3 significant digits with the original data.

    20.31 Using MATLAB:

    >> t=0:2*pi/128:2*pi;>> f=4*cos(5*t)-7*sin(3*t)+6;>> y=fft(f);>> y(1)=[ ];>> n=length(y);>> power=abs(y(1:n/2)).^2;>> nyquist=1/2;>> freq=n*(1:n/2)/(n/2)*nyquist;>> plot(freq,power);

    20.32 Since we do not know the proper order of the interpolating polynomial, this problem issuited for Newton interpolation. First, order the points so that they are as close to and as

    centered about the unknown as possible.

    x0 = 1.25 f(x0) = 0.7

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    29/46

    29

    x1 = 0.75 f(x1) = 0.6x2 = 1.5 f(x2) = 1.88

    x3 = 0.25 f(x3) = 0.45x4 = 2 f(x4) = 6

    The results of applying Newtons polynomial at i = 1.15 are

    Order f(x) Error

    0 0.7 -0.26

    1 0.44 -0.11307

    2 0.326933 -0.00082

    3 0.326112 0.011174

    4 0.337286

    The minimum error occurs for the second-order version so we conclude that the interpolation

    is 0.3269.

    20.33 Here are the results of first through fourth-order regression:

    y = 3.54685x - 2.57288

    R2

    = 0.78500

    -2

    0

    2

    4

    6

    8

    0 0.5 1 1.5 2 2.5

    y = 3.3945x2

    - 4.0093x + 0.3886

    R2

    = 0.9988

    -2

    0

    2

    4

    6

    8

    0 0.5 1 1.5 2 2.5

    y = 0.5663x3

    + 1.4536x2

    - 2.1693x - 0.0113

    R2

    = 0.9999

    -2

    0

    2

    4

    6

    8

    0 0.5 1 1.5 2 2.5

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    30/46

    30

    y = 0.88686x4

    - 3.38438x3

    + 7.30000x2

    - 5.40448x +

    0.49429

    R2

    = 1.00000

    -2

    0

    2

    4

    6

    8

    0 0.5 1 1.5 2 2.5

    The 2nd through 4th-order polynomials all seem to capture the general trend of the data. Each

    of the polynomials can be used to make the prediction at i = 1.15 with the results tabulatedbelow:

    Order Prediction

    1 1.50602 0.26703 0.2776

    4 0.3373

    Thus, although the 2nd through 4th-order polynomials all seem to follow a similar trend, theyyield quite different predictions. The results are so sensitive because there are few data

    points.

    20.34 Since we do not know the proper order of the interpolating polynomial, this problem issuited for Newton interpolation. First, order the points so that they are as close to and as

    centered about the unknown as possible.

    x0 = 0.25 f(x0) = 7.75

    x1 = 0.125 f(x1) = 6.24

    x2 = 0.375 f(x2) = 4.85x3 = 0 f(x3) = 0

    x4 = 0.5 f(x4) = 0

    The results of applying Newtons polynomial at t= 0.23 are

    Order f(x) Error

    0 7.75 -0.2416

    1 7.5084 0.296352

    2 7.804752 0.008315

    3 7.813067 0.025579

    4 7.838646

    The minimum error occurs for the second-order version so we conclude that the interpolation

    is 7.805.

    20.35(a) The linear fit is

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    31/46

    31

    y = 2.8082x - 0.5922

    R2

    = 0.9991

    0

    10

    20

    30

    0 2 4 6 8 10 12

    The current for a voltage of 3.5 V can be computed as

    2364.95922.0)5.3(8082.2 ==y

    Both the graph and the r2 indicate that the fit is good.

    (b) A straight line with zero intercept can be fit as

    y = 2.7177x

    R2

    = 0.9978

    0

    10

    20

    30

    0 2 4 6 8 10 12

    For this case, the current at V= 3.5 can be computed as

    512.9)5.3(7177.2 ==y

    20.36 The linear fit is

    y = 4.7384x + 1.2685

    R2

    = 0.9873

    0

    10

    20

    30

    40

    50

    60

    0 2 4 6 8 10 12

    Therefore, an estimate forL is 4.7384. However, because there is a non-zero intercept, a

    better approach would be to fit the data with a linear model with a zero intercept

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    32/46

    32

    y = 4.9163x

    R2

    = 0.9854

    010

    20

    30

    40

    50

    60

    0 2 4 6 8 10 12

    This fit is almost as good as the first case, but has the advantage that it has the physically

    more realistic zero intercept. Thus, a superior estimate ofL is 4.9163.

    20.37 Since we do not know the proper order of the interpolating polynomial, this problem is

    suited for Newton interpolation. First, order the points so that they are as close to and as

    centered about the unknown as possible.

    x0 = 0.5 f(x0) = 20.5

    x1 = 0.5 f(x1) = 20.5x2 = 1 f(x2) = 96.5

    x3 = 1 f(x3) = 96.5x4 = 2 f(x4) = 637

    x5 = 2 f(x5) = 637

    The results of applying Newtons polynomial at i = 0.1 are

    Order f(x) Error

    0 20.5 -16.4

    1 4.1 -17.76

    2 -13.66 15.984

    3 2.324 0

    4 2.324 0

    5 2.324

    Thus, we can see that the data was generated with a cubic polynomial.

    20.38 Because there are 6 points, we can fit a 5 th-order polynomial. This can be done with Eq.

    18.26 or with a software package like Excel or MATLAB that is capable of evaluating the

    coefficients. For example, using MATLAB,

    >> x=[-2 -1 -0.5 0.5 1 2];>> y=[-637 -96.5 -20.5 20.5 96.5 637];

    >> a=polyfit(x,y,5)

    a =0.0000 0.0000 74.0000 -0.0000 22.5000 0.0000

    Thus, we see that the polynomial is

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    33/46

    33

    iiV 5.2274 3 +=

    20.39 Linear regression yields

    y = 0.0195x + 3.2895

    R2 = 0.9768

    0

    5

    10

    15

    20

    0 100 200 300 400 500 600 700

    The percent elongation for a temperature of 400 can be computed as

    072.112895.3)400(0195.0elongation% =+=

    20.40(a) A 4th-order interpolating polynomial can be generated as

    y = 0.0182x4 - 0.1365x3 + 0.1818x2 + 0.263x + 0.1237

    R2 = 1

    0.4

    0.45

    0.5

    0.55

    0.6

    1.5 1.7 1.9 2.1 2.3 2.5 2.7

    The polynomial can be used to compute

    568304.00.1237+.1)0.262958(2+.1)0.181771(2+(2.1)13646.0.1)0.018229(2)12( 2341 ==.JThe relative error is

    %0021.0%100568292.0

    568304.0568292.0=

    =t

    Thus, the interpolating polynomial yields an excellent result.

    (b) A program can be developed to fit natural cubic splines through data based on Fig. 18.18.If this program is run with the data for this problem, the interpolation at 2.1 is 0.56846 which

    has a relative error oft= 0.0295%.

    A spline can also be fit with MATLAB. It should be noted that MATLAB does not use a

    natural spline. Rather, it uses a so-called not-a-knot spline. Thus, as shown below, although

    it also yields a very good prediction, the result differs from the one generated with the natural

    spline,

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    34/46

    34

    >> format long>> x=[1.8 2 2.2 2.4 2.6];>> y=[0.5815 0.5767 0.556 0.5202 0.4708];>> spline(x,y,2.1)

    ans =0.56829843750000

    This result has a relative error oft= 0.0011%.

    20.41 The fit of the exponential model is

    y = 97.915e0.151x

    R2

    = 0.9996

    0500

    1000

    1500

    2000

    2500

    0 5 10 15 20

    The model can be used to predict the population 5 years in the future as

    426891484.97 )25(150992.0 == ep

    20.42 The prediction using the model from Sec. 20.4 is

    30655.2)001.0()23.1(9.55 54.062.2 ==Q

    The linear prediction is

    x0 = 1 f(x0) = 1.4

    x1 = 2 f(x1) = 8.3

    987.2)123.1(12

    4.13.84.1 =

    +=Q

    The quadratic prediction is

    x0 = 1 f(x0) = 1.4x1 = 2 f(x1) = 8.3

    x2 = 3 f(x2) = 24.2

    19005.2)223.1)(123.1(13

    12

    4.13.8

    23

    3.82.24

    987.2 =

    +=Q

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    35/46

    35

    20.43 The model to be fit is

    21

    0bb

    QDbS=

    Taking the common logarithm gives

    QbDbbS 10210101010 loglogloglog ++=

    We can use a number of different approaches to fit this model. The following shows how it

    can be done with MATLAB,

    >> D=[1 2 3 1 2 3 1 2 3]';>> S=[0.001 0.001 0.001 0.01 0.01 0.01 0.05 0.05 0.05]';>> Q=[1.4 8.3 24.2 4.7 28.9 84 11.1 69 200]';>> Z=[ones(size(S)) log10(D) log10(Q)];>> y=log10(S);>> a=inv(Z'*Z)*(Z'*y)

    a =-3.2563-4.87261.8627

    Therefore, the result is

    QDS 101010 log862733.1log8726.42563.3log +=

    or in untransformed format

    862733.18726.4000554.0 QDS = (1)

    We can compare this equation with the original model developed in Sec. 20.4 by solving Eq.1 forQ,

    5368.06158.29897.55 SDQ =

    This is very close to the original model.

    20.44(a) The data can be plotted as

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    36/46

    36

    0.0E+00

    5.0E-04

    1.0E-03

    1.5E-03

    2.0E-03

    0 10 20 30 40

    (b) This part of the problem is well-suited for Newton interpolation. First, order the points so

    that they are as close to and as centered about the unknown as possible.

    x0 = 5 f(x0) = 1.519 103

    x1 = 10 f(x1) = 1.307 103

    x2 = 0 f(x2) = 1.787

    103

    x3 = 20 f(x3) = 1.002 103

    x4 = 30 f(x4) = 0.7975 103

    x5 = 40 f(x5) = 0.6529 103

    The results of applying Newtons polynomial at T= 7.5 are

    Order f(x) Error

    0 1.51900E-03 -0.00011

    1 1.41300E-03 -7E-06

    2 1.40600E-03 7.66E-07

    3 1.40677E-03 9.18E-08

    4 1.40686E-03 5.81E-095 1.40686E-03

    The minimum error occurs for the fourth-order version so we conclude that the interpolation

    is 1.40686 103.

    (b) Polynomial regression yields

    y = 5.48342E-07x2

    - 4.94934E-05x + 1.76724E-03

    R2

    = 9.98282E-01

    0.0E+00

    5.0E-04

    1.0E-03

    1.5E-03

    2.0E-03

    0 10 20 30 40

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    37/46

    37

    This leads to a prediction of

    33527 104269.11076724.1)5.7(1094934.4)5.7(1048342.5 =+=

    20.45 For the first four points, linear regression yields

    y = 117.16x - 1.0682

    R2

    = 0.9959

    0

    10

    20

    30

    40

    50

    0 0.1 0.2 0.3 0.4

    We can fit a power equation to the last four points.

    y = 1665x3.7517

    R2

    = 0.9395

    0

    20

    40

    60

    80

    100

    0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45

    Both curves can be plotted along with the data.

    0

    20

    40

    60

    80

    100

    0 0.1 0.2 0.3 0.4 0.5

    20.46 A power fit to all the data can be implemented as in the following plot.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    38/46

    38

    y = 185.45x1.2876

    R2

    = 0.9637

    0

    20

    40

    60

    80

    100

    0 0.1 0.2 0.3 0.4 0.5

    Although the coefficient of determination is relatively high (r2 = 0.9637), this fit is not very

    acceptable. In contrast, the piecewise fit from Prob. 20.45 does a much better job of tracking

    on the trend of the data.

    20.47 The Thinking curve can be fit with a linear model whereas the Braking curve can be fit

    with a quadratic model as in the following plot.

    y = 0.1865x + 0.0800

    R2

    = 0.9986

    y = 5.8783E-03x2

    + 9.2063E-04x - 9.5000E-02

    R2

    = 9.9993E-01

    0

    20

    40

    60

    80

    100

    0 20 40 60 80 100 120 140

    A prediction of the total stopping distance for a car traveling at 110 km/hr can be computed

    as

    m726.91109.5000(110)109.2063(110)105.87830.0800)0.1865(110 2423 =+++= d20.48 Using linear regression gives

    y = -0.6x + 39.75

    R2

    = 0.5856

    0

    10

    20

    30

    40

    50

    0 10 20 30 40

    A prediction of the fracture time for an applied stress of 20 can be computed as

    75.2775.39)20(6.0 =+=t

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    39/46

    39

    Some students might consider the point at (20, 40) as an outlier and discard it. If this is done,

    4th-order polynomial regression gives the following fit

    y = -1.3951E-04x4

    + 1.0603E-02x3

    - 2.1959E-01x2

    + 3.6477E-02x +

    4.3707E+01

    R

    2

    = 9.8817E-01

    0

    10

    20

    30

    40

    50

    0 10 20 30 40

    A prediction of the fracture time for an applied stress of 20 can be computed as

    103.1943.707+0)0.036477(2+)0.21959(200)0.010603(2+(20)0.00013951 234 ==t

    20.49 Using linear regression gives

    y = -2.015000E-06x + 9.809420E+00

    R2

    = 9.999671E-01

    9.5

    9.6

    9.7

    9.8

    9.9

    0 20000 40000 60000 80000 100000 120000

    A prediction ofgat 55,000 m can be made as

    6986.980942.9)000,55(10015.2)000,55( 6 =+= g

    Note that we can also use linear interpolation to give

    698033.9)000,55(1 =g

    Quadratic interpolation yields

    697985.9)000,55(2 =g

    Cubic interpolation gives

    69799.9)000,55(3 =g

    Based on all these estimates, we can be confident that the result to 3 significant digits is

    9.698.

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    40/46

    40

    20.50 A plot of 10log versus log10can be developed as

    y = 0.3792x + 2.0518

    R2

    = 0.9997

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    -3.5 -3.3 -3.1 -2.9 -2.7 -2.5

    As shown, the best fit line is

    0518.2log3792.0log 1010 +=

    Therefore,B = 102.0518 = 112.67 and m = 0.3792, and the power model is

    3792.067.121 xy =

    The model and the data can be plotted as

    y = 112.67x0.3792

    R2

    = 0.9997

    0

    2

    4

    68

    10

    12

    14

    0 0.0005 0.001 0.0015 0.002 0.0025 0.003 0.0035

    20.51 Using linear regression gives

    y = 0.688x + 2.79

    R2

    = 0.9773

    0

    2

    4

    6

    0 1 2 3 4 5 6

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    41/46

    41

    Therefore, y = 2.79 and= 0.688.

    20.52 A power fit can be developed as

    y = 0.7374x0.5408

    R2

    = 0.9908

    0

    2

    4

    6

    8

    10

    12

    0 20 40 60 80 100 120 140

    Therefore,= 0.7374 and n = 0.5408.

    20.53 We fit a number of curves to this data and obtained the best fit with a second-order

    polynomial with zero intercept

    y = 1628.1x2

    + 140.05x

    R2

    = 1

    0

    1

    2

    3

    4

    5

    0 0.004 0.008 0.012 0.016 0.02 0.024

    Therefore, the best-fit curve is

    yyu 05.1401.1628 2 +=

    We can differentiate this function

    05.1402.3256 += ydy

    du

    Therefore, the derivative at the surface is 140.05 and the shear stress can be computed as

    1.8 105(140.05) = 0.002521 N/m2.

    20.54 We can use transformations to linearize the model as

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    42/46

    42

    aTBD

    1lnln +=

    Thus, we can plot the natural log ofversus 1/Ta and use linear regression to determine theparameters. Here is the data showing the transformations.

    T Ta 1/Ta ln

    0 1.787 273.15 0.003661 0.580538

    5 1.519 278.15 0.003595 0.418052

    10 1.307 283.15 0.003532 0.267734

    20 1.002 293.15 0.003411 0.001998

    30 0.7975 303.15 0.003299 -0.22627

    40 0.6529 313.15 0.003193 -0.42633

    Here is the fit:

    y = 2150.8x - 7.3143

    R2

    = 0.998

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.60.8

    0.0031 0.0032 0.0033 0.0034 0.0035 0.0036 0.0037

    Thus, the parameters are estimated as D = e7.3143 = 6.65941 104 andB = 2150.8, and theAndrade equation is

    Tae /8.215041065941.6 =

    This equation can be plotted along with the data

    0

    0.5

    1

    1.5

    2

    0 10 20 30 40

    Note that this model can also be fit with nonlinear regression. If this is done, the result is

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    43/46

    43

    Tae /66.221041039872.5 =

    Although it is difficult to discern graphically, this fit is slightly superior (r2 = 0.99816) to that

    obtained with the transformed model (r2 = 0.99757).

    20.55 Hydrogen: Fifth-order polynomial regression provides a good fit to the data,

    y = 4.3705E-14x5

    - 1.5442E-10x4

    + 2.1410E-07x3

    - 1.4394E-04x2

    + 4.7032E-02x + 8.5079E+00

    R2

    = 9.9956E-01

    14

    14.2

    14.4

    14.6

    14.8

    15

    15.2

    200 300 400 500 600 700 800 900 1000

    Carbon dioxide: Third-order polynomial regression provides a good fit to the data,

    y = 4.1778E-10x3

    - 1.3278E-06x2

    + 1.7013E-03x + 4.4317E-01

    R2

    = 9.9998E-01

    0.6

    0.7

    0.8

    0.9

    1

    1.1

    1.2

    1.3

    200 300 400 500 600 700 800 900 1000

    Oxygen: Fifth-order polynomial regression provides a good fit to the data,

    y = -1.3483E-15x5

    + 5.1360E-12x4

    - 7.7364E-09x3

    + 5.5693E-

    06x2

    - 1.5969E-03x + 1.0663E+00

    R2

    = 1.0000E+00

    0.9

    0.95

    1

    1.05

    1.1

    200 300 400 500 600 700 800 900 1000

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    44/46

    44

    Nitrogen: Third-order polynomial regression provides a good fit to the data,

    y = -3.0895E-10x3

    + 7.4268E-07x2

    - 3.5269E-04x + 1.0860E+00

    R2

    = 9.9994E-01

    1

    1.04

    1.08

    1.12

    1.16

    1.2

    200 300 400 500 600 700 800 900 1000

    20.56 This part of the problem is well-suited for Newton interpolation. First, order the points so

    that they are as close to and as centered about the unknown as possible, forx = 4.

    y0 = 4 f(y0) = 38.43y1 = 2 f(y1) = 53.5

    y2 = 6 f(y2) = 30.39

    y3 = 0 f(y3) = 80

    y4 = 8 f(y4) = 30

    The results of applying Newtons polynomial at y = 3.2 are

    Order f(y) Error

    0 38.43 6.028

    1 44.458 -0.8436

    2 43.6144 -0.2464

    3 43.368 0.1124484 43.48045

    The minimum error occurs for the third-order version so we conclude that the interpolation is

    43.368.

    (b) This is an example of two-dimensional interpolation. One way to approach it is to use

    cubic interpolation along the y dimension for values at specific values ofx that bracket the

    unknown. For example, we can utilize the following points at x = 2.

    y0 = 0 f(y0) = 90

    y1 = 2 f(y1) = 64.49

    y2 = 4 f(y2) = 48.9y3 = 6 f(y3) = 38.78

    T(x = 2, y = 2.7) = 58.13288438

    All the values can be tabulated as

    T(x = 2, y = 2.7) = 58.13288438

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    45/46

    45

    T(x = 4, y = 2.7) = 47.1505625T(x = 6, y = 2.7) = 42.74770188

    T(x = 8, y = 2.7) = 46.5

    These values can then be used to interpolate at x = 4.3 to yield

    T(x = 4.3, y = 2.7) = 46.03218664

    Note that some software packages allow you to perform such multi-dimensional

    interpolations very efficiently. For example, MATLAB has a function interp2 that provides

    numerous options for how the interpolation is implemented. Here is an example of how it can

    be implemented using linear interpolation,

    >> Z=[100 90 80 70 60;85 64.49 53.5 48.15 50;70 48.9 38.43 35.03 40;55 38.78 30.39 27.07 30;40 35 30 25 20];>> X=[0 2 4 6 8];>> Y=[0 2 4 6 8];>> T=interp2(X,Y,Z,4.3,2.7)

    T =47.5254

    It can also perform the same interpolation but using bicubic interpolation,

    >> T=interp2(X,Y,Z,4.3,2.7,'cubic')

    T =46.0062

    Finally, the interpolation can be implemented using splines,

    >> T=interp2(X,Y,Z,4.3,2.7,'spline')

    T =46.1507

    20.57 This problem was solved using an Excel spreadsheet and TrendLine. Linear regression

    gives

    y = 0.0455x + 0.107

    R2

    = 0.9986

    0

    0.2

    0.4

    0.6

    0 2 4 6 8 10

    PROPRIETARY MATERIAL. The McGraw-Hill Companies, Inc. All rights reserved. No part of this Manual may

    be displayed, reproduced or distributed in any form or by any means, without the prior written permission of thepublisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill for their individual

    course preparation. If you are a student using this Manual, you are using it without permission.

  • 8/2/2019 Numerical Method for engineers-chapter 20

    46/46

    46

    Forcing a zero intercept yields

    y = 0.061x

    R2

    = 0.841

    0

    0.2

    0.4

    0.6

    0.8

    0 2 4 6 8 10

    One alternative that would force a zero intercept is a power fit

    y = 0.1821x0.4087

    R2

    = 0.8992

    0

    0.2

    0.4

    0.6

    0.8

    0 2 4 6 8 10

    However, this seems to represent a poor compromise since it misses the linear trend in the data.

    An alternative approach would to assume that the physically-unrealistic non-zero intercept is an

    artifact of the measurement method. Therefore, if the linear slope is valid, we might try y =

    0.0455x.