Finite Difference Methods for Hamilton-Jacobi Equations II · PDF fileFINITE DIFFERENCE...
-
Upload
duongxuyen -
Category
Documents
-
view
214 -
download
2
Transcript of Finite Difference Methods for Hamilton-Jacobi Equations II · PDF fileFINITE DIFFERENCE...
Finite Difference Methods for Hamilton-JacobiEquations II
Chi-Wang Shu
Division of Applied Mathematics
Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Outline
• ENO and WENO interpolations to compute left and right derivatives
for Cartesian meshes
• ENO and WENO interpolations to compute gradients for triangular
meshes
• Fast sweeping method for WENO schemes on Cartesian meshes
• Treatment of boundary conditions
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
ENO and WENO interpolations to compute left and right derivatives
From the last lecture, in order to design a high order finite difference
method for solving the 2D HJ equation
ϕt + H(ϕx, ϕy) = 0, ϕ(x, y, 0) = ϕ0(x, y) (1)
on rectangular meshes, we can proceed as follows:
• Find a suitable monotone numerical Hamiltonian,
H(u−, u+; v−, v+), such that
H ( ↑, ↓; ↑, ↓ ) .
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Compute high order approximations to the left and right x-derivatives
and y-derivatives of ϕ at the grid point (x, y) = (xi, yj), in a
dimension by dimension fashion, and denote them as u−
i,j , u+i,j , v−
i,j
and v+i,j , respectively.
• Form the semi-discrete scheme
d
dtϕi,j = −H
(
u−
i,j, u+i,j ; v
−
i,j , v+i,j
)
and discretize it in time by high order TVD time discretization (or
another time discretization method).
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Therefore, in order to obtain high order finite difference schemes for HJ
equations on Cartesian meshes, we only need to discuss one dimensional
high order accurate approximations to the left and right derivatives, given
the point values of the function on grid points.
In the first lecture, we indicated that we could use the usual polynomial
interpolation procedure, namely
• Choose a stencil such as S = xi−2, xi−1, xi, xi+1 containing four
grid points, including xi and biased to the left (Note: linear stability for
time dependent calculations restricts how much one can bias the
stencil to one side. The most commonly used “upwind stencil” is one
point biased to the upwind side)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Find the interpolating polynomial p(x) which interpolates the function
ϕ at each grid point in the stencil S. That is, p(xi−2) = ϕi−2,
p(xi−1) = ϕi−1, p(xi) = ϕi, p(xi+1) = ϕi+1. Because the stencil
S has 4 points, the interpolation polynomial p(x) is of degree 3 (a
cubic polynomial)
• Take u−
i = p′(xi) as the approximation to the left derivative of ϕ at
the location x = xi. One should work out the algebra first to obtain
the explicit formula
u−
i =1
∆x
(
1
6ϕi−2 − ϕi−1 +
1
2ϕi +
1
3ϕi+1
)
(for non-uniform mesh the coefficients will depend on the local mesh
sizes but not on ϕ).
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
This would lead to linear schemes, namely the schemes are linear when
applied to linear PDEs. These schemes are excellent for smooth solutions
but may generate spurious oscillations when applied to non-differentiable
viscosity solutions.
We would like to have approximations which are
• high order accurate in approximating left and right derivatives in
smooth regions, and
• (essentially) non-oscillatory near kinks, i.e. discontinuities in the
derivatives of the function
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
The spurious oscillations appear because the interpolation stencil S may
cross a discontinuity of the derivative. In such cases, not only will the
accuracy of the interpolation be completely lost (remember accuracy is
proved based on the assumption of smoothness of the underlying function
over the interpolation stencil), but also the interpolation tends to generate
overshoots or undershoots, especially for approximating derivatives.
For fixed stencils (for example, always use two points to the left, the point
itself, and one point in the right), the stencil will definitely cross the
discontinuity of the derivative somewhere.
One way to overcome this difficulty is to “limit” the approximation, through,
e.g. a minmod limiter. This leads to second order TVD type schemes.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
A better way is the ENO (essentially non-oscillatory) or WENO (weighted
ENO) procedure. Let us first describe the ENO interpolation procedure
(Osher and Shu, SINUM 1991).
Suppose we would like to find a polynomial p(x) of degree k ≥ 2
interpolating the function ϕ at the points in the stencil S, which contains
the two points xi−1, xi. Note: it is important to notice that, unlike the
case in conservation laws, here we would start with a stencil containing
two points xi−1, xi, not just one point xi. This is because the first
order scheme already uses a linear interpolation with the stencil
xi−1, xi. The correct ENO stencil should contain the stencil for the first
order base scheme, which provides correct upwinding and stability.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
First, recall the definition of Newton divided differences:
ϕ[i] = ϕi, ϕ[i, i + 1] =ϕ[i + 1] − ϕ[i]
xi+1 − xi
and in general
ϕ[i, · · · , i + m] =ϕ[i + 1, · · · , i + m] − ϕ[i, · · · , i + m − 1]
xi+m − xi
Let us assume that all these Newton divided differences have been
computed and stored. Note: for uniform meshes, we only need to compute
undivided differences, hence saving cost.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Start with the first order stencil S1 = xi−1, xi.
• Decide to add either the left neighbor, xi−2, or the right neighbor,
xi+1, into the stencil. If
|ϕ[i − 2, i − 1, i]| < |ϕ[i − 1, i, i + 1]|
then we believe the stencil xi−2, xi−1, xi is better than
xi−1, xi, xi+1. This is because the interpolation polynomial pl(x)
on the stencil xi−2, xi−1, xi is given by
pl(x) = p1(x) + ϕ[i − 2, i − 1, i] (x − xi−1) (x − xi)
and the interpolation polynomial pr(x) on the stencil xi−2, xi−1, xiis given by
pr(x) = p1(x) + ϕ[i − 1, i, i + 1] (x − xi−1) (x − xi)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
where p1(x) is the first degree interpolation polynomial over
S1 = xi−1, xi.
Notice that pl(x) − p1(x) and pr(x) − p1(x) are both a scalar
multiple of the same function (x − xi−1) (x − xi), and the deviation
pl(x) − p1(x) is smaller than the deviation pr(x) − p1(x). If we
believe the first degree interpolation polynomial p1(x) is good
(yielding a good first order monotone scheme), we would like to
deviate from it as little as possible (while still keeping accuracy). This
leads to the ENO choice of pl(x). Hence in this case, the stencil for
the quadratic interpolation polynomial is S2 = xi−2, xi−1, xi.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Otherwise, if
|ϕ[i − 2, i − 1, i]| ≥ |ϕ[i − 1, i, i + 1]|
we choose S2 = xi−1, xi, xi+1.
• We now repeat this process. Suppose S2 = xi−1, xi, xi+1. We
would decide to add either the left neighbor, xi−2, or the right
neighbor, xi+2, into the stencil. If
|ϕ[i − 2, i − 1, i, i + 1]| < |ϕ[i − 1, i, i + 1, i + 2]|
then we choose the stencil for the cubic interpolation polynomial as
S3 = xi−2, xi−1, xi, xi+1. Otherwise, we choose
S3 = xi−1, xi, xi+1, xi+2.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• We continue this process until the target stencil Sk is chosen. The
interpolating polynomial p(x) on this stencil is what we want. We
would then take u−
i = p′(xi). In practice, we do not need to explicitly
compute p(x) and then take its derivative. We simply precompute the
coefficients for each possible stencil. For example, if the final ENO
stencil is S3 = xi−2, xi−1, xi, xi+1, then we have
u−
i =1
∆x
(
1
6ϕi−2 − ϕi−1 +
1
2ϕi +
1
3ϕi+1
)
where the coefficients 16, −1, 1
2and 1
3are precomputed and stored.
For non-uniform meshes, these coefficients depend on the local mesh
sizes but not on ϕ, hence they can still be precomputed and stored.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• For computing u+, the only change to the procedure above is the
starting first order stencil, it is changed to S1 = xi, xi+1.
The ENO procedure is simple to code and to compute, even for
non-uniform meshes. We refer to (Osher and Shu, SINUM 1991) for
computational results.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
The WENO interpolation procedure (Jiang and Peng, SISC 2000) is based
on the ENO procedure. If we still use the previous example of trying to
obtain piecewise cubic (third order accurate for derivatives) polynomial
interpolations, and if we insist that the stencil should contain xi−1, xiwhich is the stencil for the first order monotone scheme, then we have the
following three possible stencils which might be chosen by the ENO
procedure:
S0 = xi−3, xi−2, xi−1, xi,
S1 = xi−2, xi−1, xi, xi+1,
S2 = xi−1, xi, xi+1, xi+2
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
They correspond to three third order approximations to the left derivative
u−
i ≈ ϕx(x−
i ):
u−,0i =
1
∆x
(
1
3∆+ϕi−3 −
7
6∆+ϕi−2 +
11
6∆+ϕi−1
)
,
u−,1i =
1
∆x
(
−1
6∆+ϕi−2 +
5
6∆+ϕi−1 +
1
3∆+ϕi
)
,
u−,2i =
1
∆x
(
1
3∆+ϕi−1 +
5
6∆+ϕi −
1
6∆+ϕi+1
)
,
The ENO procedure would choose one of these and ignore the remaining
two. This is the correct procedure to follow near kinks (discontinuities of
the first derivative), as one or two out of the three candidate stencils S0,
S1 and S2 might contain a kink.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
However, in the smooth region, all three stencils are equally good. It is a
waste to look at all of them and eventually discard two of them. A greedy
algorithm would try to use all of them
u−
i = w0u−,0 + w1u
−,1 + w2u−,2 (2)
Now the question is how to choose the weights w0, w1 and w2.
For consistency we need
w0 + w1 + w2 = 1
and for stability we prefer wk ≥ 0.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
In fact, if w0 + w1 + w2 = 1 is satisfied, then any choice of w0, w1 and
w2 would lead to at least third order accuracy, since each u−,k is already
third order accurate. There are WENO schemes in the literature which are
of this type (the weighted average is not higher order accurate than the
approximation in each substencil).
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
A simple algebra reveals that, if we choose the weights w0, w1 and w2 as
the so-called optimal linear weights
w0 = γ0 = 0.1, w1 = γ1 = 0.6, w2 = γ2 = 0.3,
then the approximation
u−
i = γ0u−,0 + γ1u
−,1 + γ2u−,2
would be fifth order accurate. In fact, this would be the same
approximation obtained from the interpolation polynomial based on the
larger stencil
S = S1 ∪ S2 ∪ S3 = xi−3, xi−2, xi−1, xi, xi+1, xi+2
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Of course, this approximation will be oscillatory near kinks. Now, the trick
is to require that the choice of the weights w0, w1 and w2 to be such that
• in smooth regions, the weights w0, w1 and w2 are very close to the
optimal linear weights γ0, γ1, and γ2:
w0 = 0.1+O(∆x2), w1 = 0.6+O(∆x2), w2 = 0.3+O(∆x2),
• near kinks, if the stencil Sk contains a kink while at least one of the
other two stencils does not, then the corresponding weight wk is very
small. In fact, we require wk = O(∆x4) in this case.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
The key ingredient in designing a nonlinear weight to satisfying the two
properties listed above is a smoothness indicator, which is a measurement
of how smooth the function being interpolated is inside the interpolation
stencil. The recipe used in (Jiang and Peng, SISC 2000) is similar to that
in (Jiang and Shu, JCP 1996) for conservation laws, namely the
smoothness indicator is a scaled sum of the squares of the L2 norms of
the second and higher derivatives of the interpolation polynomial on the
target interval. We remark that there is a difference to the case for
conservation laws: here the smoothness indicator sums the squares of the
L2 norms of the second and higher derivatives, not the first and higher
derivatives as in the conservation law case.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
These smoothness indicators work out to be
IS0 = 13(a − b)2 + 3(a − 3b)2,
IS1 = 13(b − c)2 + 3(b + c)2,
IS2 = 13(c − d)2 + 3(3c − d)2,
where
a =∆2ϕi−2
∆x, b =
∆2ϕi−1
∆x, c =
∆2ϕi
∆x, d =
∆2ϕi+1
∆x(3)
are the second order differences, defined by
∆2ϕi = ϕi+1 − 2ϕi + ϕi−1
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
With these smoothness indicators, the nonlinear weights are then defined
by
w0 =w0
w0 + w1 + w2
, w1 =w1
w0 + w1 + w2
, w2 =w2
w0 + w1 + w2
,
with
w0 =1
(ε + IS0)2, w1 =
6
(ε + IS1)2, w2 =
3
(ε + IS2)2,
where ε is a small number to prevent the denominator to become zero and
is typically chosen as ε = 10−6.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Finally, after some algebraic manipulations, we obtain the fifth order
WENO approximation to u−
i as
u−
i =1
12∆x(−∆+ϕi−2 + 7∆+ϕi−1 + 7∆+ϕi − ∆+ϕi+1)
−ΦWENO(a, b, c, d)
where
ΦWENO(a, b, c, d) =1
3w0 (a− 2b + c) +
1
6
(
w2 −1
2
)
(b− 2c + d)
with a, b, c, d defined by (3).
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
By symmetry, the approximation to the right derivative u+i is given by
u+i =
1
12∆x(−∆+ϕi−2 + 7∆+ϕi−1 + 7∆+ϕi − ∆+ϕi+1)
+ΦWENO(e, d, c, b)
with b, c, d defined by (3) and e defined by
e =∆2ϕi+2
∆x.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
ENO and WENO interpolations to compute gradients for triangular meshes
While in principle the ENO and WENO interpolation procedures can be
designed in a similar fashion for triangular meshes (Abgrall, JCP 1994;
Zhang and Shu, SISC 2003), the procedure is quite involved. We therefore
skip the details and refer to (Abgrall, JCP 1994; Zhang and Shu, SISC
2003). We will describe an alternative approach, namely the discontinuous
Galerkin method, for solving HJ equations on triangular meshes in next
lecture.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Fast sweeping method for WENO schemes on Cartesian meshes
The fast sweeping method (Boue and Dupuis, SINUM 1999; Zhao, Math
Comp 2005) is an efficient procedure to obtain the solutions of a numerical
scheme for solving steady state HJ equations. As we mentioned before, if
we use a time accurate method, such as the Runge-Kutta method to
march in time until steady state is reached, the computational cost is quite
high.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
As of now the fast sweeping method is mainly designed for solving convex
HJ equations. In particular, it is mostly used for solving the Eikonal
equation
H(φx, φy) = f(x, y)
where
H(u, v) =√
u2 + v2.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Let us now describe the fast sweeping procedure:
• Write out the scheme
H
(
∆x−ϕi,j
∆x,
∆x+ϕi,j
∆x;
∆y−ϕi,j
∆y,
∆y+ϕi,j
∆y
)
= fi,j
for the first order scheme and
H(
u−
i,j, u+i,j ; v
−
i,j , v+i,j
)
= fi,j
where u−
i,j , u+i,j , v−
i,j , and v+i,j are nonlinear functions of ϕk,` for (k, `)
near (i, j), for high order WENO schemes.
Notice that both will be a nonlinear system of algebraic equations for
the unknowns ϕi,j for all (i, j) in the computational domain.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• The nonlinear equation at the location (i, j) is local, involving only
finitely many (independent of the mesh sizes) neighboring points. For
example, for a first order scheme, the equation at the location (i, j)
involves only the five unknowns ϕi,j , ϕi−1,j , ϕi+1,j , ϕi,j−1, ϕi,j+1.
• The local solver: If we assume all the neighboring values are known,
e.g. in the first order case we assume ϕi−1,j , ϕi+1,j , ϕi,j−1 and
ϕi,j+1 are known, then we attempt to explicit solve ϕi,j (that is, write
ϕi,j explicitly as a function of ϕi−1,j , ϕi+1,j , ϕi,j−1 and ϕi,j+1).
Note: since the equation is nonlinear, this step is by no means trivial.
Often this cannot be done, or the solution is not unique. However, for
the Eikonal equation and first order upwind scheme, this can be done.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• We use a Gauss-Seidel iteration procedure with four alternating
direction sweepings:
(1) i = 0 : I, j = 0 : J ; (2) i = I : 0, j = 0 : J ;
(3) i = I : 0, j = J : 0; (4) i = 0 : I, j = J : 0.
For Gauss-Seidel, solutions are updated during the iteration instantly.
Thus, when we reach the location i from left to right, the value at i− 1
is already the updated one although the value at i + 1 is still the old
one. When we loop to a point (i, j), we use the local solver to obtain
a new value for ϕi,j .
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
There is a “causality” check to determine which solution to choose if
the local solver has more than one solution, and if we should use this
new value or keep the old one: for the Eikonal equation, we adopt the
new value if it is smaller than the old value, and we discard it if it is
bigger than the old value.
• The iteration stops when the residue is smaller than a pre-set
threshold (usually taken as slightly above machine zero).
It can be shown (Zhao, Math Comp 2005) that the fast sweeping method
for a first order upwind scheme solving the Eikonal equation converges to
the truncation error of the scheme in O(N) cost, where N is the number
of grid points. This is to say that the number of Gauss-Seidel iterations
needed is independent of the mesh size, or the total number of grid points
N .
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
For the high order WENO scheme, the local solver is very difficult, if not
impossible, to obtain, because of the complicated nonlinearity caused by
the nonlinear weights in the WENO procedure. Zhang, Zhao and Qian
(JSC 2006) used a very clever trick to avoid using the local solver
associated with the WENO scheme. Rather, they use the local solver
associated with the first order scheme, in such a way that when steady
state is reached, the solution obtained is the solution to the high order
WENO scheme, not the first order monotone scheme. The procedure is
summarized as follows for the third order case:
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• The solution from the first-order fast sweeping method is used as the
initial guess for all the grid points
• The following Gauss-Seidel iterations with four alternating direction
sweepings are then performed:
(1) i = 0 : I, j = 0 : J ; (2) i = I : 0, j = 0 : J ;
(3) i = I : 0, j = J : 0; (4) i = 0 : I, j = J : 0.
(4)
When we loop to a point (i, j), the solution is updated as follows,
φnewi,j =
min(φxmini,j , φymin
i,j ) + fi,j h, if |φxmini,j − φymin
i,j | ≤ fi,j h,
φxmini,j
+φymin
i,j+(2f2
i,jh2
−(φxmini,j
−φymin
i,j)2)
1
2
2, otherwise
(5)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
where fi,j = f(xi, yj), and
φxmini,j = min
(
φi,j − h (φx)−
i,j, φi,j + h (φx)+i,j
)
φymini,j = min
(
φi,j − h (φy)−
i,j, φi,j + h (φy)+i,j
)
, (6)
with
(φx)−
i,j = (1−w−)
(
φi+1,j − φi−1,j
2h
)
+w−
(
3φi,j − 4φi−1,j + φi−2,j
2h
)
,
(7)
(φx)+i,j = (1−w+)
(
φi+1,j − φi−1,j
2h
)
+w+
(−3φi,j + 4φi+1,j − φi+2,j
2h
)
,
(8)
w− =1
1 + 2r2−
, r− =ε + (φi,j − 2φi−1,j + φi−2,j)
2
ε + (φi+1,j − 2φi,j + φi−1,j)2, (9)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
w+ =1
1 + 2r2+
, r+ =ε + (φi,j − 2φi+1,j + φi+2,j)
2
ε + (φi+1,j − 2φi,j + φi−1,j)2. (10)
Here ε is a small number in the WENO nonlinear weights. The
definitions for (φy)−
i,j and (φy)+i,j are of course analogous.
• Convergence is declared if
∥
∥φnew − φold∥
∥ ≤ δ, (11)
where δ is a given convergence threshold value.
We refer to (Zhang, Zhao and Qian, JSC 2006) for more details and
numerical results.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Treatment of boundary conditions
We now discuss the treatment of (non-periodic) boundary conditions. Here
we mainly discuss the result contained in (Huang, Shu and Zhang, JCM
2008) for steady state Eikonal equations using fast sweeping method, but
the methodology applies to more general cases.
For the convenience of the algorithm description below, we divide the set
of mesh points (xi, yj) into the following four categories:
• Category I contains the points at the inflow part of the domain
boundary. The numerical solution φi,j in Category I is fixed at the
prescribed physical boundary condition and does not change during
the fast sweeping iteration.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Category II contains the points at the outflow part of the domain
boundary, where no physical boundary condition is given, and the
ghost points outside the computational domain near the outflow
boundary which are necessary for the wide stencil WENO
interpolation. The numerical solution φi,j in Category II is obtained by
extrapolation of suitable accuracy, based on the numerical solution
inside the computational domain.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Category III contains the few points inside the computational domain
and near the inflow boundary. These points cannot be updated by the
WENO scheme because of its wide stencil. For the third order WENO
scheme under consideration, any point which has a horizontal or
vertical distance less than 3h from the inflow boundary belongs to this
category. The standard strategy in the literature of fast sweeping
method to treat points in Category III is to fix the numerical solution
φi,j as the exact solution of the PDE and it does not change during
the fast sweeping iteration. This of course is not always feasible.
Another strategy used in the literature is to fix the numerical solution
φi,j as that of a first order fast sweeping solution and it does not
change during the fast sweeping iteration. This could of course lead to
a loss of local and hence global accuracy, since information will flow
from this part of the boundary into the computational domain.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
• Category IV contains all the remaining points, which are updated
during the fast sweeping iterations until convergence.
Boundary treatment strategy I: Richardson extrapolation
The first strategy that we propose to treat points in Category III is to obtain
several first order accurate solutions with different mesh sizes, then use
Richardson extrapolation to obtain accurate point values for those points in
Category III. This is feasible without excessive computational cost
because points in Category III are close to the inflow boundary, hence the
first order fast sweeping iterations can be performed locally, greatly
reducing the computational cost.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Richardson extrapolation is a well-known idea so we will only describe our
application of this idea briefly. Assume Ih is the numerical solution of the
first order fast sweeping scheme with mesh size h at the location (x∗, y∗),
which is a grid point in Category III. If we further assume
Ih − I = αh + βh2 + O(h3)
with constants α and β, where I is the exact solution at the location
(x∗, y∗), which is reasonable when the exact solution is smooth, then
clearly
Ih =1
3Ih − 2Ih/2 +
8
3Ih/4 (12)
would be a third order approximation to I :
Ih − I = O(h3).
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
This boundary treatment strategy is suitable for most types of inflow
boundaries, including the source boundary consisting of a single point.
The efficiency of this strategy however depends on how fast we can
compute the first order approximations Ih, Ih/2 and Ih/4 for all grid points
inside Category III. When the characteristics from the inflow boundary do
not intersect with each other, such first order fast sweeping computation
can be performed locally and is very fast. When the characteristics from
the inflow boundary do intersect with each other, the efficiency of this
strategy would decrease. Fortunately, in this case the inflow boundary
would not be a single point, hence the second strategy described in next
subsection would usually be applicable.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Boundary treatment strategy II: a Lax-Wendroff type procedure
The original Lax-Wendroff scheme (Lax and Wendroff, CPAM 1960) uses
an important idea of converting the time derivatives to spatial derivatives,
by repeatedly using the PDE. We propose to use the same idea to obtain
high order approximations to the solution values for the points in Category
III.
To fix the ideas, let us assume that the left boundary
Γ = (x, y) : x = 0, 0 ≤ y ≤ 1 (13)
of the computational domain [0, 1]2 is the inflow boundary, on which the
solution is given as
φ(0, y) = g(y), 0 ≤ y ≤ 1.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
We would like to obtain a high order approximation to the solution value
φi,j ≈ φ(xi, yj) for i = 1, 2 and a fixed j, which corresponds to a point
(xi, yj) in Category III. A simple Taylor expansion gives, for i = 1, 2,
φ(xi, yj) = φ(0, yj) + ih φx(0, yj) +(ih)2
2φxx(0, yj) + O(h3)
hence our desired approximation for the third order WENO scheme is
φi,j = φ(0, yj) + ih φx(0, yj) +(ih)2
2φxx(0, yj).
We already have φ(0, yj) = g(yj). The Eikonal PDE, evaluated at the
point (0, yj), becomes
H(φx(0, yj), g′(yj)) = f(0, yj) (14)
in which the only unknown quantity is φx(0, yj). Solving this (usually
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
nonlinear) equation should give us φx(0, yj). There might be more than
one root, in which case we should choose the root so that
∂uH(φx(0, yj), g′(yj)) > 0 (15)
where ∂u refers to the partial derivative with respect to the first argument
in H(u, v). The condition (15) guarantees that the boundary Γ in (13) is
an inflow boundary. If the condition (15) still cannot pin down a root, then
we would choose the root which is closest to the value from the first order
fast sweeping solution at the same grid point. To obtain φxx(0, yj), we
first take the derivative with respect to y on the original PDE, and then
evaluate it at the the point (0, yj), which yields
∂uH(φx(0, yj), g′(yj))φxy(0, yj)+∂vH(φx(0, yj), g
′(yj))g′′(yj) = fy(0, yj),
(16)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
where ∂u and ∂v refer to the partial derivatives with respect to the first and
second arguments in H(u, v), respectively. In this equation the only
unknown quantity is φxy(0, yj), hence we obtain easily its value, thanks
to (15). We then take the derivative with respect to x on the original PDE,
and evaluate it at the the point (0, yj) to obtain
∂uH(φx(0, yj), g′(yj))φxx(0, yj)+∂vH(φx(0, yj), g
′(yj))φxy(0, yj) = fx(0, yj),
This time, the only unknown quantity is φxx(0, yj), which we can obtain
readily from this equality.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
It is clear that this procedure can be carried out to any desired order of
accuracy. Also, the inflow boundary Γ in (13) can be any piece of a
smooth curve: we only need to change the x and y partial derivatives to
normal and tangential derivatives with respect to Γ. However, for this
approach to work, Γ can not consist of a single point.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Numerical examples
Example 1. We solve the Eikonal equation with
f(x, y) =π
2
√
sin2(π
2x)
+ sin2(π
2y)
.
The inflow boundary Γ is the single point (0,0). The computational domain
is [−1, 1]2. The exact solution for this problem is
φ(x, y) = − cos(π
2x)
− cos(π
2y)
.
Since the inflow boundary Γ consists of a single point, the second strategy
described above does not apply. We use the first strategy described above
to handle the inflow boundary condition. Namely, in the small box
[−2h, 2h]2, we apply the first order fast sweeping method with three
different mesh sizes h, h/2 and h/4, and then use the Richardson
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
extrapolation (12) to obtain a third order approximation to the grid values
φi,j in this small box, which are then fixed as the initial values during the
third order fast sweeping WENO process. Notice that this process has
very little computational cost since the box [−2h, 2h]2 is very small. For
the outflow boundary, which is the boundary of the box [−1, 1]2, we take a
simple third order extrapolation to provide solution values in the ghost
points outside the computational domain. The The results are given in
Table 1. We can see clearly that the scheme with the numerical boundary
treatment gives the correct order of accuracy.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Table 1: Example 1. Richardson extrapolation for the inflow boundary. N
is the number of mesh points in each direction.
N L1 error order L∞ order iteration number
40 8.00E-04 6.36E-04 40
80 5.92E-05 3.76 3.33E-05 4.25 30
160 3.64E-06 4.02 1.54E-06 4.44 38
320 4.00E-07 3.19 1.58E-07 3.28 50
640 4.98E-08 3.00 2.02E-08 2.97 81
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Example 2 (shape-from-shading). We solve the Eikonal equation with
case (a): f(x, y) =√
(1 − |x|)2 + (1 − |y|)2; (17)
case (b): f(x, y) = 2√
y2(1 − x2)2 + x2(1 − y2)2. (18)
The computational domain Ω = [−1, 1]2. The inflow boundary for this
example is the whole boundary of the box [−1, 1]2, namely
Γ = (x, y) : |x| = 1 or |y| = 1. The boundary condition
φ(x, y) = 0 is prescribed on Γ. The exact solutions for these two cases
are given by
case (a): φ(x, y) = (1 − |x|)(1 − |y|); (19)
case (b): φ(x, y) = (1 − x2)(1 − y2). (20)
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
For this example, we can apply both of the strategies described above. We
first apply the Richardson extrapolation strategy for the points inside the
computational domain which are of distance at most 2h away from the
inflow boundary Γ, using the results of the first order fast sweeping
method with three different mesh sizes h, h/2 and h/4. The results are
given in Table 2. We can again see clearly that the scheme with this
numerical boundary treatment gives the correct order of accuracy.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Table 2: Example 2. Richardson extrapolation for the inflow boundary. N
is the number of mesh points in each direction.
N L1 error order iter L1 error order iter
case (a) case (b)
80 3.45E-06 21 3.38E-05 35
160 3.04E-07 3.51 28 3.44E-06 3.30 50
320 2.58E-08 3.56 46 2.23E-07 3.95 81
640 2.14E-09 3.59 81 9.25E-09 4.59 149
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Next, we apply the Lax-Wendroff type procedure to obtain third order
approximations to the values of the numerical solution corresponding to
the points inside the computational domain which are of distance at most
2h away from the inflow boundary Γ. The results are given in Table 3.
This time, since the solution is a polynomial of degree lower than the order
of the scheme, we are able to obtain the exact solution with only round-off
errors, as the Lax-Wendroff type procedure is able to prescribe the values
to the points inside the computational domain which are of distance at
most 2h away from the inflow boundary Γ exactly by Taylor expansion.
We remark that the first strategy of using the Richardson extrapolation is
not able to provide the solution values to the points inside the
computational domain which are of distance at most 2h away from the
inflow boundary Γ exactly, but only to the designed third order accuracy,
hence the final fast sweeping WENO results in Table 2 are also only high
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
order accurate but not exact to round-off errors.
Table 3: Example 2. Lax-Wendroff type procedure for the inflow boundary.
N is the number of mesh points in each direction.
N L1 error L∞ iter L1 error L∞ iter
case (a) case (b)
80 2.06E-14 9.26E-13 1 8.64E-07 9.99E-04 35
160 1.58E-14 2.34E-12 1 5.25E-08 2.34E-04 47
320 1.09E-14 5.49E-12 1 4.43E-15 4.26E-12 62
640 1.01E-14 1.08E-11 2 1.41E-15 1.14E-12 90
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Example 3. We solve the Eikonal equation with f(x, y) = 1. The
computational domain is [−1, 1]2, and the inflow boundary Γ is the unit
circle of center (0,0) and radius 0.5, that is
Γ =
(x, y) : x2 + y2 =1
4
.
The boundary condition φ(x, y) = 0 is prescribed on Γ. The exact
solution for this problem is the distance function to the circle Γ. This exact
solution has a singularity at the center of the circle to which the
characteristics converge, hence we exclude the box [−0.15, 0.15]2 when
measuring the errors.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
For this problem, it is not easy to apply the Richardson extrapolation
strategy, since we use rectangular meshes and the inflow boundary Γ is
not on grid points. However, the Lax-Wendroff type procedure can be
easily used to obtain the values of the numerical solution corresponding to
the points inside the computational domain which have a horizontal or
vertical distance less than 3h from the inflow boundary Γ. For the outflow
boundary, which is the boundary of the box [−1, 1]2, we take a simple
third order extrapolation to provide solution values in the ghost points
outside the computational domain. The results are given in Table 4. We
can see happily again that the scheme with this numerical boundary
treatment gives the correct order of accuracy away from the singularity at
the center.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Table 4: Example 3. Lax-Wendroff type procedure for the inflow boundary.
N is the number of mesh points in each direction. The errors are measured
in the computational domain but outside the box [−0.15, 0.15]2.
N L1 error order L∞ order iteration number
80 0.573E-05 0.129E-03 25
160 0.122E-05 2.23 0.407E-05 4.98 32
320 0.191E-06 2.68 0.122E-05 1.74 46
640 0.246E-07 2.95 0.161E-06 2.92 62
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Example 4. We solve the Eikonal equation with f(x, y) = 1. The
computational domain is [−3, 3]2, and the inflow boundary Γ consists of
two circles of equal radius 0.5 with centers located at (−1, 0) and
(√
1.5, 0), respectively, that is
Γ =
(x, y) : (x + 1)2 + y2 =1
4or (x −
√1.5)2 + y2 =
1
4
.
The boundary condition φ(x, y) = 0 is prescribed on Γ. The exact
solution for this problem is the distance function to Γ. The exact solution
for this problem is the distance function to the circle Γ. This exact solution
has singularities at the centers of the circles and on the line that has the
same distance to the two circles, on which the characteristics converge,
hence we exclude the boxes [−1.15, −0.85] × [−0.15, 0.15],
[√
1.5 − 0.15,√
1.5 + 0.15] × [−0.15, 0.15] and
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
[√
0.375 − 0.65,√
0.375 − 0.35] × [−3, 3] when measuring the
errors. Again, for this problem, it is not easy to apply the Richardson
extrapolation strategy, since we use rectangular meshes and the inflow
boundary Γ is not on grid points. However, the Lax-Wendroff type
procedure can again be easily used to obtain the values of the numerical
solution corresponding to the points inside the computational domain
which have a horizontal or vertical distance less than 3h from the inflow
boundary Γ. For the outflow boundary, which is the boundary of the box
[−3, 3]2, we take a simple third order extrapolation to provide solution
values in the ghost points outside the computational domain. The results
are given in Table 5. We can see happily again that the scheme with this
numerical boundary treatment gives the correct order of accuracy away
from the singularities.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
Table 5: Example 4. Lax-Wendroff type procedure for the inflow boundary.
N is the number of mesh points in each direction. The errors are measured
in the computational domain but outside the boxes [−1.15, −0.85] ×[−0.15, 0.15], [
√1.5 − 0.15,
√1.5 + 0.15] × [−0.15, 0.15] and
[√
0.375 − 0.65,√
0.375 − 0.35] × [−3, 3].
N L1 error order L∞ order iteration number
80 0.569E-02 0.274E-02 38
160 0.346E-03 4.04 0.766E-03 1.84 47
320 0.240E-04 3.85 0.294E-04 4.71 47
640 0.470E-05 2.35 0.336E-05 3.13 67
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
References for the second lecture:
[1] R. Abgrall, On essentially non-oscillatory schemes on unstructured
meshes: analysis and implementation, Journal of Computational Physics,
v114 (1994), pp.45-54.
[2] M. Boue and P. Dupuis, Markov chain approximations for deterministic
control problems with affine dynamics and quadratic cost in the control,
SIAM Journal on Numerical Analysis, v36 (1999), pp.667-695.
[3] G. Jiang and D.P. Peng, Weighted ENO schemes for Hamilton-Jacobi
equations, SIAM Journal on Scientific Computing, v21 (2000),
pp.2126-2143.
[4] G. Jiang and C.-W. Shu, Efficient implementation of weighted ENO
schemes, Journal of Computational Physics, v126 (1996), pp.202-228.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
[5] L. Huang, C.-W. Shu and M. Zhang, Numerical boundary conditions for
the fast sweeping high order WENO methods for solving the Eikonal
equation, Journal of Computational Mathematics, v26 (2008), pp.336-346.
[6] S. Osher and C.-W. Shu, High-order essentially nonoscillatory schemes
for Hamilton-Jacobi equations, SIAM Journal on Numerical Analysis, 28
(1991), 907-922.
[7] C.-W. Shu, High order numerical methods for time dependent
Hamilton-Jacobi equations, in Mathematics and Computation in Imaging
Science and Information Processing, S.S. Goh, A. Ron and Z. Shen,
Editors, Lecture Notes Series, Institute for Mathematical Sciences,
National University of Singapore, volume 11, World Scientific Press,
Singapore, 2007, pp.47-91.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
[8] Y.-T. Zhang and C.-W. Shu, High-order WENO schemes for
Hamilton-Jacobi equations on triangular meshes, SIAM Journal on
Scientific Computing, v24 (2003), pp.1005-1030.
[9] Y.-T. Zhang, H.-K. Zhao and J. Qian, High order fast sweeping methods
for static Hamilton-Jacobi equations, Journal of Scientific Computing, v29
(2006), pp.25-56.
[10] H.-K. Zhao, A fast sweeping method for Eikonal equations,
Mathematics of Computation, v74 (2005), pp.603-627.
Division of Applied Mathematics, Brown University
FINITE DIFFERENCE METHODS FOR HAMILTON-JACOBI EQUATIONS II
The End
THANK YOU!
Division of Applied Mathematics, Brown University