Docsity

Estimating Time Step Restrictions for Ordinary Differential Equations, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Jeffrey Hellrung
Friday, November 04, 2005
Math 269A, Assignment 05
1. For each of the following ODE’s determine a good estimate of the timestep restriction (if there is a
timestep restriction) required to get qualitatively correct solutions when using the methods (a) forward
Euler, (b) the 4th order Runge-Kutta method given in Assignment 4, (c) trapezoidal method, and (d)
backward Euler.
ODE 1 dy
dt =−y2y(0) = 5 t∈[0,5]
ODE 2 dy
dt =y2y(0) = 1 t∈[0,5]
ODE 3 dy
dt = 4t2cos y y(0) = 1 t∈[0,10]
Solution
The intervals of absolute stability for the various methods are given below:
method λh ∈S=
forward Euler (−2,0)
4th order Runge-Kutta (−2.785,0)
trapezoidal method (−∞,0)
backward Euler (−∞,0) ∪(2,∞)
•(ODE 1) We have
f(y) = −y2⇒fy=−2y=λ.
Since y′≤0, we know that y(t)≤y(0) for all t≥0, i.e., yis decreasing. Note that y′= 0 for y= 0,
hence y(t) cannot cross the line y= 0, and since y(0) >0, we can then bound 0 ≤y(t)≤y(0) = 5.
It follows that −10 ≤λ≤0.
The following table summarizes those hsuch that λh ∈Sfor all −10 ≤λ≤0. Note that we need
not worry about ensuring that λh /∈Swhen λ > 0 since λis always nonpositive.
method h∈
forward Euler (0,0.2)
4th order Runge-Kutta (0,0.2785)
trapezoidal method (0,∞)
backward Euler (0,∞)
•(ODE 2) We have
f(y) = y2⇒fy= 2y=λ.
Since y′≥0, we know that y(t)≥y(0) = 1 for all t≥0, hence 2 ≤λ.
The following table summarizes those hsuch that λh /∈Sfor all 2 ≤λ. Note that we need not
worry about ensuring that λh ∈Swhen λ < 0 since λis always nonnegative.
method h∈
forward Euler (0,∞)
4th order Runge-Kutta (0,∞)
trapezoidal method (0,∞)
backward Euler ∅
•(ODE 3) We have
f(y) = 4t2cos y⇒fy=−4t2sin y=λ.
Since t∈[0,10], |λ| ≤ 400.
The following table summarizes those hsuch that λh ∈Sfor all −400 ≤λ < 0 and λh /∈Sfor
all 0 < λ ≤400.
1
pf3
pf4

Partial preview of the text

