Docsity

Final Spring 2010-2011.pdf, Exams of Numerical Methods in Engineering

Partial preview of the text

Download Final Spring 2010-2011.pdf and more Exams Numerical Methods in Engineering in PDF only on Docsity!

AMERICAN UNIVERSITY OF BEIRUT

Mathematics Department-FAS

MATH 251

FINAL EXAM

SPRING 2010-

Closed Book, 2hours

STUDENT NAME

ID NUMBER

Problem Out of Grade 1 15

TOTAL 100

  1. (15 points) For which values of x is there a difficulty in computing f (x)? What is the problem? What remedy do you suggest? - (7 points)f (x) = x +

x^2 + 4

  • (8 points)f (x) = tan(x) − 1 (N.B. Determine only the smallest positive value of x that causes a problem.)

(c) (6 points)Prove that:

(rn − r) =

2 rn− 1

(rn− 1 − r)^2

then show that for n ≥ 1:

|rn − r| =

(rn− 1 − r)^2 <

2 n^

(r 0 − r)^2

n

(d) (6 points)Let r 0 = 3/2. Find an estimate on the least value of n for which: |rn − r| < 2 −^50 Hint: Using the result in (c), show first that |rn − r| < 2 (−^2 n)

  1. (20 points) Consider the following set of data:

Dn = {(xi, yi)|i = 0, ..., n where yi = f (xi) , and xi+1−xi = h, 0 < h ≤ 1 }

(a) (6 points) Write first the Central difference formula ψh(f (xi)) that approximates the first derivative f ′(xi) , then derive the ex- pression of the error series (h) = f ′ (xi) − ψh(f (xi)) in the form:

(h) = c 1 hα^1 + c 2 hα^2 + c 3 hα^3 + ....,

by determining the values of the constants {α 1 , α 2 , α 3 , ...}.

  • ψh(f (xi)) =
  • (h) =

(c) (8 points) Let f (x) = 3xex. For the purpose of approximating f ′(2.0) and then improving this approximation, fill in the empty slots in the following table adequately, starting with h 0 = 0.5. Express all the results obtained in F (10, 5 , − 15 , +15).

h ψh(.) ψ^1 h(.) ψ h^2 (.) h 0 = 0. 5

h 0 / 2

h 0 / 4

Best approximation to f ′(2.0) :

  1. (15 points) Consider the following set of data, where the partition points {xi}ni=0 are equally spaced: Dn = {(xi, yi)|i = 0, ..., n ; a = x 0 , b = xn; h = xi+1 −xi; , yi = f (xi) ; } (a) (1pt)Based on Dn, approximate the integral I =

∫ (^) b a f^ (x)dx^ using the Composite Trapezoidal rule:

I ≈ T (h) =

(b) (4 points) Complete the following MATLAB function that approx- imates the integral I =

∫ (^) b a f^ (x)dx^ using the Composite Trape- zoidal rule. This function takes as inputs:

  • a function f
  • 2 real numbers a < b
  • a positive number h, with 0 < h ≤ 1 where n = b−ha is the number of subintervals determined by the partition points. function I = CompositeTrapezoid(f, a, b, h)

(c) (2 points)Assume f ∈ C∞[a, b]. Write the Romberg extrapolation formulae of orders 1,2 then k, based on the Composite Trapezoidal rule (Do not derive the formulae): i. R^1 (h) =

ii. R^2 (h) =

% The elements of the second column of R are of all values of T(h) : % approximations of I using the Composite Trapezoidal rule

% All elements of the remaining columns of R from the 3rd one till % the last one are the Romberg approximations of all orders

% Display the best approximation to I

end

  1. (15 points)Let I =

0 3 xe

x (^) dx.

  • (12 points) How many partition points are needed if I is to be computed using the composite trapezoidal rule, up to two decimal places (rounding to the closest)? Compute I in that case. N.B The exact value of I = 25. 1671683
  1. (15 points) Consider the following Initial value Problem:

(IV P )

{ (^) dy dt = 2t^ +^ e

−y (^) ; t ∈ [1, 2 .00] y(1) = 3 To solve (IVP) in F (10, 4 , − 20 , +20) (rounding to the closest):

(a) (3 points) (IVP) is first solved on [1, 1 .25] using the discrete scheme of Euler’s method: (RK1).

  • Write first the formulae for this scheme:

(RK1)

yi+1 = ....................................................

  • Use 1 step ONLY of this scheme to approximate y(1.25).

i ti yi k 1 yi+ 0 1....

(b) (5 points)(IVP) is then solved on [1.25 , 1.50] using the discrete scheme of the 2nd order Runge Kutta method - Midpoint Rule: (RK2.M).

  • Write then the formulae of this scheme:

(RK 2 .M )

yi+1 = ....................................................

  • Use 1 step ONLY of this scheme to approximate y(1.50).

i ti yi k 1 k 2 yi+ 0 1.....

(c) (6 points)Finally, (IVP) is then solved on [1.50 , 2.00] using the discrete scheme of the 2nd order Runge Kutta method - Trape- zoid Rule (Heun’s method): (RK2.T).

  • Write then the formulae of this scheme:

(RK 2 .T )

yi+1 = ....................................................

  • Use 2 steps ONLY of this scheme to approximate y(1.75) and y(2.00).

i ti yi k 1 k 2 yi+ 0 1..... 1.....

(d) (1pt) The discrete solution of (IVP) is

Y 4 = {y 0 = 3, ....................................................................................}