Midterm 2 Practice Problems - Numerical Analysis | MATH 128A, Exams of Mathematical Methods for Numerical Analysis and Optimization

Material Type: Exam; Class: Numerical Analysis; Subject: Mathematics; University: University of California - Berkeley; Term: Summer 2009;

Typology: Exams

Pre 2010

Uploaded on 10/01/2009

koofers-user-76q
koofers-user-76q 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 128A-2 SUMMER 2009: MIDTERM 2 PRACTICE PROBLEMS
Questions
(1) Fill in the table as accurately as possible using two-point formulas (including the centered difference
formula) for f0:
f(1) = 6 f(0) = 1 f(1) = 2
f0(1) = f0(0) = f0(1) =
(2) Do you remember the definitions of the following quadrature methods? Newton-Cotes, composite
trapezoidal, Romberg, adaptive Simpson, Gaussian.
(3) Find coefficients a,b, and cso that the following quadrature rule has the best possible degree of
precision:
Z1
0
f(x)dx af(1) + bf(0) + cf (+1).
What is the resulting rule’s degree of precision?
(4) Use an easy substitution to transform the improper integral R
1
1
x2+1 dx into an integral of the
form R1
0f(u)du. Transform the result into an integral which can be estimated with the following
quadrature rule:
Z1
1
g(t)dt f(1) + f(+1).
(5) Use Euler’s method with h= 1 to estimate the solution to y0= 2t+y/t, 1 t3, y(1) = 1.
(6) Find a Lipschitz constant Lfor the above problem.
(7) Find y00 in terms of tand (if necessary) y, and compute an upper bound Mon |y00 (t)|.
(8) Find a bound on the local truncation error τwhen using Euler’s method to solve this problem.
(9) Find a bound for the absolute error in estimating y(3), using the error bound hM
2L(eL(tit0)1).
(10) Write down a step (wi+1 as a function of ti,wi,h) of the second-order Taylor method for solving
the IVP from problem 5.
(11) Based on your answers to problem 5, estimate y(1.5) based on y(1), y0(1), y(2), and y0(2).
(12) Express the following Runge-Kutta method in one line (i.e., as a single formula for wi+1):
k1=hf(ti, wi)
k2=hf(ti+h, wi+k1)
wi+1 =wi+k2
(13) What is the order of the Runge-Kutta method in problem 12?
(14) (Skip if confused.) Consider Romberg integration with the following notation:
h1=h, h2=h, . . . , hi=h/2i1, . . .;
Ri,1is the composite trapezoidal estimate of Rb
af(x)dx with step-size hi;
Ri+1,j+1 is the value of Rb
af(x)dx extrapolated from Ri,j and Ri+1,j , assuming Ri,j has error
O(h2j
i).
Show that Ri+1,j+1 is equal to Ri+1,j +h2
i
h2
ijh2
i
(Ri+1,j Ri,j).
Date: Monday 7/26.
1
pf2

Partial preview of the text

Download Midterm 2 Practice Problems - Numerical Analysis | MATH 128A and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 128A-2 SUMMER 2009: MIDTERM 2 PRACTICE PROBLEMS

Questions (1) Fill in the table as accurately as possible using two-point formulas (including the centered difference formula) for f ′: f (−1) = 6 f (0) = 1 f (1) = 2 f ′(−1) = f ′(0) = f ′(1) = (2) Do you remember the definitions of the following quadrature methods? Newton-Cotes, composite trapezoidal, Romberg, adaptive Simpson, Gaussian. (3) Find coefficients a, b, and c so that the following quadrature rule has the best possible degree of precision: (^) ∫ 1

0

f (x) dx ≈ af (−1) + bf (0) + cf (+1).

What is the resulting rule’s degree of precision? (4) Use an easy substitution to transform the improper integral

1

1 x^2 +1 dx^ into an integral of the form

0 f^ (u)^ du.^ Transform the result into an integral which can be estimated with the following quadrature rule: (^) ∫ 1

