Evaluate the following integral a analytically,

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.