9.3 Exercises
309
Remarks If the interest is in the stationary limit of a diffusion equation, one can
either solve the associated Laplace or Poisson equation directly, or use a Backward
Euler scheme for the time-dependent diffusion equation with a very long time step.
Using a Forward Euler scheme with small time steps is typically inappropriate in
such situations because the solution changes more and more slowly, but the time
step must still be kept small, and it takes “forever” to approach the stationary state.
This is yet another example why one needs implicit methods like the Backward
Euler scheme.
Exercise 9.10: Solve a Two-Point Boundary Value Problem
Solve the following two-point boundary-value problem
u
(x) = 2, x ∈ (0, 1), u(0) = 0, u(1) = 1 .
Hint Do Exercise 9.9. Modify the boundary condition in the code so it incorporates
a known value for u(1).
Filename: 2ptBVP.py.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0
International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing,
adaptation, distribution and reproduction in any medium or format, as long as you give appropriate
credit to the original author(s) and the source, provide a link to the Creative Commons licence and
indicate if changes were made.
The images or other third party material in this chapter are included in the chapter’s Creative
Commons licence, unless indicated otherwise in a credit line to the material. If material is not
included in the chapter’s Creative Commons licence and your intended use is not permitted by
statutory regulation or exceeds the permitted use, you will need to obtain permission directly from
the copyright holder.
Précédent

- 328/350

Suivant