Example For Numerical
Example For Numerical
Example For Numerical
Examples 1.
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 the equation
𝑄2
0 = 1− 3𝐵
𝑔𝐴𝑐
where 𝑔 = 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 y
𝑦2
by B = 3 + y and 𝐴𝑐 = 3𝑦 + . Solve for the critical depth using
2
a. Bisection.
i |Ea|%
1 0.5 -32.25821 2.5 0.813032 1.5 -0.030946
2 1.5 -0.03095 2.5 0.813032 2 0.601809 25.00
3 1.5 -0.03095 2 0.601809 1.75 0.378909 14.29
4 1.5 -0.03095 1.75 0.378909 1.625 0.206927 7.69
5 1.5 -0.03095 1.625 0.206927 1.5625 0.097956 4.00
6 1.5 -0.03095 1.5625 0.097956 1.53125 0.036261 2.04
7 1.5 -0.03095 1.53125 0.036261 1.515625 0.003383 1.03
8 1.5 -0.03095 1.515625 0.003383 1.5078125 -0.013595 0.52
b. False position.
i |Ea|%
1 0.5 -32.2582 2.50000 0.81303 2.45083 0.79987
2 0.5 -32.2582 2.45083 0.79987 2.40363 0.78612 1.96
3 0.5 -32.2582 2.40363 0.78612 2.35834 0.77179 1.92
4 0.5 -32.2582 2.35834 0.77179 2.31492 0.75689 1.88
5 0.5 -32.2582 2.31492 0.75689 2.27331 0.74145 1.83
6 0.5 -32.2582 2.27331 0.74145 2.23347 0.72547 1.78
7 0.5 -32.2582 2.23347 0.72547 2.19534 0.70900 1.74
8 0.5 -32.2582 2.19534 0.70900 2.15888 0.69206 1.69
9 0.5 -32.2582 2.15888 0.69206 2.12404 0.67469 1.64
10 0.5 -32.2582 2.12404 0.67469 2.09077 0.65693 1.59
Hint; For (b) and (c) use initial guesses of 𝑥𝑙 = 0.5 and 𝑥𝑢 = 2.5, and iterate until the
approximate error falls below 1% or the number of iterations exceeds 10. Discuss your results.
WINDOWS USER 1
Perfection is a laudable goal; it is rarely if ever attained
where V = volume [m3], h = depth of water in tank [m], and R = the tank radius [m].
Fig. P5.17
If R = 10 m, to what depth must the tank be filled so that it holds 1000 m3? Use three iterations
of the false-position method to determine your answer. Determine the approximate relative
error after each iteration. Employ initial guesses of 0 and R.
Solution
𝜋
The equation to be solved is 𝑓(ℎ) = 𝜋𝑅ℎ2 − (3 ) ℎ3 − 𝑣
Because this equation is easily to differentiate, the Newton-Raphson method is the best choice
to achieve the result efficiently. It can be formulated as
𝜋
𝜋𝑅𝑥𝑖 2 − ( 3 ) 𝑥𝑖 3 − 𝑣
𝑥𝑖+1 = 𝑥𝑖 −
2𝜋𝑅ℎ − 𝜋ℎ2
Substituting the value of the given parameter
𝜋
𝜋(10)𝑥𝑖 2 − (3) 𝑥𝑖 3 − 1000
𝑥𝑖+1 = 𝑥𝑖 −
2𝜋(10)ℎ − 𝜋ℎ2
The iterations can be summarized as
i f’(Xi)
Xi f(Xi) Xr |Ea|%
0 10 1094.395 314.1593 6.516432
1 6.516432 44.26917 276.0353 6.356057 53.45821
2 6.356057 0.2858 272.4442 6.355008 2.523185
3 6.355008 1.26E-05 272.4202 6.355008 0.016507
4 6.355008 0 272.4202 6.355008 7.28E-07
Thus, after only three iterations, the root is determined to be 6.355008 with an approximate
relative error of 0.017%.
WINDOWS USER 2
Perfection is a laudable goal; it is rarely if ever attained
Examples 3.
Medical studies have established that a bungee jumper’s chances of sustaining a significant
vertebrae injury increase significantly if the free-fall velocity exceeds 36 m/s after 4 s of free
fall. Your boss at the bungee-jumping company wants you to determine the mass at which this
criterion is exceeded given a drag coefficient of 0.25 kg/m. You know from your previous
studies that the following analytical solution can be used to predict fall velocity as a function
of time:
𝑔𝑥𝑚 𝑔𝑥𝑐𝑑
𝑣(𝑡) = √ tan ℎ (√ 𝑥𝑡),
𝑐𝑑 𝑚
Try as you might, you cannot manipulate this equation to explicitly solve for m—that is, you
cannot isolate the mass on the left side of the equation. An alternative way of looking at the
problem involves subtracting v(t) from both sides to give a new function:
𝑔𝑥𝑚 𝑔𝑥𝑐𝑑
𝑓(𝑚) = √ tan ℎ (√ 𝑥𝑡) − 𝑣(𝑡),
𝑐𝑑 𝑚
Now we can see that the answer to the problem is the value of m that makes the function
equal to zero. Hence, we call this a “roots” problem
a. Bisection Method
we can see that the function changes sign between values of 50 and 200. The plot obviously
suggests better initial guesses, say 140 and 150, but for illustrative purposes let’s assume we
don’t have the benefit of the plot and have made conservative guesses. Therefore, the initial
estimate of the root 𝑥𝑚 lies at the midpoint of the interval
50 + 200
𝑥𝑚 = = 125
2
Note that the exact value of the root is 142.7376. This means that the value of 125 calculated
here has a true percent relative error of
142.7376 − 125
|εr | = | | x100% = 12.43%
142.7376
Next we compute the product of the function value at the lower bound and at the midpoint: f
(50) f (125) = -4.579(-0.409) = 1.871 which is greater than zero, and hence no sign change
occurs between the lower bound and the midpoint. Consequently, the root must be located in
the upper interval between 125 and 200. Therefore, we create a new interval by redefining the
lower bound as 125. At this point, the new interval extends from 𝑥𝑙 = 125 to 𝑥𝑢 = 200. A revised
root estimate can then be calculated as
125 + 200
𝑥𝑚 = = 162.5
2
which represents a true percent error of |εr | = 13.85%. The process can be repeated to obtain
refined estimates. For example, f (125) f (162.5) = -0.409(0.359) = -0.147
WINDOWS USER 3
Perfection is a laudable goal; it is rarely if ever attained
Therefore, the root is now in the lower interval between 125 and 162.5. The upper bound is
redefined as 162.5, and the root estimate for the third iteration is calculated as
125 + 162.5
𝑥𝑚 = = 143.75
2
which represents a percent relative error of εr = 0.709%? The method can be repeated until
the result is accurate enough to satisfy your needs.
i |Ea|%
1 50 -4.57938708 200 0.860291 125 -33.4943
2 125 -0.408601463 200 0.860291 162.5 -33.8024 23.08
3 125 -0.408601463 162,5 0.359404 143.75 -33.6634 13.04
4 125 -0.408601463 143,75 0.020577 134.375 -33.5833 6.98
5 134.24 -0.183681058 143,75 0.020577 138.995 -33.6238 3.42
6 138.995 -0.078411248 143,75 0.020577 141.3725 -33.6439 1.68
7 141.3725 -0.028167557 143,75 0.020577 142.56125 -33.6537 0.83
8 142.5613 -0.003612063 143,75 0.020577 143.15563 -33.6586 0.42
Examples 4.
Use bisection to determine the drag coefficient needed so that an 80-kg bungee jumper 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 XI=0.1 and Xu=0.2 and iterate until the approximate relative error falls
below 2%.
WINDOWS USER 4
Perfection is a laudable goal; it is rarely if ever attained
𝑔𝑥𝑚 𝑔𝑥𝑐𝑑
Recall that 𝑣(𝑡) = √ tan ℎ (√ 𝑥𝑡), where v(t) is velocity after t free fall, m mass of
𝑐𝑑 𝑚
object and 𝑐𝑑 is drag coefficient
Solution
𝑔𝑥𝑚 𝑔𝑥𝑐𝑑
𝑓(𝑐𝑑 ) = √ tan ℎ (√ 𝑥𝑡) − 𝑣(𝑡)
𝑐𝑑 𝑚
By substituting the given value into above equation
9.81(80) 9.81𝑐𝑑
𝑓(𝑐𝑑 ) = √ tan ℎ (√ 𝑥4) − 36
𝑐𝑑 80
The first iteration is
0.1 + 0.2
𝑥𝑟 = = 0.15
2
f (0.1) f (0.15) = 0.860291(-0.204516) = -0.175944
Therefore, the root is in the first interval and the upper guess is redefined as Xu = 0.15. The
second iteration is
0.1 + 0.15
𝑥𝑟 = = 0.125
2
0.125 − 0.15
|εr | = | | x100% = 20%
0.125
Therefore, the root is in the second interval and the lower guess is redefined as Xu = 0.125.
The remainder of the iterations are displayed in the following table:
i |Ea|
1 0.1 0.860291 0.2 -1.19738 0.15 -0.20452
2 0.1 0.860291 0.15 -0.20452 0.125 0.318407 20
3 0.125 0.318407 0.15 -0.20452 0.1375 0.054639 9.09
4 0.1375 0.054639 0.15 -0.20452 0.14375 -0.07551 4.35
5 0.1375 0.054639 0.14375 -0.07551 0.140625 -0.01058 2.22
6 0.1375 0.054639 0.140625 -0.01058 0.139063 0.021995 1.12
Repeat Example 4, but use the false-position method to obtain your solution.
9.81(80) 9.81𝑐𝑑
𝑓(𝑐𝑑 ) = √ tan ℎ (√ 𝑥4) − 36
𝑐𝑑 80
The first iteration is
WINDOWS USER 5
Perfection is a laudable goal; it is rarely if ever attained
−1.19738(0.1 0.2)
𝑥𝑟 = 0.2 − = 0.141809
0.86029 ( 1.19738)
f (0.1) f (0.141809) = 0.860291(-0.03521) = -0.030292
−0.03521(0.1 0.141809)
𝑥𝑟 = 0.141809 − = 0.140165
0.86029 ( 0.03521)
0.140165 − 0.141809
|εr | = | | x100% = 1.17%
0.140165
Therefore, after only two iterations we obtain a root estimate of 0.140165 with an approximate
error of 1.17% which is below the stopping criterion of 2%.
Therefore, the root is in the first interval and the upper guess is redefined as 𝑥𝑟 = 0.141809.
The second iteration is
Examples 5.
The Manning equation can be written for a rectangular open channel as
5
√𝑠(𝐵𝐻) ⁄3
𝑄= 2
𝑛(𝐵 + 2𝐻) ⁄3
where Q = flow [m3/s], S = slope [m/m], H = depth [m], and n = the Manning roughness
coefficient. Develop a fixed-point iteration scheme to solve this equation for H given Q = 5, S
= 0.0002, B = 20, and n = 0.03. Prove that your scheme converges for all initial guesses greater
than or equal to zero
5⁄ 5⁄
√𝑠(𝐵𝐻) 3 √0.0002(20𝐻) 3
𝑄= 2⁄ = 2⁄ =5
𝑛(𝐵 + 2𝐻) 3 0.03(20 + 2𝐻) 3
2⁄ 5⁄
5𝑥0.03(20 + 2𝐻) 3 = √0.0002(20𝐻) 3
2⁄
5 5𝑥0.03(20 + 2𝐻) 3
𝐻 ⁄3 = 5⁄
√0.0002(20) 3
3⁄
2⁄ 5 2⁄
0.15(20 + 2𝐻) 3 0.320372(20 + 2𝐻) 5
𝐻=( 5⁄ ) =
√0.0002𝑥(20) 3 3.09984
2⁄
H = 0.103351(20 + 2H) 5 ……………………………………..……………………… Eq. 1
WINDOWS USER 6
Perfection is a laudable goal; it is rarely if ever attained
i 𝑥𝑟
0 0,5
1 0.349303069
2 0.347289076
3 0.347262042
4 0.347261679
5 0.347261674
6 0.347261674
Examples 6.
A concrete lined trapezoidal channel with uniform flow has a base width of 5m and the side
slopes are equal at 1:2(V: H). If the discharge is known to be 30m3/s in uniform flow, what is
the normal depth of the channel? [take bed slope s=0.001 and manning’s coefficient n=0.015]
1 2⁄ 1⁄
Q= AR 3 S 2
𝑛
𝐴
Where R= hydraulic radius = , P=perimeter of the channel
𝑝
Use fixed point iteration with initial guesses of 1.5 and conduct four iterations.
WINDOWS USER 7
Perfection is a laudable goal; it is rarely if ever attained
5⁄
(𝑌(5 + 2𝑌) 3 √0.001
30 = 2⁄
0.015(5 + 4.47) 3
2⁄
30𝑥0.015(5 + 4.47) 3 5⁄
= (𝑌(5 + 2𝑌) 3
√0.001
2⁄
𝑌 = √2.46(5 + 4.47𝑌) 5 − 2.5𝑌…......………………...………………...……………. Eq. 1
2⁄
𝑌 = 0.984(5 + 4.47) 5 − 0.4𝑌 2 ……………………...………………………...……......Eq. 2
i 𝑥𝑟 i 𝑥𝑟
0 1,5 0 1,5
1 1.776530873 1 1.73235
2 1.664605989 2 1.522989
3 1.711486652 3 1.713772
4 1.692120025 4 1.541485
5 1.700166963 5 1.698482
6 1.696831409 6 1.556479
7 1.698215413 7 1.685865
8 1.697641392 8 1.568698
9 1.69787951 125 1.625347
10 1.69778074 126 1.625346
11 1.69782171 127 1.625347
12 1.697804716 128 1.625346
13 1.697811765 129 1.625347
14 1.697808841 130 1.625346
15 1.697810054 131 1.625347
16 1.697809551 132 1.625346
17 1.697809759 133 1.625347
18 1.697809673 134 1.625346
19 1.697809709 135 1.625347
20 1.697809694 136 1.625346
21 1.6978097 137 1.625347
22 1.697809698 138 1.625346
23 1.697809699 141 1.625347
24 1.697809698 142 1.625346
25 1.697809698 143 1.625347
WINDOWS USER 8
Perfection is a laudable goal; it is rarely if ever attained
#Q1. According to Archimedes’ principle, the buoyancy force is equal to the weight of fluid
displaced by the submerged portion of the object. For the sphere depicted in Fig. P5.22,
FIGURE P5.22
use bisection to determine the height, h, of the portion that is above water. Employ the
following values for your computation: r = 1 m, ρs = density of sphere = 200 kg/m3, and ρw =
density of water = 1,000 kg/m3. Note that the volume of the above-water portion of the sphere
can be computed with
[3𝑟 − ℎ]
𝑉 = 𝜋ℎ2
3
#Q2. A trough of length L has a cross section in the shape of a semicircle with radius r. (See
the accompanying figure.) When filled with water to within a distance h of the top, the volume
V of water is
ℎ 1
𝑣 = 𝐿 [0.5𝜋𝑟 2 − 𝑟 2 𝑎𝑟𝑐𝑠𝑖𝑛 ( ) − ℎ(𝑟 2 − ℎ2 ) ⁄2 ]
𝑟
Suppose L=10ft, r = 1ft, and V = 12.4 ft3. Find the depth of water in the trough to within 0.01ft
(Hint; Use the appropriate method for your solution)
WINDOWS USER 9