Docsity

Numerical Methods for Scientific Computing II - Homework 2 | MATH 572, Assignments of Mathematics

Toggle sidebar
bg1
MATH 572 Numerical Methods for Scientific Computing II Winter 2005
hw#2 due : Tuesday , February 8
1. Find the local truncation error for the backward Euler method un+1 =un+hf(un+1).
2. Consider the midpoint method un+1 =un+hf(un+h
2f(un)) applied to the test equation
y0=λy.
a) Assume that λis a negative real number. Show that hλ is contained in the region of
absolute stability if and only if −2≤hλ ≤0.
b) Show that no imaginary value of hλ is contained in the region of absolute stability.
3. Consider the trapezoid method un+1 =un+h
2(f(un) + f(un+1)). Find the local
truncation error and show that the scheme is A-stable.
4. Consider the initial value problem y1
y20
=−11 9
9−11 y1
y2,y1
y20
=1.0
1.2.
a) Find an analytic expression for the exact solution of the problem and also for the
numerical solutions given by the forward Euler and backward Euler methods. In each case
show analytically that limh→0u1,n =y1,n at a fixed time t=tn=nh.
b) Compute the numerical solution for 0 ≤t≤2 using forward Euler and backward Euler
with step size h= 0.11,0.10,0.09. In each case plot the first component of the exact
solution y1(t) and the numerical solution u1,n vs. time. Display the results as in the class
handout (use the subplot command in Matlab). Discuss the results. Which cases are
absolutely stable and which are not absolutely stable?
5. a) Find the coefficients γi, βiin the 4-step Adams-Bashforth method,
un+1 =un+hγ0fn+γ1∇fn+γ2∇2fn+γ3∇3fn,
un+1 =un+hβ0fn+β1fn−1+β2fn−2+β3fn−3.
b) Find the coefficients γ∗
i, β∗
iin the 3-step Adams-Moulton method,
un+1 =un+hγ∗
−1fn+1 +γ∗
0∇fn+1 +γ∗
1∇2fn+1 +γ∗
2∇3fn+1,
un+1 =un+hβ∗
−1fn+1 +β∗
0fn+β∗
1fn−1+β∗
2fn−2.
c) Find the local truncation error for each method. Which method is more accurate?
6. Consider the problem y00 +y= 0, y(0) = 1, y0(0) = 0. Express the problem as a first
order linear system, y0=Ay. Solve the system using (a) forward Euler, (b) backward
Euler, and (c) RK4, with step size h= 0.1 up to time t= 4π. Plot the solution in phase
space, i.e. plot y1(t) on the x-axis and y2(t) on the y-axis, for the exact solution and the
numerical solutions. Present all these results in a single Matlab plot which is correctly
scaled (use the commands axis(’equal’) and hold on). Which of the three methods
gives the best results? Why? Does absolute stability play a role?

Partial preview of the text

Download Numerical Methods for Scientific Computing II - Homework 2 | MATH 572 and more Assignments Mathematics in PDF only on Docsity!

MATH 572 Numerical Methods for Scientific Computing II Winter 2005

hw#2 due : Tuesday , February 8

  1. Find the local truncation error for the backward Euler method un+1 = un + hf (un+1).
  2. Consider the midpoint method un+1 = un +hf (un + h 2 f (un)) applied to the test equation y′^ = λy.

a) Assume that λ is a negative real number. Show that hλ is contained in the region of absolute stability if and only if − 2 ≤ hλ ≤ 0.

b) Show that no imaginary value of hλ is contained in the region of absolute stability.

  1. Consider the trapezoid method un+1 = un + h 2 (f (un) + f (un+1)). Find the local truncation error and show that the scheme is A-stable.
  2. Consider the initial value problem

y 1 y 2

y 1 y 2

y 1 y 2

0

a) Find an analytic expression for the exact solution of the problem and also for the numerical solutions given by the forward Euler and backward Euler methods. In each case show analytically that limh→ 0 u 1 ,n = y 1 ,n at a fixed time t = tn = nh.

b) Compute the numerical solution for 0 ≤ t ≤ 2 using forward Euler and backward Euler with step size h = 0. 11 , 0. 10 , 0 .09. In each case plot the first component of the exact solution y 1 (t) and the numerical solution u 1 ,n vs. time. Display the results as in the class handout (use the subplot command in Matlab). Discuss the results. Which cases are absolutely stable and which are not absolutely stable?

  1. a) Find the coefficients γi, βi in the 4-step Adams-Bashforth method,

un+1 = un + h

γ 0 fn + γ 1 ∇fn + γ 2 ∇^2 fn + γ 3 ∇^3 fn

un+1 = un + h

β 0 fn + β 1 fn− 1 + β 2 fn− 2 + β 3 fn− 3

b) Find the coefficients γ i∗ , β i∗ in the 3-step Adams-Moulton method,

un+1 = un + h

γ∗− 1 fn+1 + γ 0 ∗ ∇fn+1 + γ 1 ∗ ∇^2 fn+1 + γ 2 ∗ ∇^3 fn+

un+1 = un + h

β−∗ 1 fn+1 + β 0 ∗ fn + β 1 ∗ fn− 1 + β 2 ∗ fn− 2

c) Find the local truncation error for each method. Which method is more accurate?

  1. Consider the problem y′′^ + y = 0, y(0) = 1, y′(0) = 0. Express the problem as a first order linear system, y′^ = Ay. Solve the system using (a) forward Euler, (b) backward Euler, and (c) RK4, with step size h = 0.1 up to time t = 4π. Plot the solution in phase space, i.e. plot y 1 (t) on the x-axis and y 2 (t) on the y-axis, for the exact solution and the numerical solutions. Present all these results in a single Matlab plot which is correctly scaled (use the commands axis(’equal’) and hold on). Which of the three methods gives the best results? Why? Does absolute stability play a role?