Information Technology Reference
In-Depth Information
Find, in particular, the value
u
.L=2; 4/. (Hint: Scale the problem first.)
˘
Exercise 7.13.
The exercise is similar to Exercise
7.10
, but now you should imple-
ment Algorithm
7.3
.
˘
Exercise 7.14.
Modify Algorithm
7.3
so that there can be a non-homogeneous Neu-
mann condition at x
D
0: @
u
=@x
D
N
0
.t /. Implement the algorithm and verify the
implementation.
˘
Exercise 7.15.
Suppose we want to solve (
7.82
) with scheme (7.115). Extend Algo-
rithm
7.1
to this case. Find a test problem for your program using the method of
manufactured solutions.
˘
Exercise 7.16.
Extend the algorithm in Exercise
7.15
to handle Neumann condi-
tions @
u
=@x
D
0 at both ends.
˘
Exercise 7.17.
Assume that the problem to be solved by Algorithm
7.6
has Neu-
mann conditions @
u
=@x
D
0 at the end x
D
1. Modify the algorithm acc-
ordingly.
˘
Exercise 7.18.
Use your favorite programming language and implement Algo-
rithm
7.6
. (If arrays in your language cannot start at index 0, you need to rewrite
the algorithm first, so that i runs from 1 to n
C
1 instead of from 0 to n.) Verify your
implementation.
˘
Exercise 7.19.
Assume that the problem to be solved by Algorithm
7.6
has a vari-
able diffusion coefficient as explained in Sect.
7.4.7
. Modify the algorithm to handle
this extension of the problem.
˘
Exercise 7.20.
Write a program, in a programming language of your choice, that
implements Algorithm
7.7
. Set up at least two test problems to test that the program
works correctly.
˘
Exercise 7.21.
Use the program from Exercise
7.20
to solve the problem (
7.102
)-
(
7.105
). Apply two grid spacings, x
D
0:1 and x
D
0:01. First, run the explicit
method (
D
0) with the maximum t for these two cases. Then run the implicit
backward Euler scheme (
D
1) with t
D
0:5x
2
and t
D
10x
2
. Repeat the
latter tests with the Crank-Nicolson scheme (
D
0:5). Create animations of the
solutions in each case and write a report about how the various methods solve this
quite challenging numerical problem.
˘
Exercise 7.22.
Modify Algorithm
7.7
such that one can choose between non-
homogeneous Dirichlet or Neumann conditions at the boundary points.
˘
Exercise 7.23.
Write extensions in the algorithm from Exercise
7.22
such that a
variable diffusion coefficient is allowed.
˘
Exercise 7.24.
Make a program implementing the algorithm from Exercise
7.23
.
Set up a series of test cases for checking that one can handle Dirichlet and Neumann
boundary conditions as well as a variable diffusion coefficient (use the method of
manufactured solutions to test the latter feature).
˘