• Tidak ada hasil yang ditemukan

INCREMENTAL SEARCHES AND DETERMINING INITIAL GUESSES

ROOTS OF EQUATIONS

5.4 INCREMENTAL SEARCHES AND DETERMINING INITIAL GUESSES

would converge in 14 and 39 iterations, respectively. In contrast, the modified false- position method would converge in 12 iterations. Thus, for this example, it is somewhat more efficient than bisection and is vastly superior to the unmodified false-position method.

5.4 INCREMENTAL SEARCHES AND DETERMINING

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 εaand the true error εtafter each iteration.

5.2 Determine the real root of f(x)=4x36x2+7x2.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 εafalls below a level of εs=10%.

5.3 Determine the real root of f(x)=26+85x91x2+ 44x38x4+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)=1320x+19x2 3x3 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 xl=1 and xu=0, and a stopping criterion of 1%.

5.5 Locate the first nontrivial root of sin x=x3, where xis in radians. Use a graphical technique and bisection with the initial interval from 0.5 to 1. Perform the computation until εais 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(x4)=0.7(a)graphi- cally, (b)using three iterations of the bisection method, with initial guesses of xl=0.5 and xu=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.80.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 εaand 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 xl=4 and xu=5.

5.9Find the smallest positive root of the function (xis in radians) x2##cosx##=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)=x48x335x2+ 450x1001 using the false-position method. Use initial guesses of xl=4.5 and xu=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 x3.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)=2x61.6x4+12x+1

Use bisection to determine the maximumof this function. Employ initial guesses of xl=0 and xu=1, and perform iterations until the approximate relative error falls below 5%.

5.13 The velocity vof a falling parachutist is given by v=gm

c

!1e(c/m)t"

where g=9.8 m/s2. For a parachutist with a drag coefficient c=15 kg/s, compute the mass mso that the velocity is v=35 m/s at t$9 s. Use the false-position method to determine mto 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/s2. Start with initial guesses of xl=0.1 and xu=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’ 4 2

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 yfor such a channel must satisfy the equation

0=1 Q2 gA3cB

where g=9.81 m/s2, Ac=the cross-sectional area (m2), and B= the width of the channel at the surface (m). For this case, the width and the cross-sectional area can be related to depth yby

B=3+y and Ac=3y+y2 2

Solve for the critical depth using (a)the graphical method, (b)bi- section, and (c)false position. For (b)and (c)use initial guesses of xl=0.5 and xu=2.5, and iterate until the approximate error falls below 1% or the number of iterations exceeds 10. Discuss your results.

5.17 You are designing a spherical tank (Fig. P5.17) to hold water for a small village in a developing country. The volume of liquid it can hold can be computed as

V =πh2[3Rh] 3

where V=volume [m3], h=depth of water in tank [m], and R= the tank radius [m].

lnos f =139.34411+1.575701×105

Ta 6.642308×107 Ta2 +1.243800×1010

Ta3 8.621949×1011 Ta4

where os f =the saturation concentration of dissolved oxygen in freshwater at 1 atm (mg/L) and Ta=absolute temperature (K).

Remember that Ta=T+273.15, where T =temperature (C).

According to this equation, saturation decreases with increasing temperature. For typical natural waters in temperate climates, the equation can be used to determine that oxygen concentration ranges from 14.621 mg/L at 0C to 6.413 mg/L at 40C. Given a value of oxygen concentration, this formula and the bisection method can be used to solve for temperature in C.

(a) If the initial guesses are set as 0 and 40C, how many bisection iterations would be required to determine temperature to an absolute error of 0.05C?

(b) Develop and test a bisection program to determine Tas a func- tion of a given oxygen concentration to a prespecified absolute error as in (a). Given initial guesses of 0 and 40C, test your program for an absolute error = 0.05C and the following cases: osf=8, 10 and 12 mg/L. Check your results.

5.19 A reversible chemical reaction 2A+BC

can be characterized by the equilibrium relationship K= cc

c2acb

where the nomenclature ci represents the concentration of con- stituent i. Suppose that we define a variable xas representing the number of moles of C that are produced. Conservation of mass can be used to reformulate the equilibrium relationship as

K= (cc,0+x) (ca,02x)2(cb,0x)

where the subscript 0 designates the initial concentration of each constituent. If K=0.016, ca,0=42, cb,0=28, and cc,0=4, determine the value of x. (a)Obtain the solution graphically. (b)On the basis of (a), solve for the root with initial guesses of xl=0 and xu=20 to εs!0.5%. Choose either bisection or false position to obtain your solution. Justify your choice.

5.20 Figure P5.20a shows a uniform beam subject to a linearly increasing distributed load. The equation for the resulting elastic curve is (see Fig. P5.20b)

