ASE 311, Fall 2012, Exam 2 (take home) Available 12 Nov. 2012 — Due Friday 12 Nov. 2012 in class Electronic version Due before midnight, 12 Nov. 2012 Student Name: Make sure your work is neat and organized. Be sure to work all problems. All problems must be turned in on time, and an electronic version must be handed in as well. Problem Points Worth Points Received 1 25 2 25 3 25 4 25 Total 100 1. (25 points) Consider the differential equation: dα = 7x7 − 5x3 − 3x2 − 2x dx (1) where α = α(x). (a) Using the forward difference approximation for the derivative with h = 0.5, h = 0.1, h = 0.01 and h = 0.001, plot the solution α over x ∈ [−1, 1]. (b) Perform local integration on the right hand side of (1) over the stencil nodes (i.e. the subintervals of length h) Z 7x7 − 5x3 − 3x2 − 2xdx h using an appropriate Guass-Legendre quadrature rule (and plot your answer). Demonstrate that the sum of the local integrals is exact over [−1, 1] by comparing to the value of the (computed by hand) direct integral over [−1, 1]. Compare your solution to the Reimann sum R over the interval for each h, which is justPthe sum of the function evaluations at the stencil nodes times the stencil width, R = i f (xi )h. Also compare your solution to Matlab’s quadv function. (c) Let α be the specific energy and x the time (i.e. x = t in (1)), then if we multiplied the right hand side of (1) by the appropriate constants Ci taking the correct physical units/dimensions (e.g. C4 in units of m2 s−4 ) , α̇ = 7C1 t5 − 5C2 t3 − 3C3 t2 − 2C4 t, equation (1) could solve for the Oberth effect. Give one other example of a first order ordinary differential equation of importance in Aerospace Engineering. Write it down and explain what it solves, and how one could use (1) to find a numerical solution. 2. (25 points) Given the following data, x = [0.10, 0.40, 0.90, 1.50, 1.80] y = [0.75, 1.45, 0.85, 0.35, 0.18] we are interested in fitting the function y = axb ecx , where a, b and c are the coefficients to be determined. (a) Setup a linear system that will perform a linear regression analysis. That is, transform the above equation into a suitable form and write down the linear system that results from minimizing the square of the error between the data and the above function. Write down the system in Ax = b form and solve using matlab. Compute the r2 value. Is the linear fit good? (b) Now treat this as a nonlinear regression problem. Write down the nonlinear system of equations that results from minimizing the square of the error between the data and the above function. 3. (25 points) Consider the integral equation in f = f (x, t): Z x 3 f = xt − g(t)dt 0 where g(t) = sin(2πt) − tanh(t). (a) Write a Newton–Raphson algorithm to find the roots of this function, using x = [0.1; 0.1], a tolerance of 1 × 10−10 , and 25 interations. (b) Plot this function f = f (x, t) using Matlab’s mesh function, versus x and t for a mesh spacing of h = .05. (c) Provide at least 3 distinct reasons that can lead to the Newton–Raphson method failing to find a root. 4. (25 points) Suppose you are given a function y = y(x) and the the following discrete data points: yi xi -2.50 0.00 0.75 1.00 0.00 2.00 1.25 3.00 (a) Write down (by hand) the “unsimplified” Lagrange interpolating polynomial through this data (i.e. keep in the form of the factored Lagrange polynomials, but feel free to simplify the denominators). (b) Evaluate (by hand) the Lagrange interpolant at x = 0.5. (c) Show by hand the Newton interpolant at x = 0.5. Explain how you did, and why you chose to do it this way? (d) Show by hand the Newton interpolant at x = 2.5. Explain how you did, and why you chose to do it this way?