Information Technology Reference
In-Depth Information
(a) Verify by direct differentiation that the analytical solution of this problem is
given by
r.t/ D 1
4 .e 4t 1/:
(b) An explicit scheme for the initial value problem ( 2.53 ) can be written in the
form
y nC1 D y n C t.1 C 4y n /:
Explain the derivation of this scheme.
(c) Similarly, derive the following implicit 20 scheme:
z n C t
1 4t :
z nC1 D
(d) Set t D 1=10 and compute, by hand, y 1 ;y 2 ;y 3 and z 1 ; z 2 ; z 3 : Compare these
values with the analytical values given by r.t/;r.2t/,andr.3t/:
(e) Write a computer program for the implicit and the explicit scheme. The program
should accept N and T as input data and make a graph of the explicit, 21 implicit,
and exact solutions for t ranging from 0 to T . The numerical schemes should
use t D T=N:
(f) Test the program for T D 1: Evaluate the error for various values of t: Do the
computations indicate that the error is O.t/‹
˘
Exercise 2.2. Consider the initial value problem
r 0 .t / D r.t/ C 2t t 2 ;
(2.54)
r.0/ D 1;
for t ranging from t D 0 to t D T:
(a) Verify that the analytical solution of this problem is given by
r.t/ D e t
C t 2 :
(b) Derive the explicit scheme
y nC1 D y n C t.y n C 2t n t n
/;
20 Note that setting t
1=4 or larger is not a good idea. This also illustrates that implicit schemes
can impose stability restrictions on time stepping. But usually, implicit schemes allow much longer
time steps than explicit schemes.
21 From time to time we use the terms “explicit solution” and “implicit solution”. This is not
entirely accurate; we should use instead the term numerical solution generated by the explicit
scheme, which is the precise statement, but it is too lengthy to use all the time, so now and then we
cheat a little bit.
D
 
Search WWH ::




Custom Search