y= w0

120EIL(x5+2L2x3L4x) (P5.20) V h

R

Figure P5.17

If R=3 m, to what depth must the tank be filled so that it holds 30 m3? Use three iterations of the false-position method to deter- mine your answer. Determine the approximate relative error after each iteration. Employ initial guesses of 0 and R.

5.18 The saturation concentration of dissolved oxygen in fresh- water can be calculated with the equation (APHA, 1992)

Use bisection to determine the point of maximum deflection (that is, the value of xwhere dy/dx$0). Then substitute this value into Eq. (P5.20) to determine the value of the maximum deflection. Use the following parameter values in your computation: L$600 cm, E$50,000 kN/cm2, I$30,000 cm4, and w0$2.5 kN/cm.

5.21You buy a $25,000 piece of equipment for nothing down and

$5,500 per year for 6 years. What interest rate are you paying? The formula relating present worth P, annual payments A, number of years n, and interest rate iis

A=P i(1+i)n (1+i)n1

5.22 Many fields of engineering require accurate population esti- mates. For example, transportation engineers might find it necessary to determine separately the population growth trends of a city and adjacent suburb. The population of the urban area is declining with time according to

Pu(t)=Pu,maxekut+Pu,min

while the suburban population is growing, as in

Ps(t)= Ps,max

1+[Ps,max/P01]ekst

where Pu,max, ku,Ps,max,P0,andks= empirically derived para- meters. Determine the time and corresponding values of Pu(t) and Ps(t) when the suburbs are 20% larger than the city. The parameter values are Pu,max=75,000, ku=0.045/yr, Pu,min=100,000 people, Ps,max=300,000 people, P0=10,000 people, ks$ 0.08/yr. To obtain your solutions, use (a)graphical and (b)false- position methods.

5.23Integrate the algorithm outlined in Fig. 5.10 into a complete, user-friendly bisection subprogram. Among other things:

(a) Place documentation statements throughout the subprogram to identify what each section is intended to accomplish.

(b) Label the input and output.

(c) Add an answer check that substitutes the root estimate into the original function to verify whether the final result is close to zero.

(d) Test the subprogram by duplicating the computations from Examples 5.3 and 5.4.

5.24 Develop a subprogram for the bisection method that mini- mizes function evaluations based on the pseudocode from Fig. 5.11.

Determine the number of function evaluations (n) per total itera- tions. Test the program by duplicating Example 5.6.

5.25 Develop a user-friendly program for the false-position method. The structure of your program should be similar to the bisection algorithm outlined in Fig. 5.10. Test the program by duplicating Example 5.5.

5.26 Develop a subprogram for the false-position method that minimizes function evaluations in a fashion similar to Fig. 5.11.

Determine the number of function evaluations (n) per total itera- tions. Test the program by duplicating Example 5.6.

5.27 Develop a user-friendly subprogram for the modified false- position method based on Fig. 5.15. Test the program by determin- ing the root of the function described in Example 5.6. Perform a number of runs until the true percent relative error falls below 0.01%. Plot the true and approximate percent relative errors versus number of iterations on semilog paper. Interpret your results.

5.28 Develop a function for bisection in a similar fashion to Fig. 5.10. However, rather than using the maximum iterations and Eq. (5.2), employ Eq. (5.5) as your stopping criterion. Make sure to round the result of Eq. (5.5) up to the next highest integer. Test your function by solving Example 5.3 using Ea,d=0.0001.

PROBLEMS 141

w0

L

(a)

(x= 0, y= 0) (x=L, y= 0) x

(b) Figure P5.20

6

C H A P T E R 6

142

Open Methods

For the bracketing methods in Chap. 5, the root is located within an interval prescribed by a lower and an upper bound. Repeated application of these methods always results in closer estimates of the true value of the root. Such methods are said to be convergentbecause they move closer to the truth as the computation progresses (Fig. 6.1a).

In contrast, the open methods described in this chapter are based on formulas that require only a single starting value ofxor two starting values that do not necessarily bracket

f(x)

x

(a)

xl xu

xl xu

f(x)

x

(b)

xi

xi + 1

f(x)

x

(c)

xi

xi + 1

xl xu

xl xu xlxu FIGURE 6.1

Graphical depiction of the fundamental difference between the (a) bracketing and (b) and (c) open methods for root location. In (a), which is the bisection method, the root is constrained within the interval prescribed by xland xu. In contrast, for the open method depicted in (b) and (c), a formula is used to project from xito xi+1in an iterative fashion.

Thus, the method can either (b) diverge or (c) converge rapidly, depending on the value of the initial guess.