Develop an M-file to solve a single ODE with Heun’s

of 5 underdamped, 40 critically damped, and 200 over- damped. The spring constant k = 20 Nm. The initial ve- locity is zero, and the initial displacement x = 1 m. Solve this equation using a numerical method over the time period ≤ t ≤ 15 s. Plot the displacement versus time for each of the three values of the damping coefficient on the same plot. 22.16 A spherical tank has a circular orifice in its bottom through which the liquid flows out Fig. P22.16. The flow rate through the hole can be estimated as Q out = C A √ 2gh where Q out = outflow m 3 s, C = an empirically derived coefficient, A = the area of the orifice m 2 , g = the gravita- tional constant = 9.81 ms 2 , and h = the depth of liquid in the tank. Use one of the numerical methods described in this chapter to determine how long it will take for the water to flow out of a 3-m diameter tank with an initial height of 2.75 m. Note that the orifice has a diameter of 3 cm and C = 0.55. 22.17 In the investigation of a homicide or accidental death, it is often important to estimate the time of death. From the experimental observations, it is known that the surface tem- perature of an object changes at a rate proportional to the dif- ference between the temperature of the object and that of the surrounding environment or ambient temperature. This is known as Newton’s law of cooling. Thus, if Tt is the tem- perature of the object at time t, and T a is the constant ambi- ent temperature: d T dt = −K T − T a where K 0 is a constant of proportionality. Suppose that at time t = 0 a corpse is discovered and its temperature is measured to be T o . We assume that at the time of death, the body temperature T d was at the normal value of 37 °C. Suppose that the temperature of the corpse when it was dis- covered was 29.5 °C, and that two hours later, it is 23.5 °C. The ambient temperature is 20 °C. a Determine K and the time of death. b Solve the ODE numerically and plot the results. 22.18 The reaction A → B takes place in two reactors in series. The reactors are well mixed but are not at steady state. The unsteady-state mass balance for each stirred tank reactor is shown below: dCA 1 dt = 1 τ CA − CA 1 − kCA 1 dCB 1 dt = 1 τ CB 1 + kCA 1 dCA 2 dt = 1 τ CA 1 − CA 2 − kCA 2 dCB 2 dt = 1 τ CB 1 − CB 2 − kCB 2 where CA = concentration of A at the inlet of the first reactor, CA 1 = concentration of A at the outlet of the first re- actor and inlet of the second, CA 2 = concentration of A at the outlet of the second reactor, CB 1 = concentration of B at the outlet of the first reactor and inlet of the second, CB 2 = concentration of B in the second reactor, τ = residence time for each reactor, and k = the rate constant for reaction of A to produce B. If CA is equal to 20, find the concentrations of A and B in both reactors during their first 10 minutes of opera- tion. Use k = 0.12min and τ = 5 min and assume that the initial conditions of all the dependent variables are zero. 22.19 A nonisothermal batch reactor can be described by the following equations: dC dt = − e − 10T +273 C d T dt = 1000e − 10T +273 C − 10T − 20 where C is the concentration of the reactant and T is the tem- perature of the reactor. Initially, the reactor is at 16 °C and has a concentration of reactant C of 1.0 gmolL. Find the concen- tration and temperature of the reactor as a function of time. 22.20 The following equation can be used to model the de- flection of a sailboat mast subject to a wind force: d 2 y d z 2 = f z 2E I L − z 2 where f z = wind force, E = modulus of elasticity, L = mast length, and I = moment of inertia. Note that the force FIGURE P22.16 A spherical tank. H r