College of Engineering and Architecture
Civil Engineering Department
Brgy. Bajumpandan, Dumaguete City
ENM 331 – NUMERICAL METHODS AND ANALYSIS
MWF 5:30 PM - 7:30 PM
NUMERICAL METHODS AND ANALYSIS
CASE STUDIES
Veegay T. Kibete
BSCE III
Engr. Irismay T. Jumawan MBA, MEngCE
Instructor
January 2024
I. CASE STUDY: LINEAR SYSTEMS OF EQUATION
NODE A: NODE D:
NODE B: NODE E:
NODE C: NODE F:
NODE G: NODE F:
II. CASE STUDY:
Assignment 1: For the sample problem use any methods in solving the velocity
Continuity Equation:
Q= UAc
wherein:
Ac= BH (cross-sectional Area of a rectangular channel)
U= (1/n) R2/3S1/2 (Manning Equation)
R= Ac/P (Hydraulic Radius)
P= B +/2H (wetted perimeter of a rectangle)
Substituting:
( )[ ]
1 5
3
S 2
( BH )
Q= 2
n
( B+2 H ) 3
( )[ ]
1 5
S2 ( BH ) 3
0= 2
−Q
n 3
( B+2 H )
Substituting the given:
Q= 5 m3/s n= 0.03
B= 20 m S= 0.0002
( )[ ]
1 5
0.0002 2 20 ( H ) 3
f ( H )= 2
−5
0.03 3
( 20+2 H )
[ ]
5
( 20 H ) 3
f ( H )=( 0.471405 ) 2
−5
3
( 20+2 H )
2
3
' 46.31122316 H ( 50+ 3 H )
f ( H )= 5
( 20+2 H ) 3
1 st Iteration :
2nd Iteration:
[ ]
5
[ ]
20 ( 0.5 ) 3 5
f ( 0.5 )=( 0.471405 ) 2
−5 20 ( 0.726114 ) 3
f ( 0.726114 )=( 0.471405 ) −5
( 20+2 ( 0.5 )) 3 2
( 20+2 ( 0.726114 ) ) 3
f ( 0.5 )=−2.12537
f ( 0.726114 )=0.278014
'
f ( 0.5 )=46.31122316 ¿ ¿
f ' ( 0.726114 )=46.31122316¿ ¿
'
f (0.5)=9.39957
f ' ( 0.726114 )=11.7867
Using Newton-Raphson Method:
i Xo f(Xo) f'(Xo)
1 0.5 -2.12537 9.39957
2 0.726114 0.218014 11.7867
3 0.702527 0.002704 11.55674
4 0.702293 2.69E-01 11.55444
5 0.702293 0 11.55444
Q= UBH; H= 0.702293
5= U[20(0.702293)]
U= 0.356 m/s
Assignment 2: Use the same given of Assignment 1, use trapezoidal section with side slopes of 45°.
Using the same given, but in a trapezoidal section with side slopes of 45°.
Given: 20
I------------------------------------
---------- ---I ----------
- -
Q= 5 m/s n= 0.03
H√2 H√2
H H
B= 20 m S= 0.0002 45ᵒ 45ᵒ
I---------I-------------------
H I---------I
20-2H H
Continuity Equation:
Q= UAc
where:
1 (3 )
2 1
U = R S2
n
Ac
R=
P
Ac=
[ B 1+B 2
2
H
] > cross-sectional area of a trapezoid
P=B+2 H √ 2 > wetted perimeter of a trapezoid section
B1=20
B2= 20+2H
Substituting to the Equation:
[ ]
2
( B 1+B 2 ) 3 1
(H ) ( B 1+B 2 )
Q=
1
n () 2
B+ 2 H √ 2
S2 [
2
(H )]
Using the given:
[ ]
2
( 20+20−2 H ) 3
(H)
[ ]
1
5=¿) 2 ( 20+ 20−2 H )
( 0.0002 ) 2 (H)
20+2 H √2 2
[ ]
2
( 20−H ) ( H ) 3
f ( H )=( 0.471405 ) ( 20−H )−5
20+2 H √ 2
( 31427 √3 50 ( H−20 ) ( 7071 H 2+70000 H −400000 ) )
(√ 7071
'
f ( H )=¿
H +50000 )
3 −H ( H−20 ) 2
800 ( 7071 H +50000 )
1st Iteration:
[ ]
2
( 20−( 0.5 ) ) ( 0.5 ) 3
f ( 0.5 )=( 0.471405 ) ( 20−( 0.5 ) )−5
20+2 ( 0.5 ) √ 2
f(0.5) = 0.440397555
(31427 √3 50 ((0.5)−20 ) ( 7071(0.5)2 +70000(0.5)−400000 ) )
√(
'
f ( 0.5 )=¿
800
3 −(0.5) ( (0.5)−20 )
7071(0.5)+50000 )
( 7071( 0.5)+50000 )
2
f’(0.5)= 6.30982491
2nd Iteration:
[ ]
2
( 20− ( 0.4302 ) ) ( 0.4302 ) 3
f ( 0.4302 )=( 0.471405 ) ( 20−( 0.4302 ) )−5
20+ 2 ( 0.4302 ) √ 2
f(0.4302)= -0.018407993
( 31427 √3 50 ( ( 0.4302 )−20 ) ( 7071 ( 0.4302 )2 +70000 ( 0.4302 ) −400000 ) )
√( )
'
f ( 0.4302 )=¿ 3 −( 0.4302 ) ( ( 0.4302 )−20 ) 2
800 ( 7071 ( 0.4302 )+ 50000 )
7071 ( 0.4302 ) +50000
f’(0.4302)= 6.85273995
Using Newton-Raphson Method:
i Xo f(Xo) f'(Xo)
1 0.5 0.440397555 6.30982491
2 0.430204473 -0.018407993 6.85273995
3 0. 4302890997 -3.05236E-05 6.83004077
4 0.432895166 -8.40839E-11 6.83000314
5 0. 432895166 0 6.85000314
H= 0.4329
[ ]
1
5
U= 20+20−2 ( 0.4329 )
( 0.4329 )
2
U= 0.5903 m/s
Assignment 3:
Solution:
a. Insert the given parameter values into the first equation to obtain
0.2 ×1.23 ×1600
∆ p=f • =39.36 f
2 ×0.005
Determine Re by inserting the parameter values into the third given equation.
1.23 × 40 ×0.005
ℜ= −5
=13743.02
1.79 ×10
Now rewrite the second equation as follows.
( )
1 2.51
6
=−2.0 log ( 1.5 ×10 +¿ )
√f 3.7 ×0.005 13743.02• √ f
( √f )
1
=−2.0 log ((8.10811+ ¿
18.26382
√f
) • 10 ¿ −5
( √1f )−23.02585+2.0 log (8.10811+ ¿ 18.26382
√f
) ¿0
It remains to solve (2) for f. To simplify the problem, solve the equation for x=√f and then
determine f as f=(√f ¿2 = x 2 .
f ( x )= ( 1x )−23.02585+2.0 log (8.10811+ ¿ 18.26382
x
)
( ) ( )
1 1
f ' ( x )= + 2• •¿
x 2
18.26382 )
8.10811+
x
X0 = √f0 = √ ( 0.136
ℜ )
0.25
=0.170838
Now Newton's method can be used to determine the root of f.
f (x 0) −7.68222
x i=x 0− =0.170838− =0.00067
f ' (x 0) −45.1451
0.102679−0.170838
ε a= =−253.649
0.102679
Now, solve the substitution formula x=√ f for f
2 2
f ≈ x 4 =0.082307 =0.0067744
Substitute f to the 1st Equation:
0.2 ⋅1.23⋅ 1600
Δ p=0.0067744 ⋅ =39.36 ⋅0.0067744=0.266642 Pa
2 ⋅0.005
Δ p=0.266642 Pa
b. Repeat the computation but for a rougher commercial steel pipe (ε=0.045~mm)
0.2⋅1.23 ⋅1600
1 st Equation: Δp=f ⋅ =39.36 ⋅ f
2⋅ 0.005
Determine ℜ by inserting the parameter values into the third given equation.
1.23 ⋅ 40 ⋅0.005
ℜ= −5
=13743.02
1.79 ⋅10
Now, you can rewrite the second equation as follows:
1 4.5 ⋅10−5 2.51
=−2 log( + )
√f 3.7 ⋅0.005 13743.02⋅ √ f
1
⇔ =−2 log ¿ )
√f
1 18.26382
⇔ =−23.02585+2 log (243.243+ )=0
√f √f
Use the same substitution formula as in (a) and determine the derivative of the modified function f(x) as follows. Note that
the initial guess remains the same.
1 18.26382
f (x)= −23.02585+2 log (243.24324 + )
x x
Now, solve the substitution formula x=√ f for f
−1 1 −18.26382
f ' (x)= +2 ⋅ ⋅( )
x
2
18.26382 x
2
243.24324 +
x
x 0=√ fo=
√ 0.316
R e 0.25
=0.170838
Assignment 4
Solution:
First determine the derivative of y and insert the given parameter values into the equation to obtain:
Note that
where
Since , preform iterations of the bisection method to obtain the following
results.
Iteration xL f(xL) xU f(xU) xr f(xR)
1 0.00000 -0.00089 450.00000 0.00000 225.00000 0.00017
2 0.00000 -0.00089 225.00000 0.00017 112.50000 -0.00057
3 112.50000 -0.00057 225.00000 0.00017 168.75000 -0.00023
4 168.75000 -0.00023 225.00000 0.00017 196.87500 -0.00003
5 196.87500 -0.00003 225.00000 0.00017 210.93750 0.00007
6 196.87500 -0.00003 210.93750 0.00007 203.90625 0.00002
7 196.87500 -0.00003 203.90625 0.00002 200.39063 -0.00001
8 200.39063 -0.00001 203.90625 0.00002 202.14844 0.00001
9 200.39063 -0.00001 202.14844 0.00001 201.26953 0.00000
10 200.39063 -0.00001 201.26953 0.00000 200.83008 0.00000
11 200.83008 0.00000 201.26953 0.00000 201.04980 0.00000
12 201.04980 0.00000 201.26953 0.00000 201.15967 0.00000
13 201.15967 0.00000 201.26953 0.00000 201.21460 0.00000
14 201.21460 0.00000 201.26953 0.00000 201.24207 0.00000
15 201.24207 0.00000 201.26953 0.00000 201.25580 0.00000
16 201.24207 0.00000 201.25580 0.00000 201.24893 0.00000
17 201.24207 0.00000 201.24893 0.00000 201.24550 0.00000
18 201.24550 0.00000 201.24893 0.00000 201.24722 0.00000
19 201.24550 0.00000 201.24722 0.00000 201.24636 0.00000
20 201.24550 0.00000 201.24636 0.00000 201.24593 0.00000
21 201.24593 0.00000 201.24636 0.00000 201.24614 0.00000
22 201.24593 0.00000 201.24614 0.00000 201.24604 0.00000
23 201.24604 0.00000 201.24614 0.00000 201.24609 0.00000
24 201.24609 0.00000 201.24614 0.00000 201.24612 0.00000
25 201.24612 0.00000 201.24614 0.00000 201.24613 0.00000
26 201.24612 0.00000 201.24613 0.00000 201.24612 0.00000
27 201.24612 0.00000 201.24612 0.00000 201.24612 0.00000
28 201.24612 0.00000 201.24612 0.00000 201.24612 0.00000
29 201.24612 0.00000 201.24612 0.00000 201.24612 0.00000
Insert the approximation into the initial equation to obtain:
CASE STUDY: CURVE FITTING
Solution:
LEAST-SQUARE REGRESSION (POLYNOMIAL)
x y
Depth Stress
x² x³ x⁴ x⁵ x⁶
(m) (kPa)
1.9 14.4 3.61 6.86 13.03 24.76 47.05
3.1 28.7 9.61 29.79 92.35 286.29 887.50
4.2 19.2 17.64 74.09 311.17 1,306.91 5,489.03
5.1 43.1 26.01 132.65 676.52 3,450.25 17,596.29
5.8 33.5 33.64 195.11 1,131.65 6,563.57 38,068.69
6.9 52.7 47.61 328.51 2,266.71 15,640.31 107,918.16
8.1 71.8 65.61 531.44 4,304.67 34,867.84 282,429.54
9.3 62.2 86.49 804.36 7,480.52 69,568.84 646,990.18
10 76.6 100 1,000.00 10,000.00 100,000.00 1,000,000.00
∑x3=3,102.8 ∑x4=26,276.6 ∑x5=231,708.7 ∑x6=2,099,426.4
∑x=54.4 ∑y=402.2 ∑ x²=390.22
1 3 8 4
N=9
x⁷ x⁸ xy x²y x³y x⁴y
89.39 169.84 27.36 51.98 98.77 187.66
2,751.26 8,528.91 88.97 275.81 855.00 2,650.51
23,053.93 96,826.52 80.64 338.69 1,422.49 5,974.46
89,741.07 457,679.45 219.81 1,121.03 5,717.26 29,158.02
220,798.42 1,280,630.82 194.30 1,126.94 6,536.25 37,910.26
744,635.33 5,137,983.74 363.63 2,509.05 17,312.42 119,455.73
2,287,679.25 18,530,201.89 581.58 4,710.80 38,157.46 309,075.46
6,017,008.71 55,958,180.97 578.46 5,379.68 50,031.01 465,288.35
10,000,000.00 100,000,000.00 766.00 7,660.00 76,600.00 766,000.00
∑x7=19,385,757. ∑x8=181,470,202. ∑xy=2,900.7 2
∑x y=23,173.9 ∑x3y=196,730. ∑x4y=1,735,700.
34 13 5 7 66 44
Using Gaussian Elimination with pivoting to determine the value of a, a1, a2, a3 and a4.
9 54.4 390.22 3,102.81 26,276.63 a₀ 402.2
54.4 390.22 3,102.81 26,276.63 231,708.78 a₁ 2,900.75
390.22 3,102.81 26,276.63 231,708.78 2,099,426.44 a₂ 23,173.97
3,102.81 26,276.63 231,708.78 2,099,426.44 19,385,757.34 a₃ 196,730.66
26,276.63 231,708.78 2,099,426.44 19,385,757.34 181,470,202.13 a₄ 1,735,700.44
m 9 54.4 390.22 3,102.81 26,276.63 a₀ 402.2
6.04444444 61.4022222
4 0 2 744.14 7,521.88 72,881.16 a₁ 469.67
43.3577777
744.14
8 0 9,357.56 97,177.92 960,130.26 a₂ 5,735.47
344.756444
4 0 7,521.88 97,177.92 1,029,713.39 10,326,720.57 a₃ 58,069.62
2919.62531 960,130.2 10,326,720.5
1 0 72,881.16 6 7 104,752,294.51 a₄ 561,427.14
m 9 54.4 390.22 3,102.81 26,276.63 a₀ 402.2
61.4022222
0 2 744.14 7,521.88 72,881.16 a₁ 469.67
12.11918497 0 0 339.13 6,018.90 76,869.97 a₂ 43.40
122.50171 0 0 6,018.90 108,270.57 1,398,653.53 a₃ 533.70
1186.946659 0 0 76,869.97 1,398,653.53 18,246,242.17 a₄ 3,948.62
m 9 54.4 390.22 3,102.81 26,276.63 a₀ 402.2
0 61.40222222 744.14 7,521.88 72,881.16 a₁ 469.67
0 0 339.13 6,018.90 76,869.97 a₂ 43.40
17.7482550
0 0 0 1,445.63 34,345.77 a₃ -236.63
3
226.670679
0 0 0 34,345.77 822,074.72 a₄ -5,889.63
3
m 9 54.4 390.22 3,102.81 26,276.63 a₀ 402.2
61.4022222
0 2 744.14 7,521.88 72,881.16 a₁ 469.67
0 0 339.13 6,018.90 76,869.97 a₂ 43.40
0 0 0 1,445.63 34,345.77 a₃ -236.63
23.75839606 0 0 0 0 6,074.31 a₄ -267.61
6074.31 a₄ = -267.61
a₄ = -0.04406
1,445.63 a₃ + 34,345.77 a₄ = - 236.63
a₃ = 0.88302
339.13 a₂ + 6,018.90 a₃ + 76,869.97 a₄ = 43.40 a₂ = -5.55779
61.4022 a₁ + 744.14 a₂ + 7,521.88 a₃ + 72,881.16 a₄ = 469.67 a₁ = 19.12614
9 a₀ + 54.4 a₁ + 390.22 a₂ + 3,102.81 a₃ + 26,276.63 a₄ = 402.2 a₀ = -5.74328
y= -5.74328 + 19.12614x - 5.55779x2 + 0.88302x3 - 0.04406x4
x= 4.5 m
y= -5.74328 + 19.12614(4.5) - 5.55779(4.5)2 + 0.88302(4.5)3 - 0.04406(4.5)4
y= 41.43193 kpa (Shear at the depth of 4.5 m)
Solution:
a.
Distance (m) x Lane Width (m)
X Y 3.5
DISTANC LANE WIDTH
E (m) (m) 3
2.4 2.9
1.5 2.1 2.5
2.4 2.3
2
1.8 2.1
1.8 1.8 1.5
2.9 2.7
1.2 1.5 1
0.5
0
1 1.5 2 2.5 3 3.5
3 2.9
1.2 1.5
x y
Distance (m) Lane Width (m) xy x²
2.4 2.9 6.96 5.76
1.5 2.1 3.15 2.25
2.4 2.3 5.52 5.76
1.8 2.1 3.78 3.24
1.8 1.8 3.24 3.24
2.9 2.7 7.83 8.41
1.2 1.5 1.8 1.44
3 2.9 8.7 9
1.2 1.5 1.8 1.44
2
∑x= 18.2 ∑y= 19.8 ∑xy= 42.78 ∑x = 40.54
b. LEAST-SQUARE REGRESSION (LINEAR)
N= 9
x̄ = 2.02222 y= 0.71672 + 0.73349x
ȳ= 2.2
Distance (x) 2.4 1.5 2.4 1.8 1.8 2.9 1.2 3 1.2
Lane Width (y) 2.477 1.817 2.477 2.037 2.037 2.844 1.597 2.917 1.597
Distance (m) x Lane Width (m)
3.5
9 ( 42.78 )− (18.2 )( 19.8 ) 2.5
a 1=
9(40.54 )−¿ ¿
a1= 0.73349 2
1.5
a0= y−a1 x
1
a0= 2.2−90.73349 ¿(2.02222)
a0= 0.71672 0.5
0
y= a0 + a1x 1 1.5 2 2.5 3 3.5
y= 0.71672 + 0.73349x
c. x= 2m
y= 0.71672 + 0.73349x = 0.71672 + 0.73349(2) = 2.19370 m (corresponding minimum lane width)