308
9 Solving Partial Differential Equations
∂u/∂x = 0. Reformulate the problem in Exercise 9.6 such that we compute only
for x ∈ [0, 1]. Display the solution and observe that it equals the right part of the
solution in Exercise 9.6.
Filename: symmetric_gaussian_diffusion.py.
Remarks In 2D and 3D problems, where the CPU time to compute a solution of
PDE can be hours and days, it is very important to utilize symmetry as we do above
to reduce the size of the problem.
Also note the remarks in Exercise 9.6 about the constant area under the u(x, t)
curve: here, the area is 0.5 and u → 0.5 as t → 0.5 (if the mesh is sufficiently
fine—one will get convergence to smaller values for small σ if the mesh is not fine
enough to properly resolve a thin-shaped initial condition).
Exercise 9.9: Compute Solutions as t → ∞
Many diffusion problems reach a stationary time-independent solution as t → ∞.
The model problem from Sect. 9.2.4 is one example where u(x, t) = s(t) = const
for t → ∞. When u does not depend on time, the diffusion equation reduces to
−βu
(x) = f (x),
in one dimension, and
−β∇
2 u = f (x),
in 2D and 3D. This is the famous Poisson equation, or if f = 0, it is known as the
Laplace equation. In this limit t → ∞, there is no need for an initial condition, but
the boundary conditions are the same as for the diffusion equation.
We now consider a one-dimensional problem
− u
(x) = 0, x ∈ (0, L), u(0) = C, u
(L) = 0,
(9.38)
which is known as a two-point boundary value problem. This is nothing but the
stationary limit of the diffusion problem in Sect. 9.2.4. How can we solve such a
stationary problem (9.38)? The simplest strategy, when we already have a solver for
the corresponding time-dependent problem, is to use that solver and simulate until
t → ∞, which in practice means that u(x, t) no longer changes in time (within
some tolerance).
A nice feature of implicit methods like the Backward Euler scheme is that one
can take one very long time step to “infinity” and produce the solution of (9.38).
a) Let (9.38) be valid at mesh points x i in space, discretize u by a finite difference,
and set up a system of equations for the point values u i ,i = 0, . . . , N, where u i
is the approximation at mesh point x i .
b) Show that if Δt → ∞ in (9.16)–(9.18), it leads to the same equations as in a).
c) Demonstrate, by running a program, that you can take one large time step with
the Backward Euler scheme and compute the solution of (9.38). The solution is
very boring since it is constant: u(x) = C.
Filename: rod_stationary.py.
Précédent

- 327/350

Suivant