Numerical Methods HW2

6
PROBLEMS PROBLEMS 139 5.1 Determine the real roots of f (x ) =−0.6x 2 + 2.4x + 5.5: (a) Graphically. (b) Using the quadratic formula. (c) Using three iterations of the bisection method to determine the highest root. Employ initial guesses of x l = 5 and x u = 10. Compute the estimated error ε a and the true error ε t after each iteration. 5.2 Determine the real root of f (x ) = 4x 3 6x 2 + 7x 2.3: (a) Graphically. (b) Using bisection to locate the root. Employ initial guesses of x l = 0 and x u = 1 and iterate until the estimated error ε a falls below a level of ε s = 10%. 5.3 Determine the real root of f (x ) =−26 + 85x 91x 2 + 44x 3 8x 4 + x 5 : (a) Graphically. (b) Using bisection to determine the root to ε s = 10%. Employ ini- tial guesses of x l = 0.5 and x u = 1.0. (c) Perform the same computation as in (b) but use the false- position method and ε s = 0.2 %. 5.4 (a) Determine the roots of f (x ) =−13 20x + 19x 2 3x 3 graphically. In addition, determine the first root of the function with (b) bisection, and (c) false position. For (b) and (c) use initial guesses of x l =−1 and x u = 0, and a stopping criterion of 1%. 5.5 Locate the first nontrivial root of sin x = x 3 , where x is in radians. Use a graphical technique and bisection with the initial interval from 0.5 to 1. Perform the computation until ε a is less than ε s = 2%. Also perform an error check by substituting your final answer into the original equation. 5.6 Determine the positive real root of ln (x 4 ) = 0.7 (a) graphi- cally, (b) using three iterations of the bisection method, with initial guesses of x l = 0.5 and x u = 2, and (c) using three iterations of the false-position method, with the same initial guesses as in (b). 5.7 Determine the real root of f (x ) = (0.8 0.3x )/x : (a) Analytically. (b) Graphically. (c) Using three iterations of the false-position method and initial guesses of 1 and 3. Compute the approximate error ε a and the true error ε t after each iteration. Is there a problem with the result? 5.8 Find the positive square root of 18 using the false-position method to within ε s = 0.5%. Employ initial guesses of x l = 4 and x u = 5. 5.9 Find the smallest positive root of the function (x is in radians) x 2 cos x = 5 using the false-position method. To locate the region in which the root lies, first plot this function for values of x between 0 and 5. Perform the computation until ε a falls below ε s = 1%. Check your final answer by substituting it into the origi- nal function. 5.10 Find the positive real root of f (x ) = x 4 8x 3 35x 2 + 450x 1001 using the false-position method. Use initial guesses of x l = 4.5 and x u = 6 and performs five iterations. Compute both the true and approximate errors based on the fact that the root is 5.60979. Use a plot to explain your results and perform the compu- tation to within ε s = 1.0%. 5.11 Determine the real root of x 3.5 = 80: (a) analytically, and (b) with the false-position method to within ε s = 2.5%. Use initial guesses of 2.0 and 5.0. 5.12 Given f (x ) =−2x 6 1.6x 4 + 12x + 1 Use bisection to determine the maximum of this function. Employ initial guesses of x l = 0 and x u = 1, and perform iterations until the approximate relative error falls below 5%. 5.13 The velocity v of a falling parachutist is given by v = gm c ( 1 e (c/m)t ) where g = 9.8 m/s 2 . For a parachutist with a drag coefficient c = 15 kg/s, compute the mass m so that the velocity is v = 35 m/s at t 9 s. Use the false-position method to determine m to a level of ε s = 0.1%. 5.14 Use bisection to determine the drag coefficient needed so that an 80-kg parachutist has a velocity of 36 m/s after 4 s of free fall. Note: The acceleration of gravity is 9.81 m/s 2 . Start with initial guesses of x l = 0.1 and x u = 0.2 and iterate until the approximate relative error falls below 2%. 5.15 A beam is loaded as shown in Fig. P5.15. Use the bisection method to solve for the position inside the beam where there is no moment. 3’ 3’ 2 4 100 lb/ft 100 lb Figure P5.15 5.16 Water is flowing in a trapezoidal channel at a rate of Q = 20 m 3 /s. The critical depth y for such a channel must satisfy the equation 0 = 1 Q 2 gA 3 c B

