Project Work - CM

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

1) You are designing a spherical tank (Fig.

below) 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 (𝑚3 ), h = depth of water in tank (m), and R = the tank radius (m).
If R = 3 m, what depth must the tank be filled to so that it holds 30 𝑚3 ? Use three iterations
of the Newton-Raphson method to determine your answer. Determine the approximate
relative error after each iteration. Note that an initial guess of R will always converge.

2) Develop a user-friendly MATLAB program to test the computations of 𝑓(𝑥) = 𝑒 −𝑥 − 𝑥


using Secant method. Start with initial estimates of 𝑥−1 = 0 and 𝑥0 = 1.0.

3) The outflow concentration from a reactor is measured at a few times over a 24-hr period:

𝑡 (ℎ𝑟) 0 1 5.5 10 12 14 16 18 20 24
𝑐 (𝑚𝑔⁄𝐿) 1 1.5 2.3 2.1 4 5 5.5 5 3 1.2

The flow rate for the outflow in 𝑚3 ⁄𝑠 can be computed with the following equation:
2𝜋
𝑄(𝑡) = 20 + 10 ( (𝑡 − 10))
24
se the best numerical integration method to determine the flow weighted average
concentration leaving the reactor over the 24-hr period,
𝑡
∫0 𝑄(𝑡)𝑐(𝑡)𝑑𝑡
𝑐̅ = 𝑡
∫0 𝑄(𝑡)𝑑𝑡
4
4) Develop a MATLAB program to test the computation of ∫−2(1 − 𝑥 − 4𝑥 3 + 2𝑥 5 )𝑑𝑥 using
Simpson’s 1/3 and Simpson’s 3/8th rule.
5) The following system of equations is designed to determine concentrations (the c’s in
g/𝑚3 ) in a series of coupled reactors as a function of the amount of mass input to each
reactor (the right-hand sides in g/day),
15𝑐1 − 3𝑐2 − 𝑐3 = 3300
−3𝑐1 + 18𝑐2 − 6𝑐3 = 1200
−4𝑐1 − 𝑐2 + 12𝑐3 = 2400
a) Determine the matrix inverse using MATLAB.
b) Determine the solution using MATLAB.
c) Determine how much the rate of mass input to reactor 3 must be increased to induce
a 10 g/𝑚3 rise in the concentration of reactor 1. (d) How much will the concentration
in reactor 3 be reduced if the rate of mass input to reactors 1 and 2 is reduced by 700
and 350 g/day, respectively.

6) Assuming that drag is proportional to the square of velocity, we can model the velocity of
a falling object like a parachutist with the following differential equation
𝑑𝑣 𝑐𝑑
= 𝑔 − ( ) 𝑣2
𝑑𝑡 𝑚
where v is velocity (m/s), t = time (s), g is the acceleration due to gravity (9.81 𝑚⁄𝑠 2 ), 𝑐𝑑
= a second-order drag coefficient (kg/m), and m = mass (kg). Solve for the velocity and
distance fallen by a 90-kg object with a drag coefficient of 0.225 kg/m. If the initial height
is 1 km, determine when it hits the ground. Obtain your solution with (a) Euler’s method
and (b) the fourth-order RK method.
7) Determine the temperatures along a 1-m horizontal rod described by the heat-conduction
equation (Eq. 30.1). Assume that the right boundary is insulated and that the left boundary
(x = 0) is represented by
𝜕𝑇
−𝑘 ′ = | = ℎ(𝑇𝑎 − 𝑇𝑏 )
𝜕𝑥 𝑥=0
here 𝑘 ′ is coefficient of thermal conductivity (W/m · °C), h = convective heat transfer
coefficient (W/m2 · °C), 𝑇𝑎 = ambient temperature (°C), and T0 = temperature of the
rod at x = 0 (°C). Solve for temperature as a function of time using a spatial step of ∆𝑥 =
10−5 𝑚
1 𝑐m and the following parameter values: 𝑘 ′ = 2 × = 10 W/m · °C, h = 25 W/𝑚2
𝑠2
. °C, and 𝑇𝑎 = 50 °C. Assume that the initial temperature of the rod is zero.
8) Generate eight equally-spaced points from the function f (t) = sin2t from t =0 to 2π. Fit this
data with (a) a seventh degree interpolating polynomial. Compare the interpolating
polynomial with the actual function graphically using MATLAB.
9) To calculate a planet’s space coordinates, we have to solve the function f(x) = x − 1 − 0.5
sin x. Let the base point be a = xi = π/2 on the interval [0,π]. Determine the 5th degree Taylor
series expansion resulting in a maximum error of 0.015 on the specified interval. The error
is equal to the absolute value of the difference between the given function and the specific
Taylor series expansion.
10) Consider the function f(x) = x3 − 2x + 4 on the interval [−2, 2] with h = 0.25. Use the
forward and backward, finite difference approximations for the first and second derivatives
so as to graphically illustrate which approximation is most accurate. Graph all three first
derivative finite difference approximations along with the theoretical, and do the same for
the second derivative as well.
11) a) Determine the LU decomposition without pivoting by hand for the following matrix
and check your results by validating that [L][U] = [A].

8 2 1
[3 7 2]
2 3 9
(b) Employ the result of (a) to compute the determinant. (c) Repeat (a) and (b) using
MATLAB
12) The following second-order ODE is considered to be stiff 𝑑2 𝑦⁄𝑑𝑥 2 =
−1001 𝑑𝑦⁄𝑑𝑥 − 1000𝑦. Solve this differential equation (a) analytically and (b)
numerically for x = 0 to 5. For (b) use an implicit approach with h = 0.5. Note that the
initial conditions are 𝑦(0) = 1 and 𝑦 , (0) = 0. Display both results graphically.

13) The following nonlinear, parasitic ODE was suggested by Hornbeck (1975):
𝑑𝑦1 ⁄𝑑𝑡 = 5(𝑦1 − 𝑡 2 ). If the initial condition is 𝑦1 (0) = 0.08, obtain a solution from 𝑡 =
0 𝑡𝑜 5
(a) Analytically (b) Using the fourth-order RK method with a constant step size of 0.03125.
(c) Using the MATLAB function ODE45. (d) Using the MATLAB function ODE23s. (e)
Using the MATLAB function ODE23tb. Present your results in graphical form.
14) The infinite series
𝑛
1
𝑓(𝑛) = ∑
𝑖4
𝑖=1

Converges on a value of 𝑓(𝑛) = 𝜋 4 ⁄90 as 𝑛 approaches infinity. Write a program in single


precision to calculate 𝑓(𝑛) for 𝑛 = 10,000 by computing the sum from 𝑖 = 1 𝑡𝑜 10,000.
Then repeat the calculation but in reverse order—that is, from 𝑖 = 10,000 𝑡𝑜 1 using
increments of −1. In each case, compute the true percent relative error. Explain the results.
15) Determine the number of terms necessary to approximate cos 𝑥 to 8 significant figures
using the Maclaurin series approximation
𝑥2 𝑥4 𝑥6 𝑥8
cos 𝑥 = 1 − + − + − ⋯
2 4! 6! 8!
Calculate the approximation using a value of 𝑥 = 0.3𝜋. Write a program to determine your
result.

You might also like