Paractice Problem _Math Methods I_ (1)
Paractice Problem _Math Methods I_ (1)
Suppose that you have the task of measuring the lengths of a bridge and a rivet and come up with
9999 and 9 cm, respectively. If the true values are 10,000 and 10 cm, respectively, compute (a) the
true error and (b) the true percent relative error for each case.
Problem 2
In mathematics, functions can often be represented by infinite series. For example, the exponential
function can be computed using
𝑥2 𝑥3 𝑥𝑛
ex = 1 + x + + + ---------
2! 3! 𝑛!
Thus, as more terms are added in sequence, the approximation becomes a better and better estimate
of the true value of ex. Given equation is called a Maclaurin series expansion. Starting with the
simplest version, ex = 1, add terms one at a time to estimate e0.5. After each new term is added,
compute the true and approximate percent relative errors. Note that the true value is e0.5 = 1.648721.
Add terms until the absolute value of the approximate error estimate 𝜀𝑎 falls below a prespecified
error criterion es conforming to three significant figures.
Problem 3
Use forward and backward difference approximations of O(h) and a centered difference
approximation of O(h2) to estimate the first derivative of
at x = 0.5 using a step size h = 0.5. Repeat the computation using ℎ = 0.25 . Note that the
derivative can be calculated directly as
Problem 4
𝑥3 𝑥5 𝑥7
𝑠𝑖𝑛 𝑥 = 1 − + − + −−−−−
3! 5! 7!
Starting with the simplest version, sin x = 1, add terms one at a time to estimate 𝑠𝑖𝑛 (𝜋/3). After
each new term is added, compute the true and approximate percent relative errors. Use your pocket
calculator to determine the true value. Add terms until the absolute value of the approximate error
estimate falls below an error crite rion conforming to two significant figures.
Problem 5
Use zero- through third-order Taylor series expansions to predict 𝑓 (3) for
𝑓(𝑥) = 25 𝑥 3 − 6 𝑥 2 + 7 𝑥 − 88
using a base point at 𝑥 = 1. Compute the true percent relative error et for each approximation.
Use forward and backward difference approximations of 𝑂(ℎ) and a centered difference
approximation of 𝑂(ℎ2 ) to estimate the first derivative of the function examined. Evaluate the
derivative at 𝑥 = 2 using a step size of ℎ = 0.2. Compare your results with the true value of the
derivative. Interpret your results on the basis of the remainder term of the Taylor series expansion.
Problem 6
The Stefan-Boltzmann law can be employed to estimate the rate of radiation of energy H from a
surface, as in
𝐻 = 𝐴𝑒𝜎𝑇 4
where H is in watts, A = the surface area (m2), e = the emissivity that characterizes the emitting
properties of the surface (dimension less), 𝜎 = a universal constant called the Stefan-Boltzmann
constant (= 5.67 × 10−8 𝑊 𝑚−2 𝐾 −4 ), and T = absolute temperature (K). Determine the error
of H for a steel plate with A = 0.15 m2, e = 0.90, and 𝑇 = 650 ± 20. Compare your results with
the exact error. Repeat the computation but with 𝑇 = 650 ± 40. Interpret your results.
Problem 7
a) Use Bisection method to solve the problem with initial guess of [10, 16]. to determine the
drag coefficient c needed for a parachutist of mass m = 68.1 kg to have a velocity of 40
m/s after free falling for time t = 10 s. Note: The acceleration due to gravity is 9.81 m/s2.
𝑔𝑚 𝑐
𝑣(𝑡) = (1 − 𝑒 −(𝑚)𝑡 )
𝑐
b) For a parachutist with a drag coefficient c = 15 kg/s, compute the mass m so that the
velocity is v = 36 m/s at t = 10 s. Use the false-position method to determine m to a level
of es = 0.1%.
c) Use bisection to determine the drag coefficient needed so that an 82-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 = 3 and xu = 5 and iterate until the approximate relative error falls
below 2%. Also perform an error check by substituting your final answer into the original
equation.
Problem 8
1) Determine the roots of 𝑓(𝑥) = − 0.5𝑥 2 + 2.5 𝑥 + 4.5
a) Using the quadratic formula.
b) 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 𝜀𝑎 and the true error 𝜀𝑡 after
each iteration.
2) Determine the real root of 𝑓(𝑥) = 5𝑥 3 − 5𝑥 2 + 6 𝑥 − 2
a) Using the quadratic formula.
b) Using three iterations of the bisection method to determine the highest root. Employ initial
guesses of xl = 0 and xu = 1 and iterate until the estimated error 𝜀𝑎 falls below a level of
10%.
Problem 9
using the false-position method. Use initial guesses of xl = 4.5 and xu = 6 and perform five
iterations. Compute both the true and approximate errors based on the fact that the root is 5.60979.
Also perform the computation to within 𝜀𝑠 = 1.0%.
Problem 10
As depicted in Fig., the velocity of water, v (m/s), discharged from a cylindrical tank through a
long pipe can be computed as
√2𝑔𝐻
𝑣 = √2𝑔𝐻 tanh ( 𝑡)
2𝐿
where g = 9.81 m/s2, H = initial head (m), L = pipe length (m), and t = elapsed time (s). Determine
the head needed to achieve v = 5 m/s in 2.5 s for a 4-m-long pipe
a) By using bisection
b) With false position.
Employ initial guesses of xl = 0 and xu = 2 m with a stopping criterion of 𝜀𝑠 = 1%. Check you
results.
Problem 11
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 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 y by
𝑦2
𝐵 = 3 + 𝑦 𝑎𝑛𝑑 𝐴𝑐 = 3𝑦 +
2
Solve for the critical depth using (a) bisection, and (b) false position. 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 5.
Problem 12
You are designing a spherical tank (Fig.) to hold water for a small village in a developing country.
The volume of liquid it can hold can be computed as
[3𝑅 − ℎ]
𝑉 = 𝜋ℎ2
3
where V = volume (m3), h = depth of water in tank (m), and R = the tank radius (m).
The saturation concentration of dissolved oxygen in freshwater can be calculated with the equation
a) If the initial guesses are set as 0 and 40 0C, how many bisection iterations would be required
to determine temperature to an absolute error of 0.05 0C?
b) Develop and test a bisection program to determine T as a function of a given oxygen
concentration to a prespecified absolute error as in (a). Given initial guesses of 0 and 40
0
C, test your program for an absolute error = 0.05 0C and the following cases: osf = 8, 10,
and 12 mg/L.
Problem 14
Use the Newton-Raphson method to estimate the root of 𝑓(𝑥) = −𝑒 −𝑥 − 𝑥, employing an initial
guess of x0 = 0.
Use the secant method to estimate the root of 𝑓(𝑥) = −𝑒 −𝑥 − 𝑥. Start with initial estimates of
𝑥−1 = 0 and 𝑥0 = 1.0.
Use the false-position and secant methods to estimate the root of 𝑓(𝑥) = 𝑙𝑛 𝑥 . Start the
computation with values of 𝑥𝑙 = 𝑥𝑖−1 = 0.5 and 𝑥𝑢 = 𝑥𝑖 = 5.0
Problem 15
Determine the roots of the following simultaneous nonlinear equations using Newton-Raphson
method:
𝑦 = − 𝑥 2 + 𝑥 + 0.75
𝑦 + 5𝑥𝑦 = 𝑥 2
Problem 18
2𝑥2 + 5𝑥3 = 9
2𝑥1 + 𝑥2 + 𝑥3 = 9
3𝑥1 + 𝑥2 = 10
Three masses are suspended vertically by a series of identical springs where mass 1 is at the top
and mass 3 is at the bottom. If g = 9.81 m/s2 , m1 = 2 kg, m2 = 3 kg, m3 = 2.5 kg, and the k’s = 10
kg/s2 , solve for the displacements x.
Hint: Generate three equations for each mass. Then convert the equation into unknown variable
x’s and then solve those equations.
Problem 20
Solve the following set of equations with LU decomposition:
Problem 21
Consider vectors:
⃗⃗
𝐴⃗ = 2𝑖⃗ − 3𝑗⃗ + 𝑎𝑘
⃗⃗
⃗⃗ = 2𝑏 + 𝑗⃗ − 4𝑘
𝐵
⃗⃗
𝐶⃗ = 3𝑖⃗ + 𝑐 𝑗⃗ + 2 𝑘
Vector 𝐴⃗ is perpendicular to 𝐵
⃗⃗ as well as to 𝐶⃗. It is also known that 𝐵
⃗⃗ . 𝐶⃗ = 2. Use any method to
solve the three unknowns, a, b, and c.
Problem 23
Figure shows three reactors linked by pipes. As indicated, the rate of transfer of chemicals through
each pipe is equal to a flow rate (Q, with units of cubic meters per second) multiplied by the
concentration of the reactor from which the flow originates (c, with units of milligrams per cubic
meter). If the system is at a steady state, the transfer into each reactor will balance the transfer out.
Develop mass balance equations for the reactors and solve the three simultaneous linear algebraic
equations for their concentrations.
Problem 25
The Lower Colorado River consists of a series of four reservoirs as shown in Fig. Mass balances
can be written for each reservoir and the following set of simultaneous linear algebraic equations
results:
13.442 0 0 0 𝑐1 750.5
−13.442 12.252 0 0 𝑐2 300
[ ] {𝑐 } = { }
0 −12.252 12.377 0 3 102
0 0 −12.377 11.797 𝑐4 30
here the right-hand-side vector consists of the loadings of chloride to each of the four lakes and c1,
c2, c3, and c4 = the resulting chloride concentrations for Lakes Powell, Mead, Mohave, and Havasu,
respectively.
a) Use the matrix inverse to solve the concentrations in each of the four lakes.
b) How much must the loading to Lake Powell be reduced in order for the chloride
concentration of Lake Havasu to be 75?
c) Using the column-sum norm, compute the condition number and how many suspect digits
would be generated by solving this system.
Problem 26
A peristaltic pump delivers a unit flow (Q1) of a highly viscous fluid. The network is depicted in
Fig. Every pipe section has the same length and diameter. The mass and mechanical energy balance
can be simplified to obtain the flow in every pipe. Solve the following system of equations to
obtain the flow in every pipe.
𝑄3 + 2𝑄4 − 2𝑄2 = 0
𝑄5 + 2𝑄6 − 2𝑄4 = 0
3𝑄7 − 2𝑄6 = 0
𝑄1 = 𝑄2 + 𝑄3
𝑄3 = 𝑄4 + 𝑄5
𝑄5 = 𝑄6 + 𝑄7
Problem 27
Use Newton’s interpolating polynomial to determine y at x = 3.5 to the best possible accuracy.
Compute the finite divided differences as and order your points to attain optimal accuracy and
convergence.
𝑥 0 1 2.5 3 5 6
𝑓(𝑥) 2 5.4375 7.3516 7.5625 9.1875 12
Problem 28
𝑥 0 1 2 3 4 5
𝑓(𝑥) 0 0.5 0.8 0.9 0.941176 0.961538
𝑥2
Note that the values in the table were generated with the function 𝑓(𝑥) = (1+ 𝑥 2 ).
Use the portion of the given steam table for superheated H2O at 200 MPa to
a) Find the corresponding entropy s for a specific volume v of 0.108 m3 /kg with linear
interpolation,
b) Find the same corresponding entropy using newton interpolation,
3
𝑣 (𝑚 ⁄𝑘𝑔) 0.10377 0.11144 0.1254
𝑘𝐽
𝑠 ( ⁄𝑘𝑔. 𝐾 ) 6.4147 6.5453 6.7664
Problem 30
The specific volume of a superheated steam is listed on steam tables for various temperatures.
For example, at a pressure of 3000 lb/in2, absolutely:
3
𝑣 (𝑚 ⁄𝑘𝑔) 700 720 740 760 780
3
𝑣 (𝑚 ⁄𝑘𝑔) 0.0977 0.12184 0.14060 0.15509 0.16643
Problem 31
The function 𝑓(𝑥) = 2𝑒 −1.5𝑥 can be used to generate the following table of unequally spaced data:
Problem 33
Evaluate the integral of the following tabular data with (a) the trapezoidal rule and (b) Simpson’s
rules:
𝑥 -2 0 2 4 6 8 10
𝑓(𝑥) 35 5 -10 2 5 3 20
Problem 34
The following data was collected for a cross-section of a river (y = distance from bank, H = depth,
and U = velocity).
𝑦, 𝑚 0 1 3 5 7 8 9 10
𝐻, 𝑚 0 1 1.5 3 3.5 3.2 2 0
𝑈, 𝑚/𝑠 0 0.1 0.12 0.2 0.25 0.3 0.15 0
Use numerical integration to compute the (a) average depth, (b) cross-sectional area, (c) average
velocity, and (d) the flow rate. Note that the cross-sectional area (Ac) and the flow rate (Q) can be
computed as
𝑦 𝑦
𝐴𝑐 = ∫ 𝐻(𝑦) 𝑑𝑦 𝑄 = ∫ 𝐻(𝑦)𝑈(𝑦) 𝑑𝑦
0 0
Problem 35
𝑚 = ∫ 𝜌(𝑥)𝐴𝑐 (𝑥) 𝑑𝑥
0
where m = mass, 𝜌(𝑥) density, Ac(x) = cross-sectional area, x = distance along the rod, and L =
the total length of the rod. The following data have been measured for a 10-m length rod.
Determine the mass in kilograms to the best possible accuracy.
𝑥, 𝑚 0 2 3 4 6 8 10
𝜌, 𝑔/𝑐𝑚3 4.00 3.95 3.89 3.80 3.60 3.41 3.30
𝐴𝑐 , 𝑐𝑚2 100 103 106 110 120 133 150