Applied Numerical Mathematics 37 (2001) 535–549
Linearly implicit Runge–Kutta methods for advection–reaction–diffusion equations M.P. Calvo ∗ , J. de Frutos, J. Novo Departamento de Matemática Aplicada y Computación, Universidad de Valladolid, Valladolid, Spain
Abstract We construct two variable-step linearly implicit Runge–Kutta methods of orders 3 and 4 for the numerical integration of the semidiscrete equations arising after the spatial discretization of advection–reaction–diffusion equations. We study the stability properties of these methods giving the appropriate extension of the concept of L-stability. Numerical results are reported when the methods presented are combined with spectral discretizations. Our experiments show that the methods, being easily implementable, can be competitive with standard stiffly accurate time integrators. 2001 IMACS. Published by Elsevier Science B.V. All rights reserved.
1. Introduction In this paper we are concerned with linearly implicit Runge–Kutta methods for the numerical integration of systems of ordinary differential equations that arise from the spatial discretization of advection–reaction–diffusion partial differential equations. The main difficulty in dealing with these systems is that the use of explicit time integrators is usually inefficient because the system becomes stiffer as the spatial mesh is refined. On the other hand, if a stiffly accurate integrator is chosen, one has to solve nonlinear equations implicitly that are difficult to handle, especially in connection with spectral methods [5]. The typical approach to solve the nonlinear equations arising in implicit methods is to use a modified Newton iteration with banded approximations to the Jacobian obtained using finite differences. However, when dealing with spectral spatial discretizations of advection–reaction–diffusion equations a high number of failures in the Newton iteration may occur [13]. This could be one of the reasons why very few codes combining spectral discretizations together with implicit time integrators can be found in the literature. An alternative approximation to the Jacobian is obtained by considering only the matrix corresponding to the spatial discretization of the diffusion terms. See, for example, [9,10] where a variable order, variable step BDF time integrator with the Jacobian approximated in this way was used to integrate in time Burgers’ equation and one- and two-dimensional reaction–diffusion equations. In these * Corresponding author.
E-mail address:
[email protected] (M.P. Calvo). 0168-9274/01/$ – see front matter 2001 IMACS. Published by Elsevier Science B.V. All rights reserved. PII: S 0 1 6 8 - 9 2 7 4 ( 0 0 ) 0 0 0 6 1 - 1
536
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
experiments the number of iterations in the modified Newton method was observed to be independent of the number of degrees of freedom and never higher than five. In order to avoid the difficulties that appear when trying to solve the nonlinear equations arising in an implicit method, combined pairs of an implicit integrator for the linear part with an explicit scheme for the nonlinear terms have been proposed by many authors [8,11,16,19]. Some recent work in this context are the papers [2], where the so-called explicit–implicit multistep methods are studied, and [3], where Runge–Kutta type methods are presented. Let us consider a system of ODEs of the special form dy = Ly + N (t, y), dt
y(t0 ) = y 0 ,
(1)
where y = [y1 , y2 , . . . , yd ]T and L is a d × d matrix. The matrix L stems from the spatial discretization of the diffusive terms and N(t, y) arises from the discretization of advective, reactive and source terms. For the linearly implicit Runge–Kutta method specified by the Butcher tableaux 0
0
0
c2
0
γ
c3 .. .
0 .. .
a32 .. .
γ ..
cs+1
0
as+1,2
...
as+1,s
0
b2
...
bs
..
.
a21
0
a31 .. .
a32 .. .
0 .. .
..
γ
as+1,1
as+1,2
...
as+1,s
0
γ
b1
b2
...
bs
bs+1
.
(2) .
the equations that describe the step tn → tn+1 = tn + h take the form Y 1 = yn,
Y i = yn + h
i
aij LY j +
j =2
y n+1 = y n + h
s+1
i−1
ai,j N (tn + hcj , Y j ) ,
j =1
bi LY i +
i=2
s+1
2 i s + 1,
bi N (tn + hci , Y i ) ,
i=1
where Y i denote the internal stages. Throughout the paper we assume, as usual, that ci =
i j =1
aij =
i−1
aij ,
1 i s + 1.
(3)
j =1
If the simplifying assumptions (3) hold, only the order conditions for autonomous problems y = Ly + N (y) have to be considered. In the sequel A and A denote the matrices of the coefficients of the implicit and the explicit tableaux of the Runge–Kutta method (2), respectively, bT = [0, b2 , . . . , bs , γ ], T b = [b1 , b2 , . . . , bs , bs+1 ] and cT = [0, c2 , . . . , cs+1 ]. Linearly implicit Runge–Kutta methods are a particular instance of additive Runge–Kutta methods. Additive Runge–Kutta methods were first studied in [7] where the order conditions up to order four are
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
537
given. More recently these methods have been considered in [1,15], for general partitioning. In [3] several linearly implicit Runge–Kutta methods of second and third order are constructed. In this paper, after a brief review of the order conditions, we study the stability properties of linearly implicit Runge–Kutta methods giving the appropriate extension of the concept of L-stability when applied to (1). This property is not satisfied for the methods presented in [3]. In Section 4 we construct two embedded pairs of linearly implicit Runge–Kutta methods of orders three and four. In both cases the implicit scheme has been chosen as an L-stable singly diagonally implicit Runge–Kutta method already existing in the literature. Section 5 contains some numerical illustrations and our conclusions are given in Section 6.
2. Order conditions The conditions that must be imposed for a linearly implicit RK method (2) for (1) to have order r can be easily derived with the help of the so-called bicolour rooted trees. The reader is referred to [14] where they are called P -trees and are used in the case of coordinate partitioning. See also [1] where N -trees have been recently considered to study additive Runge–Kutta methods with general partitioning. A bicolour rooted tree is a rooted tree where each vertex has been assigned a colour, say black or white. In our case, the colour white has been assigned to vertices associated with the linear term and the colour black corresponds to vertices representing the nonlinear part. Using bicolour rooted trees the Taylor expansion of the solution of (1) can be easily written in terms of the so-called elementary differentials. For instance, the elementary differential associated with the bicolour rooted tree with only one white vertex is F (t1 )(y) = Ly, while the elementary differential associated with the bicolour rooted tree with only one black vertex is F (t4 )(y) = N(y). For a full description of the elementary differentials associated with N -
Fig. 1. Elementary differentials and order conditions up to order 3 if (3) holds.
538
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
Fig. 2. Order conditions for order 4 if (3) and (4) hold.
trees we refer to [1] or [14]. As an illustration, we have depicted in Fig. 1 the 9 bicolour rooted trees with r vertices, 1 r 3, and the corresponding elementary differentials and order conditions. The first three conditions ensure that the left method in (2) has order three for linear problems. The conditions associated with the trees t4 –t7 imply order three for the method on the right of (2) and equations corresponding to the trees t8 and t9 are necessary compatibility conditions. Notice that as long as (3) is satisfied, the order conditions associated with two bicolour rooted trees which only differ in the colour of the terminal vertices are the same. On the other hand, due to the linearity of the first term of the right hand side of (1), bicolour rooted trees for which a white vertex has more than one branch may be disregarded. In spite of these reductions, the number of compatibility equations grows dramatically with the order of the method. There are 2 compatibility conditions for order three, 10 for order four and so on. However, many of the order conditions become identical if the following simplifying assumption is imposed: bi = bi ,
1 i s + 1.
(4)
With this restriction, those trees that only differ in the colour of the root give the same order condition. For instance, in Fig. 1 the order conditions for t4 and t7 are the same as the order conditions for t1 and t8 respectively and may be disregarded. On the other hand t5 and t9 differ from t2 and t3 in the colour of both the root and the terminal vertex so that from (3), (4) it follows that the order conditions for t5 and t9 may be ignored. This leaves only five order conditions to be imposed for a method to have order three.
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
539
In Fig. 2 we have depicted the bicolour rooted trees to be considered for a third order method satisfying (3), (4) to have order four, together with the corresponding order equations. In the sequel we assume that method (2) always satisfies (3) and (4).
3. Linear stability Let us consider as a model the linear advection–diffusion equation ut = νuxx + aux ,
ν, a > 0,
(5)
with periodic boundary conditions in [0, 2π ]. After Fourier spatial discretization of (5), the system of ordinary differential equations to be solved consists of a set of N + 1 decoupled ordinary differential equations like y = λy + iµy,
(6)
where λ equals −(ν/a 2 )µ2 , with −N/2 µ/a N/2. The linearly implicit method (2) applied to the test equation (6) with step size h becomes y1 = R(z + iw)y0 , where z = hλ, w = hµ and R(z + iw) =
det (I d − zA − iw A + (z + iw)1b T ) det (I d − zA − iw A)
.
The matrices A, A and bT are defined in Section 1 and 1 = [1, . . . , 1]T ∈ Rs+1 . In the following we analyze the desirable stability requirements for the linearly implicit method (2). Firstly we remark that (2) cannot be A-stable since an explicit method is used to integrate the nonlinear terms. On the other hand, let us suppose that for some α0 > 0 a parabola z = −α0 ω2 is contained in the stability region of (2). Then, since the eigenvalues of (6) lie on the parabola z = −(ν/a 2 )ω2 , the step-size restriction h < ν/(a 2 α0 ) ensures stability for all values of N . Notice that a linearly implicit Runge– Kutta method has better stability properties for (6) as smaller α0 is. A necessary condition (although not sufficient) for the previous parabola property is that lim R(z + iw) = 0,
z→−∞
∀ω ∈ R,
(7)
a property similar to the L-stability of the implicit scheme. the denominator of R(z + iw) is (1 − γ z)s , a polynomial Due to the structure of the matrices A and A, of degree s in z. On the other hand, due to the null first column of the matrix A, the numerator is a polynomial of degree s in z and degree s + 1 in w. In order to get (7) the coefficient accompanying zs + (z + iw)1bT does not in the numerator must be zero. The first column of the matrix I d − zA − iw A contain terms in z and for methods satisfying as+1,j = bj , 1 j s + 1, nor does the last row of this matrix. Then, the condition as+1,1 = 0 ensures the desired property for the linearly implicit integrator, since as+1,1 appears as a factor in the coefficient of the leading term zs . Notice that methods proposed in [3] do not satisfy this condition. In that paper, the stability properties of the full scheme are considered as a consequence of the stability properties of the implicit and the explicit methods separately. More precisely, several methods in [3] are chosen in such a way that the
540
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
Fig. 3. Stability regions of linearly implicit RK methods.
implicit method is L-stable and the explicit integrator is selected to have the largest possible stability region. However, this is not enough to ensure good stability properties for the linearly implicit method. In order to illustrate this fact we have plotted in Fig. 3 the stability regions of two third order linearly implicit methods based on the L-stable, three-stage, third order SDIRK method [14]. We consider two different explicit schemes combined with it. The first one is proposed in [3] and has the same stability region as all fourth-order explicit Runge–Kutta methods. The contour of its stability region has been plotted using a dashed line. The second explicit scheme has been constructed satisfying a41 = 0 and its stability region contains the curve z = − 14 ω2 (see Section 4.1). Its stability region has been delimited in Fig. 3 using a solid line and we also show the curve z = − 14 ω2 with a dotted line. The figure on the right exhibits a more detailed view of the stability region near the origin. The different stability properties of both methods have important practical implications. For instance, let us consider the system of ordinary differential equations obtained after Fourier spatial discretization with N degrees of freedom of the model equation (5). For the explicit method proposed in the present paper the restriction h < 4ν/a 2 ensures stability for all N . On the contrary, for the method presented in [3] all the curves λ = −αµ2 leave the stability region of the method and thus, the step-size must be reduced when N increases. Remark. Notice that adding a reaction term such as bu, b < 0, to Eq. (5) merely produces a translation of the spectrum. More precisely, λ in Eq. (6) behaves as −(ν/a 2 )µ2 + b. If the curves z = −αω2 , α α0 , lie on the stability region of the method so do the curves z = −αω2 + b, α α0 , b < 0.
4. Embedded pairs of linearly implicit Runge–Kutta methods As mentioned in the introduction, we restrict our attention to linearly implicit methods for which the implicit scheme is an L-stable singly diagonally implicit Runge–Kutta (SDIRK) method combined with an explicit Runge–Kutta scheme satisfying (3) and (4). In this way, the number of order conditions is reduced as pointed out in Section 2.
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
541
4.1. An embedded pair of order three To construct a variable-step linearly implicit code we decided to begin with a third order formula based on the L-stable, three-stage, third order SDIRK method with Butcher tableau 0
0
γ 1+γ 2 1
0
0
γ 1−γ 2 b2
b3
γ
0
b2
b3
γ
0
,
γ
(8)
where γ is the middle root of 6x 3 − 18x 2 + 9x − 1 = 0, b2 = − 32 γ 2 + 4γ − 14 and b3 = 32 γ 2 − 5γ + 54 . As long as (3) and (4) hold, for the explicit method to have order three, two order conditions must be imposed, associated with trees t6 and t8 in Fig. 1. However, the order condition corresponding to t6 is automatically satisfied because the implicit method has order three not only for linear problems but also for general ODEs. The only order condition to be considered is
1+γ b3 a32 γ + γ (1 − a41 − a43 )γ + a43 2
1 = . 6
(9)
We are left with the task of choosing the values of a32 and a41 that still remain as free parameters. Here we choose a41 = 0 to ensure (7) for the linearly implicit method (see Section 3). After this assumption the Butcher tableau of the explicit method is 0
0
γ 1+γ 2 1
γ 1+γ − a32 2 0
a32
0
1 − a43
a43
0
0
b2
b3
γ
0 ,
(10)
where a43 =
1 3
− 2γ 2 − 2b3 a32 γ , γ (1 − γ )
(11)
and there is still a free parameter a32 that will be selected to adapt the stability region of the linearly implicit method to the problem we are dealing with. More precisely, as pointed out at the end of Section 3, the stability region of the linearly implicit method should contain the curves z = −α0 w 2 with α0 > 0 as small as possible.
542
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
The stability function R(z + iw) of the linearly implicit method (8), (10) is
1 1 + z(1 − 3γ ) + z2 3γ 2 − 3γ + 12 + iw 1 + z(1 − 3γ ) + z2 2γ 3 − 3γ 2 + 16 3 (1 − γ z)
iw 3
w2 − 1 + z 2γ 3 − 6γ 2 + 23 − 2z2 γ 2 (γ − a43 a32 ) − 1 − 6zγ 2 (γ − 2a43 a32 ) 2 6 + w 4 γ 2a43 a32 .
A necessary condition (but not sufficient) to ensure that the curve z = −αw 2 , α > 0 lies on the stability region of the linearly implicit method is 43 a 32 − γ | |a < 1. (12) lim R −αw 2 + iw = w→+∞ αγ For a given method (8), (10) its stability region will contain at most the curves z = −αw 2 with |a43 a32 − γ | . γ Now we minimize α0 as a function of the free parameter a32 . The minima are obtained when a43 a32 = γ (a32 = −0.3972686938096126 and a32 = 0.4802753954575924). Both values correspond to α0 = 0. This means that for these two values of the free parameter the condition (12) is satisfied for every α. However, the condition |R(−αw 2 + iw)| < 1 is only satisfied at the limit. On the other hand, the analysis of the 1 is necessary if an stability function along the imaginary axis shows that the condition a43 a32 γ 2 24 interval of the imaginary axis containing the origin should lie on the stability region of the linearly implicit method. This implies that α > α0 =
−0.2711138729598376 a32 0.3541205746078174,
(13)
which is not satisfied by the two values of the free parameter mentioned above. However, it is possible to relax the condition (13) without losing the good stability properties of the linearly implicit method. Let us consider F (z, w) = |R(z + iw)|2 − 1 = 0, the function defining the contour of the stability region. It is not difficult to check that at z = 0, w = 0, ∂ 2F ∂ 3F ∂ 4F ∂F = = = 0, = −2 + 48γ 2 a43 a32 . ∂w ∂w 2 ∂w 3 ∂w 4 Then, near the origin, every curve z = −αw 2 , α > 0 is contained in the stability region of the method 1 . even if γ 2 a43 a32 > 24 Under these considerations we studied in a systematic way the stability regions of the linearly implicit methods obtained for different values of the free parameter a32 between −0.3972686938096126 and −0.2711138729598376. Finally, we chose an intermediate value a32 = −0.35 for which α0 is small enough for our purposes and there is only a small interval of the imaginary axis near the origin not contained in the stability region of the method. In order to estimate the local errors we have considered the second order formula
y n+1 = y n + h b2 LY 2 + N(tn + c2 h, Y 2 )
+ b3 LY 3 + N(tn + c3 h, Y 3 ) + γ Ly n+1 + N(tn + h, Y 4 ) , where Y 2 , Y 3 and Y 4 are the internal stages of the third order scheme. The error estimation requires the solution of an extra linear system per step but with the same matrix used when calculating the internal
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
543
stages. The second order approximation y n+1 can be interpreted as the solution generated with a linearly implicit Runge–Kutta method with an additional internal stage Y 5 = y n+1 defined by the coefficients a5,i = a5,i = bi , 1 i 3, a5,4 = a5,5 = 0, a5,5 = a5,4 = γ . 4.2. An embedded pair of order four In this subsection we look for a fourth order linearly implicit Runge–Kutta method. As implicit integrator we have considered the L-stable, five-stage, fourth order method whose coefficients are displayed in Table 6.5 of [14]. This method is endowed with an embedded third order scheme to estimate the local errors. In order to construct the explicit Runge–Kutta method we have followed similar considerations to those detailed in Section 4.1. After imposing the condition a6,1 = 0 to ensure L-stability for the linearly implicit method (see Section 3), there are nine free parameters that will be chosen to satisfy the seven order conditions (six for order four, associated with the trees t8 , t12 –t14 , t16 and t17 , and one more for the embedded method to have order three). However, only the six order conditions for the fourth order method are independent. This leads to three free parameters that we have chosen as a5,3 , a6,3 and a6,4 . Finally, the free coefficients have been determined in order to enlarge the stability region of the linearly implicit method following the ideas pointed out in Section 4.1. More precisely, if R(z + iw) denotes the stability function of the linearly implicit method we first ask for
lim R −αw 2 + iw = 0,
w→+∞
for all α > 0. The other two conditions are obtained from the expression of the stability function along the imaginary axis R(iw) = 1 + iw −
w 2 iw 3 w 4 − + + R5 iw 5 − R6 w 6 , 2 6 24
where R5 and R6 depend on the free parameters a5,3 , a6,3 and a6,4 . Choosing R5 = Butcher tableau of the explicit method is 0
0
1 4
1 4
3 4
− 14
11 20
13 − 100
43 75
8 75
0
1 2
6 − 85
42 85
179 1360
15 − 272
0
1
0
79 24
− 58
25 2
− 85 6
0
0
25 24
− 49 48
125 16
− 85 12
1 4
1 48
and R6 =
1 192
the
0 1
0 ,
(14)
and the stability region of the linearly implicit method also contains a family of parabolas z = −αw 2 , α > α0 with α0 larger than the one corresponding to the third order method.
544
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
The embedded third order method to estimate the local errors is the linearly implicit method with the same matrices A and A and weights given in Table 6.5 of [14]. As the third order implicit method is not longer L-stable, in order to improve the step size selection of the linearly implicit scheme we propose to use err = (I − hγ L)−1(y n+1 − y n+1 ), following the idea of L.F. Shampine, cited in [14]. There is an additional linear system to solve, but with the same matrix used to compute the internal stages.
5. Numerical experiments In order to test the efficiency of the methods described above, we have first considered the forced Burgers’ equation (see [5, p. 76]) ut = νuxx + uux + f (t, x),
−1 x 1,
t > 0,
(15)
subject to homogeneous Dirichlet boundary conditions. The case of time dependent boundary conditions could be handle using the ideas in [4,17] in order to avoid the possible order reduction phenomenon. This will be subject of further research. The initial condition was set to u(0, x) = sin(π(x + 1)). We have chosen as a forcing term the product of a nonsymmetric hat function in space with a periodic function in time. More precisely f (t, x) = g(x) sin t, with g(x) =
0,
3(x + 13 ), 3 2 2 ( 3 − x), 0,
−1 x − 13 , − 13 x 0, 0 x 23 , 2 x 1. 3
(16)
With this forcing term the solution of (15) becomes nearly periodic in time after a transient state, so that, the use of variable step-sizes becomes necessary for an efficient method. For the spatial discretization we have considered a Chebyshev spectral Galerkin method [5]. After the spatial discretization the differential system to be solved is By = Ay + f (t, y),
(17)
where B, A denote mass and stiffness matrices, respectively. The time integrators have been adapted to these kind of ordinary differential systems. The choice of the basis becomes crucial in order to achieve an efficient spectral Galerkin approximation. We took the basis functions proposed in [18]. With this choice B becomes pentadiagonal whereas A has a special triangular structure that allows us to solve the linear systems involved in the time integration in O(N) arithmetic operations (N being the number of degrees of freedom), see [18]. The nonlinear terms were evaluated using collocation and Fast Fourier Transform techniques. In our numerical experiments the time integration of (17) has been performed using three different methods. (i) The first one is the third order linearly implicit Runge–Kutta method constructed in Section 4.1 and implemented with variable step-sizes. It requires 4 evaluations of the nonlinear term per step, 3 matrix–vector multiplications per step, 4 linear systems with the same matrix B − hγ A to be
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
545
Fig. 4. Efficiency diagram for Burgers’ equation, ν = 0.3.
solved at each step (one of them for the error estimation) and one more linear system with matrix B. We will refer to this method as LIRK3 and in the figures we will represent the data generated with it using triangles joined by a dashed–dotted line. (ii) The second scheme, LIRK4, is the fourth order, six-stage, linearly implicit Runge–Kutta method proposed in Section 4.2, also implemented with variable step-sizes. This algorithm needs 6 evaluations of the nonlinear part, 5 matrix–vector multiplications and the solution of 6 linear systems with the same matrix per step. Again a linear system with matrix B must be solved at each time step. In the figures we use circles joined by a dashed line to represent the data obtained with this method. (iii) As a reference method we have considered the backward differentiation formulae, BDF, implemented with variable step size and variable order up to 5 (see, e.g., [14]). This method is widely used in the numerical integration of stiff ODEs. The superior efficiency of this code for the time integration of dissipative equations with respect to other frequently used time integrators was experimentally checked in [12,13] (see also [9,10]). In [9,10], as we pointed out in the introduction, the BDF code is implemented using a modified Newton iteration in which the exact Jacobian is replaced by the Jacobian of the linear terms of the equations, i.e., by the matrix corresponding to the spatial discretization of the diffusion terms. Here, we use the same kind of implementation for the BDF algorithm. As in [9,10] the number of iterations in the modified Newton iteration to achieve convergence was found to be below five and hardly dependent on the number of degrees of freedom N . However, it is well known that for advection-dominated problems the average order selected by BDF codes drops near 2. As we will next see, this fact makes linearly implicit Runge–Kutta methods proposed in Section 4 a good option when dealing with this kind of problems. The data corresponding to the BDF method have been plotted in the figures using diamonds joined by a solid line. We have integrated the test problem in the time interval [0, 5]. In order to check the stability properties of the time integrators, and to study the applicability of the methods to a wide range of problems, from
546
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
Fig. 5. Efficiency diagram for Burgers’ equation, ν = 0.0003.
diffusion-to-convection-dominated, we took several values of the diffusion parameter ranging from 0.3 to 0.0003. We only report here the results corresponding to the values which we have considered to be the most significant. The smaller the parameter ν is, the larger should be N in order to resolve the steeper gradients appearing in the solution. For each value N every experiment was carried out using different values of the tolerance. The CPU time represented in the figures was the smallest among those yielding a given error but using different values of the time integration tolerance. This means that the point plotted corresponds to a value of the tolerance such that a further reduction hardly reduces the error but considerably increases the computational cost. Fig. 4 gives, for ν = 0.3, errors at t = 5 against computational cost measured by the CPU time in logarithmic scale. The number of degrees of freedom we have considered starts with N = 10 and it is doubled up to N = 80. We observe that for errors larger than 10−5 the fourth order method LIRK4 is the most efficient of the methods being compared. When smaller errors are required, the BDF code takes advantage of its higher order and needs less CPU time than Runge–Kutta methods to achieve a given error. Notice that this example is diffusion-dominated and thus is well suited for BDF codes. Even so, both linearly implicit methods give better results than BDF for moderate size errors. In Fig. 5 we show error against CPU time for the smallest value of the diffusion parameter ν = 0.0003 and N = 160, 320, 640, 960 and 1280. The first aspect to emphasize is that a comparison between the linearly implicit methods shows a better performance of the third order scheme. The main reason for this better behaviour is the larger stability region of the third order method, which becomes crucial for large values of N and small values of ν. This last test is not diffusion-dominated and then the performance of the BDF formulae deteriorates. Clearly, the most efficient method becomes LIRK3, that takes full advantage of its well suited stability region. As a second test problem we have considered the reaction–diffusion equation ut = ν*u + u − u3 + f (t, x, y),
t > 0,
(18)
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
547
Fig. 6. Efficiency diagram for a two dimensional reaction–diffusion equation.
in a rectangular domain Ω = [−1, 3] × [−1, 1]. For the spatial discretization we used a spectral element method [5,16], based on a fixed decomposition Ω = Ω1 ∪ Ω2 with Ω1 = [−1, 1] × [−1, 1] and Ω2 = [1, 3] × [−1, 1]. We determined the forcing term such that the exact solution was u(t, x, y) = 1 (x + 1)(2x − 21 ), if (2 + cos(π t))u1 (x)(y 2 − 1). Here, u1 was taken to be the function u1 (x) = 30 4 1 23 −1 x 2, u1 (x) = 30 (3 − x)(x − 4 ), if 2 x 3. We refer the reader to [10] for details. In Fig. 6 we have plotted errors at t = 1.5 against CPU time for ν = 0.005. The total number of degrees of freedom in the spatial discretization ranges from 171 to 1275. We observe that, for this example, the linearly implicit LIRK3 method is quite competitive with the BDF code. In fact, the corresponding points lie virtually on the same line. However, the fourth order integrator is, in this example, the most efficient of the methods being compared.
6. Conclusions We have presented two variable step linearly implicit Runge–Kutta methods for the numerical integration of the semidiscrete equations arising after the spatial discretization of advection–reaction– diffusion equations. Although this class of methods is well known, to our knowledge there were no variable step implementations in the literature. On the other hand, the proposed methods have stability properties more appropriate to the problem we are dealing with than the already existing schemes. The numerical experiments show that our codes can be competitive when compared with a variable step, variable order BDF code of previously proved efficiency. Furthermore, there are examples where the new methods outperform BDF. One can doubt whether the approximation to the Jacobian used in the experiments affects the efficiency of BDF. Anyway, when using an implicit integrator, the user must supply such an approximation. This is actually the main drawback of general purpose codes especially when combined with spectral discretizations. What is not in doubt is that linearly implicit Runge–Kutta methods only require the user to supply a linear solver together with a routine for the evaluation of the nonlinear part. We remark that the explicit treatment of the nonlinear part could be not suitable in
548
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
the case of highly stiff reaction terms. However, an implicit treatment of these terms would require the approximation to the Jacobian which still remains as an open problem. The methods proposed in this paper, while suited to the time integration of advection–reaction– diffusion equations, have the advantage of its simplicity and perform well enough to become a possible alternative to other stiffly accurate time integrators.
Acknowledgements This research has been partly supported by DGICYT under project PB95-705 and by Junta de Castilla y León under project VA36/98.
References [1] A.L. Araújo, A. Murua, J.M. Sanz-Serna, Symplectic methods based on decompositions, SIAM J. Numer. Anal. 34 (1997) 1926–1947. [2] U.M. Ascher, S.J. Ruuth, B. Wetton, Implicit–explicit methods for time-dependent PDE’s, SIAM J. Numer. Anal. 32 (1995) 797–823. [3] U.M. Ascher, S.J. Ruuth, R.J. Spiteri, Implicit–explicit Runge–Kutta methods for time-dependent partial differential equations, Appl. Numer. Math. 25 (1997) 151–167. [4] M.P. Calvo, C. Palencia, Avoiding the order reduction of Runge–Kutta methods for linear initial boundary value problems, Math. Comp. (to appear). [5] C. Canuto, M. Hussaini, A. Quarteroni, T. Zang, Spectral Methods in Fluid Dynamics, Springer-Verlag, Berlin, 1987. [6] G.J. Cooper, A. Sayfy, Additive methods for the numerical solution of ordinary differential equations, Math. Comput. 35 (1980) 1159–1172. [7] G.J. Cooper, A. Sayfy, Additive Runge–Kutta methods for stiff ordinary differential equations, Numer. Math. 36 (1981) 431–445. [8] M. Crouzeix, Une méthode multipas implicite–explicite pour l’approximation des équations d’évolution paraboliques, Numer. Math. 35 (1980) 257–276. [9] J. de Frutos, B. García-Archilla, J. Novo, A postprocessed Galerkin method with Chebyshev or Legendre polynomials, Numer. Math. 86 (2000) 419–442. [10] J. de Frutos, J. Novo, A postprocess based improvement of the spectral element method, Appl. Numer. Math. 33 (2000) 217–223. [11] J. de Frutos, T. Ortega, J.M. Sanz-Serna, A pseudospectral method for the “good” Boussinesq equation, Math. Comp. 57 (1991) 109–122. [12] B. García-Archilla, Some practical experience with the time integration of dissipative equations, J. Comput. Phys. 122 (1995) 25–29. [13] B. García-Archilla, J. de Frutos, Time integration of the nonlinear Galerkin method, IMA J. Numer. Anal. 14 (1994) 1–24. [14] E. Hairer, G. Wanner, Solving Ordinary Differential Equations II: Stiff and Differential–Algebraic Problems, Springer-Verlag, New York, 1991. [15] J.C. Jorge, Los métodos de pasos fraccionarios para la integración de problemas parabólicos lineales: formulación general, análisis de la convergencia y diseño de nuevos métodos, Ph.D. Thesis, Universidad de Zaragoza, Zaragoza, 1992.
M.P. Calvo et al. / Applied Numerical Mathematics 37 (2001) 535–549
549
[16] A.T. Patera, A spectral element method for fluid dynamics: Laminar flow in a channel expansion, J. Comput. Phys. 54 (1984) 468–488. [17] D. Pathria, The correct formulation of intermediate boundary conditions for Runge–Kutta time integration of initial boundary value problems, SIAM J. Sci. Comput. 18 (1997) 1255–1266. [18] J. Shen, Efficient spectral-Galerkin method II. Direct solvers of second a four order equations using Chebyshev polynomials, SIAM J. Sci. Comput. 16 (1995) 74–87. [19] E. Sterner, Semi-implicit Runge–Kutta schemes for the Navier–Stokes equations, BIT 37 (1997) 164–178.