Download Estimating Time Step Restrictions for Ordinary Differential Equations and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Jeffrey Hellrung Friday, November 04, 2005 Math 269A, Assignment 05

  1. For each of the following ODE’s determine a good estimate of the timestep restriction (if there is a timestep restriction) required to get qualitatively correct solutions when using the methods (a) forward Euler, (b) the 4th^ order Runge-Kutta method given in Assignment 4, (c) trapezoidal method, and (d) backward Euler. ODE 1 dy dt = −y^2 y(0) = 5 t ∈ [0, 5] ODE 2 dy dt = y^2 y(0) = 1 t ∈ [0, 5] ODE 3 dy dt = 4t^2 cos y y(0) = 1 t ∈ [0, 10] Solution The intervals of absolute stability for the various methods are given below: method λh ∈ S = forward Euler (− 2 , 0) 4 th^ order Runge-Kutta (− 2. 785 , 0) trapezoidal method (−∞, 0) backward Euler (−∞, 0) ∪ (2, ∞) - (ODE 1) We have f (y) = −y^2 ⇒ fy = − 2 y = λ. Since y′^ ≤ 0, we know that y(t) ≤ y(0) for all t ≥ 0, i.e., y is decreasing. Note that y′^ = 0 for y = 0, hence y(t) cannot cross the line y = 0, and since y(0) > 0, we can then bound 0 ≤ y(t) ≤ y(0) = 5. It follows that − 10 ≤ λ ≤ 0. The following table summarizes those h such that λh ∈ S for all − 10 ≤ λ ≤ 0. Note that we need not worry about ensuring that λh /∈ S when λ > 0 since λ is always nonpositive. method h ∈ forward Euler (0, 0 .2) 4 th^ order Runge-Kutta (0, 0 .2785) trapezoidal method (0, ∞) backward Euler (0, ∞) - (ODE 2) We have f (y) = y^2 ⇒ fy = 2y = λ. Since y′^ ≥ 0, we know that y(t) ≥ y(0) = 1 for all t ≥ 0, hence 2 ≤ λ. The following table summarizes those h such that λh /∈ S for all 2 ≤ λ. Note that we need not worry about ensuring that λh ∈ S when λ < 0 since λ is always nonnegative. method h ∈ forward Euler (0, ∞) 4 th^ order Runge-Kutta (0, ∞) trapezoidal method (0, ∞) backward Euler ∅ - (ODE 3) We have f (y) = 4t^2 cos y ⇒ fy = − 4 t^2 sin y = λ. Since t ∈ [0, 10], |λ| ≤ 400. The following table summarizes those h such that λh ∈ S for all − 400 ≤ λ < 0 and λh /∈ S for all 0 < λ ≤ 400.

method h ∈ forward Euler (0, 0 .005) 4 th^ order Runge-Kutta (0, 0 .006963) trapezoidal method (0, ∞) backward Euler (0, 0 .005)

  1. Consider an ordinary differential equation of the form

dy dt

= f (y, t) y(t 0 ) = y 0 (D1)

whose solution is to be approximated using a general one-step method of the form

yn+1 = yn + dtΨ(yn, tn, dt) (M1).

Assume that the local truncation error is of order p + 1 so that

y(tn+1) = y(tn) + dtΨ(y(tn), tn, dt) + τndtp+

where y(t) is the solution of (D1) and τn is a constant that depends on derivatives of this solution.

(a) Derive an error estimate for the approximation obtained with (M1) of the form

|en| ≤ C 1 |e 0 | + C 2 dtp^ n = 1, 2 ,... , N

where C 1 and C 2 are constants and dt = tb− Nt a. Please state your assumptions concerning Ψ. (b) For a second order Runge-Kutta method of your choosing, give the explicit representation of Ψ(yn, tn, dt) that arises when the method is expressed in form (M1).

Solution

(a) We make a Lipschitz assumption on Ψ with respect to the first argument:

|Ψ(u, t, h) − Ψ(v, t, h)| ≤ L|u − v|

for some L ≥ 0. We further assume that the τn’s are bounded in absolute value by some M ≥ 0 (this occurs if the derivatives of the solution are bounded, for example). Then if we define

en = y(tn) − yn

we obtain the recurrence relation

|en+1| = |y(tn+1) − yn+1| ≤ |y(tn) − yn| + h |Ψ(y(tn), t, h) − Ψ(yn, t, h)| + |τn|hp+ ≤ (1 + Lh)|en| + |τn|hp+

The solution to the recurrence relation then gives

|en| ≤ (1 + Lh)n|e 0 | + hp+

n∑− 1

k=

|τk|(1 + Lh)n−k−^1 ≤ (1 + Lh)n|e 0 | + M hp+

n∑− 1

k=

(1 + Lh)k.

The summation is a geometric series, with sum

n∑− 1

k=

(1 + Lh)k^ =

(1 + Lh)n^ − 1 (1 + Lh) − 1

(1 + Lh)n^ − 1 Lh

for β between yk and yk + h 2 F (yk), so

yk+1 = yk + hF (yk) + h^2

Fy (yk)F (yk) + h^3

Fyy (β)F (yk)^2.

If yk = y(t), we get the local truncation error to be

τ = y(t + h) − yk+1 = h^3

y′′′(α) −

Fyy (β)F (yk)^2