Download - Expfast Bit
-
8/3/2019 Expfast Bit
1/24
BIT manuscript No.(will be inserted by the editor)
A quadrature based method for evaluating the
exponential-type functions for exponential methods
Mara Lopez-Fernandez
Received: date / Accepted: date
Abstract We present a quadrature-based method to evaluate the exponential-like op-
erators required by different kinds of exponential integrators. The method approxi-mates these operators by means of a quadrature formula that converges like O(ecK),with K the number of quadrature nodes, and it is useful when solving parabolic equa-
tions. The approach allows also the evaluation of the associated scalar mappings. The
method is based on the numerical inversion of sectorial Laplace transforms. Several
numerical illustrations are provided to test the algorithm, including examples with a
mass matrix and the application of the method inside the MATLAB package EXP4,
an adaptive solver based on an exponential RungeKutta method.
Keywords exponential methods numerical inverse Laplace transform parabolicequations
Mathematics Subject Classification (2000) 65M70 65R10
1 Introduction
The good numerical results obtained from the application of exponential methods
to the time integration of stiff semilinear problems, have motivated much interest
on these kind of methods during the last years, see for instance [13,1012]. The
problems under consideration can be written in the abstract format
u(t) = Au(t) + f(t, u(t)), u(0) = u0, 0 t T, (1.1)
Supported by DGI-MCYT under projects MTM 2008-03541 and MTM 2007-63257, cofinanced by
FEDER funds, and the SIMUMAT project S-0505/ESP/0158 of the Council of Education of the Regional
Government of Madrid (Spain).
M. Lopez-Fernandez
Instituto de Ciencias Matematicas (CSIC-UAM-UC3M-UCM), Serrano 123, 28006 Madrid, Spain. E-
mail: [email protected]
-
8/3/2019 Expfast Bit
2/24
2 Mara Lopez-Fernandez
where A is a linear operator representing the highest order differential terms and f
is a lower order nonlinear operator. The solution to the initial value problem (1.1) is
then given by the variation of constants formula and most of the exponential methods
considered in the literature are constructed from this representation of the solution.
Let us consider for instance the family of multistep exponential methods de-veloped in [2]. Given a stepsize h > 0, n 0 and approximations un+j u(tn+j),tn+j = (n + j)h, 0 j k1, the k-step method approximates the solution u of (1.1)at tn+k = (n + k)h by
un+k = 0(k, hA)un + hk1j=0
j+1(k, hA)jfn, (1.2)
where fn = f(tn, un), denotes the standard forward difference operator, and forC and k 1,
0(k,) = ek, j(k,) =
k
0
e(k)
j1 d, 1 j k. (1.3)As we can see in (1.2), these methods require the evaluation ofj(k, hA), 0 j k,for j(k,) defined in (1.3). This is in fact the main difficulty in the implementationof the methods in (1.2) and, in general, of exponential methods, since they typically
require the evaluation of vector-valued mappings (hA), with h the time step in thediscretization and either
() = em, C, (1.4)
or
() =
m0
e(m)p() d, (1.5)
with m an integer and p() a polynomial. The values of m and p in (1.5) depend onthe method. For instance, in the case of the methods in (1.2), it is clear from (1.3) that
m = k, the number of steps of the method, and
p() =
j1
=(1) . . . ( j + 2)
(j1)!, 1 j k.
If we consider instead the explicit exponential RungeKutta methods in [11], then it
is m = 1 and
p() =k1
(k1)!, k 1,
as we show in Section 2.1.
In the present paper we propose a way to evaluate the operators (hA) in (1.4)and (1.5) when A in (1.1) is the infinitesimal generator of an analytic semigroup in
a Banach space X. Thus, we will assume that A : D(A) XX is sectorial, i.e., A
is a densely defined and closed linear operator on X and there exist constants M> 0,R, and an angle 0 < <
2, such that the resolvent fulfils
(zIA)1 M
|z |, for |arg(z )| < . (1.6)
-
8/3/2019 Expfast Bit
3/24
A quadrature method for evaluating exponential-type functions 3
In all our examples, A will be in practice a discrete version of a sectorial operator, i.
e., a matrix arising after the spatial semidiscretization of (1.1) by a certain numerical
method.
The approach we follow in the present paper is based on a suitable contour inte-
gral representation of the mappings (hA) and it is related with the method in [12].More precisely, the contour integral representation in [12] is given by the Cauchy in-tegral formula. The goal is both the evaluation of the mappings (h) at scalar level,assuming that a diagonalization of A is available, but also at operator/matrix level
for non diagonal matrices, working with the full matrix A. However, despite the good
computational results reported in [12], the way of selecting the parameters involved in
the quadrature formulas is not very much clear and they depend very strongly on the
equation considered and the spatial discretization parameters. Alternatively, the algo-
rithm we propose is derived by using Laplace transformation formulas. Our method
is finally based on another contour integral representation of the (hA). However,our quadrature formulas borrow their parameters from the inversion method of sec-
torial Laplace transforms developed in [16], where a rigorous analysis of the error is
performed together with an optimization process to choose the different parameters
involved in the approximation. Thus, for sectorial operators A our approach seems toprovide a more natural selection of the quadrature parameters, it is more accurate and
is much less problem-dependent, since the quadrature parameters depend only on the
sectorial width in (1.6). For a comparison with the approach in [12] we refer toSection 6.1.
In order to apply the quadrature formulas developed in [16], we derive a represen-
tation of the operators in (1.4) and (1.5) as the inverses of suitable Laplace transforms
(z, hA) at certain values of the original variable . These Laplace transforms haveall the form
(z, hA) = R(z)(zIhA)1, (1.7)
with R(z) a scalar rational mapping of z C. Due to (1.6), the mappings (z, hA)turn out to be sectorial in the variable z, i.e., there exist constants R and M > 0,
possibly different from the constants in (1.6), such that
(z, hA) is analytic for z in the sector |arg(z )| < and there
(z, hA) M
|z |, for some 1.
(1.8)
In this way, we reduce the problem of computing (hA) to the inversion of a sectorialLaplace transform (z, hA) of the form (1.7). We then use the inversion method in[16], which consists on a special quadrature to discretize the inversion formula for
the Laplace transform. Thus, we finally approximate
(hA) K
=K
wemz(z, hA) =
K
=K
wemzR(z)(zIhA)
1, (1.9)
with the quadrature weights w and nodes z given in (2.8). The convergence results
in [16] assure an error estimate in the approximation (1.9) like O(ecK). Further,by following this approach, our selection of the parameters in the implementation of
-
8/3/2019 Expfast Bit
4/24
4 Mara Lopez-Fernandez
exponential methods will depend only on in (1.6), being independent ofh and M. Inthe particular case that we want to evaluate at a scalar in the sector |arg()| , the approximation becomes simply
()
K=K
wemz(z,) =
K=K
wemzR(z
)
z.(1.10)
The contour integral representation of the mappings given by the inversionformula of the Laplace transform (see (2.5)) can be used at different levels:
(i) At operator/matrix level it allows pre-computing all the required (hA) by anexponential method before the time-stepping begins. Thus, only the products
matrix vector need to be carried out at every time step. Moreover, this algo-rithm allows parallelism both to compute the inverses (zIhA)
1 for different
z, and to implement (1.9) for the different required.The main drawback at this level is that, even if A is a large sparse matrix and
the inverses (zIhA)1 can be efficiently computed, the storage of the resulting
full matrices (hA) and the subsequent products matrix vector can becomeprohibitive for large problems. For this reason, we consider that the representationat this level makes sense only for moderate size problems, specially if they are
described by a full matrix A. This is the case in the example given in Section 6.1,
where a Chebychev collocation method is applied for the spatial discretization of
the 1D Allen-Cahn equation. It is also the case in the 2D examples of Section 6.2,
where spatial discretizations by the finite element method are considered. Let us
also notice that so far we did not have knowledge of the application of exponential
methods to problems with a mass matrix.
(ii) At vector level, our approach is useful to compute products of the form (hA)v,for a given vector v. For problems with a large sparse matrix, it can be used in
combination with Krylov subspace approximations. In this situation
(A)v Vm(Hm)e1 v2, (1.11)
where Vm contains the Arnoldi or Lanczos basis of the mth Krylov subspace with
respect to A, v and , Hm is a much smaller matrix than A, and e1 is the m-dimensional unit vector. We can apply (1.9) to evaluate the products (Hm)e1.Then, we do not compute the full inverses (zI Hm)
1 for every , but solvethe linear systems
(zIHm)x = e1. (1.12)
In Section 7 we provide an example of this application inside the MATLAB
package EXP4, which implements a variable step size exponential Runge-Kutta
method by using Krylov techniques [9]. In this case, our approach is to be com-
pared with Pade approximants, also used for instance in [1]. The work-efficiency
diagrams in this context are very much the same with both techniques, but our
approach is easier to program. Moreover, we think that it can be more easily ex-
tended to the implementation of other exponential solvers, since it uses no recur-
rences, neither to evaluate differentmappings nor to evaluate(jhA), j = 1, . . . ,from (hA).
-
8/3/2019 Expfast Bit
5/24
A quadrature method for evaluating exponential-type functions 5
(iii) At scalar level, we can apply (1.9) to compute (), C. The evaluation of thescalars () is itself a well-known problem in numerical analysis, as exemplifiedin [12] with the mapping
() =e1
. (1.13)
On the one hand, the evaluation of for small by using formula (1.13) suffersfrom cancellation error. On the other hand, the use of a truncated Taylor expansion
only works well for small enough . Thus, there are some intermediate values of for which the choice of the proper formula is not very much clear, leading toa lost of accuracy. For inside a sector |arg( )| , these difficultiescan be overcome by writing in the format (1.5), with m = 1 and p() = 1.By doing so, we will be able to evaluate (), independently of the size of, byusing essentially the same technique developed in principle to evaluate the vector-
valued mapping (hA). Actually, in Section 4 we derive a formula to evaluate(), too.
Let us notice that for problems with a large sparse matrix, the use of (1.9) could
be combined with a data sparse procedure to approximate the resolvent operators, as
it is proposed in [4,5]. We did not test this approach in the present paper, but follow
the Krylov subspace approximation mentioned in paragraph (ii).
By using (1.9) we are in fact computing an approximation to the numerical solu-
tion of (1.1) provided by an exponential method. Thus, the global error after applying
(1.9) to the time integration of (1.1) can be split into the error in the time integra-
tion by the pure exponential method and the deviation from the numerical solution
introduced by the approximation (1.9) of the operators (hA). The error in the timeintegration for the exponential integrators considered in the present paper is analyzed
in [2] and [11] (see Section 2.1), and the quadrature error is analyzed in [16] (see
Section 2.2, Theorem 2.1). In order to visualize the effect of this approximation, we
show in Section 5 the performance of our implementation for several problems with
known exact solution and moderate size after the spatial discretization. In the errorplots provided we can observe that the error coincides with the expected error for the
exact exponential integrators up to high accuracy for quite moderate values of K in
(1.9), i.e., the error induced by the quadrature (1.9) is negligible compared with the
error in the time integration.
Finally, we notice that the matrix exponential etA and also certain rational appro-
ximations to it originating from RungeKutta schemes have already been successfully
approximated by using this approach [13,15, 16].
The paper is organized as follows. In Section 2.1 we briefly review the class
of multistep exponential methods proposed in [2] and the exponential RungeKutta
methods in [11]. Section 2.2 is devoted to the inversion method of sectorial Laplace
transforms in [16]. In Section 3 we deduce a representation of the operators required
in the implementation of these exponential integrators in terms of suitable Laplace
transforms. We consider with some detail in Section 4 the evaluation of the associated
mappings at scalar level and present some numerical results. We test our algorithm at
matrix level with several academic examples present in the related literature in Sec-
tion 5. In Section 6 we apply our method, also at matrix level, to examples governed
-
8/3/2019 Expfast Bit
6/24
6 Mara Lopez-Fernandez
by a full matrix. Finally, in Section 7, we use our quadratures at vector level as an
auxiliary tool inside the MATLAB package EXP4.
2 Preliminaries
2.1 Exponential methods
In this section we briefly review the exponential multistep methods of [2] and the
exponential RungeKutta methods of [11], all of them explicit.
The multistep exponential methods developed in [2] are constructed for the time
integration of problems of the form (1.1), with A : D(A) XX the infinitesimalgenerator of a C0-semigroup in a Banach space X. As we already mentioned in the In-
troduction, given k 1 and approximations un+j u(tn+j), 0 j k1, the k-stepmethod computes un+k from formula (1.2). Under quite general assumptions about
the nonlinearity f(t, u(t)) and the starting values u0, . . . , uk1, it is shown in [2, The-orem 1] that the method defined in (1.2) exhibits full order k. The approach proposed
in the present paper is useful to evaluate j(k, hA) for the mappings j(k,) definedin (1.3), provided that the operator A is the infinitesimal generator of an analytic
semigroup.
Concerning the exponential RungeKutta methods presented in [11], they are
more particularly designed for the time integration of semilinear parabolic problems.
For h = T/N, N 1, and 1 i s, the approximations un to u(tn), with tn = nh, aregiven by
Uni = ecihAun + h
i1j=1
ai j(hA)f(tn + cjh,Un j),
un+1 = ehAun + h
s
i=1bi(hA)f(tn + cih,Uni),
(2.1)
with c1 = 0 (Un1 = un). In (2.1), the coefficients bi() and ai j() are linear combi-nations ofk() and k(cl) with
k() =
10
e(1)k1
(k1)!d, C, k 1. (2.2)
Setting 0() = e, we see that the implementation of (2.1) requires the evaluation
ofk(hA) and k(cl hA), for 1 l s and several values ofk 0. Assuming that thesolution u and the nonlinearity f are sufficiently smooth, stiff order conditions are de-
rived in [11] and exponential RungeKutta methods of the form (2.1) are constructed
up to order four.
2.2 The numerical inversion of sectorial Laplace transforms
In this section we review the numerical inversion method for sectorial Laplace trans-
forms presented in [16], which is a further development of [15].
-
8/3/2019 Expfast Bit
7/24
A quadrature method for evaluating exponential-type functions 7
P
T(P)
Fig. 2.1 Action ofT in (2.6) on the real axis
For a locally integrable mapping f : (0,) X, bounded by
f(t) Ct1et, for some R, > 0, (2.3)
we denote its Laplace transform
F(z) = L[f](z) =
0
etzf(t) dt, Rez > . (2.4)
When F satisfies (1.8), the method in [16] allows to approximate the values of f
from few evaluations of F. This is achieved by means of a suitable quadrature rule to
discretize the inversion formula
f(t) =1
2i
eztF(z) dz, (2.5)
where is a contour in the complex plane, running from i to i and laying inthe analyticity region of F. Due to (1.8), can be taken so that it begins and ends inthe half plane Rez < 0. Following [16], in (2.5) we choose as the left branch of ahyperbola parameterized by
R : x T(x) = (1 sin(+ ix)) + , (2.6)
where > 0 is a scale parameter, is the shift in (1.8), and 0 < < 2 . Thus,
is the left branch of the hyperbola with center at (, 0), foci at (0, 0), (2, 0), andwith asymptotes forming angles (/2 +) with the real axis, so that remains inthe sector of analyticity ofF, |arg(z )| < . In Figure 2.1 we show the actionof the conformal mapping T on the real axis.
After parameterizing (2.5), the function f is approximated by applying the trun-
cated trapezoidal rule to the resulting integral along the real axis, i.e.,
f(t) =1
2i
etz F(z) dz K
=K
w etz F(z), (2.7)
-
8/3/2019 Expfast Bit
8/24
8 Mara Lopez-Fernandez
with quadrature weights w and nodes z given by
w =
2iT() , z = T(), K K, (2.8)
and > 0 a suitable step length parameter. We notice that the minus sign in the for-mula for the weights comes from setting the proper orientation in the parametrization
of. In case of symmetry, the sum in (2.7) can be halved to
f(t) Re
K
=0
w etz F(z)
, (2.9)
with w0 = w0 and w = 2w
, 1. The good behavior of the quadrature formula
(2.7) is due to the good properties of the trapezoidal rule when the integrand can be
analytically extended to a horizontal strip around the real axis [20,21].
During the last years, different choices of contours and parameterizations havebeen studied for the numerical inversion of sectorial Laplace transforms. Apart from
the approach in [15,16], which is the one we follow, the choice of a hyperbola hasbeen studied in [4,5,17,19,24]. The choice of as a parabola has been consideredrecently in [4,5,24] and we refer also to Talbots method [22,23] for another kind
of integration contour , with horizontal asymptotes as |z| . Our choice of thehyperbola (2.6) relies on the fact that it seems to be the best one to approximate f(t)uniformly for t [t0, t0], 1, with the same evaluations of F(z). It also seemsto be the best choice with respect to in (2.2), it allows full control of round-offerrors amplification and the optimization routine to select the parameters involved
in the quadrature formula is also quite simple. Finally, the hyperbolas have already
been applied with success in a variety of situations, such as the fast algorithms for
convolution quadratures in [13,14,18].
We refer to [15,16] for details in the proof of the following convergence result.
Theorem 2.1 [16] Assume that the Laplace transform F(z) satisfies the sectorialcondition (1.8) and letand d be such that
0 < d < + d 0, 1 and K 1, we select the parameters
=a()
K, =
2dK(1)
t0a(), (2.11)
where, for (0, 1), a() is the mapping
a() = arccosh
(1) sin
, (2.12)
and
= min(0,1)
e2dK(1)/a() + e2dK/a()
, (2.13)
-
8/3/2019 Expfast Bit
9/24
A quadrature method for evaluating exponential-type functions 9
for the precision in the evaluations of the Laplace transform F and the elementaryoperations in (2.7).
Then, there exist positive C, c, such that the error EK(t) in the approximation (2.7)to f(t) with quadrature weights and nodes in (2.8) is bounded by
EK(t) C t1+ ecK
, (2.14)
uniformly for t [t0, t0], where is the exponent in (1.8).
In case we do not have any reliable information about the errors in the compu-
tation of the matrices (zI hA)1, we cannot use formula (2.13). In this situation,setting = 1 1/K instead of in (2.11) still guarantees the control of round-offerrors, but we only can assure an error bound like O(+ ecK/ ln K). In all our experi-ments in Section 5 we used (2.11) with = 1015.
3 Evaluation of the vector-valued mappings
In this section we apply some Laplace transformation formulas to obtain a suitable
representation of the operators j(k, hA), j(hA), and j(cl hA) required in (1.2) and(2.1).
Let us denote the Laplace transform of a mapping f() by F(z) = L[f](z), andthe inverse Laplace transform by f() = L1[F]().
3.1 Evaluation of the mappings required by the multistep methods
For j in (1.3) with 1 j k, it holds
j
(k,) = k0
e(k)j d= L1[L[f
0(,)]L[f
j]](k),
where, for > 0,
f0(,) = e and fj() =
j
. (3.1)
For every j 1 and z C, we define
j(z,) = L[f0(,)](z)L[fj](z) =1
zL[fj](z). (3.2)
Then, for every C and j 1,
j(k,) = L1
[j(,)](k). (3.3)
For j = 0
0(k,) = ek = L1
1
(k),
-
8/3/2019 Expfast Bit
10/24
10 Mara Lopez-Fernandez
and thus we define
0(z,) =1
z. (3.4)
For scalar, the mappings j(z,), with 1 j 4 are given by
1(z,) =1
z(z), 2(z,) =
1
z2(z),
3(z,) =2z
2z3(z), 4(z,) =
33z +z2
3z4(z).
(3.5)
In order to evaluate j(k, hA), 0 j 4, we propose to use the formulas in (3.5)with hA instead of and perform the inversion of the Laplace transform to approxi-mate the original mappings at = k. In this way, the Laplace transforms we need toinvert are:
0(z, hA) = (zIhA)1,
1(z, hA) =1
z
(zIhA)1,
2(z, hA) =1
z2(zIhA)1,
3(z, hA) =2z
2z3(zIhA)1,
4(z, hA) =33z +z2
3z4(zIhA)1.
(3.6)
Although the formulas in (3.6) are derived just formally, we notice that they can be
justified by combining the Cauchy integral formula with the inversion formula for
the Laplace transform. More precisely, for suitable contours 1 and 2 in the complexplane, both laying in the resolvent set of A, it holds
j(k, hA) =1
2i
1
j(k,)(IhA)1 d
=1
2i
1
1
2i
2
ekj( ,) d
(IhA)1 d
=1
2i
2
ek
1
2i
1
j( ,)(IhA)1 d
d
=1
2i
2
ekj( , hA) d = L1[j(, hA)](k).
(3.7)
Due to (1.6), all the Laplace transforms j(k, hA) in (3.6) are sectorial, since theysatisfy (1.8) with = max{0,} and = , for and in (1.6). We notice that, forall j, the resulting bounds in (1.8) are independent of h.
Thus, we can compute the operators j(k, hA), 0 j k, by using the methoddescribed in Section 2.2 to compute the inverse Laplace transforms of the mappings
j(z, hA) in (3.2). We notice that the inverse Laplace transforms need to be approx-imated only at the fixed value = k, which is specially favorable for the application
-
8/3/2019 Expfast Bit
11/24
A quadrature method for evaluating exponential-type functions 11
of the inversion method (see the bound in Theorem 2.1). Then, we set = 1, t0 = k,and select the parameters and following Theorem 2.1. The selection of and dis more heuristic and a good choice is 12 (
2 ) and d slighly smaller than .
For example, if= 0 in (1.8), good values are around = 0.7 and d = 0.6. Next,
we compute the quadrature weights w and nodes z in (2.8) and approximate theoperators in (1.2) by
j(k, hA) K
=K
wekzj(z, hA). (3.8)
The sum in (3.8) can be halved in case of symmetry like in (2.9).
As we already mentioned in the Introduction, the computation of all the required
operators j(k, hA), 0 j k, can be carried out before the time stepping of theexponential method begins. Thus, if we use the method of lines and apply the expo-
nential method to some spatial discretization of (1.1), only the matrix-vector products
in (1.2) need to be computed at every time step.
3.2 Evaluation of the mappings required by the RungeKutta methods
For j in (2.2), j 1 and t > 0, we have
j() =
10
e(1)j1
(j1)!d= L1[L[g0(,)]L[gj]](1),
where, for > 0 and C,
g0(,) = e and gj() =
j1
(j1)!. (3.9)
For every j 1 and z C, we define
j(z,) = L[g0(,)](z)L[gj](z) =1
zj(z)(3.10)
and0(z,) = (z)1. Then, for every C and j 0,
j() = L1[j(,)](1). (3.11)
The same argument as in (3.7) justifies the computation of the operators j(hA)and j(cl hA), j 0, 2 l s, by performing the inversion of the Laplace transforms
j(z,hA) =1
zj(zIhA)1, j 0, = 1, cl , (3.12)
to approximate the original mappings at = 1. If (1.6) holds, the Laplace transformsin (3.12) are also the sectorial in the sense of (1.8) and we can use the inversion
method of [16].
As in the case of the methods in (1.2), the computation of all the required oper-
ators j(hA) and j(cl hA), j 0, can be carried out before the time stepping of theexponential method begins.
-
8/3/2019 Expfast Bit
12/24
12 Mara Lopez-Fernandez
Remark 3.1 In general, we can always evaluate a mapping (hA) of the form of (1.5)by using the numerical inversion of the Laplace transform, just by noticing that (hA)is the inverse Laplace transform at = n of a mapping (z, hA) like in (1.7),
(z
,hA
) =R
(z
)(zI
hA)
1
,
with R(z) = L[p](z), a scalar rational function of z.
The above Remark implies that our algorithm can be used to implement other
kinds of exponential methods, different than those in [2,11], as long as they require
the evaluation of mappings of the form of (1.4) and (1.5).
4 Evaluation of the scalar mappings
As we already mentioned in the Introduction, we can also apply the inversion of the
Laplace transform to evaluate with accuracy the scalar mappings () in (1.5). In
this section we consider with some detail the evaluation of the mappings
gj(m,) =
m0
e(m)j1 d, j 1, m N, (4.1)
by means of the quadrature formula (1.10). The result provided by (1.10) does not
depend on the size of, but the formula is only useful in principle for values ofinside a sector of the form |arg( )| . However, using that
emg1(m,) = g1(m,), C, (4.2)
and
gj+1(m,) =
jgj(m,)mj
, j 1, m N
, (4.3)
it is easy to see by induction that, for m N and C,
emgj(m,) =
j=1
j11
(1)1mjg(m,), j 1. (4.4)
Thus, we can compute
gj(m,) = em
L1
Gj (,)
(m), (4.5)
with
Gj (z,) =1
zj(z)
j=1
j11
!(1)1(mz)j, j 1. (4.6)
which provides a stable formula to approximate gj(m,) for inside a propersector |arg( )| > and moderate size.
-
8/3/2019 Expfast Bit
13/24
A quadrature method for evaluating exponential-type functions 13
Table 4.1 Computation of() in (1.13) for [1, 1] by using formulas (2.7) and (4.2). We show theabsolute error obtained in MATLAB with K= 15 and K= 25.
< 0 K= 15 K= 25 K= 15 K= 25-1 1.5050e-12 1.3323e-15 1 1.5050e-12 3.3307e-15
-1e-1 1.5227e-12 3.2196e-15 1e-1 1.5227e-12 3.5527e-15
-1e-2 1.4243e-12 4.4409e-15 1e-2 1.4243e-12 4.6629e-15-1e-3 1.3750e-12 1.3323e-15 1e-3 1.3750e-12 1.3323e-15
-1e-4 1.3738e-12 1.7764e-15 1e-4 1.3738e-12 1.7764e-15
-1e-5 1.3747e-12 3.6637e-15 1e-5 1.3747e-12 3.7748e-15
-1e-6 1.3748e-12 3.6637e-15 1e-6 1.3748e-12 3.7748e-15
-1e-7 1.3695e-12 1.9984e-15 1e-7 1.3695e-12 1.9984e-15
-1e-8 1.3717e-12 1.1102e-16 1e-8 1.3717e-12 2.2204e-16
-1e-9 1.3715e-12 1.1102e-16 1e-9 1.3715e-12 0
-1e-10 1.3711e-12 0 1e-10 1.3711e-12 0
-1e-11 1.3711e-12 0 1e-11 1.3711e-12 0
-1 e- 12 1.371 5e-12 1.110 2e-16 1e-12 1.3 715e-12 0
-1e-13 1.3712e-12 0 1e-13 1.3712e-12 2.2204e-16
In Table 4.1 we show the error obtained in the evaluation of () = g1(1,)in (1.13) for different values of in the interval [1, 1]. For < 0, we applied theinversion formula (2.7) with t = 1 and
F(z) = G1(z,) =1
z(z), (4.7)
which, for these values of, fulfils (1.8) with = 0, = 0, and = 2. We assumedthat the evaluations of G1 can be carried out in MATLAB up to machine accuracy
and thus we set = 2.22041016. Then, we computed the quadrature weights andnodes in (2.8) following (2.11)(2.13) with = 1. Setting = 0.7 and d = 0.6, weobtained = 0.693, for K = 15, and = 0.793, for K = 25. In Table 4.1 we cansee that K = 25 is enough to attain almost the machine accuracy of MATLAB in theevaluations of(). For positive values of, we used (4.2) with m = 1.
5 Test with some academic examples
In this section we test our quadratures at matrix level with some of the examples
presented in [2] and [11]. For every of these examples the exact solution is known
and the convergence of the exponential methods considered is well understood.
5.1 Test for the multistep exponential methods
Our first example is the problem considered in [2]
ut(x, t) = uxx(x,t) +1
0
u(s, t) ds
ux(x,t) + g(x, t), (5.1)
for x [0, 1] and t [0, 1], subject to homogeneous Dirichlet boundary conditions andwith g(x, t) such that the exact solution to (5.1) is u(x, t) = x(1x)et
-
8/3/2019 Expfast Bit
14/24
14 Mara Lopez-Fernandez
103
102
101
100
1015
1010
105
100
dt
err
or
ExpS1ExpS2ExpS3ExpS4
103
102
101
100
1015
1010
105
100
dt
err
or
ExpS1ExpS2ExpS3ExpS4
Fig. 5.1 Error of exponential multistep methods (1.2) applied to (5.1), for k= 1, 2, 3, and 4. Left: WithK= 15 quadrature nodes on the hyperbolas, Right: With K= 25.
The spatial discretization of (5.1) is carried out by using standard finite differ-
ences with J= 512 spatial nodes, centered for the approximation of ux. The nonlocal
term is approximated by means of the composite Simpsons formula.To integrate in time the semidiscrete problem we use (1.2) with k= 1, 2, 3 and 4,
so that A is the (J1) (J1) matrix
A = J2tridiag ([1,2, 1]).
We approximate the matrices j(k, hA), 0 j k, required in (1.2) by applying thequadrature rule (3.8). To avoid an extra source of error, the initial values u1, . . . ,uk1are computed from the exact solution. In a less academic example, these values can be
computed by means of a one-step method of sufficiently high order or by performing
the fix point iteration proposed in [2].
In Figure 5.1 we show the error versus the stepsize at t= 1, measured in a discreteversion of the norm 1/2, for K = 15 and K = 25 in (3.8). We see that for K = 25the full precision is achieved for all the methods implemented; cf. [2, Section 6].
In Figure 5.1 we also show lines of slope 1, 2, 3 and 4, to visualize the order of
convergence.
5.2 Test for the exponential RungeKutta methods
Secondly, we consider the example from [11]
ut(x, t) = uxx(x,t) +1
1 + u(x,t)2+ g(x,t), (5.2)
for x [0, 1] and t [0, 1], subject to homogeneous Dirichlet boundary conditions andwith g(x, t) such that the exact solution to (5.2) is again u(x, t) = x(1x)et.
We discretize (5.2) in space by standard finite differences with J= 200 grid pointsand apply for the time integration some of the methods proposed in [11]. More pre-
cisely, following the notation
i = i(hA), and i,j = i,j(hA) = i(cjhA), 2 j s, (5.3)
-
8/3/2019 Expfast Bit
15/24
A quadrature method for evaluating exponential-type functions 15
we implemented (2.1) with s = 1, the second-order method
012
121,2
0 1
(5.4)
the third-order method
0
13
131,2
23
231,3
432,3
432,3
1 322 0
322
(5.5)
and the fourth-order one
0
1
2
1
21,212
121,3 2,3 2,3
1 1,4 22,4 2,4 2,412
121,5 2a5,2 a5,4 a5,2 a5,2 a5,4
1 32 + 43 0 0 2 + 43 42 83
(5.6)
with
a5,2 =1
22,5 3,4 +
1
42,4
1
23,5
and
a5,4 =
1
42,5 a5,2.
For the implementation of (5.4) we need to invert four different Laplace trans-
forms of the form of (3.12), to approximate 0
h2A
,0(hA), 1
h2A
, and 1(hA).The implementation of both (5.5) and (5.6) requires the inversion of eight Laplace
transforms.
In Figure 5.2 we show the error at t = 1 versus the stepsize, measured in themaximum norm. The expected order of convergence for this example is k for the k-
order method. In order to check our algorithm, we added lines with the corresponding
slopes in Figure 5.2. We can see that also for this kind of methods we attain full
precision for K= 25 in (3.8).
Let us notice that in the two examples presented so far the matrix operator A can
be easily diagonalized by means of fast Fourier techniques. It also turns out that all the
eigenvalues are well separated from 0, so that a direct evaluation of the mappingsat scalar level is neither a problem in these examples. Our aim so far was to test the
performance of the quadratures explained in Section 2.2 in the context of exponential
integrators. In the following sections we address more challenging problems.
-
8/3/2019 Expfast Bit
16/24
16 Mara Lopez-Fernandez
103
102
101
100
1015
1010
105
100
dt
err
or
ExpRK1ExpRK2ExpRK3ExpRK4
103
102
101
100
1015
1010
105
100
dt
err
or
ExpRK1ExpRK2ExpRK3ExpRK4
Fig. 5.2 Error of RungeKutta methods (1.2) with s = 1, (5.4), (5.5), and (5.6), applied to (5.2). Left: WithK= 15 quadrature nodes in (3.8), Right: With K= 25.
6 Examples with a full matrix
6.1 The 1D Allen-Cahn equation
The purpose of this section is to compare the performance of the quadratures pro-
posed in the present paper with the similar approach presented in [12]. Thus, we
consider the Allen-Cahn equation in 1D,
ut = uxx + uu3, x [1, 1], t > 0,
u(x, 0) = 0.53x + 0.47sin(1.5x), u(1,t) = 1, u(1, t) = 1.(6.1)
For = 0.01 and t [0, 70], we apply the four-order method (5.6) to a spatial semi-
discretization of (6.1) by an 80-point Chebychev spectral method. We compare theresults with those obtained by using the code provided in [12] for this problem,
which implements a time-differencing Runge-Kutta method of order four, too, called
ETDRK4 [3]. We compute the error against a reference solution obtained with 45
quadrature nodes and time step 3 105, half the smallest time step used to produceFigures 6.1 and 6.2.
As we can see in Figures 6.1 and 6.2, the quadratures used in [12] do not con-
verge for less than 20 quadrature nodes and do not provide similar results to those
obtained with our approach with less than 30 quadrature nodes. We consider that
these results are useful to compare the performance of the different quadratures used
to evaluate the exponential type mappings. They also show that method (5.6) with
our implementation performs better for (6.1) than ETDRK4 with the implementation
of [12].
In order to have a reference, we also added in Figure 6.2 the results obtained
with the MATLAB solver ode15s, an variable step size integrator for stiff problems.
It turns out that for the highest tolerance requirements, our implementation of (5.6)
performs similarly to ode15s, even though it is an explicit and fixed step size method.
-
8/3/2019 Expfast Bit
17/24
A quadrature method for evaluating exponential-type functions 17
104
102
100
102
1010
105
100
105
dt
err
or
ExpRKETDKT
104
102
100
102
1010
105
100
dt
err
or
ExpRKETDKT
104
102
100
102
108
106
104
102
100
dt
error
ExpRKETDKT
104
102
100
102
108
106
104
102
100
dt
error
ExpRKETDKT
Fig. 6.1 Relative error versus step size for (6.1) after applying our implementation of (5.6) (ExpRK) and
the code of [12](ETDKT), with the same number of quadrature nodes. In clockwisesense: K= 15, K= 20,K= 25, and K= 35.
6.2 Examples with a Mass Matrix in 2D
Our approach allows to apply exponential methods to problems with a mass matrix
arising after a spatial discretization by the finite element method of a parabolic PDE.In this situation, the semi-discrete version of (1.1) will be a system of ODEs
MU = SU+ F(U), M Mass Matrix, S Stiffness Matrix
Reformulating as
U = M1SU+M1F(U),
we can use formula (1.9) for A = M1S. Then, we can evaluate
0(hA) = exp(hA), 1(hA), . . .
by linear combinations of
(zIhA)1 = (zMhS)
1M,
for z on a hyperbola , = K, . . . , K.
-
8/3/2019 Expfast Bit
18/24
18 Mara Lopez-Fernandez
102
100
102
104
1010
105
100
105
cpu time (s)
err
or
ode15sExpRKETDKT
102
100
102
104
1010
105
100
cpu time (s)
err
or
ode15sExpRKETDKT
102
100
102
104
108
106
104
102
100
cpu time (s)
error
ode15sExpRKETDKT
102
100
102
104
108
106
104
102
100
cpu time (s)
error
ode15sExpRKETDKT
Fig. 6.2 Relative error versus CPU time for (6.1) after applying our implementation of (5.6) (ExpRK)
and the code of [12] (ETDKT), with different number of quadrature nodes. We also show the results with
ode15s. In clockwise sense: K= 15, K= 20, K= 25, and K= 35.
As a test of the computational efficiency of this approach, let us consider in the
first place the inhomogeneous heat equation on the unit square = (0, 1)2,
ut(t,x) = u(t,x) + f(x) for x ; t 0,u(t,x) = u(t,x) for x ; t 0,u(0,x) = 0,
(6.2)
where f is the indicator function of the rectangleR = [0.6, 0.8][0.2, 0.8]. We semidis-cretize (6.2) by linear finite elements on a triangular mesh with 542 triangles and 301
vertices, so that A = M1S is a full square matrix of dimension 301.Since this problem is linear and the inhomogeneous term is time independent, all
the Exponential RungeKutta methods coincide with the Exponential Euler method,
which is exact for (6.2) but errors in the evaluation of0(hA) and 1(hA) (followingthe notation of Section 2.1). Thus, for this example we are only interested in mea-
suring error with respect to the number of quadrature nodes versus CPU time, see
Figure 6.3. We computed the exact solution at t = 1 by applying again the numericalinversion of the Laplace transform, since
u(1,x) = L1[(zMS)1/z](1) f(x).
Another interesting feature of this example is how it illustrates the error ampli-
fication associated to exponential methods, a phenomenon already known (see for
-
8/3/2019 Expfast Bit
19/24
A quadrature method for evaluating exponential-type functions 19
102
100
102
104
1020
1015
1010
105
100
cpu time (s)
err
or
ode45ode15sExpRK1ExpRK2ExpRK3ExpRK4
104
102
100
1010
108
106
104
102
dt
err
or
ExpRK1ExpRK2ExpRK3ExpRK4
102
100
102
104
1020
1015
1010
105
100
cpu time (s)
error
ode45ode15s
ExpRK1ExpRK2ExpRK3ExpRK4
104
102
100
1014
1012
1010
108
dt
error
ExpRK1ExpRK2ExpRK3ExpRK4
Fig. 6.3 Left: Relative error versus CPU time for (6.2) after applying our implementation of the Expo-
nential RungeKutta Methods described in Section 2.1, with K= 10 (top) and K= 20 (botton) quadraturenodes. We also show the results with ode15s and ode45. Right: Error versus time step with K= 10 (top)and K= 20 (botton) quadrature nodes.
instance [1]). In this example, the only error amplification is the one in the evaluation
of the exponential type mappings. In fact, we can observe that from the biggest time
step all the exponential RungeKutta methods achieve the full precision allowed bythe number of quadrature nodes; then, this error grows as the time step is reduced. A
theoretical study of this phenomenon is beyond the scope of the present paper.
We finally consider the 2D Allen-Cahn equation in = (0, 1)2,
ut = u + uu3, for x ; t 0,
u(t,x) = u(t,x) for x ; t 0,u(0,x) = u0(x), for x ,
(6.3)
where, for d = x (3/4, 1/2)2, we define
u0(x) = 1 + cos(2d), ifd < 1/4, u0(x) = 0, elsewhere.
We apply the exponential Euler method, (5.4), (5.5), and (5.6) to the spatial semidis-
cretization of (6.3) by linear finite elements, for the same triangulation we used for
(6.2). In Figure 6.4, we show work-precision diagrams for = 0.1 and = 1 at t= 10.We also show the results obtained with ode15s.
-
8/3/2019 Expfast Bit
20/24
20 Mara Lopez-Fernandez
102
100
102
104
1015
1010
105
100
105
cpu time (s)
err
or
ode15sExpRK1ExpRK2ExpRK3ExpRK4
102
100
102
104
1010
105
100
105
1010
cpu time (s)
err
or
ode15sExpRK1ExpRK2ExpRK3ExpRK4
Fig. 6.4 Left: Relative error versus CPU time for (6.3) after applying our implementation of the Expo-
nential RungeKutta Methods described in Section 2.1 with K= 20. Left: = 0.1. Right: = 1. We alsoshow the results with ode15s.
7 Inside the package EXP4
In this section we apply our quadratures at vector level (see the Introduction), as a
tool inside the MATLAB package EXP4. EXP4 is an implementation of the adaptive
exponential integrator developed in [9]. This method is an embedded method based
on an exponential RungeKutta method of 7 stages, defined for general IVP of the
form
y = f(y), y(0) = y0. (7.1)
For A the jacobian of f, EXP4 requires, at every time step, the evaluation of( 13
hA)v,
( 23
hA)v, and (hA)v, where is the mapping in (1.13) (1 following the notationin Section 2.1), h is the step size and v a given vector, both varying along the time
stepping process.
For problems with a large sparse matrix A, EXP4 computes the matrices (A)
by means of a Krylov subspace approximation (1.11). In this way, the problem isreduced to compute 1(Hm), for Hm a much smaller matrix than A. This last com-putation is performed by using a sophisticated routine, called phim. There are several
internal functions inside phim, where several cases for Hm are distinguished, taking
into account its size and if it can be easily reduced to a diagonal matrix. phim uses
also a recurrence relation developed in [9] to efficiently evaluate 1(jHm), j Nfrom 1(Hm). It finally evaluates 1(Hm) by using a Pade approximant at matrixand vector level (internal functions phim pde and phis pade) or at scalar level (in-
ternal function phis), in caseHm is diagonalized. This routine phim is very optimized
for the implementation of this particular exponential method.
Since Hm and A have the same spectral properties, in case A fulfils (1.6) also
does Hm. Thus, for this type of problems we can evaluate the 1(jHm)v by usingthe approach of the present paper, i.e., by linear combinations of the solutions to
the linear systems (1.12). To do this, we replaced the routine phim in EXP4 by a
new phim cont. Apart from the simplicity in the programming (see Figure 7.2), the
recurrences to compute 1(jHm)v from 1(Hm)v are not anymore needed since,by Theorem 2.1, we can use the same solutions to (1.12) to approximate 1(jHm)v
-
8/3/2019 Expfast Bit
21/24
A quadrature method for evaluating exponential-type functions 21
for different j [1, 3]. This is due to the fact that, for k in (2.2), we have
k(j) =1
jk
j0
e(js)sj
(j1)!ds = L1
1
zk(z)
(j).
Thus, we think that phim can be easily extended to the implementation of otheradaptive exponential methods that use Krylov techniques and require the evaluation
of other exponential type mappings, different from 1. As we can see in the followingtest problem (Figure 7.1), the computational cost does not grow at all with respect to
the original implementation by means of the routine phim. For the rest of the package,
we only need to set in the initializing routine, exp4 initialize, the number of
quadrature nodes in terms of the tolerance options. In this way, we set
tol > 105, K1 = 8, K3 = 12,tol > 107, K1 = 12, K3 = 16,tol > 109, K1 = 14, K3 = 18,tol > 1011, K1 = 18, K3 = 22,tol > 1013, K1 = 20, K3 = 24,Else, K1 = 24, K3 = 28,
where K1 is the number of nodes to compute (Hm) at a single value of and K3is to compute (jHm) for all j [1, 3]. We also compute the quadrature nodes andweights following (2.13) before the time stepping begins, since they do not depend
on the value ofnor on v.In order to test the computational effect of replacing phim by phim cont, we
consider the homogeneous heat equation on the unit square = (0, 1)2, which is oneof the examples provided by the original package EXP4,
ut(t,x,y) = u(t,x,y), for (x,y) ; t 0,u(t,x,y) = 0, for (x,y) ; t 0,u(0,x,y) = peaks (x,y).
(7.2)
We consider a spatial semidiscretization by means of standard finite differences on
an uniform 100100 grid, so that A is a sparse matrix of dimension 10, 000.In Figure 7.1, we show work-efficiency diagrams for (7.2) at t = 10, for two
different values of the stiffness parameter . This plots were obtained by setting theerror tolerance options AbsTol = RelTol = 103, 103.5, . . . ,1014.5. We can seethat the results are very much the same by using either phim or phim cont.
8 Conclusions
In this paper we derived a quadrature based method to approximate the exponential-
like operators required for the implementation of exponential methods. The algorithm
is based on the numerical inversion of sectorial Laplace transforms and is useful at
scalar, vector and matrix/operator level. It is simple to implement and parallelizable.
Apart from the error bound stated in Theorem 2.1, which is a partial result of those
proved in [16], we tested our algorithm with academic examples from [2] and [11]
-
8/3/2019 Expfast Bit
22/24
22 Mara Lopez-Fernandez
101
102
103
1015
1010
105
100
cpu time (s)
relative
error
exp4exp4cont
100
101
102
103
1015
1010
105
100
cpu time (s)
relative
error
exp4exp4cont
Fig. 7.1 Left: Relative error versus CPU time for EXP4 after applying our evaluation of the mappings(exp4cont) and the original Pade based routine (exp4), for = 0.2 (left) and = 0.02 (right).
and with the evaluation of the prototypical mapping in (1.13). We also appliedthe algorithm to more challenging examples governed by a full matrix operator, in-
cluding finite element semi-discretizations of parabolic PDEs. In these examples ourapproach is shown to be better than the one in [12]. Finally, we applied with success
our method at vector level, as an auxiliary tool inside the MATLAB package EXP4
[9].
Acknowledgements The author is grateful to Christian Lubich, Achim Schadle, Cesar Palencia, and En-
rique Zuazua for helpful discussions during the preparation of the manuscript.
References
1. H. Berland, B. Skaflestad, W. M. Wright, EXPINT - A MATLAB package for exponential integrators,
ACM Transactions on Mathematical Software, 33, Article Number 4 (2007).
2. M. P. Calvo, C. Palencia, A class of explicit multistep exponential integrators for semilinear problems,
Numer. Math., 102, 367381 (2006).
3. S. M. Cox, P. C. Matthews, Exponential time differencing for stiff systems, J. Comput. Phys., 176,
430455 (2002).
4. I. P. Gavrilyuk, W. Hackbusch, B. N. Khoromskij, Data-sparse approximation to the operator-valued
functions of elliptic operators, Math. Comp., 73, 12971324 (2004).
5. I. P. Gavrilyuk, W. Hackbusch, B. N. Khoromskij, Data-sparse approximation to a class of operator-
valued functions, Math. Comp., 74, 681708 (2005).
6. D. Henry, Geometric theory of semilinear parabolic equations. Lecture Notes in Mathematics 840,
Springer, Berlin, (1981).
7. M. Hochbruck, C. Lubich, On Krylov subspace approximations to the matrix exponential operator,
SIAM J. Numer. Anal., 34, 19111925 (1997).
8. M. Hochbruck, C. Lubich, Error analysis of Krylov methods in a nutshell, SIAM J. Sci. Comput., 19,
695701 (1998).
9. M. Hochbruck, C. Lubich, H. Selhofer, Exponential integrators for large systems of differential equa-
tions, SIAM J. Sci. Comput., 19, 15521574 (1998).
10. M. Hochbruck, A. Ostermann, Exponential RungeKutta methods for parabolic problems, Appl. Nu-
mer. Math., 53, 323339 (2005).
11. M. Hochbruck, A. Ostermann, Explicit exponential Runge-Kutta methods for semilinear parabolic
problems, SIAM J. Numer. Anal., 43, 10691090 (2005).
12. A. K. Kassam, L. N. Trefethen, Fourth-order time-stepping for stiff PDEs, SIAM J. Sci. Comput., 26,
12141233 (2005).
-
8/3/2019 Expfast Bit
23/24
A quadrature method for evaluating exponential-type functions 23
function out = phim_cont(A,h,fac_t,v)%% function out = phim_cont(A,h,fac_t,v)%% Matrix evaluation of the function% phi(z) = (exp(z)-1)/z% for A sectorial. It uses the inversion of the Laplace transform.%
% Called with arguments: Return:% A the matrix phi(A)% A, h the matrix phi(h*A)% A, h, fac_t the matrix out(:,j)=phi(j*h*A)*e1, j=1..fac_t% A, h, fac_t, v the matrix out(:,j)=phi(j*h*A)*v, j=1..fac_t%% The global variable PARACONT is a structure set in the intializing routine.
if nargin
-
8/3/2019 Expfast Bit
24/24
24 Mara Lopez-Fernandez
13. M. Lopez-Fernandez, C. Lubich, C. Palencia, A. Schadle, Fast Runge-Kutta approximation of inho-
mogeneous parabolic equations, Numer. Math., 102, 277291 (2005).
14. M. Lopez-Fernandez, C. Lubich, A. Schadle, Adaptive, fast and oblivious convolution in evolution
equations with memory, SIAM J. Sci. Comput., 30, 10151037 (2008).
15. M. Lopez-Fernandez, C. Palencia, On the numerical inversion of the Laplace transform of certain
holomorphic mappings, Appl. Numer. Math., 51, 289303 (2004).
16. M. Lopez-Fernandez, C. Palencia, A. Schadle, A spectral order method for inverting sectorial Laplace
transforms, SIAM J. Numer. Anal., 44, 13321350 (2006).
17. W. McLean, V. Thomee, Time discretization of an evolution equation via Laplace transforms, IMA J.
Numer. Anal., 24, 439463 (2004).
18. A. Schadle, M. Lopez-Fernandez, and C. Lubich, Fast and oblivious convolution quadrature, SIAM J.
Sci. Comput., 28, 421438 (2006).
19. D. Sheen, I. H. Sloan, V. Thomee, A parallel method for time discretization of parabolic equations
based on Laplace transformation and quadrature, Math. Comp., 69, 177195 (2000).
20. F. Stenger, Approximations via Whittakers Cardinal Function, J. Approx. Theory, 17, 222240
(1976).
21. F. Stenger, Numerical methods based on Whittaker Cardinal, or sinc Functions, SIAM Rev., 23, 165
224 (1981).
22. A. Talbot, The accurate numerical inversion of Laplace transforms, J. Inst. Math. Appl., 23, 97120
(1979).
23. J. A. C. Weideman, Optimizing Talbots contours for the inversion of the Laplace transform, SIAM J.
Numer. Anal., 44, 23422362 (2006).24. J. A. C. Weideman, L. N. Trefethen, Parabolic and hyperbolic contours for computing the Bromwich
integral, Math. Comput., 76, 13411356 (2007).