Docsity

Solved Assignment for Numerical Analysis I | CAAM 453, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
CAAM 453 ·NUMERICAL ANALYSIS I
Problem Set 6
Posted Thursday, 15 November 2007. Due Wednesday, 28 November 2007.
1. [25 points: 5 points for each part]
Consider 2-step linear multistep methods of the form
xk+2 +Axk+1 +Bxk=hCfk+1
for the initial value problem x0(t) = f(t, x(t)), x(t0) = x0, where A,B, and Care constants.
(a) Determine all choices of A,B, and Cfor which this method is consistent.
(b) Determine a choice of A,B, and Cthat gives O(h2) truncation error.
(c) Assess the zero-stability of the method found in part (b).
(d) What does your answer to part (c) imply about the behavior of the linear multistep method as
h→0 for such values of A,B, and C?
(e) For the method found in part (b), calculate those values of λh for which xk→0 as k→ ∞ when
applied to the differential equation x0=λx.
Method of Lines. Many physical models give rise to time-dependent partial differential equations. General
techniques to solve such problems are beyond the scope of this course. However, many such problems can
be attacked using standard ODE integrators via a technique known as the method of lines. In the next three
problems, you will solve two fundamental equations:
ut=uxfirst order wave equation
ut=uxx heat equation.
In these equations, u≡u(t, x) is a scalar function of two real variables, utdenotes the time derivative, and
uxdenotes the space derivative.
2. [25 points: 6 points each for (a), (b), (c); 7 points for (d)]
Consider the wave equation ut=uxfor t≥0 and x∈(−∞,∞). Given the initial data
u(0, x) = sin(2πx),
the exact solution is simply
u(t, x) = sin(2π(x+t)).
The method of lines approximates the solution to a partial differential equation by first discretizing the
domain in the xdirection into points xj=j∆x, where ∆x= 1/n for some fixed n. Since the initial
data is periodic, we only need to discretize from x1= ∆xthrough xn= 1, and then assign x0=xnby
periodicity.
pf3
pf4
pf5

Partial preview of the text

Download Solved Assignment for Numerical Analysis I | CAAM 453 and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

CAAM 453 · NUMERICAL ANALYSIS I

Problem Set 6

Posted Thursday, 15 November 2007. Due Wednesday, 28 November 2007.

  1. [25 points: 5 points for each part] Consider 2-step linear multistep methods of the form

xk+2 + Axk+1 + Bxk = hCfk+

for the initial value problem x′(t) = f (t, x(t)), x(t 0 ) = x 0 , where A, B, and C are constants.

(a) Determine all choices of A, B, and C for which this method is consistent.

(b) Determine a choice of A, B, and C that gives O(h^2 ) truncation error.

(c) Assess the zero-stability of the method found in part (b).

(d) What does your answer to part (c) imply about the behavior of the linear multistep method as h → 0 for such values of A, B, and C?

(e) For the method found in part (b), calculate those values of λh for which xk → 0 as k → ∞ when applied to the differential equation x′^ = λx.

Method of Lines. Many physical models give rise to time-dependent partial differential equations. General techniques to solve such problems are beyond the scope of this course. However, many such problems can be attacked using standard ODE integrators via a technique known as the method of lines. In the next three problems, you will solve two fundamental equations:

ut = ux first order wave equation ut = uxx heat equation.

In these equations, u ≡ u(t, x) is a scalar function of two real variables, ut denotes the time derivative, and ux denotes the space derivative.

  1. [25 points: 6 points each for (a), (b), (c); 7 points for (d)] Consider the wave equation ut = ux for t ≥ 0 and x ∈ (−∞, ∞). Given the initial data

u(0, x) = sin(2πx),

the exact solution is simply u(t, x) = sin(2π(x + t)).

The method of lines approximates the solution to a partial differential equation by first discretizing the domain in the x direction into points xj = j∆x, where ∆x = 1/n for some fixed n. Since the initial data is periodic, we only need to discretize from x 1 = ∆x through xn = 1, and then assign x 0 = xn by periodicity.

Now approximate the spatial (x) derivative by a finite difference method. The simplest approach is to use the forward difference ux(t, xj ) ≈

u(t, xj+1) − u(t, xj ) ∆x

one can use Taylor’s Theorem to verify this approximation incurs on O(∆x) error. The method of lines transforms the partial differential equation ut = ux into an ordinary differential equation by replacing ux with this finite difference approximation:

ut(t, xj ) =

u(t, xj+1) − u(t, xj ) ∆x

Exploiting periodicity (which implies that u(t, xn) = u(t, x 0 )), we have reduced the partial differential equation into a system of n ordinary differential equations. Using the notation

u(t) =

u(t, x 1 ) u(t, x 2 ) .. . u(t, xn)

∈ Rn,

this system of differential equations can be written as

