278
8 Solving Ordinary Differential Equations
a) A forward finite difference approximation to the derivative f (a) reads
u
(t n ) ≈
u(t n + Δt) − u(t n )
Δt
.
We can justify this formula mathematically through Taylor series. Write up the
Taylor series for u(t n + Δt) (around t = t n , as given above), and then solve
the expression with respect to u (t n ). Identify, on the right-hand side, the finite
difference approximation and an infinite series. This series is then the error in the
finite difference approximation. If Δt is assumed small (i.e. Δt << 1), Δt will
be much larger than Δt 2 , which will be much larger than Δt 3 , and so on. The
leading order term in the series for the error, i.e., the error with the least power
of Δt is a good approximation of the error. Identify this term.
b) Repeat a) for a backward difference:
u
(t n ) ≈
u(t n ) − u(t n − Δt)
Δt
.
This time, write up the Taylor series for u(t n − Δt) around t n . Solve with respect
to u (t n ), and identify the leading order term in the error. How is the error
compared to the forward difference?
c) A centered difference approximation to the derivative, as explored in Exercise 8.13, can be written
u
(t n +
1
2
Δt) ≈
u(t n + Δt) − u(t n )
Δt
.
Write up the Taylor series for u(t n ) around t n +
1
2 Δt and the Taylor series for
u(t n + Δt) around t n +
1
2 Δt. Subtract the two series, solve with respect to
u (t n +
1
2 Δt), identify the finite difference approximation and the error terms
on the right-hand side, and write up the leading order error term. How is this
term compared to the ones for the forward and backward differences?
d) Can you use the leading order error terms in a)–c) to explain the visual
observations in the numerical experiment in Exercise 8.13?
e) Find the leading order error term in the following standard finite difference
approximation to the second-order derivative:
u
(t n ) ≈
u(t n + Δt) − 2u(t n ) + u(t n − Δt)
Δt 2
.
Hint Express u(t n ±Δt) via Taylor series and insert them in the difference formula.
Filename: Taylor_differences.pdf.
8 Solving Ordinary Differential Equations
a) A forward finite difference approximation to the derivative f (a) reads
u
(t n ) ≈
u(t n + Δt) − u(t n )
Δt
.
We can justify this formula mathematically through Taylor series. Write up the
Taylor series for u(t n + Δt) (around t = t n , as given above), and then solve
the expression with respect to u (t n ). Identify, on the right-hand side, the finite
difference approximation and an infinite series. This series is then the error in the
finite difference approximation. If Δt is assumed small (i.e. Δt << 1), Δt will
be much larger than Δt 2 , which will be much larger than Δt 3 , and so on. The
leading order term in the series for the error, i.e., the error with the least power
of Δt is a good approximation of the error. Identify this term.
b) Repeat a) for a backward difference:
u
(t n ) ≈
u(t n ) − u(t n − Δt)
Δt
.
This time, write up the Taylor series for u(t n − Δt) around t n . Solve with respect
to u (t n ), and identify the leading order term in the error. How is the error
compared to the forward difference?
c) A centered difference approximation to the derivative, as explored in Exercise 8.13, can be written
u
(t n +
1
2
Δt) ≈
u(t n + Δt) − u(t n )
Δt
.
Write up the Taylor series for u(t n ) around t n +
1
2 Δt and the Taylor series for
u(t n + Δt) around t n +
1
2 Δt. Subtract the two series, solve with respect to
u (t n +
1
2 Δt), identify the finite difference approximation and the error terms
on the right-hand side, and write up the leading order error term. How is this
term compared to the ones for the forward and backward differences?
d) Can you use the leading order error terms in a)–c) to explain the visual
observations in the numerical experiment in Exercise 8.13?
e) Find the leading order error term in the following standard finite difference
approximation to the second-order derivative:
u
(t n ) ≈
u(t n + Δt) − 2u(t n ) + u(t n − Δt)
Δt 2
.
Hint Express u(t n ±Δt) via Taylor series and insert them in the difference formula.
Filename: Taylor_differences.pdf.
