Information Technology Reference
In-Depth Information
Extend your program from Exercise 3.1 to compute
e
F n
e
S n
K n
D
and generate a plot of K n K 0
K 0
for t D 1=100 and t D 1=500. Argue that K n
seems to converge toward a constant, for all n,ast becomes smaller.
(e) Let t D 10=N . Use the program you developed in (d) to compute
K N K 0
K 0 t
for N D 100; 200; 300; 400; 500. Argue that
K N
K 0
K 0
ct;
where c is independent of t .
˘
Exercise 3.3. Consider the following system of ODEs:
u 0 D v 3 ; u .0/ D u 0 ;
v 0 D
(3.79)
u 3 ;
v .0/ D v 0 :
(a) Define
r.t/ D u 4 .t / C v 4 .t /;
(3.80)
and show that
r.t/ D r.0/
(3.81)
for all t 0.
(b) Derive the following explicit finite difference scheme for system ( 3.79 ):
D u n t v n
u nC1
;
(3.82)
D v n C t u n
v nC1
:
(c) Write a program that implements the scheme ( 3.82 ). The program should:
Accept u 0 , v 0 , N ,andT as input.
Compute the numerical solution defined by ( 3.82 )usingt D T=N for
n D 0;1;:::;N.
Plot the numerical solution of u and v both as functions of t and in the state
space.
 
Search WWH ::




Custom Search