Civil Engineering Computation Numerical Methods : Root Finding and Optimization – Part 2 2 Root Finding and Optimization - Part 2 ROOT LOCATION WITH NUMERICAL METHODS 3 Root Finding and Optimization - Part 2 Root Location – False Position ¢ Another method of root location that is relatively easy to program is the method of False Position ¢ Successive iteration of the root estimate are made using f (xupper )(xlower − xupper ) xnew = xupper − f (xlower ) − f (xupper ) 4 Root Finding and Optimization - Part 2 Root Location – False Position ¢ Now we can try with the same problem. gm ⎛ gcd ⎞ v = tanh⎜ t⎟ cd ⎝ m ⎠ 5 Root Finding and Optimization Root Location – False Position ¢ The problem is to determine the mass of the bungee jumper (m) such that a velocity (v) of 36 m/s is attained after a time (t) of 4 s. ¢ The acceleration of gravity (g) is 9.81 2 m/s and the drag coefficient (cd) is 0.25 kg/m. gm ⎛ gcd ⎞ v = tanh⎜ t⎟ cd ⎝ m ⎠ 6 Root Finding and Optimization cha01102_ch05_123-150.qxd 12/17/10 8:01 AM Page 148 Problem 1 ¢ The saturation concentration of dissolved148 oxygenROOTS: in freshwater BRACKETING METHODScan be calculated with the equation 5.8 The saturation concentration of dissolved oxygen in and freshwater can be calculated with the equation y2 Ac 3y 1.575701 105 = + 2 ln osf 139.34411 × Solve for the critical depth using the graphical method, = − + Ta (a) 6.642308 107 1.243800 1010 (b) bisection, and (c) false position. For (b) and (c) use 2 × 3× initial guesses of xl 0.5 and xu 2.5, and iterate until the − Ta + Ta = = 11 approximate error falls below 1% or the number of iterations 8.621949 10 exceeds 10. Discuss your results. 4× − Ta 5.11 The Michaelis-Menten model describes the kinetics of where o the saturation concentration of dissolved oxy- 7 Rootsf Finding and Optimization - Part 2 enzyme mediated reactions: = 1 gen in freshwater at 1 atm (mg L− ); and Ta absolute = dS S temperature (K). Remember that Ta T 273.15, where vm dt = − ks S T temperature (°C). According to this= equation,+ saturation + where S substrate concentration (moles/L), v maxi- decreases= with increasing temperature. For typical natural m mum uptake= rate (moles/L/d), and k the half-saturation= waters in temperate climates, the equation can be used to de- s constant, which is the substrate level at= which uptake is half termine that oxygen concentration ranges from 14.621 mg/L of the maximum [moles/L]. If the initial substrate level at at 0 °C to 6.949 mg/L at 35 °C. Given a value of oxygen con- t 0 is S0, this differential equation can be solved for centration, this formula and the bisection method can be = S S0 vm t ks ln(S0/S) used to solve for temperature in °C. = − + (a) If the initial guesses are set as 0 and 35 °C, how many Develop an M-file to generate a plot of S versus t for the bisection iterations would be required to determine tem- case where S0 8 moles/L, vm 0.7 moles/L/d, and = = perature to an absolute error of 0.05 °C? ks 2.5 moles/L. = (b) Based on (a), develop and test a bisection M-file function 5.12 Areversible chemical reaction to determine T as a function of a given oxygen concen- 2A B → C tration. Test your function for osf 8, 10 and 14 mg/L. + = ← Check your results. can be characterized by the equilibrium relationship 5.9 Abeam is loaded as shown in Fig. P5.9. Use the bisec- c K c tion method to solve for the position inside the beam where 2 = cacb there is no moment. where the nomenclature c represents the concentration of con- 5.10 Water is flowing in a trapezoidal channel at a rate of i stituent i. Suppose that we define a variable x as representing Q 20 m3/s. The critical depth y for such a channel must the number of moles of C that are produced. Conservation of satisfy= the equation mass can be used to reformulate the equilibrium relationship as Q2 0 1 B (cc,0 x) 3 K = − gAc +2 = (ca,0 2x) (cb,0 x) where g 9.81 m/s2, A the cross-sectional area (m2), − − c where the subscript 0 designates the initial concentration and B the= width of the channel= at the surface (m). For this of each constituent. If K 0.016, c 42, c 28, and case, the= width and the cross-sectional area can be related to a,0 b,0 c 4, determine the value= of x. = = depth y by c,0 = (a) Obtain the solution graphically. B 3 y = + (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 100 lb/ft 100 lb false= position= to obtain =your solution. Justify your choice. 5.13 Figure P5.13a shows a uniform beam subject to a lin- early increasing distributed load. The equation for the result- ing elastic curve is (see Fig. P5.13b) w y 0 ( x5 2L2x3 L4x) (P5.13) = 120EIL − + − 3’ 3’ 4’ 2’ Use bisection to determine the point of maximum deflection (i.e., the value of x where dy/dx 0). Then substitute this value into Eq. (P5.13) to determine= the value of the maximum FIGURE P5.9 deflection. Use the following parameter values in your Problem 1 ¢ Where osf = the saturation concentration of dissolved oxygen in −1 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. 8 Root Finding and Optimization - Part 2 Problem 1 ¢ For typical natural waters in temperate climates, the equation can be used to determine that oxygen concentration ranges from 14.621 mg/L at 0 °C to 6.949 mg/L at 35 °C. ¢ Given a value of oxygen concentration, this formula and the bisection method can be used to solve for temperature in °C. ¢ If the initial guesses are set as 0 and 35 °C, how many bisection iterations would be required to determine temperature to an absolute error of 0.05 °C and what is the temperature? 9 Root Finding and Optimization - Part 2 cha01102_ch05_123-150.qxd 12/17/10 8:01 AM Page 148 148 ROOTS: BRACKETING METHODS 5.8 The saturation concentration of dissolved oxygen in and freshwater can be calculated with the equation y2 Ac 3y 1.575701 105 = + 2 ln osf 139.34411 × Solve for the critical depth using the graphical method, = − + Ta (a) 6.642308 107 1.243800 1010 (b) bisection, and (c) false position. For (b) and (c) use 2 × 3× initial guesses of xl 0.5 and xu 2.5, and iterate until the − Ta + Ta = = 11 approximate error falls below 1% or the number of iterations 8.621949 10 exceeds 10. Discuss your results. 4× − Ta 5.11 The Michaelis-Menten model describes the kinetics of where osf the saturation concentration of dissolved oxy- enzyme mediated reactions: = 1 gen in freshwater at 1 atm (mg L− ); and Ta absolute = dS S temperature (K). Remember that Ta T 273.15, where vm dt = − ks S T temperature (°C). According to this= equation,+ saturation + where S substrate concentration (moles/L), v maxi- decreases= with increasing temperature. For typical natural m mum uptake= rate (moles/L/d), and k the half-saturation= waters in temperate climates, the equation can be used to de- s constant, which is the substrate level at= which uptake is half termine that oxygen concentration ranges from 14.621 mg/L of the maximum [moles/L]. If the initial substrate level at at 0 °C to 6.949 mg/L at 35 °C. Given a value of oxygen con- t 0 is S0, this differential equation can be solved for centration, this formula and the bisection method can be = S S0 vm t ks ln(S0/S) used to solve for temperature in °C. = − + (a) If the initial guesses are set as 0 and 35 °C, how many Develop an M-file to generate a plot of S versus t for the bisection iterations would be required to determine tem- case where S0 8 moles/L, vm 0.7 moles/L/d, and = = perature to an absolute error of 0.05 °C? ks 2.5 moles/L. = (b) Based on (a), develop and test a bisection M-file function 5.12 Areversible chemical reaction to determine T as a function of a given oxygen concen- 2A B → C tration. Test your function for osf 8, 10 and 14 mg/L. + = ← Check your results. can be characterized by the equilibrium relationship 5.9 Abeam is loaded as shown in Fig. P5.9. Use the bisec- c K c tion method to solve for the position inside the beam where 2 Problem 2 = cacb there is no moment. where the nomenclature ci represents the concentration of con- 5.10¢ WaterWater is flowing is in aflowing trapezoidal in a trapezoidal channel at a rate of 3 stituent i. Suppose that we define a variable x as representing Qchannel20 at m a rate3/s. of The Q = 20 critical m /s. The depth y for such a channel must critical= depth y for such a channel the number of moles of C that are produced. Conservation of satisfymust satisfy the theequation equation mass can be used to reformulate the equilibrium relationship as Q2 0 1 B (cc,0 x) = − gA3 K + c = (c 2x)2(c x) 2 2 a,0 b,0 where g 9.81 m/s , Ac the cross-sectional area (m ), − − 10 Root Finding and Optimization - Part 2 where the subscript 0 designates the initial concentration and B the= width of the channel= at the surface (m).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages45 Page
-
File Size-