− 1

g(t) dt ≈ f (−1) + f (+1).

(5) Use Euler’s method with h = 1 to estimate the solution to y′^ = 2t + y/t, 1 ≤ t ≤ 3, y(1) = 1. (6) Find a Lipschitz constant L for the above problem. (7) Find y′′^ in terms of t and (if necessary) y, and compute an upper bound M on |y′′(t)|. (8) Find a bound on the local truncation error τ when using Euler’s method to solve this problem. (9) Find a bound for the absolute error in estimating y(3), using the error bound hM 2 L (eL(ti−t^0 )^ − 1). (10) Write down a step (wi+1 as a function of ti, wi, h) of the second-order Taylor method for solving the IVP from problem 5. (11) Based on your answers to problem 5, estimate y(1.5) based on y(1), y′(1), y(2), and y′(2). (12) Express the following Runge-Kutta method in one line (i.e., as a single formula for wi+1):

k 1 = hf (ti, wi) k 2 = hf (ti + h, wi + k 1 ) wi+1 = wi + k 2

(13) What is the order of the Runge-Kutta method in problem 12? (14) (Skip if confused.) Consider Romberg integration with the following notation:

  • h 1 = h, h 2 = h,... , hi = h/ 2 i−^1 ,.. .;
  • Ri, 1 is the composite trapezoidal estimate of

∫ (^) b a f^ (x)^ dx^ with step-size^ hi;

  • Ri+1,j+1 is the value of

∫ (^) b a f^ (x)^ dx^ extrapolated from^ Ri,j^ and^ Ri+1,j^ , assuming^ Ri,j^ has error O(h^2 i j). Show that Ri+1,j+1 is equal to Ri+1,j + h

(^2) i h^2 i−j −h^2 i^ (Ri+1,j^ −^ Ri,j^ ).

Date: Monday 7/26. 1

Answers

(1)

f (−1) = 6 f (0) = 1 f (1) = 2 f ′(−1) ≈ − 5 f ′(0) ≈ − 2 f ′(1) ≈ 1 (2) Yes. (3) (a, b, c) = 121 (− 1 , 8 , 5); degree is 2. (4) The substitution x = 1/u produces

0

1 1+u^2 du. Then^ u^ = (t+1)/2 produces^

− 1

1 2+(t+1)^2 / 2 dt^ ≈^0 .75. (5) y(2) ≈ 4, y(3) ≈ 10. (6)

∣ (^) ∂y∂ (2t + y/t)

∣ = | 1 /t| ≤ 1. (7) y′′(t) = 2 + y′/t − y/t^2 = 2 + (2t + y/t)/t − y/t^2 = 4. We can take M = 4. (8) Euler’s method generally has τi+1 = yi+1− hw i+1= y(ti+h)−[y(ti)+hy

′(ti)] h =^

y′′(ξ)h^2 / 2 h =^

h 2 y

′′(ξ). Thus we have τ = 2h = 2, at every step. (9) 2(e^2 − 1). (Numerically, this is something smaller than 2(3^2 − 1) = 16.) The actual error is much better. (10) wi+1 = wi + h[2ti + wi/ti] + h

2 2 [4]. (11) The divided difference table below (see section 3.3) says y(t) ≈ 1+3(t−1)+0(t−1)^2 +3(t−1)^2 (t−2): t = 1 1 3 t = 1 1 0 3 3 t = 2 4 3 6 t = 2 4

Plugging in t = 1.5 gives y(1.5) ≈ 2 .125.

(12) wi+1 = wi + hf (ti + h, wi + hf (ti, wi)). (13) The method is first-order (i.e., τi+1 = O(h)). In particular, the O(h^2 ) Taylor coefficient to wi+1 is twice that of y(ti + h).

(14) This is algebra, but the important step is to realize Ri+1,j+1 = Ri+1,j − h^2 i+1j h^2 i+1j−h^2 ij^ (Ri+1,j^ −^ Ri,j^ ).

2