Proc. R. Soc. A-2008-Flyer-1823-49.pdf

Embed Size (px)

Citation preview

  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    1/28

    , published 8 July 2008, doi: 10.1098/rspa.2008.00414642008Proc. R. Soc. AN Flyer and A.S Fokashalf-lineevolution partial differential equations. I. Thenumerical method for solving

    A hybrid analytical

    References

    lated-urlshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#re

    Article cited in:html#ref-list-1http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.This article cites 14 articles, 5 of which can be accessed free

    Subject collections

    (319 articles)applied mathematics

    Articles on similar topics can be found in the following collections

    Email alerting serviceherethe box at the top right-hand corner of the article or click

    Receive free email alerts when new articles cite this article - sign up in

    http://rspa.royalsocietypublishing.org/subscriptionsgo to:Proc. R. Soc. ATo subscribe to

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#related-urlshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#related-urlshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#related-urlshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#ref-list-1http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#ref-list-1http://rspa.royalsocietypublishing.org/cgi/collection/applied_mathematicshttp://rspa.royalsocietypublishing.org/cgi/collection/applied_mathematicshttp://rspa.royalsocietypublishing.org/cgi/alerts/ctalert?alertType=citedby&addAlert=cited_by&saveAlert=no&cited_by_criteria_resid=royprsa;464/2095/1823&return_type=article&return_url=http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.pdfhttp://rspa.royalsocietypublishing.org/cgi/alerts/ctalert?alertType=citedby&addAlert=cited_by&saveAlert=no&cited_by_criteria_resid=royprsa;464/2095/1823&return_type=article&return_url=http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.pdfhttp://rspa.royalsocietypublishing.org/cgi/alerts/ctalert?alertType=citedby&addAlert=cited_by&saveAlert=no&cited_by_criteria_resid=royprsa;464/2095/1823&return_type=article&return_url=http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.pdfhttp://rspa.royalsocietypublishing.org/subscriptionshttp://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/subscriptionshttp://rspa.royalsocietypublishing.org/subscriptionshttp://rspa.royalsocietypublishing.org/cgi/alerts/ctalert?alertType=citedby&addAlert=cited_by&saveAlert=no&cited_by_criteria_resid=royprsa;464/2095/1823&return_type=article&return_url=http://rspa.royalsocietypublishing.org/content/464/2095/1823.full.pdfhttp://rspa.royalsocietypublishing.org/cgi/collection/applied_mathematicshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#related-urlshttp://rspa.royalsocietypublishing.org/content/464/2095/1823.full.html#ref-list-1
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    2/28

    A hybrid analyticalnumerical method forsolving evolution partial differential

    equations. I. The half-line

    BY N. FLYER1,* AN D A. S. FOKAS2

    1Institute for Mathematics Applied to the Geosciences,National Center for Atmospheric Research, Boulder, CO 80305, USA

    2Department of Applied Mathematics and Theoretical Physics,University of Cambridge, Cambridge CB3 0WA, UK

    A new method, combining complex analysis with numerics, is introduced for solving alarge class of linear partial differential equations (PDEs). This includes any linearconstant coefficient PDE, as well as a limited class of PDEs with variable coefficients(such as the Laplace and the Helmholtz equations in cylindrical coordinates). Themethod yields novel integral representations, even for the solution of classical problemsthat would normally be solved via the Fourier or Laplace transforms. Examples includethe heat equation and the first and second versions of the Stokes equation for arbitraryinitial and boundary data on the half-line. The new method has advantages incomparison with classical methods, such as avoiding the solution of ordinary differentialequations that result from the classical transforms, as well as constructing integral

    solutions in the complex plane which converge exponentially fast and which areuniformly convergent at the boundaries. As a result, these solutions are well suited fornumerics, allowing the solution to be computed at any point in space and time withoutthe need to time step. Simple deformation of the contours of integration followed bymapping the contours from the complex plane to the real line allow for fast and efficientnumerical evaluation of the integrals.

    Keywords: numerical contour integration; evolution partial differential equations;

    integral transforms

    1. Introduction

    A new method for analysing boundary-value problems for linear and integrablenonlinear partial differential equations (PDEs) was introduced by one of theauthors inFokas (1997)and implemented for a variety of problems inFokas &Sung (2005). For linear evolution PDEs with spatial derivatives of arbitraryorder formulated either on the half-line, 0!x!N, or in the finite interval,0!x!L, this method expresses the solution as an integral in the complex k-plane(the Fourier plane). This integral involves the x-Fourier transform of the initial

    condition and certaint-transforms of the given boundary conditions ( Fokas 2002;

    Proc. R. Soc. A (2008) 464, 18231849

    doi:10.1098/rspa.2008.0041

    Published online1 April 2008

    * Author for correspondence ([email protected]).

    Received28 January 2008Accepted28 February 2008 1823 This journal is q2008 The Royal Society

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    3/28

    Fokas & Pelloni 2005; Pelloni 2005). It should be noted that this methodconstructs novel representations for even simple problems that are traditionallysolved in terms of classical transforms. For example, for the heat equation on afinite interval with Dirichlet boundary conditions, the new method yields a novelintegralrepresentation instead of the classical Fourier sineseriesrepresentation.

    The new representation, in contrast to the classical one, is uniformly convergentat the boundaries.

    It will be shown here that these novel integral representations are suitable forthe numerical evaluation of the solution. This is a consequence of the fact that itis possible, using simple contour deformations in the complex k-plane, to obtainintegrals involving integrands with a strong decay for large k.

    In order to present this novel approach in its simplest form, we will onlyconsider initial and boundary conditions for which the associated Fourier andt-transforms can be computed analytically. In this case, the numericalimplementation consists only of computing an integral in the complex k-plane

    involving a decaying integrand for large k.This new technique will be illustrated by integrating numerically certaininitial-boundary-value problems on the half-line for the heat equation

    qtZ qxx; 1:1for the first version of the Stokes equation

    qtCqxxxZ 0 1:2and for the second version of the Stokes equation

    qtK qxxxZ 0: 1:3

    Equations (1.2) and (1.3) are the linear limits of the celebrated KortewegdeVries equation and equation (1.3) corresponds to the case of dominant surfacetension.

    The paper is organized as follows: 2 gives a brief overview of the analyticalmethod ofFokas (2002)and derives the integral representations of the solutionsfor the above PDEs; 3 presents the technique for the numerical integration ofthe integrals presented in 2; 5 summarizes the methodology and 6 theadvantages and limitations of the method. Appendix A gives the MATLAB andMATHEMATICAcode for implementing the novel numerical method for an exampleof the heat equation. Appendix B compares the new method with the classicalLaplace transform method.

    2. Novel integral representations on the half-line

    Here, we give only a brief overview of the analytical method that is used to derivethe novel integral representations of the solution. A detailed discussion is giveninFokas (2002). The one-parameter family of solutions

    expikxKwkt; k2C; 2:1where w(k) is a polynomial of degree n and Re w(k)R0 for k real (the latterrestriction ensures that the initial-value problem for the associated PDE is wellposed) is admitted by the following linear evolution PDE:

    qtCwKivxqZ 0: 2:2

    N. Flyer and A. S. Fokas1824

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    4/28

    For example, for the heat equation,w(k)Zk2 andwKivxZKv2x. We next seek afunction X(x,t,k) such that we can rewrite the PDE as the following family ofdivergence forms:

    eKikxCwktqtKeKikxCwktXxZ 0: 2:3Simplifying this equation and replacing qtby Kw

    Kivx

    q, we find

    Xx; t; kZ iukKuKivxkC ivx

    q: 2:4The r.h.s. of this equation involves derivatives of order up to nK1, nbeing theorder of the polynomial w(k). Hence, we can write X(x,t,k) as

    Xx; t; kZXnK1jZ0

    cjkvjxq: 2:5

    Equating (2.4) and (2.5) for X(x,t,k) and letting KivxZl(an arbitrary complex

    parameter), we can compute the coefficients cj(k) in terms ofw(k)XnK1jZ0

    cjkiljZ iwkKwl

    kKl ; 2:6

    wherekand lare arbitrary complex parameters. By employing Gausss theorem,equation (2.3) yields in Fourier space the time evolution of the solution in termsof its behaviour on the timespace boundary, as given by the Fourier transformof the initial condition and certain t-transforms of the boundary values (see(2.9)). Then, taking the inverse Fourier transform, we find

    qx; tZ 12p

    N

    KN

    eikxKwktq0kdkK 12pN

    KN

    eikxKwkt~gk; tdk;0!x!N; tO0; 2:7

    where q0 and ~g are defined as follows (Fokas 2002): q0k is the Fouriertransform of the initial condition, i.e.

    q0kZN

    0eKikxqx; 0dx; Imk%0; 2:8

    and ~g

    k; t

    represents certaint-transforms ofX(0,t,k), namely the transforms of

    the boundary values at xZ0,

    ~gk; tZXnK1jZ0

    cjkT

    0euksvjxq0; sds

    2:9

    Z

    XnK1jZ0

    cjk~gjwk; t jZ 0;.; nK1; tO0; k2C; 2:10

    with cj(k) defined in (2.6).The representation (2.7) cannotbe used directly for the solution of a given initial-

    boundary-value problem because some of the boundary valuesfvjxq0; tg

    nK10

    are unknown. Indeed, the number of boundary conditions Nrequired for a well-posedproblem is given inFokas (2002)by

    1825Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    5/28

    NZ

    n

    2; ifnis even;

    nC1

    2 ; ifnis odd andansKic;

    nK1

    2 ; ifnis odd andanZKic;

    2666666664

    2:11

    wherecis a positive constant andandenotes the coefficient ofkn inw(k).

    Suppose that q(0,t) and the first NK1 derivatives of q(0,t) are given as

    boundary conditions. Then, the t-transformsf~gjwk; tgnK1N of the remainingunknown derivatives can be obtained by solving a system of nKN algebraicequations. These equations are obtained by replacing kwith n(k) in the equation

    ~gk; tZXnK1

    jZ0cjk~gjwk; tZ q0k; Imk%0; 2:12

    where n(k) denotes any of the roots of the equation w(n)Zw(k), which map DK

    into DC, with DK denoting the part of the domain

    D :fk2C; Rewk!0g;in the lower half complexk-plane andDC the part ofDin the upper half complexk-plane. Weemphasizethat the boundary valuesfvjxqgnK1jZNare never needed, onlytheirt-transforms are required, which can be obtained from the transforms of thegiven boundary conditions and from (2.12).

    The solution can then be represented in the formqx; tZ 1

    2p

    N

    KN

    expik xKwktq0kdk

    K 1

    2p

    vDC

    expik xKwkt~gk; tdk; 0!x!N; tO0: 2:13In what follows, we will apply the above construction to equations (1.1)(1.3).

    (a) The heat equation

    Substituting the expression (2.1) into equation (1.1), we find wZk2. Henceequation (2.6) with nZ2 implies

    c0Cc1ilZ ik2Kl2

    kKl Z ikC il; 2:14

    giving for equation (2.10)

    ~gZ ik~g0C ~g1: 2:15Using Rek2Z jkj2 cos2 argk, it follows that

    DC :arg k2p

    4;

    3p

    4

    ; DK :argk2

    5p

    4 ;

    7p

    4

    : 2:16

    N. Flyer and A. S. Fokas1826

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    6/28

    For mapping DK into DC, the equation n2Zk2 implies nZKk. Replacing kby Kk in equation (2.12), we find

    ~g1K ik~g0Z q0Kk; ImkR0: 2:17We now consider the Dirichlet problem

    qx; 0Z q0x; 0!x!N; q0; tZ g0t; tO0; 2:18where the functions q0(x) and g0(t) have appropriate smoothness. The first ofthese functions has appropriate decay, and the functionsq0andg0are compatibleat xZtZ0, i.e. q0(0)Zg0(0).

    In this case we solve equation (2.17) for ~g1 (the t-transform of the unknownboundary derivative) and substitute the result in the expression for ~ggiven in(2.15). This yields

    ~gZ2ik~g0C q0Kk; ImkR0: 2:19Hence, ifq(x,t) satisfies the heat equation (1.1) and the initial and boundary

    conditions given by equations (2.18), then the solution for {0!x!N, tO0} isgiven by

    qx; tZ 12p

    N

    KN

    expik xKk2tq0kdk

    K 1

    2p

    vDC

    expikxKk2t2ik~g0k2; tC q0Kkdk; 2:20

    where vDC is the boundary of the domain DC defined in (2.16) and depicted infigure 1, and q0

    k

    and ~g0k; t

    are given by

    q0kZN

    0eKikxq0xdx; Imk%0; 2:21

    ~g0k; tZt

    0eksg0sds; tO0; k2C: 2:22

    (b ) The first version of the Stokes equation

    For equation (1.2), w(k)ZKik3. Hence by (2.6),

    c0Cc1ilK c2l2Z k3Kl3

    kKl Z k2K ikilKKl2;

    i:e: ~gZ k2 ~g0K ik~g1K~g2: 2:23In this case

    DC :argk2p

    3;

    2p

    3

    ; DK :argk2 p;

    4p

    3

    g

    5p

    3 ; 2p

    : 2:24

    Now, the equation n3Zk3 implies nZak and nZa2k, aZexp

    2ip=3

    . Further-

    more, ifk2DC

    thenak2DK

    1 anda2

    k2DK

    2 (figure 2). Hence, replacingkby akanda2kin equation (2.12), we find the following two equations coupling the threeboundary values:

    1827Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    7/28

    a2k2 ~g0K iak~g1K~g2 Z q0ak; 2:25ak2 ~g0K ia

    2k~g1K~g2Z q0a2k; k2DC: 2:26Thus, for a well-posed problem, we need one boundary condition, i.e. NZ1.

    We now consider the problem defined by equations (2.18). In this case we solveequations (2.25) and (2.26) for ~g1 and ~g2 and substitute the results in theexpression for ~gdefined by the second of equations (2.23).

    Hence, ifq(x,t) satisfies equation (1.2) and the initial and boundary conditionsgiven by equations (2.18), then the solution for {0!x!N, tO0} is given by

    qx; tZ 12p

    N

    KN

    expik xC ik3tq0kdkK 12pvDC

    expik xC ik3t

    !3k2 ~g0Kik3; tKaq0akKa2q0a2kdk; 2:27

    where aZe2ip=3; vDC is the boundary of the domain DC defined by the first ofequations (2.24) and depicted in figure 2; and q0k and ~g0k; t are definedby equations (2.21) and (2.22), respectively.

    (c) The second version of the Stokes equationFor equation (1.3), w(k)Zik3, hence

    ~gZKk2 ~g0C ik~g1C ~g2: 2:28In this case

    DC :argk2 0;p

    3

    h ig

    2p

    3 ;p

    ; DK :arg k2

    4p

    3 ;

    5p

    3

    : 2:29

    Ifk2DC1 then ak2DK, and ifk2DC2 then a

    2k2DK (figure 3). Thus, for the

    determination of ~g for k2DC

    1, we replace kby akin equation (2.12),

    Ka2k2 ~g0C iak~g1C ~g2 Z q0ak; k2DC1 ; 2:30

    D

    D+

    Figure 1. The domains defined by (2.16). Arrows indicate the boundary contour vDC.

    N. Flyer and A. S. Fokas1828

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    8/28

    similarly, for the determination of ~g fork2DC2 , we replacekby a2k in equation

    (2.12),Kak2 ~g0C ia

    2k~g1C ~g2 Z q0a2k; k2DC2: 2:31Each of equations (2.30) and (2.31) is one equation coupling the three boundaryvalues. Thus for a well-posed problem, we need two boundary conditions, i.e. NZ2.

    We now consider the initial-boundary-value problem defined by equation(2.18), supplemented with the equation

    qx0; tZ g1t; tO0; 2:32where the function g1(t) has sufficient smoothness and _q00Zg10.

    In this case we solve equations (2.30) and (2.31) for ~g2 and substitute theresulting expressions in equation (2.28).

    Hence, ifq(x,t) satisfies equation (1.3) and the initial and boundary conditionsare given by equations (2.18) and (2.32), then the solution for {0!x!N,tO0} isgiven by

    qx; tZ 12p

    N

    KN

    eikxKik3tq0kdkK

    1

    2p

    vDC1

    eik xKik3t

    1Kaa2k2 ~g0ik3; t

    Cik~g1ik3; tC q0ak

    dkK 1

    2p

    vDC2

    eik xKik3taK1k2 ~g0ik3; t

    Ca2ik~g1ik3; tC q0a2k

    dk; 2:33

    where the contours vDC1 andvDC2 are the boundaries of the domainsD

    C1 andD

    C2

    defined by the first expression in (2.29) and depicted infigure 3; q0kand ~g0k; tare defined by equations (2.21) and (2.22), respectively; and ~g1k; tis defined by

    ~g1k; t

    Z

    t

    0

    eksg1s

    ds; tO0; k2C:

    2:34

    In equation (2.33), we have simplified the expressions for ~gby employing theidentity 1CaCa2Z0.

    D1

    D+

    D2

    Figure 2. The domains defined by (2.24). Arrows indicate the boundary contour vDC.

    1829Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    9/28

    3. Numerical evaluations on the half-line

    In this section, we present a novel technique for numerically evaluating theintegral representations of the solutions to the initial-boundary-value problemsdiscussed in 2. The main ideas common to all cases are as follows.

    (i) To perform simple contour deformations in the complex k-plane suchthat the deformed integration paths are in regions where the integrandsdecay exponentially for large k. This yields rapid convergence of thenumerical scheme.

    (ii) For algorithmic convenience and simplicity, to make a change ofvariables, which maps the contours from the complex plane to the realline.

    Below, we will discuss in detail how we choose the integration path in each case.

    (a) Solutions of the heat equation

    Recall the solution to the heat equation on the half-line for {0!x!N, tO0},

    qx;tZ 12p

    N

    KN

    eik xKk2tq0k dkK

    1

    2p

    vDC

    eik xKk2t2ik~g0k2;tCq0Kk dk:3:1

    Let us first consider the integral whose contour runs along vDC. Using (2.22),the first term of the integral can be written as

    expikxKk2t~g0k2;tZeikxt

    0expKk2tKsg0s ds: 3:2

    Since exp[ikx] is bounded and analytic for Im kO0 and eKk2tKs with tRs is

    bounded and analytic for Re (k2

    )O0, it follows that, for this term, the contourvDC can be deformed to any contourL in the unshaded domain of the upper halfcomplex k-plane offigure 1. The next termexpik xKk2tq0Kk involves the

    D1

    +D

    2

    +

    D

    Figure 3. The domains defined by (2.29). Arrows indicate the boundary contours vDC1 andvDC2.

    N. Flyer and A. S. Fokas1830

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    10/28

    factors eikx and q0Kk which are bounded and analytic for Im kO0, and thefactor eKk

    2t which is bounded and analytic for Rek2O0. Hence, the contourvDC

    for this term can also be deformed to L.Splitting the term defined by q0k (see (2.8)) into two terms and then

    substituting these terms into the integral along the real axis in (3.1) results in the

    following integrand:

    eKk2t

    x0

    expikxKxq0xdxCN

    xexpikxKxq0xdx

    : 3:3

    In the first term,xKxR0, thus for this term the contour along the real axis canbe deformed to L. For the second term in (3.3), xKx%0, thus for this term thecontour along the real axis can be deformed to a contour LK in the unshadeddomain of the lower half complex k-plane.

    The term q0kis in general analytic only for Imk!0; however, depending onthe properties of q0(x), it is sometimes possible to extend the domain ofanalyticity to the upper half of the complexk-plane. For example, this is possibleifq0(x) is such that q0(x)e

    ax, aO0, is square integrable on [0,N). Ifq0(x) belongsto this restricted class, then the contour along the real axis can also be deformedto the contour L.

    Example 3.1.

    q0xZ xeKa2x; 0!x!N; g0tZ sinbt; tO0; 3:4

    whereaand b are real numbers. Then,

    q0kZ1

    ikCa22; ~g0k; tZ1

    2i

    expkC ibtK1kC ib

    KexpkK ibtK1

    kK ib

    :

    3:5Hence, equation (2.20) yields

    qx; tZ 12p

    L

    eik xKk2t 1

    ikCa22K 1

    KikCa22

    Kkeik x eibtKeKk

    2t

    k2C ib K

    eKibtKeKk2t

    k2K ib

    " #)dk; 3:6

    where the contour L that is actually used in the computation is depicted infigure 4b.

    Technically, any valley-to-valley path in the upper half plane of figure 4a,where argk2 3p=4;p and argk2 0;p=4, will give exactly the same result.However, in order to have rapid convergence for largek, it is natural to choose apath which for large k aligns with the rays of steepest descent, where the

    integrand decays most rapidly. In the current problem, these lie at argkZGp=8.Hyperbolas are simple curves that possess the property of having asymptoticdirections and are therefore a natural choice for an integration path.

    1831Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    11/28

    There are many ways to parametrize hyperbolas. One way that is particularlywell suited for our work in the complex plane is to use the analytic function

    kqZ igsinaK iqZ g2eiaeqKeKiaeKq; 3:7

    which maps the points q on the real line to hyperbolas k(q) in the complex plane.The factor i multiplying the sin in (3.7) rotates the contour p/2 degrees in thecomplex plane, while g (set to 1 in this case) is a scaling factor and aZp/8 sothat the asymptotes of the hyperbola k(q) lie along the path of steepest descent.An equispaced grid in the q-direction corresponds to points along the hyperbolathat are concentrated near the origin and become exponentially sparse for large k(figure 4b). This type of mapping is particularly well suited for the numericalintegration of functions that feature their greatest variations near the origin.

    Using the mapping (3.7), the integral (3.6) becomes

    qx; tZ g2p

    N

    KN

    expikqxKk2qt 1ikqCa22K 1

    KikqCa22

    !kqexpikqx eibtKeKkq

    2t

    kq2C ib KeKibtKeKkq

    2t

    kq2Kib

    " #)cosaKiqdq: 3:8

    Now that the integral has been mapped to a straight line (the real line in thiscase), the simple trapezoidal rule can be applied to (3.8), giving exponentialaccuracy, since the integrand is analytic and decays rapidly on an unbounded

    domain. This type of numerical quadrature has been used to evaluate a variety ofcontour integrals that appear in applied mathematics, from the inversion ofLaplace integrals to fast methods for computing special functions and matrix

    3 /4 /4D+

    (a) (b)

    5

    5

    0

    5

    0

    5

    1.0

    0.5

    00.5

    1.0Im

    k

    Rek

    Figure 4. (a) A schematic of the contour L with the rays at p/4 and 3p/4 that define vDC (theboundary of the domainDC). In the shaded regionDC, the integrand grows exponentially. (b) Themodulus of the integrand of (3.6) plotted in the complex k-plane for xZtZ1/2, bZ2p and aZ2.The integration contourLdefined by the mapping (3.7) (aZp/8,gZ1) with the quadrature pointsq given as black dots.

    N. Flyer and A. S. Fokas1832

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    12/28

    exponentials (Sidje 1998; Gil et al. 2003; Lopez-Fernandez & Palencia 2004;Weideman 2006;Weideman & Trefethen 2007).

    Before numerically computing (3.8), we first discuss a truncation estimatefor the required integration interval, which is an estimate for N in truncatingN

    KNfqdqtoNKNfqdq, wheref(q) is the integrand in (3.8). It is easy to show

    that the imaginary part of the integrand is antisymmetric and thus will notcontribute to the integral. If we expand f(q) into real and imaginary parts,simplify and then take the leading order term, we find that the leading behaviourof

    jf(q)

    jis given by g(q), where

    gqZ 1p

    exp K 1

    2

    ejq jxsin

    p

    8

    $jsin 2ptj: 3:9

    Plottingjf(q)jagainstjg(q)jinfigure 5, we see that this estimate is very accurate.In addition,jg(q)jhas decayed halfway from its maximum to zero near the endsof the interval when expK1=2 ejq jxsinp=8Z1=2, i.e.

    jqjZ log 2 log 2sin p8 Klogxz1:2872Klogx: 3:10

    ForxZ10K13, this yieldsjqjz31:22. ForxZ10K43, the transition occurs aroundqZG100, giving an integration interval of q2[K101,101]. Thus, for any xO0,we can easily and accurately compute the integral since the integration intervalincreases at a slow logarithmic rate. However, for xZ0 the integration interval isinfinite and any truncation will result in the integral not converging exactly tothe boundary condition.

    The above discussion shows that the integration interval depends on x (thedependence on t is innocuous as noted in (3.9)). Furthermore, figure 6, wherethe real part of the integrand for decreasing x is plotted, indicates that the

    contributions to the integral come from two humps of constant height nearthe origin which are not a function ofxand two humps of constant height whichmove out from the origin as x/0.

    30 20 10 10 20 30

    0.025

    0.050

    0.075

    0.100

    0.125

    0.150

    0.175

    Figure 5. Comparison betweenjf(q)j andjg(q)j for xZ10K13 and tZ0.1.

    1833Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    13/28

    The fact that the real part of the integrand contains a lot of fine structurenear the outer part of its support renders the use of the trapezoidal rule

    cumbersome: as x/0 the number of evaluation nodes increases dramaticallysince they are equispaced. Hence, an adaptive quadrature method is moresuitable. We next discuss such an approach.

    (i) An alternative approach

    Equation (3.8) defines an ordinary integral with an exponentially decayingintegrand asq/GN. Any language with a built-in numerical integrator, such asMATHEMATICA, MAPLE or MATLAB, can provide a much simpler approach toevaluating the integral. This is particularly true for the integrand of (3.8) which,

    as discussed earlier, exhibits rapid variations for small x. Since these numericalintegrators use adaptive quadrature schemes that sense these variations, theyare most suitable for the integrals we are dealing with. In the table below, thetrapezoid rule, programmed in MATLAB, is compared with the MATHEMATICANIntegrate command, displaying the time in seconds it took to run the code forevaluating the integral at (x,t)Z(0.5, 0.5), (x,t)Z(1!10K3, 1!10K3) to sixdigits of accuracy and to producefigure 7.

    The evaluation of a single point takes the same amount of time in eitherprogram. To produce figure 7 takes about 14 s longer in MATHEMATICA thanMATLAB. However, in MATHEMATICA one does not have to worry about the

    number of evaluation nodes needed; furthermore, it is simpler than the MATLABcode (see appendix A). Thus, we will use MATHEMATICAin the examples analysedin this paper (table 1).

    40 20 0 20 400.04

    0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.10

    0.12(a) (b) (c)

    40 20 0 20 40 40 20 0 20 40

    Figure 6. The real part of the integrand of (3.8) plotted as a function ofq for decreasing values ofxand tZ0.1. (a) xZ1!10K3; (b) xZ1!10K8; (c) xZ1!10K13.

    N. Flyer and A. S. Fokas1834

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    14/28

    (b ) Solutions to qtCqxxxZ0 on the half-line

    Recall the general solution to (1.3) on the half-line given by the representation(2.27),

    qx; tZ 12p

    N

    KN

    expik xC ik3tq0kdkK 1

    2p

    vDC

    expik xC ik3t3k2 ~g0Kik3; tKaq0akKa2q0a2k

    dk; aZ e2ip=3; 0!x!N; tO0: 3:11

    The term involving ~g0 can be treated as the corresponding term of the heatequation in the previous subsection. However, since the real axis is notsurroundedby the domain satisfying Re

    Kik3

    O0, it is not possible, by splitting q0

    k, to

    deform the real axis to a contour in the lower half of the complex k-plane. On theother hand, ifq0(x) belongs to a restricted class, then the real axis can be deformedto the same contour that vDC will be deformed to in the upper half plane; similarconsiderations apply to the terms involving q0akand q0a2k.

    Example 3.2. Let q0(x) and g0(t) be defined by equation (3.4). Then equation(2.27) becomes

    qx; tZ 12p

    L

    expik xC ik3t 1ikCa22 C a

    iakCa22 C a2

    ia2kCa22

    C 3k2

    2 eikx e

    ibtKeik3

    t

    bKk3 K e

    KibtKeik3

    t

    bCk3

    " #dk: 3:12

    0.2

    0.4

    0.6

    0.8

    0

    0.5

    1.0

    1.5

    2.01.0

    0.5

    00.5

    1.0

    0.2

    0.4

    0.6

    0.8

    Figure 7. The solution (3.6) displayed for x2[0,1] and t2[0,2].

    Table 1. The time in seconds to evaluate the integral at ( x,t)Z(0.5, 0.5), (x,t)Z(1!10K3, 1!10K3),to six digits of accuracy and to produce figure 7.

    MATLAB (trapezoidal rule) MATHEMATICA (NIntegrate)

    (x,t)Z(0.5, 0.5) 0.02 0.02(x,t)Z(1!10K3, 1!10K3) 0.04 0.04figure 7 1.14 14.65

    1835Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    15/28

    Regarding the determination of the integration path L, this case is almost

    identical to that of the heat equation except that the rays defining the boundary ofthe domainDC are at argkequalsp/3 and 2p/3. As a result, we will use the samechange of variables defined by equation (3.7), except that awill now be p/6. Theintegration path and the modulus of the integrand are depicted infigure 8.

    After using the substitution kqZ i sinp=6K iq, the built-in numericalintegrator in MATHEMATICAis used to evaluate the r.h.s. of (3.12). The solution isplotted infigure 9.

    (c) Solutions to qtKqxxxZ0 on the half-line

    The rays argkZp=3 and 2p/3 in the representation of the solution (2.33) canbe deformed to the unshaded domain of the upper half complex k-plane offigure 3, but if exp[ikx] and exp[Kik3t] are treatedseparately, the real axiscannotbe deformed to the unshaded domain of the lower half of the complex k-plane,since exp[ikx] is unbounded for Imk!0. However, this problem can be bypassedif the term exp[ikxKik3t] is treated as asingleterm. In a follow-up paper for thefinite interval case, we will also address the issue of inhomogeneous boundaryconditions for this PDE on the half-line as certain novel treatments are needed inorder to numerically handle the deformation of the contours.

    Example 3.3. Let

    q0xZ x2eKa2x; g0tZ g1tZ 0; 3:13

    5

    0

    5

    0

    5

    Im

    k

    Rek

    1.0

    0.5

    00.5

    1.0

    5

    Figure 8. The modulus of the integrand of (3.12) plotted in the complex k-plane for xZtZ1/2,bZ2pand aZ2. The integration contour L defined by the mapping (3.7) (aZp/6, gZ1) with thequadrature points q given as black dots.

    N. Flyer and A. S. Fokas1836

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    16/28

    wherea is a positive real number. Then,

    q0kZ2

    ikCa23: 3:14

    Hence,

    qx; tZ 1p

    N

    KN

    eik xKik3t

    ikCa23 dkK1

    p

    vDC1

    eik xKik3t

    iakCa23 dkK1

    p

    vDC2

    eik xKik3t

    ia2kCa23 dk:

    3:15

    The regions of thek-complex plane where ReikxK ik3t%0 determines the threesectors (unshaded areas infigure 3) where expikxK ik3tand hence each of theintegrands in (3.15) is bounded. The contours, vDC1 and vD

    C2 , and the real axis

    can therefore be deformed to run from the valley of one sector into the valley ofanother where the integrands are exponentially small for large k. The onlyprecaution that must be taken is that the valleys widen or narrow as a function ofx and t. To illustrate this point, let us plot in figure 10 the absolute valueof expikxKik3t for two different values ofxand t, (xZ15, tZ15) and (xZ10,tZ0.1), keeping the scale the same on both plots for comparison.

    In order to overcome this difficulty, we require that the integration path kZf(q)runs straight down the centre of the valleys and also passes through the saddlepointsof the surface defined by the integrand. The saddlepoints for all the integrands occur

    whenv=vkexpikxK ik3tZ0, i.e. kZGffiffiffiffiffiffiffiffiffiffi

    x=3tp

    . We then define a shift to ourcontour bykZf(q)Caand ask for what value ofq and a willkbe equal to

    ffiffiffiffiffiffiffiffiffiffix=3t

    p .

    (i) Deformation ofvDC1 andvDC2

    The shift to the contour in this case is trivial since we only have to passthrough one saddlepoint that occurs when qZ0 in each case. As a result, for vDC1

    kZKeKip=6sin p

    6K iq

    K

    ffiffiffiffiffix

    3t

    r C

    eKip=6

    2 ; 3:16

    0

    0.25

    0.50

    0.75

    1.00

    0.25

    0.50

    0.75

    1.00 1.00.5

    00.5

    1.0

    Figure 9. The solution (3.12) displayed on x2[0,1] and t2[0,1].

    1837Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    17/28

    and for vDC2

    kZ eip=6 sin p

    6K iq

    C

    ffiffiffiffiffix

    3t

    r K

    eip=6

    2 : 3:17

    The factor of eip=6 rotates the contourp/6 degrees to orient it along the correctsectors (for vDC2 , the addition of the minus signs to this factor simply reflects itacross the imaginary axis). The contour for the vDC1 deformation is plotted in

    figure 11aand the contour for the vDC2 deformation is plotted infigure 11b. Thepoles do not occur in the sectors where the contours run.

    (ii) Deformation of the real axis

    This case is more complicated since the contour is deformed into the lower half

    plane and must pass through both saddlepointsGffiffiffiffiffiffiffiffiffiffi

    x=3tp

    . Our original deformedcontour is Ki sinp=6C iq. Splitting this expression into real and imaginaryparts, adding the shifta and setting the expressions equal to

    ffiffiffiffiffiffiffiffiffiffix=3t

    p , we have two

    equations in two unknowns,a and q. Solving the system, we arrive at the contour

    kZKi sin p

    6C iq

    C

    i

    6

    ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi9C4

    x

    t

    r : 3:18

    In this case there is an additional difficulty due to the pole at kZia2: if we fixxand lettbecome small, the contour gets shifted upward, interacting with the poleand adding an unwanted contribution. To illustrate this difficulty, we plot infigure 12aandfigure 12bthe absolute value of expikxK ik3t=ikCa23, as wellas the contour for xZ1, tZ1 and then for xZ1, and tZ0.01.

    This difficulty can be overcome by subtracting out the pole to obtain asingularity-free integrand. This is done by subtracting from the function,

    expikxK ik3

    t=ikCa2

    3

    , a function that decays in the lower half plane (suchas eKik) but has the exact same pole character. The function is derived byenforcing that the coefficients (aK1, aK2, aK3) for the three components of the

    5

    0

    5R

    ek

    Re

    k

    Imk

    Imk

    0

    5

    00.5

    1.0

    1.5

    2.0

    00.51.0

    1.5

    2.0

    5

    5

    0

    5

    5

    0

    5

    (a) (b)

    Figure 10. (a) The absolute value of eik xKik3

    t forxZ15 andtZ15. (b) The absolute value of eik xKik3

    t

    for xZ10 and tZ0.1.

    N. Flyer and A. S. Fokas1838

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    18/28

    pole in the Laurent expansion of the integrand (i.e. aK3=Kia2Ck3;aK2=Kia2Ck2; aK1=Kia2Ck) vanish when it is subtracted. Such a functionis given by

    hkZ eKikexpa2Ka6tKa2x iKia2Ck3K 1C

    3a

    4

    tC

    xKia2Ck2

    Ki1K6a2tC6a4tC9a8t2C2xC6a4txCx2

    2Kia2Ck

    : 3:19Figure 12c and figure 12d show the surfaces with the pole removed and

    the corresponding integration path. The integrand to be evaluated is nowexpikqxK ikq3t=ikqCa23K hq, where the mapping (3.18) has beenused.

    Now that all three contours have been mapped to the real axis, theintegrands decay exponentially for large kand do not involve any poles; we cannumerically evaluate the integrals using MATHEMATICA. The solution is given infigure 13.

    (iii) A note on timespace corner singularities

    One of the striking features of the solution is the wave pattern that emanatesfrom the corner of the domain (xZ0,tZ0). This phenomenon results from thefact that unless the initial and boundary data are compatible for all orders (i.e.unless they satisfy an infinite set of compatibility conditions), the solution will

    feature irregularities that emanate from the corner and behave according to thenature of the given PDE (i.e. diffuse for the heat equation; propagate for thecurrent problem;Boyd & Flyer 1999). In our case, the initial condition (IC) and

    5.02.5

    02.5

    5.0 Rek

    Re k

    5.0

    2.5

    0

    2.5

    5.0

    0

    12

    34

    5

    0

    12

    345

    5.0

    2.5

    0

    2.5

    5.0

    5.0

    Imk

    Imk

    2.5

    0

    2.5

    5.0

    (a) (b)

    Figure 11. The modulus of the integrands of thevDC1 andvDC2 contour integrals in (3.15) plotted in

    the complex k-plane for xZtZ1/2 and aZ3/2. The integration contours are defined by themappings (3.16) in (a) and (3.17) in (b) with the quadrature points q given as black dots.

    1839Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    19/28

    boundary conditions (BCs) do match at the corner, satisfying the lowest ordercompatibility condition. However, there exists an incompatibility in the nextorder, q(BC)tsq(IC)3x, since q(BC)tZ0 and q(IC)3xZK27/2. All higher orderconditions are derived by simply taking derivatives with respect to the time ofthe PDE and substituting in the IC and BCs. An extensive study on the nature ofsuch singularities and their numerical implications for dissipative, dispersive andconvective PDEs is given inFlyer & Swarztrauber (2002)and Flyer & Fornberg(2003a,b).

    4. An example of a finite interval case

    We will present details of the discussion for the finite interval case in a follow-uppaper. Hence, we discuss only briefly a simple example.

    5.02.5

    02.5

    5.0

    Rek 5.02.5

    02.5

    5.0

    Rek

    5.0 2.50

    2.55.0

    Rek

    5.0

    2.5 02.5

    5.0

    Rek

    5.0

    2.5

    5.0

    Imk

    Imk

    0

    0.25

    0.50

    0.75

    1.00

    0

    0.25

    0.50

    0.75

    1.00

    0

    2.5

    5.0

    2.5

    5.0

    Imk 0

    2.5

    5.0

    2.5

    0

    5.0

    00.25

    0.50

    0.75

    1.00

    00.250.50

    0.75

    1.00

    2.5

    Imk

    5.0

    2.5

    0

    5.0

    2.5

    (a) (b)

    (c) (d)

    Figure 12. The modulus of the integrand for the contour integral along the real axis in (3.15)plotted in the complex k-plane with aZ3/2 for (a) xZtZ1, (b) xZ1, tZ0.01, (c) same as (a) butwith the pole removed and (d) same as (b) but with the pole removed. The integration contour isdefined by the mapping (3.18) with the quadrature points q given as black dots.

    N. Flyer and A. S. Fokas1840

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    20/28

    Example for the heat equation. For equation (1.1) the numerical evaluation ofq(x,t) involves steps similar to those used in 3a. For example, let the initial andboundary conditions be

    qx; 0Z 0; 4:1q0; tZ g0tZ sint; 4:2

    q1; tZf0tZ teKt=2

    : 4:3Then, for the boundary condition at xZ0,

    ~g0k; tZt

    0q0; tek2s dsZ

    t0

    sinsek2s ds 4:4and for that at xZ1

    ~f0k; tZt

    0q1; tek2s dsZ

    t0

    seKs=2ek2s ds: 4:5

    The solution on 0!x!1 and tO0 is then given by

    qx; tZK12p

    vDC

    keikxKk2ti~g0k; tK~g0k; tcotkC ~f0k; tcsckdk

    K1

    2p

    vDK

    keikxK1Kk2ti~f0k; tC ~f0k; tcotkK~g0k; tcsckdk:

    4:6The details of the derivation will be presented in a follow-up paper that will

    focus on the finite interval case as well as on inhomogeneous boundary conditionsfor the second version of Stokes equation. As with the heat equation on the half-line, the mappingk

    q

    Z i sin

    p=8K iq

    is used to deform the vDC contour to the

    real line and kqZKi sinp=8K iq for the vDK

    contour. For the domainx2[0,1],t2[0,2p], only the short integration interval qZG10 was needed beforethe integrand became negligible. The solution is given in figure 14.

    0

    2.5

    5.0

    7.5

    10.0

    0

    0.25

    0.50

    0.75

    1.00

    0.100.05

    00.050.10

    Figure 13. The solution (3.15) displayed on x2[0,12] and t2[0,1].

    1841Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    21/28

    5. Summary of methodology

    The steps for the analytical derivation of the solution can be summarized asfollows.

    (i) Compute the Fourier transform of the initial condition for 0%x%N.(ii) Determine the number of necessary boundary conditionsfvjxq0; tgnK1jZ0 ,

    wheren is the degree of the polynomial w(k) appearing in (2.1).

    (iii) Compute the t-transforms ~gjk; tZt0eksvjxq0; sds; jZ0;.; NK1 ofthe given boundary data.

    (iv) Find the roots of w(n)Zw(k) which map the part of the domain D:fk2C; Rewk!0g in the lower half plane to the upper half complexk-plane. For example, for the heat equation the transformation n(k)ZKkmaps the domain DK to the domain DC as depicted in figure 1.Similarly, for the first version of the Stokes equation, the transfor-mations n1kZe2pi=3k and n2kZe4pi=3k map the domains DK1 and DK2depicted infigure 2to the domain DC.

    (v) Substitute these roots in the equationPnK1jZ0cjk~gjwk; tZ q0k.This will give a system of nKN linear algebraic equations for thet-transforms of the unknown boundary values, where cj(k) is defined in(2.6). We emphasize that we do notneed the unknown boundary valuesfvjxq0; tgnK1jZN, only their t-transforms are required, which can beexpressed in terms of the transformed boundary and initial data.

    (vi) The general solution is then given by

    qx; tZ 12p

    N

    KN

    expikxKwktq0kdk

    K 12p

    vDC

    expikxKwktXnK

    1

    jZ0

    cjk~gjwk; tdk: 5:1

    0

    2

    4

    6 1

    0

    1

    0.25

    0.50

    0.75

    1.0

    Figure 14. The solution (4.6) displayed for x2

    [0,1] and t2

    [0,2p

    ].

    N. Flyer and A. S. Fokas1842

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    22/28

    Once we obtain the solution, the methodology for numerically integrating thecontour integrals for the heat and first version of the Stokes equation is as follows.

    (i) Deform the integration paths, i.e. the contours vDC and the real axis to ahyperbola in the upper half k-complex plane by the mapping k

    q

    Z

    igsinaK iq, choosing a and g so that the path aligns with the rays ofsteepest descent. Real values ofqare then chosen as the numerical evaluationnodes.

    (ii) Insert the mapping k(q) into the analytical solution and then evaluatenumerically the resulting expression using the simple trapezoidal rule, whichwill give spectral accuracy for integrands that are analytic and decayexponentially fast on an unbounded domain. Alternatively, numericalintegrators built into such languages as MATHEMATICA, MAPLEor MATLABcanbe used.

    For the second version of the Stokes equation, the same steps as above applyexcept the following.

    (i) The mapping k(q) will need to be shifted by a constant a(x,t) that isdetermined by finding the saddlepoints of the relevant integrand.

    (ii) For the deformation of the integral path along the real axis, any poles in theupper half k-complex plane will need to be subtracted out as seen infigure 3.

    (iii) This is accomplished by subtracting from the integrand a function suchthat the resulting expression is free from singularities.

    6. Conclusion

    We have introduced a novel hybrid analyticalnumerical method for solvingcertain linear PDEs. The starting point of this method is the derivation of a novelanalytical representation for the solution (Fokas 2002). The advantages as well asthe limitations of the method are discussed below.

    For evolution PDEs, the main advantage of the new method is that it can be

    used to compute solutions at arbitrary points in the (x,t) plane. Neither timestepping nor spatial differencing is required. In this respect, the new method hassome similarities to the Laplace transform technique; however (i) for anevolution PDE with an nth order spatial derivative, the Laplace transforminvolves exp[KstCl(s)x], where l(s) solves an nth order algebraic equation,whereas our formulation involves expikxKwkt, where w(k) is an explicitpolynomial of degree n. For example for the equation

    qtCqxCqxxxZ 0;

    l(s) solves the cubic equation l3ClKsZ0, whereas w

    k

    Z ikK ik3. (ii) The

    explicit and analytic dependence on kallows us to deform contours which inturn yields exponentially decaying integrals and thus efficient numericalcomputations. (iii) The Laplace transform requires tgoing to N, which is not

    1843Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    23/28

    natural for evolution equations (one usually attempts to overcome this difficultyby appealing to causality arguments). Even for problems where l(s) can befound explicitly, such as the case of the heat equation, the new method hasadvantages over the Laplace transform method as shown in appendix B.

    The novel representation, in contrast to the classical Fourier integral (half-

    plane) or the Fourier series (finite interval), has the advantage that it convergesuniformly at the boundaries.

    The semi-analytical nature of the new method has a pedagogical advantage: theusual numerical techniques for spatial discretizations Fornberg (1996),Trefethen (2000)andBoyd (2001)are constructed independent of the analyticaltreatment of the given PDE. This often raises questions about the reason forteaching students analytical techniques. This should be contrasted with the newmethod, where the numerical integration is the last step of an approach that isbased on the analytical treatment of the given PDE.

    Although this method is obviously very efficient, the applications presented inthe paper have the following limitations:

    (i) involve constant coefficient PDEs,(ii) involve PDEs with derivatives of first order in time, and

    (iii) require initial and boundary conditions of sufficient simplicity, so that theirFourier transforms can be computed explicitly.

    However, among these limitations, it appears that only (i) is a significantlimitation. Indeed, the analytical method introduced in Fokas (2002) can be

    applied to any PDE that admits a Lax pair formulation. This includes linear PDEswith constant coefficients, such as the wave, the Laplace and the Helmholtzequations, as well as alimitedclass of PDEs with variable coefficients (such as theLaplace and the Helmholtz equations in cylindrical coordinates). For theseequations it is possible to obtain an integral representation in the complex k-plane,which involves the Fourier transforms of the given boundary conditions and of theunknown boundary values. For simple problems, the Fourier transforms of theunknown boundary values canbe eliminated and then the numerical techniqueintroduced in this paper can be immediately applied. For example this approach isimplemented in Kalimeris (in preparation) and Spence (in preparation) for the

    particular problems of the Laplace and modified Helmholtz equations formulatedin the interior of either an orthogonal isosceles triangle or an equilateral triangle.For more complicated problems, such as the Laplace and Helmholtz equations inthe interior of an arbitrary convex polygon, one must first use the novel numericaltechnique ofSifilakis et al. (in press)to determine the unknown boundary valuesand then one can apply the numerical technique introduced here (see Smithemanet al. in preparation).

    Regarding the limitation (iii), there exist approximations currently underinvestigation which yield an explicit integrand for the integral formulated in thecomplex k-plane; furthermore, this integrand has similar analytic properties to

    those discussed in this paper. There exist powerful methods for the numericalevaluation of Fourier-type integrals when they cannot be computed analytically(see for exampleIserles 2004).

    N. Flyer and A. S. Fokas1844

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    24/28

    We emphasize that the results presented in this paper are of exploratory natureand one can expect further improvements to be made, particularly if thesetechniques are pursued by other researchers.

    The work was supported by NSF grant no. ATM-0620100.

    Appendix A. MATLAB and MATHEMATICA codes

    (a) MATHEMATICAcode

    uZ 2p; aZ2; gZ 1; aZp=8;

    intgZexpikxKk2t

    2p

    1

    ikCa22K 1

    KikCa22

    Ckeikx

    2p

    eKiutKeKk2t

    k2K iu K

    eiutKeKk2t

    k2C iu

    !;

    kZ igsinaK iq;tempxK; tKdEvaluateintgDk; q;

    qxK; tKdIfxZZ0; Sinut; IftZ 0;xea

    2x; ReNIntegratetempx; t;fq;K30; 30g :

    1845Hybrid analyticalnumerical method

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    25/28

    Plot3D[q[x,t], {x,0,1}, {t,0,2}, PlotPoints/51, PlotRange/{K1,1}, AxesLabel/{x, t, }, Shading/False, ViewPoint/{K2,K2.4, 2}].

    Appendix B. Comparison with the Laplace transform method

    The heat equation can be solved with the classical Laplace transform. In whatfollows we will compare our method with the numerical evaluation of the inverseLaplace transform. We note that there exist different approaches to implementingthe Laplace transform method for solving PDEs. For example, Weideman &Trefethen (2007)use a Chebyshev expansion to discretize the spatial operator inthe heat equation and then apply Laplace transforms in time to the semi-discreteproblem. Here, we will consider only the classical approach.

    Once we apply the Laplace transform in time to the PDE and solve the resultingODE in space, then the Bromwich integral that must be inverted is

    1

    2pi

    aCiNaKiN

    est effiffi

    sp

    x 8

    sK162 C 2p

    4p2Cs2

    CeK4x

    K8CsK16xsK162

    ds; B 1

    where the lineaKiN toaCiN is to the right of all singularities. Before we discussdifferent ways to evaluate the integral, let us look at its properties.

    (i) There are poles at sZG2pi.(ii) There is a branch point at sZ0, with a branch cut along the negative real

    axis due to the term effiffisp x.(iii) The apparent pole atsZ16 is in fact a removable singularity. AtsZ16, the

    integrand simplifies toexp16tK4x=644x2CxC32p=64Cp2.(iv) The integral diverges for tZ0 due to the term eK4xsx=sK162.The poles and the branch cut are visible infigure 15.Next we consider three different contours to evaluate for the numerical

    evaluation of (B 1).

    (i) The Bromwich path. The integrand is highly oscillatory along aKiN toaCiN, making it challenging for numerical integration and furthermore,

    as shown infigure 16a, there is little room for the integration path to passbetween the wall that grows exponentially due to the term est and thepoles and branch point. Although, the plot is only for tZ1, the situationdeteriorates exponentially with growingtas the wall rapidly encroaches onthe imaginary axis.

    (ii) Hyperbolic deformation of path. Although the integrand decays exponen-tially in the left half plane, there is still the problem that if we deform thecontour as has been done in earlier sections (mapping the real line to ahyperbola that runs out into the left half plane), the contour will besquashed between the branch point at sZ0 and the wall that encroaches

    exponentially fast upon the imaginary axis due to est

    as tbecomes large(figure 16b). This problem could have been easily overcome ifsZ0 was nota branch point.

    N. Flyer and A. S. Fokas1846

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    26/28

  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    27/28

    References

    Boyd, J. P. 2001 Chebyshev and Fourier spectral methods, 2nd revised edn. New York, NY: Dover.Boyd, J. P. & Flyer, N. 1999 Compatibility conditions for time-dependent partial differential

    equations and the rate of convergence of Chebyshev and Fourier spectral methods. Comput.Methods Appl. Mech. Eng. 175, 281309. (doi:10.1016/S0045-7825(98)00358-2)

    Flyer, N. & Fornberg, B. 2003aAccurate numerical resolution of transients in initial-boundary valueproblems for the heat equation. J. Comput. Phys. 184, 526539. (doi:10.1016/S0021-9991(02)00034-7)

    Flyer, N. & Fornberg, B. 2003b On the nature of initial-boundary value solutions for dispersiveequations. SIAM. J. Appl. Math. 64, 546564.

    Flyer, N. & Swarztrauber, P. 2002 Convergence of spectral and finite difference methods for initial-boundary value problems. SIAM J. Sci. Comput. 23, 17311751. (doi:10.1137/S1064827500374169)

    Fokas, A. S. 1997 A unified transform method for solving linear and certain nonlinear PDEs.Proc. R. Soc. A 453, 14111443. (doi:10.1098/rspa.1997.0077)

    Fokas, A. S. 2002 A new transform method for evolution PDEs. IMA J. Appl. Math. 67, 559590.(doi:10.1093/imamat/67.6.559)

    Fokas, A. S. & Pelloni, B. 2005 A transform method for evolution PDEs on finite interval. IMAJ. Appl. Math. 70, 564587. (doi:10.1093/imamat/hxh047)

    Fokas, A. S. & Sung, L. Y. 2005 Generalised Fourier transforms, their nonlinearization and theimaging of the brain. Not. Am. Math. Soc. 52, 11781192.

    Fornberg, B. 1996 A practical guide to pseudospectral methods. Cambridge, UK: CambridgeUniversity Press.

    Gil, A., Segura, J. & Temme, N. M. 2003 Computing special functions by using quadrature rules.Numer. Algorithms33, 265275. (doi:10.1023/A:1025524324969)

    Iserles, A. 2004 On the numerical quadrature of highly-oscillating integrals. I. Fourier transforms.IMA J. Numer. Anal. 24, 365391. (doi:10.1093/imanum/24.3.365)

    Kalimeris, K. In preparation. PhD thesis, University of Cambridge.Lopez-Fernandez, M. & Palencia, C. 2004On thenumerical inversion of theLaplace transform in certain

    holomorphic mappings.Appl. Numer. Math.51, 289303. (doi:10.1016/j.apnum.2004.06.015)Pelloni, B. 2005 The spectral representation of two-point boundary value problems for third-order

    linear evolution partial differential equations. Proc. R. Soc. A 461, 29652984. (doi:10.1098/rspa.

    2005.1474)Sidje, R. B. 1998 EXPOKIT: a software package for computing matrix exponentials. ACM Trans.

    Math. Softw. 24, 130156. (doi:10.1145/285861.285868)

    1.00

    2.0

    1.00.5

    0

    0.5

    1.0

    00.25

    0.500.75

    00.5

    1.01.5

    00.25

    0.751.00

    0.100

    0

    0.2

    0.4

    0.50

    00.025

    0.0500.075

    (a) (b)

    Figure 17. (a) The analogue offigure 7, where now the solution is evaluated by Laplace transforms,with the inverse Laplace transform integral evaluated numerically by closing the contour in the lefthalf plane. (b) The solution for small t.

    N. Flyer and A. S. Fokas1848

    Proc. R. Soc. A (2008)

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://dx.doi.org/doi:10.1016/S0045-7825(98)00358-2http://dx.doi.org/doi:10.1016/S0021-9991(02)00034-7http://dx.doi.org/doi:10.1016/S0021-9991(02)00034-7http://dx.doi.org/doi:10.1137/S1064827500374169http://dx.doi.org/doi:10.1137/S1064827500374169http://dx.doi.org/doi:10.1098/rspa.1997.0077http://dx.doi.org/doi:10.1093/imamat/67.6.559http://dx.doi.org/doi:10.1093/imamat/hxh047http://dx.doi.org/doi:10.1023/A:1025524324969http://dx.doi.org/doi:10.1093/imanum/24.3.365http://dx.doi.org/doi:10.1016/j.apnum.2004.06.015http://dx.doi.org/doi:10.1098/rspa.2005.1474http://dx.doi.org/doi:10.1098/rspa.2005.1474http://dx.doi.org/doi:10.1145/285861.285868http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://dx.doi.org/doi:10.1145/285861.285868http://dx.doi.org/doi:10.1098/rspa.2005.1474http://dx.doi.org/doi:10.1098/rspa.2005.1474http://dx.doi.org/doi:10.1016/j.apnum.2004.06.015http://dx.doi.org/doi:10.1093/imanum/24.3.365http://dx.doi.org/doi:10.1023/A:1025524324969http://dx.doi.org/doi:10.1093/imamat/hxh047http://dx.doi.org/doi:10.1093/imamat/67.6.559http://dx.doi.org/doi:10.1098/rspa.1997.0077http://dx.doi.org/doi:10.1137/S1064827500374169http://dx.doi.org/doi:10.1137/S1064827500374169http://dx.doi.org/doi:10.1016/S0021-9991(02)00034-7http://dx.doi.org/doi:10.1016/S0021-9991(02)00034-7http://dx.doi.org/doi:10.1016/S0045-7825(98)00358-2
  • 8/13/2019 Proc. R. Soc. A-2008-Flyer-1823-49.pdf

    28/28

    Sifilakis, A. G., Fokas, A. S., Fulton, S. R. & Saridakis, Y. G. In press. The generalized DirichletNeumann map for linear elliptic PDEs and its numerical implementation. J. Comp. Appl. Math.(doi:10.1016/j.cam.2007.07.012)

    Smitheman, S., Spence, E. A. & Fokas, A. S. In preparation. A spectral collocation method for theLaplace and the modified Helmholtz equations in a convex polygon.

    Spence, E. A. In preparation. PhD thesis, University of Cambridge.Trefethen, L. N. 2000Spectral methods in MATLAB(software, environments, tools). Philadelphia, PA:

    SIAM.Weideman, J. A. C. 2006 Optimizing Talbots contours for the inversion of the Laplace transform.

    SIAM J. Numer. Anal. 44, 23422362. (doi:10.1137/050625837)Weideman, J. A. C. & Trefethen, L. N. 2007 Parabolic and hyperbolic contours for computing the

    Bromwich integral. Math. Comput. Math. Comp. 76, 13411356.

    1849Hybrid analyticalnumerical method

    on January 25, 2014rspa.royalsocietypublishing.orgDownloaded from

    http://dx.doi.org/doi:10.1016/j.cam.2007.07.012http://dx.doi.org/doi:10.1137/050625837http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://rspa.royalsocietypublishing.org/http://dx.doi.org/doi:10.1137/050625837http://dx.doi.org/doi:10.1016/j.cam.2007.07.012