description

anum

Transcript of Numerical Methods HW2

  • PROBLEMS

    PROBLEMS 139

    5.1 Determine the real roots of f(x) = 0.6x2 + 2.4x + 5.5:(a) Graphically.(b) Using the quadratic formula.(c) Using three iterations of the bisection method to determine

    the highest root. Employ initial guesses of xl = 5 and xu = 10.Compute the estimated error a and the true error t after eachiteration.

    5.2 Determine the real root of f(x) = 4x3 6x2 + 7x 2.3:(a) Graphically.(b) Using bisection to locate the root. Employ initial guesses of

    xl = 0 and xu = 1 and iterate until the estimated error a fallsbelow a level of s = 10%.

    5.3 Determine the real root of f (x) = 26 + 85x 91x2 +44x3 8x4 + x5:(a) Graphically.(b) Using bisection to determine the root to s = 10%. Employ ini-

    tial guesses of xl = 0.5 and xu = 1.0.(c) Perform the same computation as in (b) but use the false-

    position method and s = 0.2 %.5.4 (a) Determine the roots of f(x) = 13 20x + 19x2 3x3graphically. In addition, determine the first root of the function with(b) bisection, and (c) false position. For (b) and (c) use initialguesses of xl = 1 and xu = 0, and a stopping criterion of 1%.5.5 Locate the first nontrivial root of sin x = x3, where x is inradians. Use a graphical technique and bisection with the initialinterval from 0.5 to 1. Perform the computation until a is less thans = 2%. Also perform an error check by substituting your finalanswer into the original equation.5.6 Determine the positive real root of ln (x4) = 0.7 (a) graphi-cally, (b) using three iterations of the bisection method, with initialguesses of xl = 0.5 and xu = 2, and (c) using three iterations of thefalse-position method, with the same initial guesses as in (b).5.7 Determine the real root of f (x) = (0.8 0.3x)/x :(a) Analytically.(b) Graphically.(c) Using three iterations of the false-position method and initial

    guesses of 1 and 3. Compute the approximate error a and the trueerror t after each iteration. Is there a problem with the result?

    5.8 Find the positive square root of 18 using the false-positionmethod to within s = 0.5%. Employ initial guesses of xl = 4 andxu = 5.5.9 Find the smallest positive root of the function (x is in radians)x2

    cos x = 5 using the false-position method. To locate theregion in which the root lies, first plot this function for values of xbetween 0 and 5. Perform the computation until a falls belows = 1%. Check your final answer by substituting it into the origi-nal function.

    5.10 Find the positive real root of f(x) = x4 8x3 35x2 +450x 1001 using the false-position method. Use initial guessesof xl = 4.5 and xu = 6 and performs five iterations. Compute boththe true and approximate errors based on the fact that the root is5.60979. Use a plot to explain your results and perform the compu-tation to within s = 1.0%.5.11 Determine the real root of x3.5 = 80: (a) analytically, and(b) with the false-position method to within s = 2.5%. Use initialguesses of 2.0 and 5.0.5.12 Given

    f (x) = 2x6 1.6x4 + 12x + 1Use bisection to determine the maximum of this function. Employinitial guesses of xl = 0 and xu = 1, and perform iterations untilthe approximate relative error falls below 5%.5.13 The velocity v of a falling parachutist is given by

    v = gmc

    (1 e(c/m)t)

    where g = 9.8 m/s2. For a parachutist with a drag coefficientc = 15 kg/s, compute the mass m so that the velocity is v = 35 m/sat t 9 s. Use the false-position method to determine m to a levelof s = 0.1%.5.14 Use bisection to determine the drag coefficient needed so thatan 80-kg parachutist has a velocity of 36 m/s after 4 s of free fall.Note: The acceleration of gravity is 9.81 m/s2. Start with initialguesses of xl = 0.1 and xu = 0.2 and iterate until the approximaterelative error falls below 2%.5.15 A beam is loaded as shown in Fig. P5.15. Use the bisectionmethod to solve for the position inside the beam where there is nomoment.

    3 3 24

    100 lb/ft 100 lb

    Figure P5.15

    5.16 Water is flowing in a trapezoidal channel at a rate of Q =20 m3/s. The critical depth y for such a channel must satisfy theequation

    0 = 1 Q2

    g A3cB

    cha01064_ch05.qxd 3/20/09 11:49 AM Page 139

    FatihHighlight

    FatihHighlight

    FatihHighlight

  • (b) 4.43. Discuss and use graphical and analytical methods to explainany peculiarities in your results.6.6 Determine the lowest real root of f(x) = 12 21x +18x2 2.4x3: (a) graphically and (b) using the secant method to avalue of s corresponding to three significant figures.6.7 Locate the first positive root of

    f (x) = sin x + cos(1 + x2) 1where x is in radians. Use four iterations of the secant method withinitial guesses of (a) xi1 = 1.0 and xi = 3.0; (b) xi1 = 1.5 andxi = 2.5, and (c) xi1 = 1.5 and xi = 2.25 to locate the root.(d) Use the graphical method to explain your results.6.8 Determine the real root of x3.5 = 80, with the modified secantmethod to within s = 0.1% using an initial guess of x0 = 3.5 and = 0.01.6.9 Determine the highest real root of f (x) = 0.95x3 5.9x2 +10.9x 6:(a) Graphically.(b) Using the Newton-Raphson method (three iterations,

    xi = 3.5).(c) Using the secant method (three iterations, xi1 = 2.5 and

    xi = 3.5).(d) Using the modified secant method (three iterations, xi = 3.5,

    = 0.01).6.10 Determine the lowest positive root of f(x) = 8 sin(x)ex 1:(a) Graphically.(b) Using the Newton-Raphson method (three iterations,

    xi = 0.3).(c) Using the secant method (five iterations, xi1 = 0.5 and

    xi = 0.4).(d) Using the modified secant method (three iterations, xi = 0.3,

    = 0.01).6.11 Use the Newton-Raphson method to find the root of

    f (x) = e0.5x (4 x) 2Employ initial guesses of (a) 2, (b) 6, and (c) 8. Explain yourresults.6.12 Given

    f (x) = 2x6 1.5x4 + 10x + 2Use a root location technique to determine the maximum of thisfunction. Perform iterations until the approximate relative error fallsbelow 5%. If you use a bracketing method, use initial guesses ofxl = 0 and xu = 1. If you use the Newton-Raphson or the modifiedsecant method, use an initial guess of xi = 1. If you use the secantmethod, use initial guesses of xi1 = 0 and xi = 1. Assuming thatconvergence is not an issue, choose the technique that is best suitedto this problem. Justify your choice.6.13 You must determine the root of the following easily differen-tiable function,

    e0.5x = 5 5x

    172 OPEN METHODS

    Pick the best numerical technique, justify your choice and then usethat technique to determine the root. Note that it is known that forpositive initial guesses, all techniques except fixed-point iterationwill eventually converge. Perform iterations until the approximaterelative error falls below 2%. If you use a bracketing method,use initial guesses of xl = 0 and xu = 2. If you use the Newton-Raphson or the modified secant method, use an initial guessof xi = 0.7. If you use the secant method, use initial guesses ofxi1 = 0 and xi = 2.6.14 The function x3 2x2 4x + 8 has a double root at x = 2.Use (a) the standard Newton-Raphson [Eq. (6.6)], (b) the modifiedNewton-Raphson [Eq. (6.12)], and (c) the modified Newton-Raphson [Eq. (6.16)] to solve for the root at x = 2. Compareand discuss the rate of convergence using an initial guess ofx0 = 1.2.6.15 Determine the roots of the following simultaneous nonlinearequations using (a) fixed-point iteration and (b) the Newton-Raphson method:

    y = x2 + x + 0.75y + 5xy = x2

    Employ initial guesses of x = y = 1.2 and discuss the results.6.16 Determine the roots of the simultaneous nonlinear equations

    (x 4)2 + (y 4)2 = 5x2 + y2 = 16

    Use a graphical approach to obtain your initial guesses. Determinerefined estimates with the two-equation Newton-Raphson methoddescribed in Sec. 6.6.2.6.17 Repeat Prob. 6.16 except determine the positive root of

    y = x2 + 1y = 2 cos x

    6.18 A mass balance for a pollutant in a well-mixed lake can bewritten as

    Vdcdt

    = W Qc kV cGiven the parameter values V = 1 106m3, Q = 1 105 m3/yr,W = 1 106 g/yr, and k = 0.25 m0.5/g0.5/yr, use the modifiedsecant method to solve for the steady-state concentration. Employan initial guess of c = 4 g/m3 and = 0.5. Perform three iterationsand determine the percent relative error after the third iteration.6.19 For Prob. 6.18, the root can be located with fixed-pointiteration as

    c =(

    W QckV

    )2or as

    c = W kV

    c

    Q

    cha01064_ch06.qxd 3/20/09 11:51 AM Page 172

    FatihHighlight

  • PROBLEMS 215

    Determine h given r = 2 m, L = 5 m, and V = 8 m3. Note that ifyou are using a programming language or software tool that is notrich in trigonometric functions, the arc cosine can be computedwith

    cos1 x = 2

    tan1(

    x1 x2

    )

    8.9 The volume V of liquid in a spherical tank of radius r is relatedto the depth h of the liquid by

    V = h2(3r h)

    3

    Determine h given r = 1 m and V = 0.5 m3.8.10 For the spherical tank in Prob. 8.9, it is possible to developthe following two fixed-point formulas:

    h =

    h3 + (3V/)3r

    and

    h = 3

    3(

    rh2 V

    )

    If r = 1 m and V = 0.75 m3, determine whether either of these isstable, and the range of initial guesses for which they are stable.8.11 The Ergun equation, shown below, is used to describe theflow of a fluid through a packed bed. P is the pressure drop, isthe density of the fluid, Go is the mass velocity (mass flow ratedivided by cross-sectional area), Dp is the diameter of the particleswithin the bed, is the fluid viscosity, L is the length of the bed,and is the void fraction of the bed.

    PG2o

    DpL

    3

    1 = 1501

    (DpGo/)+ 1.75

    Given the parameter values listed below, find the void fraction ofthe bed.

    DpGo

    = 1000

    PDpG2o L

    = 10

    8.12 The pressure drop in a section of pipe can be calculated as

    p = f LV2

    2D

    where p = the pressure drop (Pa), f = the friction factor, L =the length of pipe [m], = density (kg/m3), V = velocity (m/s),and D = diameter (m). For turbulent flow, the Colebrook equationprovides a means to calculate the friction factor,

    1 f = 2.0 log(

    3.7D+ 2.51

    Re f

    )where = the roughness (m), and Re = the Reynolds number,

    Re = VD

    where = dynamic viscosity (N s/m2).(a) Determine p for a 0.2-m-long horizontal stretch of smooth

    drawn tubing given = 1.23 kg/m3, = 1.79 105 N s/m2,D = 0.005 m, V = 40 m/s, and = 0.0015 mm. Use a numer-ical method to determine the friction factor. Note that smoothpipes with Re < 105, a good initial guess can be obtained usingthe Blasius formula, f = 0.316/Re0.25.

    (b) Repeat the computation but for a rougher commercial steelpipe ( = 0.045 mm).

    8.13 The operation of a constant density plug flow reactor for theproduction of a substance via an enzymatic reaction is described bythe equation below, where V is the volume of the reactor, F is theflow rate of reactant C, Cin and Cout are the concentrations of reac-tant entering and leaving the reactor, respectively, and K and kmaxare constants. For a 500-L reactor, with an inlet concentration ofCin = 0.5 M, an inlet flow rate of 40 L/s, kmax = 5 103 s1 , andK = 0.1 M, find the concentration of C at the outlet of the reactor.

    VF

    = Cout

    Cin

    KkmaxC

    + 1kmax

    dC

    Civil and Environmental Engineering8.14 In structural engineering, the secant formula defines the forceper unit area, P/A, that causes a maximum stress m in a columnof given slenderness ratio L/k:

    PA

    = m1 + (ec/k2) sec[0.5P/(E A)(L/k)]

    where ec/k2 = the eccentricity ratio and E = the modulus of elas-ticity. If for a steel beam, E = 200,000 MPa, ec/k2 = 0.4, andm = 250 MPa, compute P/A for L/k = 50. Recall that sec x =1/cos x .8.15 In environmental engineering (a specialty area in civilengineering), the following equation can be used to compute theoxygen level c (mg/L) in a river downstream from a sewagedischarge:

    c = 10 20(e0.15x e0.5x )where x is the distance downstream in kilometers.(a) Determine the distance downstream where the oxygen level

    first falls to a reading of 5 mg/L. (Hint: It is within 2 km of thedischarge.) Determine your answer to a 1% error. Note that lev-els of oxygen below 5 mg/L are generally harmful to gamefishsuch as trout and salmon.

    (b) Determine the distance downstream at which the oxygen is at aminimum. What is the concentration at that location?

    cha01064_ch08.qxd 3/20/09 11:54 AM Page 215

    FatihHighlight

  • PROBLEMS 217

    8.19 The displacement of a structure is defined by the followingequation for a damped oscillation:

    y = 9ekt cos twhere k = 0.7 and = 4.(a) Use the graphical method to make an initial estimate of the

    time required for the displacement to decrease to 3.5.(b) Use the Newton-Raphson method to determine the root to

    s = 0.01%.(c) Use the secant method to determine the root to s = 0.01%.8.20 The Manning equation can be written for a rectangular openchannel as

    Q =

    S(BH)5/3

    n(B + 2H)2/3

    where Q = flow [m3/s], S = slope [m/m], H = depth [m], and n =the Manning roughness coefficient. Develop a fixed-point iterationscheme to solve this equation for H given Q = 5, S = 0.0002,B = 20, and n = 0.03. Prove that your scheme converges for allinitial guesses greater than or equal to zero. 8.21 In ocean engineering, the equation for a reflected standingwave in a harbor is given by = 16, t = 12, v = 48:

    h = h0[

    sin(

    2x

    )cos

    (2 tv

    )+ ex

    ]

    Solve for the lowest positive value of x if h = 0.4h0.8.22 You buy a $25,000 piece of equipment for nothing down and$5,500 per year for 6 years. What interest rate are you paying? Theformula relating present worth P, annual payments A, number ofyears n, and interest rate i is

    A = P i(1 + i)n

    (1 + i)n 1

    8.23 Many fields of engineering require accurate populationestimates. For example, transportation engineers might find it

    necessary to determine separately the population growth trends ofa city and adjacent suburb. The population of the urban area isdeclining with time according to

    Pu(t) = Pu,maxeku t + Pu,minwhile the suburban population is growing, as in

    Ps(t) = Ps,max1 + [Ps,max/P0 1]eks t

    where Pu,max, ku , Ps,max, P0, and ks = empirically derived parame-ters. Determine the time and corresponding values of Pu(t) andPs(t) when the suburbs are 20% larger than the city. The parametervalues are Pu,max = 75,000, ku = 0.045/yr, Pu,min = 100,000people, Ps,max = 300,000 people, P0 = 10,000 people, ks =0.08/yr. To obtain your solutions, use (a) graphical, (b) false-position, and (c) modified secant methods.8.24 A simply supported beam is loaded as shown in Fig. P8.24.Using singularity functions, the shear along the beam can beexpressed by the equation:

    V (x) = 20[x 01 x 51] 15 x 80 57

    By definition, the singularity function can be expressed as follows:

    x an ={

    (x a)n when x > a0 when x a

    }

    Use a numerical method to find the point(s) where the shear equalszero.

    8.25 Using the simply supported beam from Prob. 8.24, themoment along the beam, M(x), is given by:

    M(x) = 10[x 02 x 52] + 15 x 81

    + 150 x 70 + 57xUse a numerical method to find the point(s) where the momentequals zero.

    20 kips/ft

    150 kip-ft 15 kips

    5 2 1 2

    Figure P8.24

    cha01064_ch08.qxd 3/20/09 11:55 AM Page 217

    FatihHighlight

  • PROBLEMS 219

    pipes. The Fanning friction factor is dependent on a number of pa-rameters related to the size of the pipe and the fluid, which can allbe represented by another dimensionless quantity, the Reynoldsnumber Re. A formula that predicts f given Re is the von Karmanequation,

    1 f = 4 log10(Re

    f ) 0.4

    Typical values for the Reynolds number for turbulent flow are10,000 to 500,000 and for the Fanning friction factor are 0.001 to0.01. Develop a function that uses bisection to solve for f given auser-supplied value of Re between 2,500 and 1,000,000. Design thefunction so that it ensures that the absolute error in the result isEa,d < 0.000005.8.34 Real mechanical systems may involve the deflection of non-linear springs. In Fig. P8.34, a mass m is released a distance h abovea nonlinear spring. The resistance force F of the spring is given by

    F = (k1d + k2d3/2)Conservation of energy can be used to show that

    0 = 2k2d5/2

    5+ 1

    2k1d2 mgd mgh

    Solve for d, given the following parameter values: k1 = 40,000 g/s2,k2 = 40 g/(s2 m0.5), m = 95 g, g = 9.81 m/s2, and h = 0.43 m.

    0

    v0

    y

    x

    Figure P8.36

    8.36 Aerospace engineers sometimes compute the trajectories ofprojectiles like rockets. A related problem deals with the trajectoryof a thrown ball. The trajectory of a ball is defined by the (x, y)coordinates, as displayed in Fig. P8.36. The trajectory can bemodeled as

    y = (tan 0)x g2v20 cos2 0x2 + y0

    Find the appropriate initial angle 0, if the initial velocityv0 = 20 m/s and the distance to the catcher x is 35 m. Note that theball leaves the throwers hand at an elevation of y0 = 2 m and thecatcher receives it at 1 m. Express the final result in degrees. Use avalue of 9.81 m/s2 for g and employ the graphical method todevelop your initial guesses.

    h

    (a) (b)

    dh + d

    Figure P8.34

    8.35 Mechanical engineers, as well as most other engineers, usethermodynamics extensively in their work. The followingpolynomial can be used to relate the zero-pressure specific heat ofdry air, cp kJ/(kg K), to temperature (K):

    cp = 0.99403 + 1.671 104T + 9.7215 108T 29.5838 1011T 3 + 1.9520 1014T 4

    Determine the temperature that corresponds to a specific heat of1.2 kJ/(kg K).

    8.37 The general form for a three-dimensional stress field is given by xx xy xzxy yy yz

    xz yz zz

    where the diagonal terms represent tensile or compressive stressesand the off-diagonal terms represent shear stresses. A stress field(in MPa) is given by

    10 14 2514 7 1525 15 16

    To solve for the principal stresses, it is necessary to construct thefollowing matrix (again in MPa):

    10 14 2514 7 1525 15 16

    cha01064_ch08.qxd 3/20/09 11:55 AM Page 219

    FatihHighlight

  • ExtraQuestion:WriteaCprogramtofindtheresultofMaclaurinSeriesofthefunction

    1

    2! 3!

    !

    valuewillbedecidedbyuser.Stoppingcriteria(s)willbe0,05%.

    Numerical_Methods_HW2Numerical_Methods_for_Engineers 158Numerical_Methods_for_Engineers 159Numerical_Methods_for_Engineers 160Numerical_Methods_for_Engineers 190Numerical_Methods_for_Engineers 191Numerical_Methods_for_Engineers 192Numerical_Methods_for_Engineers 232Numerical_Methods_for_Engineers 233Numerical_Methods_for_Engineers 234Numerical_Methods_for_Engineers 235Numerical_Methods_for_Engineers 236Numerical_Methods_for_Engineers 237Numerical_Methods_for_Engineers 238Numerical_Methods_for_Engineers 239Numerical_Methods_for_Engineers 240Numerical_Methods_for_Engineers 241

    odev