19.
24 Develop an M-file f
Use numerical integration to estimate the particle’s mass
(in g) and average density (in g/cm3). posite Simpson’s 1∕3 rule
19.22 As specified in the following table, the earth’s density
function print error mess
varies as a function of the distance from its center (r = 0):
data is not equispaced or
University of Technology - HCMC Numerical Method Project ing the data are not of e
Faculty of Applied Mathematics r, km Semester 1 (2021 - 2022) 2 data points, implement t
0 1100 1500 2450 3400 3630
an even number of data p
ρ(g/cm3) 13 12.4 12 11.2 9.7 5.7
segments, n – 1), use Sim
r, km
Problem 1. A spherical tank has a circular 4500 5380in 6060
orifice 6280
its bottom 6380through segments.
which
ρ(g/cm3) 5.2 4.7 3.6 3.4 3 19.25 During a storm a h
the liquid flows out. The following data is collected for the flow of a rate
rectangular skyscraper
through the orifice as a function of time: described in Prob. 19.9, us
Use numerical integration to estimate the earth’s mass (in Cotes formulas (trapezoida
metric tonnes) and average density (in g/cm3). Develop ver- to determine (a) the force
t (s) 0 tically stacked subplots of (top) density versus radius, and (b) the line of force in mete
500 1000 1500 2200 2900
(bottom) mass versus radius. Assume that the earth is a per- 19.26 The following data i
3
Q (m /hr) 10.55fect sphere.
9.576 9.072 8.640 8.100 7.560 object as a function of time
19.23 A spherical tank has a circular orifice in its bottom
through which the liquid flows out (Fig. P19.23). The fol- t, s 0 4 8 12
lowing data is collected for the flow rate through the orifice υ, m/s 0 18 31 42
as a function of time:
t (s) 3600 4300 5200 6500 7000 7500
3
Q, (m /hr) 7.020t, s 6.480 0 5.688
500
4.752 3.348
1000 1500
1.404 (a)
2200 2900
Limiting yourself to tra
and 3∕8 rules, make th
Q, m3/hr 10.55 9.576 9.072 8.640 8.100 7.560 object travels from t =
t, s
Write a script with supporting 3600 4300
functions 5200 6500 7000 7500 (b) Employ the results of (a
Q, m3/hr 7.020 6.480 5.688 4.752 3.348 1.404
(a) to estimate the volume of fluid (in liters) drained over the entire z, m
a script with supporting functions (a) to estimate the
measurement periodWrite
volume of fluid (in liters) drained over the entire measure-
600
ment period and (b) to estimate the liquid level in the tank at
(b) to estimate the liquid level in the tank at t = 0 s. Note that
t = 0 s. Note that r = 1.5 m. 500r =
1.5 m.
400
300
r
200
100
H
0
0 50 10
FIGURE P19.23 FIGURE P19.25
Problem 2. Let R be the rectangle [0; 2] × [1; 4].
RR
(a) Let f (x; y) = x cos(x2 + y). Calculate the integral f (x, y)dA.
R
(b) Study the Simpson formula. Develop
cha97962_ch19_485-523.indd 522 a function to estimate the
integral in R using Simpson formula.
(c) Let n and m be the number of sub-interval in x and y compo-
nents, respectively. Estimate the integral with [n, m] = [40, 60]
and [n, m] = [80, 120] and estimate the errors.
Problem 3. Heat is conducted along a metal rod positioned be- tween two fixed
temperature walls. Aside from conduction, heat is transferred between
the rod and the surrounding air by convection. Based on a heat bal-
ance, the distribution of temperature along the rod is described by
the following sec- ond-order differential equation
d2 T
0= + h(T∞ − T )
dx2
where T = temperature (K), h = a bulk heat transfer coefficient
reflecting the relative importance of convection to conduction m−2 ,
x =distance along the rod (m), and T∞ = temperature of the sur-
rounding fluid (K).
(a) Convert this differential equation to a equivalent system of si-
multaneous algebraic equations using a centered difference ap-
proximation for the second derivative.
(b) Develop a function to solve these equations from x = 0 to L and
return the resulting distances and temperatures, in which, the
algebraic equations must be solved by tridiagonal matrix.
(c) Develop a script that invokes this function and then plots the
results.
(d) Test your script for the following parameters: h = 0.0425 m−2 ,
L = 12 m, T∞ = 220 K, T (0) = 320 K, T (L) = 450 K, and
∆x = 0.5 m.