Evaluate the following integral with a Romberg inte-

20.4 There is no closed form solution for the error function erfa = 2 √ π a e −x 2 d x Use the a two-point and b three-point Gauss-Legendre formulas to estimate erf1.5. Determine the percent relative error for each case based on the true value, which can be de- termined with MATLAB’s built-in function erf . 20.5 The force on a sailboat mast can be represented by the following function: F = H 200 z 5 + z e −2zH d z where z = the elevation above the deck and H = the height of the mast. Compute F for the case where H = 30 using a Romberg integration to a tolerance of ε s = 0.5, b the two-point Gauss-Legendre formula, and c the MATLAB quad function. 20.6 The root-mean-square current can be computed as I RMS = 1 T T i 2 t dt For T = 1, suppose that it is defined as i t = 8e −tT sin 2π t T for 0 ≤ t ≤ T2 i t = 0 for T 2 ≤ t ≤ T Evaluate the I RMS using a Romberg integration to a toler- ance of 0.1, b the two- and three-point Gauss-Legendre formulas, and c the MATLAB quad function. 20.7 The heat required, H cal, to induce a temperature change, T °C, of a material can be computed as H = mC p T T where m ⫽ mass g, and C p T ⫽ heat capacity [calg .°C]. The heat capacity increases with temperature, T °C, according to C p T = 0.132 + 1.56 × 10 −4 T + 2.64 × 10 −7 T 2 Write a script that uses the quad function to generate a plot of H versus T for cases where m = 1 kg, the starting temperature is ⫺100 °C and T ranges from 0 to 300 °C. 20.8 The amount of mass transported via a pipe over a pe- riod of time can be computed as M = t 2 t 1 Qtct dt where M = mass mg, t 1 = the initial time min, t 2 = the final time min, Qt = flow rate m 3 min, and ct = concentration mgm 3 . The following functional repre- sentations define the temporal variations in flow and concentration: Qt = 9 + 5 cos 2 0.4t ct = 5e −0.5t + 2e 0.15t Determine the mass transported between t 1 = 2 and t 2 = 8 min with a Romberg integration to a tolerance of 0.1 and b the MATLAB quad function.

20.9 Evaluate the double integral

2 −2 4 x 2 − 3y 2 + x y 3 d x d y a analytically and b using the MATLAB dblquad function. Use help to understand how to implement the function.

20.10 Compute work as described in Sec. 19.9, but use the

following equations for Fx and θ x: Fx = 1.6x − 0.045x 2 θ x = −0.00055x 3 + 0.0123x 2 + 0.13x The force is in newtons and the angle is in radians. Perform the integration from x = 0 to 30 m.

20.11 Perform the same computation as in Sec. 20.5, but for

the current as specified by i t = 6e −1.25t sin 2πt for 0 ≤ t ≤ T2 i t = 0 for T2 t ≤ T where T = 1 s.

20.12 Compute the power absorbed by an element in a cir-

cuit as described in Sec. 20.5, but for a simple sinusoidal current i = sin2πtT where T = 1 s. a Assume that Ohm’s law holds and R = 5 . b Assume that Ohm’s law does not hold and that voltage and current are related by the following nonlinear rela- tionship: V = 5i − 1.25i 3 .

20.13 Suppose that the current through a resistor is de-

scribed by the function i t = 60 − t 2 + 60 − t sin √ t and the resistance is a function of the current: R = 10i + 2i 23 Compute the average voltage over t = 0 to 60 using the composite Simpson’s 13 rule. 20.14 If a capacitor initially holds no charge, the voltage across it as a function of time can be computed as V t = 1 C t i t dt Use MATLAB to fit these data with a fifth-order polynomial. Then, use a numerical integration function along with a value of C = 10 −5 farad to generate a plot of voltage versus time. t , s 0.2 0.4 0.6 i , 10 − 3 A 0.2 0.3683 0.3819 0.2282 t , s 0.8 1 1.2 i , 10 − 3 A 0.0486 0.0082 0.1441 20.15 The work done on an object is equal to the force times the distance moved in the direction of the force. The veloc- ity of an object in the direction of a force is given by v = 4t 0 ≤ t ≤ 5 v = 20 + 5 − t 2 5 ≤ t ≤ 15 where v is in ms. Determine the work if a constant force of 200 N is applied for all t. 20.16 A rod subject to an axial load Fig. P20.16a will be deformed, as shown in the stress-strain curve in Fig. P20.16b. PROBLEMS 519 The area under the curve from zero stress out to the point of rupture is called the modulus of toughness of the material. It provides a measure of the energy per unit volume required to cause the material to rupture. As such, it is representative of the material’s ability to withstand an impact load. Use nu- merical integration to compute the modulus of toughness for the stress-strain curve seen in Fig. P20.16b. 20.17 If the velocity distribution of a fluid flowing through a pipe is known Fig. P20.17, the flow rate Q i.e., the vol- ume of water passing through the pipe per unit time can be computed by Q = v d A, where v is the velocity, and A is the pipe’s cross-sectional area. To grasp the meaning of this relationship physically, recall the close connection between summation and integration. For a circular pipe, A = πr 2 and d A = 2πr dr . Therefore, Q = r v 2πr dr 20 40 60 0.1 s, ksi b a e 0.02 0.05 0.10 0.15 0.20 0.25 s 40.0 37.5 43.0 52.0 60.0 55.0 Rupture 0.2 e Modulus of toughness FIGURE P20.16 a A rod under axial loading and b the resulting stress-strain curve, where stress is in kips per square inch 10 3 lbin 2 , and strain is dimensionless. r A FIGURE P20.17