



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A solution to the problem of deriving the coefficients α, β1, and β2 for a second-order runge-kutta method. The document uses the quadrature formula and the taylor expansion to derive the equations for the coefficients. The document also includes a proof of convergence for the 'θ method'.
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Jeffrey Hellrung
Friday, October 21, 2005
Math 269A, Assignment 03
y
∗ = yn + αdtf (yn),
yn+1 = yn + dt (β 1 f (yn) + β 2 f (y
∗ )).
Derive the equations for α, β 1 , and β 2 that give a second order method.
Solution
We use the quadrature formula
y(t + h) = y(t) +
t+h
t
y
′ (x)dx = y(t) +
t+h
t
f (y(x))dx.
Now if we set
P 1 (x) = f (y(t)) = y
′ (t),
then P agrees with f at t, and further, for x ∈ [t, t + h],
y
′ (x) = f (y(x)) = P 1 (x) + y
′′ (α 1 )(x − t)
for some α 1 ∈ [t, t + h], hence
|f (x) − P 1 (x)| ≤ |y
′′ (α 1 )| h ≤ M 0 M 1 h,
since y
′′ = (f
′ ◦ y) · (f ◦ y), where
M 0 = sup [t,t+h]
f ◦ y,
M 1 = sup [t,t+h]
f
′ ◦ y.
Thus (^) ∣ ∣ ∣ ∣ ∣
∫ (^) t+h
t
f (x)dx −
∫ (^) t+h
t
P 1 (x)dx
≤ M 0 M 1 h
2 ,
and ∫ (^) t+h
t
P 1 (x)dx = f (y(t))h.
If we denote
y
∗ = y(t) + f (y(t))h,
it follows that
|y(t + h) − y
∗ | ≤ M 0 M 1 h
2 .
Now if we set
P 2 (x) =
x − (t + h)
t − (t + h)
f (y(t)) +
x − t
(t + h) − t
f (y(t + h)),
then P 2 agrees with f at t and t + h, and further, for x ∈ [t, t + h],
f (x) = P 2 (x) +
y
′′′ (α 2 )
(x − t)(x − (t + h))
for some α 2 ∈ [t, t + h]. Hence, as above
|f (x) − P 2 (x)| ≤
|y
′′′ (α 2 )|
h
2 0
2 1
h
2 = C 1 h
2 ,
where M 0 , M 1 are as above and
M 2 = sup [t,t+h]
f
′′ ◦ y.
Thus (^) ∣ ∣ ∣ ∣ ∣
t+h
t
f (x)dx −
t+h
t
P 2 (x)dx
≤ C 1 h
3 ,
and ∫ t+h
t
P 2 (x)dx =
h
(f (y(t)) + f (y(t + h))).
Note that the polynomial
Q 2 (x) =
x − (t + h)
t − (t + h)
f (y(t)) +
x − t
(t + h) − t
f (y
∗ )
differs from P 2 on [t, t + h] by no more than
|P 2 (x) − Q 2 (x)| ≤ |f (y(t)) − f (y
∗ )| ≤ M 1 |y(t) − y
∗ | ≤ M 0 M
2 1 h
2 = C 2 h
2 ,
hence (^) ∣ ∣ ∣ ∣ ∣
t+h
t
P 2 (x) −
t+h
t
Q 2 (x)
≤ C 2 h
3
and ∫ t+h
t
Q 2 (x)dx =
h
(f (y(t)) + f (y
∗ )).
By the triangle inequality, then
∣ ∣ ∣ ∣ y(t + h) −
y(t) +
h
(f (y(t)) + f (y
∗ ))
≤ (C 1 + C 2 )h
3 .
Thus, we set
α = 1, β 1 =
, β 2 =
For a general condition, we know that, by a Taylor expansion,
y(t + h) = y(t) + y
′ (t)h +
1 2 y
′′ (t)h
2
3 )
= y(t) + f (y(t))h +
1 2 f
′ (y(t))f (y(t))h
2
3 )
We can Taylor expand f (y
∗ ) to obtain
f (y ∗ ) = f (y(t) + αf (y(t))h)
= f (y(t)) + αf ′ (y(t))f (y(t))h + O(h 2 )
hence
y(t) + h (β 1 f (y(t)) + β 2 f (y
∗ )) = y(t) + (β 1 + β 2 ) f (y(t))h + αβ 2 f
′ (y(t))f (y(t))h
2
3 ),
so, by matching up the coefficients on corresponding powers of h in the expansion of y(t + h), we get
a second-order method when
β 1 + β 2 = 1, αβ 2 =
in problem 2. of Assignment 02,
dy/dt = − 2 y
2 ,
y(0) = 1
for t ∈ [0, T ].
(a) Compute the solution to time t = 2.0 and report the error in the solution that is obtained with
timesteps of size 0.1, 0.05, and 0.025.
(b) Give an estimate for the rate of convergence derived from your error data.
Solution
(a)
h (yN − y(2.0))/|y(2.0)|
1 − 0. 00357319
05 − 0. 000847975
025 − 0. 000206015
(b) The ratio of the magnitudes of successive relative errors is close to 4 = 2 2 , suggesting convergence
in h 2 :
in problem 4. of Assignment 02,
dy
dt
y, y(0) =
(a) Give the error in the numerical solution at t = 10.0 using timesteps dt = 1. 0 , 0. 1 , 0. 05 , 0 .025.
(b) Give an estimate of the rate of convergence based on your error data.
(c) Give the computed solution values at t = 10.0 for the harmonic oscillator problem when a = 0. 1
and b = 1.0 using a timesteps of 0.1, 0.05, and 0.025.
(d) Give an estimate of the rate of convergence based on your solution values.
Solution
(a)
h (yN − y(10.0))/|y(10.0)|
(b) The ratio of the magnitudes of successive relative errors is close to 4 = 2 2 for the last 3 errors,
suggesting convergence in h 2 :
(c)
h yN
(d) We compute the ratio of the differences in successive approximations to obtain
which suggests convergence in h 2 .