Information Technology Reference
In-Depth Information
Suppose we manage to find two exact solutions v .x; t / and w .x; t / to this equation.
Show that the linear combination
O u .x; t / D a v .x; t / C b w .x; t /
is also a solution of the equation for arbitrary values of the constants a and b.Setup
boundary and initial conditions that O u fulfills (hint: simply evaluate v and w at the
boundary and at t D 0).
Show that
u .x; t I k/ D e 2 k 2 t sin.kx/
(7.148)
is a solution of the diffusion PDE without source terms for any value of k. Choose
v .x; t / D u .x; t I 1/ and w .x; t / D u .x; t I 100/ and form the linear combination
O u .x; t / D v .x; t / C 0:1 w .x; t / :
Sketch the function O u .x; 0/ from an understanding of how a small-amplitude, rapidly
oscillating sine function w .x; t / is added to the half-wave sine function v .x; t /.Set
up the complete initial-boundary value problem for O u , and adjust a program for the
diffusion equation such that the program can compute this O u . Choose t D x 2 =2.
Find the time t D T when there are no more visible tracks of the rapidly oscillating
part of the initial condition. Explain that the solution you observe as graphical output
of the program is in accordance with the analytical expression for O u .
˘
Exercise 7.9. Algorithm 7.1 is easy to implement in a computer program if the
computer language has arrays whose first index is 0. All languages with some inher-
itance from C (e.g., C CC , Java, C#, Perl, Python, Ruby) have this feature. Some
languages (Matlab, for instance) use index 1 for the first element in an array. You
should then rewrite Algorithm 7.1 so that the index in space (usually called i in this
topic) runs from 1 to n C 1 and not from 0 to n. (This rewrite might sound trivial,
but a simple change from i to i C 1 very often causes errors in programs.)
˘
Exercise 7.10. Write a program that implements Algorithm 7.1 in your favorite
computer language. Note that if the arrays in your language cannot start at 0, you
should rewrite the algorithm as suggested in Exercise 7.9 . Use test problems from
Sect. 7.4.4 to test your program.
˘
Exercise 7.11. The exercise is similar to Exercise 7.10 , but now you should imple-
ment Algorithm 7.2 .
˘
Exercise 7.12. Use the program from Exercise 7.11 to solve the diffusion problem
@t D 10 @ 2 u
@ u
C x;
x 2 .0; L/; t > 0;
@x 2
u .0; t / D 2;
t > 0;
u .L; t / D 1;
t > 0;
u .x; 0/ D 1:
Search WWH ::




Custom Search