ut(t) = Au(t). (a) What is the matrix A ∈ Rn×n? (Be careful not to neglect the entry that arises because of periodicity.) (b) Verify (by proving analytically, or by simply computing a numerical example for some moderate value of n, whichever you prefer) that A has the n eigenvalues and associated eigenvectors

λj = (eiθj^ − 1)/∆x, vj = (eiθj^ , e2iθj^ ,... , eniθj^ )T^ , for θj = 2πj/n for j = 1,... , n.

Finally, the method of lines solves ut = Au using an ODE integrator. For simplicity, use the forward Euler method: uk+1 = uk + ∆tAuk. (c) Consider the eigenvalues from part (b), together with the theory of absolute stability for the for- ward Euler method, to determine a sharp condition on ∆t that ensures there are no exponentially growing solutions for a fixed value of ∆x. (n.b. This is requirement was derived in a seminal 1928 paper by Courant, Friedrichs, and Lewy; hence it is known as the CFL condition.) (d) Implement your algorithm in MATLAB to confirm that your answer to (c) is correct. In particular, take ∆x = 1/50 (n = 50) and give solutions when ∆t is (1) twice the maximum and (2) equal to the maximum allowed by the stability requirement from (c). You may show this data in several ways: You can plot the solution at time t = 2 in two dimensions (u(2, x) versus x), or in three dimensions for t ∈ [0, 2]. For the latter, the following MATLAB commands may prove useful: surf, mesh, waterfall, pcolor, shading interp.

  1. [25 points: 6 points each for (a), (b), (c); 7 points for (d)]

It is natural to pursue a better approximation to the exact solution of the first order wave equation by replacing the first-order finite difference approximation to ux by a more accurate expression, such as the centered difference formula

ux(t, xj ) ≈ u(t, xj+1) − u(t, xj− 1 ) 2∆x

which one can verify is O((∆x)^2 ) accurate.

Supplemental Problems

S1. (a) Suppose we wish to approximate the integral

− 1

f (x) dx with the quadrature rule

∫ (^1)

− 1

f (x) dx ≈ Af (0) + Bf ′(0).

How should A and B be selected to make this rule exact for all linear polynomials?

(b) Suppose we improve this rule to ∫ (^1)

− 1

f (x) dx ≈ Af (0) + Bf ′(0) + Cf ′′(0).

How should A, B, and C be selected to make this rule exact for all quadratic polynomials?

(c) With three evaluations of f , Simpson’s rule is exact for all cubic polynomials. Is the same true of your method in (b)?

(d) Assuming f is sufficiently differentiable, use the Taylor expansion with remainder term to derive a bound on (^) ∣ ∣ ∣

− 1

f (x) dx −

Af (0) + Bf ′(0) + Cf ′′(0)

(No Peano kernel-style analysis is required for this problem.)

(e) Why is the method you derived in (b) less famous than Simpson’s rule?

S2. Show that when the classical fourth-order Runge–Kutta method is applied to the equation x′(t) = λx(t), one obtains xn+1 = (1 + hλ + 12 h^2 λ^2 + 16 h^3 λ^3 + 241 h^4 λ^4 )xn. Compare this to the Taylor expansion of x(tn+1) about the point t = tn. Use MATLAB to plot the set of all hλ ∈ C for which |xn| → 0 as n → ∞. [Adapted from S¨uli and Mayers, problem 12.9]

S3. Suppose Euler’s method is used to solve the initial value problem

x′(t) = f (x, t), x(t 0 ) = x 0

on the interval t ∈ [t 0 , tfinal]. Your goal is to compute x(tfinal) as accurately as possible.

(a) Describe how Richardson extrapolation can be applied to this problem. Write a MATLAB code to implement the procedure. You may use the code euler.m from the class web site. (b) Apply your code to x′(t) = x(t) with x(0) = 1 on the interval [0, 1]. Start with step size h = 1, and state the number of levels your extrapolation table requires to give x(1) to within 10−^10 of the exact solution.

(c) You are designing a space probe to rendezvous with a near-earth asteroid. The encounter is to take place at time t = 1, and you require an accurate position vector for the asteroid at that time, so you know where to send your probe for the rendezvous. Suppose the motion of this asteroid, in suitably normalized coordinates, is given by

x′′(t) = −

x(t) ‖x(t)‖^3

, x(0) =

[ . 2

]

, x′(0) =

[ −. 65

]

where x(t) ∈ R^2 denotes the position of the satellite at time t. Write this second order system as a first order system, integrate this orbit with Euler’s method, and apply your extrapolation technique to obtain the components of x(1) to decent precision. Start your table with time step h = 2−^5.

(d) Compare this extrapolated value to the answer at tfinal that you obtain using the St¨ormer–Verlet method for this conservative system. For the equation x′′(t) = f (x(t)) with x 0 = x(t 0 ) and v 0 = x′(t 0 ), this method is:

xk+1/ 2 = xk + 12 hvk

vk+1 = vk + hf (xk+1/ 2 )

xk+1 = xk+1/ 2 + 12 hvk+1.