22
The multiplier method to construct conservative finite difference schemes for ordinary and partial differential equations Andy T.S. Wan * , Alexander Bihlo , Jean-Christophe Nave November 27, 2014 Abstract We present the multiplier method of constructing conservative finite difference schemes for ordinary and partial differential equations. Given a system of differential equations possessing conservation laws, our approach is based on discretizing conservation law multipliers and their associated density and flux functions. We show that the proposed discretization is consistent for any order of accuracy and that by construction, discrete densities can be exactly conserved. In particular, the multiplier method does not require the system to possess a Hamiltonian or variational structure. Examples, including dissipative problems, are given to illustrate the method. Key words. conservative, structure preserving, finite difference, finite volume, conservation law, first integral, conservation law multiplier, Euler operator, multiplier method 1 Introduction In recent decades, structure preserving discretizations have become an important idea in designing numerical methods for differential equations. The central theme is to devise discretizations which preserve at the discrete level certain important structures belonging to the continuous problem. In the case of ordinary differential equations with a Hamiltonian structure, geometric integrators such as symplectic and variational integrators [HLW06, LR04] are a class of discretizations which preserves symplectic structure, first integrals, phase space volume or symmetries at the discrete level. Multi-symplectic methods have also been extended to include partial differential equations possessing a Hamiltonian structure [Bri97, BR06]. On the other hand for partial differential equations in divergence form, the well-known finite volume methods [LeV92] naturally preserves conserved quantities in discrete subdomains for the equations. More recently, structure preserving discretizations such as discrete exterior calculus [Hir03], mimetic discretiza- tions [BH06] and finite element exterior calculus [AFW06, AFW10] put forth complete abstract theories on discretizing equations with a differential complex structure. Specifically, these approaches provide con- sistency, stability and preservation of the key structures of de Rham cohomology and Hodge theory at the discrete level. In the present work, we propose a numerical method for ordinary differential equations and partial differential equations which preserves discretely their first integrals or more generally conservation laws. In contrast to geometric integrators or multi-symplectic methods which require the equations to possess a Hamiltonian or variational structure, our approach is based solely on the existence of conservation laws for the given set of differential equations and thus is applicable to virtually any physical system in practice. In particular, this method can be applied to dissipative problems possessing conserved quantities. For a given system of differential equations with a set of conservation laws, under some mild assumptions on the local solvability of the system, there exists so-called conservation law multipliers which are associated to each conservation law and vice versa [Olv00, BCA10]. This can be viewed as a generalization to the * Department of Mathematics and Statistics, McGill University, Montr´ eal, QC, H3A 0B9, Canada ([email protected]) Department of Mathematics and Statistics, Memorial University of Newfoundland, St. John’s, NL, A1C 5S7, Canada ([email protected]) Department of Mathematics and Statistics, McGill University, Montr´ eal, QC, H3A 0B9, Canada ([email protected]) 1

The multiplier method to construct conservative nite di erence … · 2014. 11. 29. · tions [BH06] and nite element exterior calculus [AFW06, AFW10] put forth complete abstract

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • The multiplier method to construct conservative

    finite difference schemes for ordinary and partial differential equations

    Andy T.S. Wan∗, Alexander Bihlo†, Jean-Christophe Nave‡

    November 27, 2014

    Abstract

    We present the multiplier method of constructing conservative finite difference schemes for ordinaryand partial differential equations. Given a system of differential equations possessing conservation laws,our approach is based on discretizing conservation law multipliers and their associated density and fluxfunctions. We show that the proposed discretization is consistent for any order of accuracy and that byconstruction, discrete densities can be exactly conserved. In particular, the multiplier method does notrequire the system to possess a Hamiltonian or variational structure. Examples, including dissipativeproblems, are given to illustrate the method.

    Key words. conservative, structure preserving, finite difference, finite volume, conservation law, firstintegral, conservation law multiplier, Euler operator, multiplier method

    1 Introduction

    In recent decades, structure preserving discretizations have become an important idea in designing numericalmethods for differential equations. The central theme is to devise discretizations which preserve at thediscrete level certain important structures belonging to the continuous problem.

    In the case of ordinary differential equations with a Hamiltonian structure, geometric integrators suchas symplectic and variational integrators [HLW06, LR04] are a class of discretizations which preservessymplectic structure, first integrals, phase space volume or symmetries at the discrete level. Multi-symplecticmethods have also been extended to include partial differential equations possessing a Hamiltonian structure[Bri97, BR06].

    On the other hand for partial differential equations in divergence form, the well-known finite volumemethods [LeV92] naturally preserves conserved quantities in discrete subdomains for the equations. Morerecently, structure preserving discretizations such as discrete exterior calculus [Hir03], mimetic discretiza-tions [BH06] and finite element exterior calculus [AFW06, AFW10] put forth complete abstract theorieson discretizing equations with a differential complex structure. Specifically, these approaches provide con-sistency, stability and preservation of the key structures of de Rham cohomology and Hodge theory at thediscrete level.

    In the present work, we propose a numerical method for ordinary differential equations and partialdifferential equations which preserves discretely their first integrals or more generally conservation laws.In contrast to geometric integrators or multi-symplectic methods which require the equations to possess aHamiltonian or variational structure, our approach is based solely on the existence of conservation laws forthe given set of differential equations and thus is applicable to virtually any physical system in practice. Inparticular, this method can be applied to dissipative problems possessing conserved quantities.

    For a given system of differential equations with a set of conservation laws, under some mild assumptionson the local solvability of the system, there exists so-called conservation law multipliers which are associatedto each conservation law and vice versa [Olv00, BCA10]. This can be viewed as a generalization to the

    ∗Department of Mathematics and Statistics, McGill University, Montréal, QC, H3A 0B9, Canada ([email protected])†Department of Mathematics and Statistics, Memorial University of Newfoundland, St. John’s, NL, A1C 5S7, Canada

    ([email protected])‡Department of Mathematics and Statistics, McGill University, Montréal, QC, H3A 0B9, Canada ([email protected])

    1

    mailto:[email protected]:[email protected]:[email protected]

  • well-known Noether’s theorem for equations derived via a variational principle, in which conservation lawsof the Euler-Lagrange equations are associated with variational symmetries and vice versa.

    The main idea of our approach, called the multiplier method, is to directly discretize the conservationlaws and their associated conservation law multipliers in a manner which is consistent to the given setof differential equations. This is in contrast to the adjoint method proposed by [DKKW13] for whichdiscretizations may not have a continuous limit and hence may not be consistent with the original continuousproblem. Our approach provides a general framework for which densities can be conserved exactly at thediscrete level.

    The content of this paper is as follows: First, in Section 2, we provide a brief introduction to conservationlaw multipliers and the relevant background. Then, we describe our method in Section 3.1 for the case ofa scalar partial differential equation, as most of the main ideas are already present in that case. In Section3.2, we generalize the method to the case when there is the same number of equations as the number ofconservation laws. In Section 3.3, we treat the case when there are more equations than the number ofconservation laws. Finally, in Section 4, we illustrate the multiplier method with various examples anddemonstrate discrete preservation of their associated conservation laws; this includes problems which do notreadily possess a Hamiltonian or variational structure.

    2 Conservation law of PDEs and conservation law multipliers

    Before we describe the construction of conservative schemes for PDEs, we introduce some background forconservation laws of PDEs. First, some notations and definitions. Let I be an open interval of R, V be anopen neighborhood of a domain Ω on Rn and U (i) be open neighborhoods of Rm for i = 0, 1, . . . .We express a k-th order system of PDEs as a function F : I × V × U (0) × · · · × U (k) → Rm such that,

    F (t,x,u, Du, . . . , Dku) = 0,

    where t ∈ I, x = (x1, . . . , xn) ∈ V are independent variables and u : I × V → Rm are the dependentvariables with components u = (u1, . . . , um). If F is an analytic normal system [Olv00] for which theCauchy-Kovalevskaya existence theorem is applicable, then there exist local analytic solutions u on I × Vwhich allow us to differentiate u as many times as we wish on I × V .

    Definition 1. A l-th order conservation law of F is a divergence expression which vanishes on the solutionsof F , [

    Dtψ(t,x,u, Du, . . . , Dlu) +Dx · φ(t,x,u, Du . . . , Dlu)

    ]F=0

    = 0,

    for some density function ψ and flux functions φ = (φ1, . . . , φn) which are analytic on I×V ×U (0)×· · ·×U (l).

    Here, Dt is the total derivative with respect to t and the notation Dx ·φ means Dx ·φ =∑n

    i=1Dxiφi, where

    Dxi is the total derivative with respect to xi.Clearly, adding two conservation laws together yields a conservation law and multiplying by a scalar

    constant also yields a conservation law. So, the set of conservation laws of F forms a vector space. However,some conservation laws are not as meaningful as others, for example: density and fluxes which together formdifferential identities, such as Dt(ux) +Dx(ut) = 0, or density and fluxes which are differential consequencesof the PDEs F itself, such as if ψ and φi are of the form

    ∑j,αAj,αDαF

    j for some analytic Aj,α. Thesetwo types of conservation laws are classified as trivial conservation laws of F . Since we are interested innon-trivial conservation laws, we ”mod out” the trivial conservation laws by considering two conservationlaws as equivalent if the difference in their density and fluxes yields a trivial conservation law. It can beshown such relation defines an equivalence relation on the set of conservation laws of F .

    Definition 2. A m-tuple of analytic functions λ : I × V × U (0) × · · · × U (r) → Rm is called a r-th orderconservation law multiplier of F if there exist a density function ψ and flux functions φ which are analyticon I × V × U (0) × · · · × U (l) such that,

    λ(t,x,u, Du, . . . , Dru) ·F (t,x,u, Du, . . . , Dku) = Dtψ(t,x,u, Du, . . . , Dlu)+Dx ·φ(t,x,u, Du . . . , Dlu),

    holds on I × V × U (0) × · · · × U (l), where l = max(r, k)− 1.

    2

  • It follows that the existence of a conservation law multiplier of F implies the existence of a conservationlaw of F . The converse is also true if the PDE system F is an analytic normal system.

    Theorem 1 ([Olv00]). Let F be an analytic normal system and suppose a conservation law of F is givenby the densities ψ and fluxes φ. Then there exists a conservation law multiplier λ such that,

    λ(t,x,u, Du, . . . , Dru) ·F (t,x,u, Du, . . . , Dku) = Dtψ̃(t,x,u, Du, . . . , Dlu)+Dx · φ̃(t,x,u, Du . . . , Dlu),

    holds on I ×V ×U (0)× · · ·×U (l), where ψ̃ and φ̃ are equivalent density and fluxes to ψ and φ, respectively.

    Thus, Theorem 1 provides a recipe to find conservation laws of PDEs. In other words, given a fixedorder l, one can in principle find all conservation law of order l by first finding the set of conservation lawmultipliers (which might be empty for a given l), and then compute their associated densities and fluxes.Conservation law multipliers can be computed by using the method of Euler operator [Olv00, BCA10].Several techniques on computing the density and fluxes associated with a given conservation law multiplierhave also been discussed in [BCA10].

    3 Conservative finite difference schemes for PDEs

    We now describe the theory on how to use conservation law multipliers and their associated density andfluxes to construct conservative finite difference schemes. For clarity of presentation, we have restricted tothe case of a uniform spatial mesh and uniform time step, though in principle, extension to non-uniformgrids is possible.

    The main idea is the following: given a system of partial differential equations with a conservation law,we propose a consistent discretization for the equations by approximating its associated conservation lawmultipliers, density and fluxes. Moreover, we show the proposed discretization satisfies a discrete divergencetheorem. In particular, this implies exact conservation of discrete densities in a manner analogous to thetelescoping sum for the finite volume method.

    There are three parts in this section. First, we will present the main results in the scalar case. Second,we then generalize to the vectorial case when the number of conservation laws is the same as the numberof equations. Finally, we further generalize the vectorial case when the number of conservation laws is lessthan the number of equations. The case when the number of conservation laws is greater than the numberof equations requires a more delicate treatment; we will elaborate in the conclusion.

    Notation. In this section, we denote h as the size of a uniform mesh Ωh covering Ω and τ as the time step sizeof Ik = ((k−1)τ, kτ) which subdivides the interval I =

    ⋃k Īk. Denote the points in Ω

    h by xJ = (xj1 , . . . , xjn),where J = (j1, . . . , jn) denotes a multi-index which runs between 0 ≤ j1 ≤ N1, . . . , 0 ≤ jn ≤ Nn. Theboundary of Ωh is then defined as,

    ∂Ωh = {xJ ∈ Ωh : J = (j1, . . . , jn) such that for some i, ji = 0 or ji = Ni}.

    If u ∈ C l on I×Ω, the mesh values of Diu is denoted as Diuk,J = Diu(tk,xJ) for all i = 1, . . . , l. Similarly,the mesh values of a function f(t,x,u, Du, . . . , Dlu) is denoted as fk,J = f(tk,xJ ,uk,J , Duk,J , . . . , D

    luk,J).In particular, λk,J , ψk,J ,φk,J denotes conservation law multipliers, density and fluxes evaluated at t = tk,xJ .

    Occasionally, we use î = (0, . . . , 1, . . . , 0) with 1 at the i-th component.Also to save writing, we have sometimes omitted writing the explicit dependence on t,x,u, Du, . . . for

    multipliers λ, density ψ and fluxes φ. Similarly, we have sometimes avoided writing explicit dependencesfor their discretizations λτ,h, ψτ,h,φτ,h when the context is clear.

    3.1 Scalar PDE with one conservation law

    We first consider the scalar case when u has only one component u,

    F (t,x, u,Du, . . . ,Dku) = 0, on t ∈ I = (0, T ),x ∈ Ω, (1)

    3

  • with one conservation law. In particular, we have a conservation law multiplier λ(t,x,u, Du, . . . , Dru) withtheir associated densities ψ(t,x,u, Du, . . . , Dlu) and fluxes φ(t,x,u, Du, . . . , Dlu) satisfying,

    λ(t,x,u, Du, . . . , Dru) ·F (t,x,u, Du, . . . , Dku) = Dtψ(t,x,u, Du, . . . , Dlu)+Dx ·φ(t,x,u, Du, . . . , Dlu).(2)

    Theorem 2. Let u ∈ C l+1 on I × Ω1 and λ be a conservation law multiplier of (1) with correspondingdensity ψ and fluxes φ. Suppose λτ,h, Dτ,ht ψ and D

    τ,hx ·φ are finite difference discretizations of λ, Dtψ and

    Dx · φ with accuracy up to order p in space and q in time:∥∥∥λ− λτ,h∥∥∥l∞≤ Cλ(hp + τ q),∥∥∥Dtψ −Dτ,ht ψ∥∥∥

    l∞≤ Ct(hp + τ q),∥∥∥Dx · φ−Dτ,hx · φ∥∥∥

    l∞≤ Cx(hp + τ q).

    Define the discretization of F as:

    F τ,h :=Dτ,ht ψ +D

    τ,hx · φ

    λτ,h. (3)

    Suppose∥∥λ(t,x, u,Du, . . . ,Dru)−1∥∥

    L∞(I×Ω)

  • In other words, Theorem 2 says the discretization given by (3) is a consistent discretization of (1),provided λ(t,x, u,Du, . . . ,Dru)−1 is uniformly bounded for a given u. Next we show discretizations of F τ,h

    are conservative in the following sense,

    Theorem 3. Let λ be a conservation law multiplier of (1) with density ψ and fluxes φ and let λτ,h be a

    finite difference discretizations of λ. Let Dτ,ht ψ and Dτ,hx · φ be the following discretizations,

    Dτ,ht ψk,J =ψτ,hk,J − ψ

    τ,hk−1,J

    τ, (8)

    Dτ,hx · φk,J =n∑i=1

    φi,τ,hk,J − φi,τ,h

    k,J−îh

    , (9)

    where ψτ,h and φi,τ,h are discretizations of ψ and φi. Also let F τ,h be the corresponding discretization of (1)given by (3). If uτ,h is a solution to the discrete problem,

    F τ,hk,J = 0, xJ ∈ Ωh, (10)

    then the discrete divergence theorem for uτ,h holds,

    0 =1

    τ

    ∑xJ∈Ωh

    (ψτ,hk,J − ψ

    τ,hk−1,J

    )+

    1

    h

    ∑xJ∈∂Ωh

    φτ,hk,J · νJ , (11)

    where νJ = (νJ1 , . . . , νJn ) is the outward-pointing unit normal of ∂Ω

    h at xJ .

    Proof. Since uτ,h is a solution to (10) and by definition of F τ,h,

    0 =∑xJ∈Ωh

    λτ,hk,JFτ,hk,J =

    ∑xJ∈Ωh

    (Dτ,ht ψk,J

    )+∑xJ∈Ωh

    (Dτ,hx · φk,J

    )

    =1

    τ

    ∑xJ∈Ωh

    (ψτ,hk,J − ψ

    τ,hk−1,J

    )+

    1

    h

    n∑i=1

    ∑xJ∈Ωh

    (φi,τ,hk,J − φ

    i,τ,h

    k,J−î

    ). (12)

    Note for each fixed i,∑xJ∈Ωh

    (φi,τ,hk,J − φ

    i,τ,h

    k,J−î

    )=

    ∑j1,...,jn

    (φi,τ,hk,(j1,...,ji,...,jn) − φ

    i,τ,hk,(j1,...,ji−1,...,jn)

    )

    =∑

    j1,...,ji−1,ji+1,...,jn

    Ni∑ji=1

    (φi,τ,hk,(j1,...,ji,...,jn) − φ

    i,τ,hk,(j1,...,ji−1,...,jn)

    )=

    ∑j1,...,ji−1,ji+1,...,jn

    (φi,τ,hk,(j1,...,Ni,...,jn) − φ

    i,τ,hk,(j1,...,0,...,jn)

    )=

    ∑xJ∈Ωhji=0,Ni

    φi,τ,hk,J νJi .

    And so (12) implies

    0 =1

    τ

    ∑xJ∈Ωh

    (ψτ,hk,J − ψ

    τ,hk−1,J

    )+

    1

    h

    n∑i=1

    ∑xJ∈Ωhji=0,Ni

    φi,τ,hk,J νJi

    =1

    τ

    ∑xJ∈Ωh

    (ψτ,hk,J − ψ

    τ,hk−1,J

    )+

    1

    h

    ∑xJ∈∂Ωh

    φτ,hk,J · νJ ,

    where the last equality follows since ∂Ωh =n⋃i=1

    {xJ ∈ Ωh : J = (j1, . . . , jn) such that ji = 0 or ji = Ni

    }.

    5

  • Although it may appear that Theorem 3 restricts the discrete density and fluxes to be first order accurate,it is possible to obtain higher order accuracy for the density and fluxes, as we will illustrate in the examples.

    Corollary 1. Let ψτ,h,φτ,h be as given in Theorem 3 and uτ,h be a solution to (10). If the discretized fluxesφτ,h vanish with uτ,h at the boundary ∂Ωh, then for uτ,h∑

    xJ∈Ωhψτ,hk,J =

    ∑xJ∈Ωh

    ψτ,hk−1,J . (13)

    In other words, the proposed scheme has exact discrete conservation.

    3.2 System of m PDEs with m conservation laws

    Next we extend the previous results to systems of PDEs. Consider a k-th order system of m PDEs,

    F (t,x,u, Du, . . . , Dku) = 0, on t ∈ I,x ∈ Ω, (14)with m conservation laws. In particular, this means we have a m×m matrix of conservation law multipliersΛ(t,x,u, Du, . . . , Dru),

    Λ =

    λ11 . . . λ1m

    ......

    λm1 . . . λmm

    , (15)with their associated densities ψ(t,x,u, Du, . . . , Dlu) and fluxes Φ(t,x,u, Du, . . . , Dlu),

    ψ =

    ψ1

    ...ψm

    , Φ =φ

    11 . . . φ1n

    ......

    φm1 . . . φmn

    , (16)satisfying,

    Λ(t,x,u, Du, . . . , Dru)·F (t,x,u, Du, . . . , Dku) = Dtψ(t,x,u, Du, . . . , Dlu)+Dx ·Φ(t,x,u, Du, . . . , Dlu).(17)

    Here the notation Dx ·Φ is analogous to the divergence applied to the tensor Φ, i.e. (Dx ·Φ)j =∑n

    j=1Dxiφji.

    Analogous to (3), we now show the following discretization of the system of PDEs is consistent providedΛ is invertible on I × Ω and sup

    I×Ω

    ∥∥Λ−1∥∥op

    is bounded, where ‖·‖op is the induced matrix norm of the vector

    norm | · |.

    Theorem 4. Let u ∈ C l+1 on I × Ω and Λ in (15) be a m ×m matrix of conservation law multipliers of(14) with corresponding density ψ and fluxes Φ, as defined in (16). Suppose Λτ,h, Dτ,ht ψ and D

    τ,hx · Φ are

    finite difference discretizations of Λ, Dtψ and Dx · Φ with accuracy up to order p in space and q in time:∥∥∥∥∥∥∥Λ− Λτ,h∥∥∥op∥∥∥∥l∞≤ CΛ(hp + τ q),∥∥∥Dtψ −Dτ,ht ψ∥∥∥

    l∞≤ Ct(hp + τ q),∥∥∥Dx · Φ−Dτ,hx · Φ∥∥∥

    l∞≤ Cx(hp + τ q).

    Define the discretization of F as:

    F τ,h :=(

    Λτ,h)−1 (

    Dτ,ht ψ +Dτ,hx · Φ

    ). (18)

    Suppose Λ(t,x,u, Du, . . . , Dru) is invertible on I × Ω such that supI×Ω

    ∥∥Λ(t,x,u, Du, . . . , Dru)−1∥∥op< ∞,

    then for sufficiently small h and τ , ∥∥∥F − F τ,h∥∥∥l∞≤ C(hp + τ q).

    6

  • Proof. The proof is nearly identical to the scalar case. We only illustrate the key steps. For the moment

    assume Λτ,h is invertible and that∥∥∥Λτ,h−1∥∥∥

    opis uniformly bounded by δ > 0 on Ik × Ωh.

    Fix a t = kτ and x = xJ . Then by a similar argument as the scalar case,

    F − F τ,h = Λ−1 (Dtψ +Dx · Φ)− (Λτ,h)−1(Dτ,ht ψ +D

    τ,hx · Φ

    )= Λ−1

    [(Dtψ −Dτ,ht ψ

    )+(Dx · Φ−Dτ,hx · Φ

    )]+ Λ−1

    (Λτ,h − Λ

    )(Λτ,h)−1

    (Dτ,ht ψ +D

    τ,hx · Φ

    ), (19)

    where we used the fact that Λ−1 − (Λτ,h)−1 = Λ−1(Λτ,h − Λ

    )(Λτ,h)−1. Indeed, we can again show∥∥∥Dτ,ht ψ +Dτ,hx · Φ∥∥∥

    l∞≤M. (20)

    So combining (19), (20) and that there are uniform constants m, δ such that∥∥Λ−1∥∥

    op< m,

    ∥∥∥Λτ,h−1∥∥∥op< δ,

    it follows that,

    |F − F τ,h| ≤∥∥Λ−1∥∥

    op

    (|Dtψ −Dτ,ht ψ|+ |Dx · φ−Dτ,hx · φ|

    )+∥∥Λ−1∥∥

    op

    ∥∥∥Λτ,h − Λ∥∥∥op

    ∥∥∥Λτ,h−1∥∥∥op

    ∣∣∣Dτ,ht ψ +Dτ,hx · φ∣∣∣≤ m (Ct + Cx) (hp + τ q) +mMδCΛ(hp + τ q)= C(hp + τ q). (21)

    Taking the maximum of (21) over Ik × Ωh gives the result.It remains to show that Λτ,h is invertible and

    ∥∥∥Λτ,h−1∥∥∥op

    is uniformly bounded by δ on Ik × Ωh. Since

    for sufficiently small h, τ ,∥∥Λ− Λτ,h∥∥

    op<∥∥Λ−1∥∥−1

    op. So the inverse of Λτ,h exists and can be given by the

    Neumann series,

    Λτ,h−1

    =

    ∞∑j=0

    (Λ−1(Λτ,h − Λ)

    )jΛ−1,which implies, ∥∥∥Λτ,h−1∥∥∥

    op≤

    ∥∥Λ−1∥∥op

    1− ‖Λ−1‖op ‖Λτ,h − Λ‖op. (22)

    Thus, set δ to be the maximum of the right hand side of (22) over points in Ik × Ωh.

    The analog of conservative discretizations of F τ,h also holds for system of PDEs.

    Theorem 5. Let Λ in (15) be a m×m matrix of conservation law multipliers of (14) with density ψ andfluxes Φ, as defined (16). Let Λτ,h be a finite difference discretizations of Λ. Let Dτ,ht ψ and D

    τ,hx · Φ be the

    discretizations,

    Dτ,ht ψk,J =ψτ,hk,J −ψ

    τ,hk−1,J

    τ, (23)

    (Dτ,hx · Φ

    )jk,J

    =

    n∑i=1

    φji,τ,hk,J − φji,τ,h

    k,J−îh

    , (24)

    where ψτ,h and φji,τ,h are discretizations of ψ and φji. Also, let F τ,h be the corresponding discretization of(14) given by (18). If uτ,h is a solution to the discrete problem

    F τ,hk,J = 0, xJ ∈ Ωh, (25)

    7

  • then the discrete divergence theorem for uτ,h holds,

    0 =1

    τ

    ∑xJ∈Ωh

    (ψτ,hk,J −ψ

    τ,hk−1,J

    )+

    1

    h

    ∑xJ∈∂Ωh

    Φτ,hk,J · νJ , (26)

    where νJ = (νJ1 , . . . , νJn ) is the outward-pointing unit normal of ∂Ω

    h at xJ .

    Proof. If uτ,h satisfies (25), then on each xJ ∈ Ωh

    0 = Λτ,hF τ,h = Dτ,ht ψ +Dτ,hx · Φ. (27)

    Now apply the same argument as in the scalar case to each component of (27).

    Similar to the scalar case, we mention that Theorem 5 need not imply the discrete density and fluxes arerestricted to be first order accurate. In the examples, we illustrate that it is possible to have higher orderaccuracy for the density and fluxes as well.

    Corollary 2. Let ψτ,h,Φτ,h be as given in Theorem 5 and uτ,h be a solution to (25). If the discretized fluxesΦτ,h vanish with uτ,h at the boundary ∂Ωh, then for uτ,h∑

    xJ∈Ωhψτ,hk,J =

    ∑xJ∈Ωh

    ψτ,hk−1,J . (28)

    In other words, the proposed scheme for systems also has exact discrete conservation.

    3.3 System of m PDEs with s conservation laws, 0 < s < m

    So far, we have assumed the number of equations m is equal to the number of conservation laws s. We nowextend our result to the case when s < m. We proceed as before, consider a k-th order system of m PDEs(14) but now with s conservation laws Λ(t,x,u, Du, . . . , Dru),

    Λ =(

    Λ̃ Σ), (29)

    where Λ̃ is the s× s submatrix of Λ and Σ is the s× (m− s) submatrix of Λ,

    Λ̃ =

    λ11 . . . λ1s

    ......

    λs1 . . . λss

    , Σ =λ

    1 s+1 . . . λ1m

    ......

    λs s+1 . . . λsm

    .We assume the row vectors of Λ are locally linearly independent and hence (upon reordering of the equationsof F if necessary) Λ̃−1 exists locally. We also partition F in a similar manner,

    F =

    (F̃G

    ), (30)

    where F̃ are the first s entries of F and G is the last m− s entries of F . Since

    Dtψ +Dx · Φ = ΛF =(

    Λ̃ Σ)(

    F̃G

    )= Λ̃F̃ + ΣG,

    the main idea is to rewrite F̃ as the following,

    F̃ = Λ̃−1 (Dtψ +Dx · Φ− ΣG) . (31)

    Discretizing (31) and G yields a generalization of the consistency Theorem 4.

    8

  • Theorem 6. Let u ∈ C l+1 on I × Ω and Λ be as defined in (29). Suppose Λ̃τ,h, Dτ,ht ψ, Dτ,hx · Φ, Στ,h and

    Gτ,h are finite difference discretizations of Λ̃, Dtψ, Dx · Φ, Σ and G with accuracy up to order p in spaceand q in time: ∥∥∥∥∥∥∥Λ̃− Λ̃τ,h∥∥∥op

    ∥∥∥∥l∞≤ C

    Λ̃(hp + τ q),∥∥∥Dtψ −Dτ,ht ψ∥∥∥

    l∞≤ Ct(hp + τ q),∥∥∥Dx · Φ−Dτ,hx · Φ∥∥∥

    l∞≤ Cx(hp + τ q).∥∥∥∥∥∥∥Σ− Στ,h∥∥∥op

    ∥∥∥∥l∞≤ CΣ(hp + τ q),∥∥∥G−Gτ,h∥∥∥

    l∞≤ CG(hp + τ q).

    Define the discretization of F as:

    F τ,h :=

    (F̃τ,h

    Gτ,h

    )=

    ((Λ̃τ,h)−1

    (Dτ,ht ψ +D

    τ,hx · Φ− Στ,hGτ,h

    )Gτ,h

    ). (32)

    Suppose Λ̃(t,x,u, Du, . . . , Dru) is invertible on I × Ω such that supI×Ω

    ∥∥∥Λ̃(t,x,u, Du, . . . , Dru)−1∥∥∥op< ∞,

    then for sufficiently small h and τ , ∥∥∥F̃ − F̃ τ,h∥∥∥l∞≤ C(hp + τ q).

    And hence of course, ∥∥∥F − F τ,h∥∥∥l∞≤ C ′(hp + τ q).

    Proof. The proof follows similarly as in the square multiplier matrix case. By (31) and(32),

    F̃ − F̃τ,h

    = Λ̃−1 (Dtψ +Dx · Φ− ΣG)− (Λ̃τ,h)−1(Dτ,ht ψ +D

    τ,hx · Φ− Στ,hGτ,h

    )= Λ̃−1

    [(Dtψ −Dτ,ht ψ

    )+(Dx · Φ−Dτ,hx · Φ

    )− Σ

    (G−Gτ,h

    )−(

    Σ− Στ,h)Gτ,h

    ]+ Λ̃−1

    (Λ̃τ,h − Λ̃

    )(Λ̃τ,h)−1

    (Dτ,ht ψ +D

    τ,hx · Φ− Στ,hGτ,h

    ). (33)

    By similar reasoning as before, there exists uniform positive constants m,M,α, β such that,∥∥∥Λ̃−1∥∥∥op≤ m,

    ∣∣∣Dτ,ht ψ +Dτ,hx · Φ∣∣∣ ≤M, ∥∥∥ Σ ∥∥∥op≤ α,

    ∥∥∥Στ,h∥∥∥op≤ β,

    ∣∣∣Gτ,h∣∣∣ ≤ γ, (34)and for sufficiently small h, τ , there is a uniform δ > 0 such that (Λ̃τ,h)−1 exists and satisfies,∥∥∥(Λ̃τ,h)−1∥∥∥

    op≤ δ. (35)

    So combining (33)-(35), we have for any t = kτ and x = xJ

    |F̃ − F̃τ,h| ≤

    ∥∥∥Λ̃−1∥∥∥op

    (∣∣∣Dtψ −Dτ,ht ψ∣∣∣+ ∣∣∣Dx · Φ−Dτ,hx · Φ∣∣∣+ ∥∥∥ Σ ∥∥∥op

    ∣∣∣G−Gτ,h∣∣∣+ ∥∥∥Σ− Στ,h∥∥∥op

    ∣∣∣Gτ,h∣∣∣)+∥∥∥Λ̃−1∥∥∥

    op

    ∥∥∥Λ̃τ,h − Λ̃∥∥∥op

    ∥∥∥(Λ̃τ,h)−1∥∥∥op

    (∣∣∣Dτ,ht ψ +Dτ,hx · Φ∣∣∣+ ∥∥∥Στ,h∥∥∥op

    ∣∣∣Gτ,h∣∣∣)≤ C(hp + hq), (36)

    where C = m[Ct + Cx + αCG + γCΣ + δCΛ̃(M + βγ)

    ]. Taking the maximum of (36) over Ik × Ωh yields

    the result.

    9

  • By augmenting F̃τ,h

    with Gτ,h, we also get the desired conservative discretization of F .

    Theorem 7. Let Λ̃τ,h,Στ,h,Gτ,h be finite difference discretizations of Λ̃,Σ,G. Let Dτ,ht ψ and Dτ,hx · Φ be

    the discretizations,

    Dτ,ht ψk,J =ψτ,hk,J −ψ

    τ,hk−1,J

    τ, (37)

    (Dτ,hx · Φ

    )j=

    n∑i=1

    φji,τ,hk,J − φji,τ,h

    k,J−îh

    , (38)

    where ψτ,h and φji,τ,h are discretizations of ψ and φji. Let F τ,h be the corresponding discretization of (14)given by (32). If uτ,h is a solution to the discrete problem

    F τ,h =

    (F̃τ,h

    k,J

    Gτ,hk,J

    )= 0, xJ ∈ Ωh, (39)

    then the discrete divergence theorem (26) holds for uτ,h.

    Proof. If uτ,h satisfies (39), F̃τ,h

    = 0 and Gτ,h = 0 on each xJ ∈ Ωh. Hence,

    0 = (Λ̃τ,h)F̃τ,h

    = Dτ,ht ψ +Dτ,hx · Φ− Στ,hGτ,h = D

    τ,ht ψ +D

    τ,hx · Φ. (40)

    Now apply the same argument as in the scalar case to each component of (40).

    Corollary 3. Let ψτ,h,Φτ,h be as given in Theorem 7 and uτ,h be a solution to (39). If the discretized fluxesΦτ,h vanish with uτ,h at the boundary ∂Ωh, then for uτ,h∑

    xJ∈Ωhψτ,hk,J =

    ∑xJ∈Ωh

    ψτ,hk−1,J . (41)

    Again, the proposed scheme in this case has exact discrete conservation.

    4 Examples

    We now illustrate our method with examples of the three cases discussed in the theory section. We beginwith examples involving scalar and systems of ODEs, followed by scalar and systems of PDEs.

    4.1 Pendulum problem

    We first begin with the ODE for the pendulum problem,

    F := θtt +g

    lsin(θ) = 0,

    where g is the gravitational acceleration, l is the length of the pendulum arm and θ is the displacementangle of the pendulum. It is well-known from classical physics that the energy of such system is conserved.I.e. we have one conservation law

    Dt

    (1

    2(θt)

    2 − gl

    cos(θ)

    )∣∣∣∣F=0

    = λF |F=0 = 0,

    with the conservation law multiplier,λ = θt.

    10

  • Note that we could have also found the multiplier and conservation law through the use of Euler operator.Now suppose we discretize ψ, λ with the following expressions,

    ψτn :=1

    2

    (θn+1 − θn

    τ

    )2− g

    2l(cos(θn+1) + cos(θn)) , (42)

    λτn :=θn+1 − θn−1

    2τ. (43)

    Then, Dτt ψ defined by (8) simplifies to,

    Dτt ψn :=(θn+1 − θn−1)(θn+1 − 2θn + θn−1)

    2τ3− gl

    cos(θn+1)− cos(θn−1)2τ

    , (44)

    and so by (3), we have the discretization of F ,

    F τn :=θn+1 − 2θn + θn−1

    τ2− gl

    cos(θn+1)− cos(θn−1)θn+1 − θn−1

    = 0. (45)

    Note that the discrete density in (44) is actually second order accurate to ψ in τ , even though Dτt ψ definedby (8) may appear to be first order. Combining with the fact that λτ is also second order accurate, F τ

    is second order accurate as well by the consistency Theorem 2. Multiplying (45) by (43) shows that thediscrete density (42) is conserved for solutions of (45), as claimed by Theorem 3.

    4.2 Damped harmonic oscillator

    Recall the damped harmonic oscillator from classical mechanics,

    F := mxtt + γxt + kx = 0, (46)

    where x(t) is the displacement of an object with mass m attached to a spring with a spring constant k anda damping coefficient γ. While the energy is not conserved due to dissipation, it can be found using themethod of Euler operator that (46) has the following non-trivial conservation law

    Dt

    [eγmt

    2

    (m(xt +

    γ

    2mx)2

    +

    (k − γ

    2

    4m

    )x2)]∣∣∣∣∣

    F=0

    = λF |F=0 = 0, (47)

    with the conservation law multiplier,

    λ = eγtm

    (xt +

    γ

    2mx). (48)

    We have included the derivation for the conservation law (47) and multiplier (48) in Appendix A.Note that the density function ψ and multiplier λ can be rewritten as

    ψ =m

    2

    ((e

    γt2mx)t

    )2+

    1

    2

    (k − γ

    2

    4m

    )(e

    γt2mx)2,

    λ = eγt2m (e

    γt2mx)t.

    Thus choosing the following discretization for ψ and λ,

    ψτn :=m

    2

    (eγtn+12m xn+1 − e

    γtn2m xn

    τ

    )2+

    1

    2

    (k − γ

    2

    4m

    )(eγtn+12m xn+1 + e

    γtn2m xn

    2

    )2, (49)

    λτn := eγtn2m

    (eγtn+12m xn+1 − e

    γtn−12m xn−1

    ), (50)

    11

  • Dτt ψn defined by (8) simplifies to,

    Dτt ψn =m

    (eγtn+12m xn+1 − 2e

    γtn2m xn + e

    γtn−12m xn−1

    τ2

    )(eγtn+12m xn+1 − e

    γtn−12m xn−1

    )

    +

    (k − γ

    2

    4m

    )(eγtn+12m xn+1 + 2e

    γtn2m xn + e

    γtn−12m xn−1

    4

    )(eγtn+12m xn+1 − e

    γtn−12m xn−1

    ). (51)

    By (3), we have the discretization of F ,

    F τn := m

    (eγτ2mxn+1 − 2xn + e−

    γτ2mxn−1

    τ2

    )+

    (k − γ

    2

    4m

    )(eγτ2mxn+1 + 2xn + e

    − γτ2mxn−1

    4

    )= 0. (52)

    Indeed, it can be checked that the first term in (52) approaches mxtt(tn) + γxt(tn) +γ2

    4mx(tn) as τ → 0by l’Hôpital’s rule and the second term in (52) approaches

    (k − γ

    2

    4m

    )x(tn) as τ → 0. In other words, F τn

    defined in (52) is consistent with F in (46), as claimed by Theorem 2. Moreover, since λτ in (50) and Dτt ψin (51) are second order accurate, F τ is second order accurate as well by Theorem 2. Multiplying (52) by(50) shows that the discrete density (49) is conserved for solutions of (52), as claimed by Theorem 3. InAppendix B, we include numerical verification of the order of accuracy and of the exact conservation for thediscrete density ψτ in (49).

    4.3 Two body problem

    Consider the ODE system of the two-body problem in 1D arising from classical physics,

    F :=

    [x1tt − V ′(x1 − x2)x2tt − V ′(x2 − x1)

    ]= 0,

    where x1, x2 are position of the two particles and V is the interaction potential satisfying V ′(−z) = −V ′(z).In this case, it’s known from Noether’s theorem that both momentum and energy is conserved. In particular,we have exactly two conservation laws

    Dt

    [x1t + x

    2t

    (x1t )2+(x2t )

    2

    2 + V (x1 − x2)

    ]∣∣∣∣∣F=0

    = ΛF |F=0 = 0,

    and two sets of conservation law multipliers Λ,

    Λ =

    (1 1x1t x

    2t

    ),

    As in the previous two examples, we could have also found the multipliers and conservation laws throughthe method of Euler operator. We discretize ψ and Λ by,

    ψτn :=

    x1n+1−x1nτ + x2n+1−x2nτ12

    (x1n+1−x1n

    τ

    )2+ 12

    (x2n+1−x2n

    τ

    )2+

    V (x1n+1−x2n+1)+V (x1n−x2n)2

    , (53)Λτ,hn :=

    (1 1

    x1n+1−x1n−12τ

    x2n+1−x2n−12τ

    ). (54)

    Then Dτtψ given by (23) simplifies to

    Dτtψn :=

    [x1n+1−2x1n+x1n−1

    τ2+

    x2n+1−2x2n+x2n−1τ2

    (x1n+1−x1n−1)(x1n+1−2x1n+x1n−1)2τ3

    +(x2n+1−x2n−1)(x2n+1−2x2n+x2n−1)

    2τ3+

    V (x1n+1−x2n+1)−V (x1n−1−x2n−1)2τ

    ], (55)

    12

  • Since Λτ,h in (54) and Dτtψ in (55) are both second order accurate, we have by Theorem 4 that the secondorder accurate discretization F τ ,

    F τn :=

    x1n+1−2x1n+x1n−1τ2 + V (x1n+1−x2n+1)−V (x1n−1−x2n−1)x1n+1−x2n+1−x1n−1+x2n−1x2n+1−2x2n+x2n−1

    τ2+

    V (x2n+1−x1n+1)−V (x2n−1−x1n−1)x2n+1−x1n+1−x2n−1+x1n−1

    = 0, (56)Multiplying (56) by (54) shows that the discrete densities (53) are preserved.

    4.4 Lotka-Volterra equations

    Consider the Lotka-Volterra equations or the predator-prey equations,

    F :=

    [xt − x(a− by)yt + y(c− dx)

    ]= 0,

    where a, b, c, d are positive constants. It is known that this system has one conservation law,

    Dt

    (log(xcya)− dx− by

    )∣∣∣F=0

    = ΛF |F=0 = 0,

    with the 1× 2 multiplier matrix Λ,Λ =

    (cx − d

    ay − b

    ), (57)

    In particular, this system is of the kind where the number of conservation laws is less than the number ofequations. Hence, we first partition (57) into 1× 1 matrices Λ̃ and Σ,

    Λ̃ =(cx − d

    ),

    Σ =(ay − b

    ),

    so that G = yt + y(c− dx). In order to use (32), we discretize ψ, Λ̃, Σ, G by

    ψτn := log(xcny

    an)− dxn − byn, (58)

    Λ̃τn :=(cxn− d),

    Στn :=(ayn− b),

    Gτn :=yn − yn−1

    τ+ yn(c− dxn).

    Then Dτt ψ defined by (37) is,

    Dτt ψn :=1

    τ

    (log

    (xcny

    an

    xcn−1yan−1

    )− d(xn − xn−1)− b(yn − yn−1)

    ). (59)

    Although Λ̃τ and Σ̃τ are exact discretization of Λ̃ and Σ̃, Dτt ψ and Gτ are only first order accurate. So the

    discretization F τ given by (32) is at most first order by Theorem 6 and it simplifies to,

    F τn :=

    [1

    cxn−d

    [c log xn−log xn−1τ − d

    xn−xn−1τ −

    (cxn− d)xn(a− byn) + a log yn−log yn−1τ −

    ayn

    yn−yn−1τ

    ]yn−yn−1

    τ + yn(c− dxn)

    ]= 0.

    (60)It can be seen that by taking τ → 0, the first equation of F τ is consistent with the first equation of F .Moreover, it can be checked that solutions of (60) preserve (58).

    13

  • 4.5 Non-dissipative Lorenz equations

    Consider the non-dissipative Lorenz equations,

    F :=

    xt − σyyt − x(r − z)zt − xy

    = 0 (61)where σ, r are positive constants. It was found in [NB94] that this system has 2 conservation laws,

    Dt

    (z − x22σ

    y2

    2 +z2

    2 − rz

    )∣∣∣∣∣F=0

    = ΛF |F=0 = 0, (62)

    with the 2× 3 multiplier matrix Λ,

    Λ =

    (−xσ 0 10 y z − r

    ), (63)

    Similar to the previous example, we partition (63) into 2× 2 matrix Λ̃ and 1× 2 matrix Σ,

    Λ̃ =

    (−xσ 00 y

    ),

    Σ =

    (1

    z − r

    ),

    with G = zt−xy. To simplify the final discretization as much as possible, we choose the following discretiza-tion ψ, Λ̃, Σ, G by

    ψτn :=

    (zn − x

    2n

    2σy2n2 +

    z2n2 − rzn

    ), (64)

    Λ̃τn :=

    (−xn+xn−12σ 0

    0 yn+yn−12

    ), (65)

    Στn :=

    (1

    zn+zn−12 − r

    ), (66)

    Gτn :=zn − zn−1

    τ− xn + xn−1

    2

    yn + yn−12

    .

    Then Dτt ψ defined by (37) is,

    Dτtψn :=

    (zn−zn−1

    τ −x2n−x2n−1

    2στy2n−y2n−1

    2τ +z2n−z2n−1

    2τ − rzn−zn−1

    τ

    ). (67)

    Since Λ̃τ and Σ̃τ are second order accurate and Dτt ψ and Gτ are only first order accurate, we expect the

    discretization to be at most first order by Theorem 6. Using (32), the discretization F τ simplifies to,

    F τn :=

    xn−xn−1τ − σ yn+yn−12yn−yn−1τ −

    xn+xn−12 (r −

    zn+zn−12 )

    zn−zn−1τ −

    xn+xn−12

    yn+yn−12

    = 0. (68)Multiplying (68) by the discrete multiplier Λτn =

    (Λ̃τn Σ

    τn

    )defined by (65), (66) shows the discrete densities

    (64) are preserved.

    14

  • 4.6 Inviscid Burgers’ equation

    Next we illustrate this method for the inviscid Burgers’ equation,

    F := ut + uux = 0. (69)

    Writing (69) in conserved form, it is well-known that it has the conservation law,[Dtu+Dx

    (u2

    2

    )]F=0

    = [λ · F ]F=0 = 0, (70)

    which corresponds to a multiplier of λ = 1. Now suppose we discretize ψ, φ, λ with the following expressions,

    ψτ,hn,j := un,j ,

    φτ,hn,j :=u2n,j

    2, (71)

    λτ,hn,j := 1.

    Then, Dτ,ht ψ, Dτ,hx φ defined by (8), (9) are,

    Dτ,ht ψn,j :=un,j − un−1,j

    τ,

    Dτ,hx φn,j :=(un,j)

    2 − (un,j−1)2

    2h.

    So by (3), we obtain the well-known conservative discretization of (69) which preserves (71),

    F τ,hn,j :=un,j − un−1,j

    τ+

    (un,j)2 − (un,j−1)2

    2h= 0, (72)

    which is clearly first order in time and in space.To make this example more interesting, let us consider other conservation laws of (69). By the method of

    Euler operator (or inspired guess), the inviscid Burgers’ equation has a family of conservation law multiplierλ = up−1 for p ∈ N with the conservation law,[

    Dt

    (up

    p

    )+Dx

    (up+1

    p+ 1

    )]F=0

    = [λ · F ]F=0 = 0. (73)

    Similar to before, we discretize ψ, φ , λ with the expressions,

    ψτ,hn,j :=(un,j)

    p

    p, (74)

    φτ,hn,j :=up+1n,jp+ 1

    , (75)

    λτ,hn,j :=1

    p

    p−1∑k=0

    (un,j)p−1−k(un−1,j)

    k. (76)

    It turns out the choice for the time averaged expression (76) of λτ,hn,j simplifies the final expression of the

    discretization. Similar as before, Dτ,ht ψ, Dτ,hx φ defined by (8), (9) are,

    Dτ,ht ψn,j :=(un,j)

    p − (un−1,j)p

    pτ, (77)

    Dτ,hx φn,j :=(un,j)

    p+1 − (un,j−1)p+1

    (p+ 1)h, (78)

    15

  • It can be shown that λτ,h in (74) and Dτ,ht ψ in (77) are first order accurate in time and Dτ,hx φ is first order

    accurate in space. By Theorem 2, the discretization of (3) is first order in space and time. Employing the

    identity, ap+1 − bp+1 = (a− b)p∑

    k=0

    ap−kbk, F τ,h simplifies to,

    F τ,hn,j :=un,j − un−1,j

    τ+

    p

    p+ 1

    (un,j)p + (un,j)

    p−1un,j−1 + · · ·+ un,j(un,j−1)p−1 + (un,j−1)p

    (un,j)p−1 + (un,j)p−2un−1,j + · · ·+ un,j(un−1,j)p−2 + (un−1,j)p−1un,j − un,j−1

    h

    = 0, (79)

    which can readily be checked to preserve the discrete density (74) when the fluxes (75) vanish at theboundaries. Moreover, (79) can be seen as a generalization to (72), with p = 1.

    4.7 Korteweg-de Vries equation

    Next we consider the Korteweg-de Vries equation,

    F := ut + uux + uxxx = 0. (80)

    As written, (80) does not admit a variational principle. Indeed, it is well known that upon the change ofvariable u = vx, (80) is the Euler-Lagrange equations of a Lagrangian. Our main motivation here is toshow that we can construct a conservative discretization of the Korteweg-de Vries equation without suchtransformation.

    It can be checked (or by the method of Euler operator) that (80) has a multiplier λ = u with thecorresponding density and flux,[

    Dt

    (u2

    2

    )+Dx

    (u3

    3+ uuxx −

    u2x2

    )]F=0

    = [λ · F ]F=0 = 0. (81)

    To simplify the final expression for F τ,h, we choose to discretize ψ, φ, λ as follows,

    ψτ,hn,j :=u2n,j

    2, (82)

    φτ,hn,j :=u3n,j

    3+

    (un,j+1 + un,j

    2

    )(un,j+1 − 2un,j + un,j−1

    h2

    )− 1

    2

    (un,j+1 − un,j

    h

    )2, (83)

    λτ,hn,j :=un,j + un−1,j

    2. (84)

    Thus, (8) and (9) simplify to

    Dτ,ht ψn,j :=(un,j)

    2 − (un−1,j)2

    2τ, (85)

    Dτ,hx φn,j :=(un,j)

    3 − (un,j−1)3

    3h+

    (un,j + un,j−1

    2

    )(un,j+1 − 3un,j + 3un,j−1 − un,j−2

    h3

    ). (86)

    One can see that λτ,h in (84) and Dτ,ht ψ in (85) are first order accurate in time and Dτ,hx φ in (86) is first

    order in space. Thus, it follows from Theorem 2 that,

    F τ,hn,j :=un,j − un−1,j

    τ+

    2(u2n,j + un,jun,j−1 + u2n,j−1)

    3(un,j + un−1,j)

    (un,j − un,j−1

    h

    )+

    (un,j + un,j−1un,j + un−1,j

    )(un,j+1 − 3un,j + 3un,j−1 − un,j−2

    h3

    )= 0,

    is a first order discretization of (80) that preserves the discrete density (82) when the fluxes (83) vanish atthe boundary.

    16

  • 4.8 Shallow water PDE system

    Lastly, we consider the two-dimensional shallow-water equations in non-dimensional form

    F :=

    ut + v · ∇u+ ηxvt + v · ∇v + ηyηt +∇ · (ηv)

    = 0, (87)where v = (u, v) is the two-dimensional velocity field and η is the displacement of the water surface overa constant reference level. It is well-known that this system admits conservation of momentum and mass.The multiplier form of these conservation laws is

    ΛF = Dtψ +Dx · φ,

    or, explicitly

    0 =

    η 0 u0 η v0 0 1

    ut + v · ∇u+ ηxvt + v · ∇v + ηyηt +∇ · (ηv)

    F=0

    =

    (ηu)t +(ηu2 + 12η

    2)x

    + (ηuv)y(ηv)t + (ηuv)x +

    (ηv2 + 12η

    2)y

    (η)t + (ηu)x + (ηv)y

    F=0

    . (88)

    Choosing the discretization for ψ, φ and Λ,

    ψτ,hn,i,j =

    ηn,i,jun,i,jηn,i,jvn,i,jηn,i,j

    , (89)φτ,hn,i,j =

    ηn,i,ju2n,i,j + 12η2n,i,j ηn,i,jun,i,jvn,i,jηn,i,jun,i,jvn,i,j ηn,i,jv2n,i,j + 12η2n,i,jηn,i,jun,i,j ηn,i,jvn,i,j

    , (90)Λτ,hn,i,j =

    ηn,i,j+ηn−1,i,j2 0 un,i,j+un−1,i,j20 ηn,i,j+ηn−1,i,j2 vn,i,j+vn−1,i,j20 0 1

    , (91)then Dτ,ht ψ and D

    τ,ht φ defined by (37) and (38) are

    Dτ,ht ψn,i,j :=

    ηn,i,jun,i,j−ηn−1,i,jun−1,i,j

    τηn,i,jvn,i,j−ηn−1,i,jvn−1,i,j

    τηn,i,j−ηn−1,i,j

    τ

    , (92)

    Dτ,hx φn,i,j :=

    ηn,i,ju

    2n,i,j−ηn,i−1,ju2n,i−1,j

    h +12

    η2n,i,j−η2n,i−1,jh +

    ηn,i,jun,i,jvn,i,j−ηn,i,j−1un,i,j−1vn,i,j−1h

    ηn,i,jun,i,jvn,i,j−ηn,i+1,jun,i+1,jvn,i+1,jh +

    ηn,i,jv2n,i,j−ηn,i,j−1v2n,i,j−1

    h +12

    η2n,i,j−η2n,i,j−1h

    ηn,i,jun,i,j−ηn,i−1,jun,i−1,jh +

    ηn,i,jvn,i,j−ηn,i,j−1vn,i,j−1h

    . (93)

    17

  • Using (32), the entries of the discretization F τ,h simplifies to,(F τ,hn,i,j

    )1

    =un,i,j − un−1,i,j

    τ+

    (2ηn,i−1,j

    ηn,i,j + ηn−1,i,j

    )(un,i,j + un,i−1,j −

    un,i,j + un−1,i,j2

    )(un,i,j − un,i−1,j

    h

    )+

    (2ηn,i,j

    ηn,i,j + ηn−1,i,j

    )vn,i,j

    (un,i,j − un,i,j−1

    h

    )+

    (ηn,i,j + ηn,i−1,jηn,i,j + ηn−1,i,j

    )(ηn,i,j − ηn,i−1,j

    h

    )+

    (2

    ηn,i,j + ηn−1,i,j

    )(ηn,i,j − ηn,i−1,j

    h

    )un,i,j

    (un,i,j −

    un,i,j + un−1,i,j2

    )(

    2

    ηn,i,j + ηn−1,i,j

    )(ηn,i,jvn,i,j − ηn,i,j−1vn,i,j−1

    h

    )(un,i,j−1 −

    un,i,j + un−1,i,j2

    ), (94)(

    F τ,hn,i,j

    )2

    =vn,i,j − vn−1,i,j

    τ+

    (2ηn,i,j−1

    ηn,i,j + ηn−1,i,j

    )(vn,i,j + vn,i,j−1 −

    vn,i,j + vn−1,i,j2

    )(vn,i,j − vn,i,j−1

    h

    )+

    (2ηn,i,j

    ηn,i,j + ηn−1,i,j

    )un,i,j

    (vn,i,j − vn,i−1,j

    h

    )+

    (ηn,i,j + ηn,i,j−1ηn,i,j + ηn−1,i,j

    )(ηn,i,j − ηn,i,j−1

    h

    )+

    (2

    ηn,i,j + ηn−1,i,j

    )(ηn,i,j − ηn,i,j−1

    h

    )vn,i,j

    (vn,i,j −

    vn,i,j + vn−1,i,j2

    )(

    2

    ηn,i,j + ηn−1,i,j

    )(ηn,i,jun,i,j − ηn,i−1,jun,i−1,j

    h

    )(vn,i−1,j −

    vn,i,j + vn−1,i,j2

    ), (95)(

    F τ,hn,i,j

    )3

    =ηn,i,j − ηn−1,i,j

    τ+ηn,i,jun,i,j − ηn,i−1,jun,i−1,j

    h+ηn,i,jvn,i,j − ηn,i,j−1vn,i,j−1

    h. (96)

    Note that, as h → 0, the first four terms of (94) and (95) approaches the limit ut + uux + vuy + ηx andvt + vvy + uvx + ηy, respectively. Also, the last two terms in (94) and (95) vanish, as expected in order for

    (94)-(96) to be consistent with (87). In particular, it can be seen that Λτ,h in (91) and Dτ,ht ψ in (92) are

    first order in time and Dτ,hx φ in (93) is first order in space. Thus, the proposed discretization Fτ,h is first

    order accurate by Theorem 4.

    5 Conclusion

    In this paper, we introduced the multiplier method for ordinary and partial differential equations whichconserves discretely first integrals and conservation laws. In particular, we showed that the proposed dis-cretization is consistent to any order of accuracy depending on the choice of finite difference approximationof the conservation law multipliers, densities and fluxes. Also, we showed a discrete version of the divergencetheorem holds and thus the densities are conserved exactly at the discrete level. Due to the generality ofthe consistency theorem of the proposed discretization, we believe there is much advantage and flexibility inachieving higher order accuracy for the densities as well. Moreover, as there is some freedom to choose dis-cretization for the multipliers, densities and fluxes, we can often simplify the final form of the discretization;as demonstrated in the examples of Section 4.

    The work presented can be applied to general differential equations possessing conservation laws. Sinceour approach does not require the existence of any other geometric structure apart from the differentialequations and conservation laws themselves, this work is complementary to existing conservative methods.In particular, the multiplier method can be applied even when the underlying differential equations do notadmit a Hamiltonian or variational structure, in contrast to geometric integrators and multi-symplecticintegrators. Moreover, an important new physical case covered by the multiplier method are dissipativesystems; this was illustrated in Section 4.2 by the damped harmonic oscillator example. Indeed, it may bepossible in some cases to transform a system into one possessing a Hamiltonian or variational structure forwhich existing methods can be applied. However, depending on applications, it may be more natural andsimpler to work with the physical variables themselves. Also, such transformations may come at a loss ofaccuracy of the discretization, as in the case of the Korteweg-de Vries example in Section 4.7.

    We have investigated the case when the given differential equations possess at most the same numberof conservation laws as the number of equations. This requirement was relevant in order to locally invert afull (or sub) multiplier matrix formed by the associated conservation law multipliers. The case not covered

    18

  • here is when there are more conservation laws than the number of equations. The main difficulty stemsfrom the resulting multiplier matrix not being full rank and thus it cannot be treated in the same manner asthe other cases. Nonetheless, this is an important case which arises strictly in partial differential equations,where there may be more conservation laws than the number of equations. It is of current interest to extendour results to include that case as well.

    Also, we note that in this paper we did not consider questions pertaining to stability and convergencefor the multiplier method. As the proposed method generally leads to nonlinear discretizations, answeringthese questions is difficult in general and is the focus of our current research direction.

    Acknowledgement

    AB is a recipient of an APART Fellowship of the Austrian Academy of Sciences. JCN acknowledges partialsupport from the NSERC Discovery and NSERC Discovery Accelerator Supplement programs.

    References

    [AFW06] D. N. Arnold, R. S. Falk and R. Winther, Finite element exterior calculus, homological tech-niques, and applications, Acta Numerica , 1–155 (2006).

    [AFW10] D. N. Arnold, R. S. Falk and R. Winther, Finite element exterior calculus: from Hodge theoryto numerical stability, Bull. Amer. Math. Soc. (N.S.) 47, 281–354 (2010).

    [BCA10] G. Bluman, A. Cheviakov and S. Anco, Applications of Symmetry Methods to Partial Differ-ential Equations, Springer, 2010.

    [BH06] P. B. Bochev and J. M. Hyman, Principles of mimetic discretizations of differential operators,in Compatible spatial discretizations, pages 89–119, Springer, 2006.

    [BR06] T. J. Bridges and S. Reich, Numerical methods for Hamiltonian PDEs, Journal of Physics A:Mathematical and General 39(19), 5287 (2006).

    [Bri97] T. J. Bridges, Multi-symplectic structures and wave propagation, Math. Proc. Camb. Phil.Soc. 121, 147 (1997).

    [DKKW13] V. Dorodnitsyn, E. Kaptsov, R. Kozlov and P. Winternitz, First integrals of ordinary differenceequations beyond Lagrangian methods, (2013), arXiv:math-ph/1311.1597.

    [Hir03] A. N. Hirani, Discrete exterior calculus, PhD thesis, California Institute of Technology, 2003.

    [HLW06] E. Hairer, C. Lubich and G. Wanner, Geometric numerical integration: structure-preservingalgorithms for ordinary differential equations, Springer, Berlin, 2006.

    [LeV92] R. J. LeVeque, Numerical Methods for Conservation Laws, Birkhäuser Verlag, Basel, 2ndedition, 1992.

    [LR04] B. Leimkuhler and S. Reich, Simulating Hamiltonian dynamics, Cambridge University Press,Cambridge, 2004.

    [NB94] P. Névir and R. Blender, Hamiltonian and Nambu Representation of the Non-DissipativeLorenz Equations, Beitr. Phys. Atmosph. 67, 133–140 (1994).

    [Olv00] P. Olver, Applications of Lie Groups to Differential Equations, Springer, 2nd edition, 2000.

    19

  • Appendix A Derivation of conservation law for the damped harmonicoscillator

    For illustration, we include a short discussion on how the method of Euler operator can be used to deriveconservation laws for the damped harmonic oscillator. For more details and its general theory, see [Olv00,BCA10] for many more examples.

    Given a scalar function f(t, x, xt, xtt), the Euler operator E applied to f is given by

    E(f) = ∂f∂x− ddt

    (∂f

    ∂xt

    )+d2

    dt2

    (∂f

    ∂xtt

    ). (97)

    The special property of E is that its kernel is exactly characterized by divergence expressions. In particular,for any analytic function x(t),

    0 = E(f) ⇐⇒ f(t, x, xt, xtt) = Dtψ(t, x, xt) for some analytic function ψ(t, x, xt). (98)

    Thus, to find conservation laws of differential equations of the form F (t, x, xt, xtt) = 0, we first find con-servation law multipliers λ such that E(λF ) = 0. If such a λ is found, then there must be ψ such thatλF = Dtψ by (98). So the second step is to compute the density ψ (or fluxes in general) associated with λ.

    Indeed, if the expression for the differential equation F is already a divergence expression, then theconservation law multiplier λ = 1 would suffice. However, there may be other conservation laws for F whichare “hidden”. The goal is uncover other conserved quantities by first finding nontrivial conservation lawmultipliers λ. We illustrate this for the damped harmonic oscillator equation F := mxtt + γxt + kx bychoosing λ to have the dependence on t, x, xt. So by (98), after a laborious calculation,

    0 = E(λ(t, x, xt)F (t, x, xt, xtt)) =∂

    ∂x(λF )− d

    dt

    (∂

    ∂xt(λF )

    )+d2

    dt2

    (∂

    ∂xtt(λF )

    ).

    ⇒ 0 = xtt(

    2mλx − 2γλxt +mλxtt +mxtλxtx − (kx+ γxt)λxtxt)

    + xt

    (m(2λxt + λxttt)− 2γλxtt

    )+ x

    (2λxb− kλxtt − γλxt +mλxtt

    )(99)

    The expression multiplying xtt in (99) does not depend on xtt and hence must vanish independently, as x(t)is arbitrary.

    2mλx − 2γλxt +mλxtt +mxtλxtx − (kx+ γxt)λxtxt = 0 (100)To solve (100), we choose the ansatz of λ(t, x, xt) = a(t)xt + b(t)x which simplifies to,

    2mb− 2γa+ma′ = 0. (101)

    In general, there may be other conservation law multipliers of the form λ(t, x, xt) and finding all suchmultipliers is a classification problem for the given differential equation. Since our main goal is just to findone conservation law multiplier, the above ansatz allows us to proceed without solving the general problemof (100). Similar to (101), the expressions multiplying xt, x must also vanish independently and simplify to,

    2mb′ − 2γa′ +ma′′ = 0, (102)−a′k + 2bk − γb′ +mb′′ = 0. (103)

    Equation (102) is just a differential consequence of (101) and hence does not contain new information. Tosolve (103), we solve b in terms of a, a′ in (101) and substitute it in (103) for b, b′ and b′′. Hence, we findthe determining equation for a(t) to be,

    m

    2a′′′ − 3γ

    2a′′ +

    (2k +

    γ2

    m

    )a′ +

    2γk

    ma = 0. (104)

    Using the standard method of characteristic polynomial to solve (104), we find that a(t) is the linearcombination,

    a(t) = C1 exp( γmt)

    + C2 exp

    (γ +

    √γ2 − 4mkm

    t

    )+ C3 exp

    (γ −

    √γ2 − 4mkm

    t

    ).

    20

  • For simplicity, we choose a(t) = eγmt which gives b(t) = γ2me

    γmt by (101). Thus, we have found a conservation

    law multiplier λ(t, x, xt) = eγmt(xt +

    γ2mx

    ). To find associated density ψ, it is straightforward to match on

    both sides of,

    ψt + ψxxt + ψxtxtt = Dtψ = λF = eγmt(xt +

    γ

    2mx)

    (mxtt + γxt + kx) ,

    and obtain,

    ψ(t, x, xt) =eγmt

    2

    (m(xt +

    γ

    2mx)2

    +

    (k − γ

    2

    4m

    )x2). (105)

    In summary, using the method of Euler operator, we have derived a conserved quantity ψ given by (105)for the damped harmonic oscillator.

    Appendix B Numerical verification for the damped harmonic oscillator

    In this appendix, we numerically verify our theoretical findings for the damped harmonic oscillator examplein Section 4.2. Specifically, we observed that the proposed scheme has second order accuracy in the variablex. Additionally, we check that the density ψ is discretely conserved and that the discrete density convergesin second order to the exact value of ψ.

    For our numerical experiment, we consider the case where m = 1, k = 5, and γ = 1/2, with initialconditions x (0) = 1, and xt (0) = 0. Figure (1) shows the solution computed with N = 200 points, which isin good agreement with the exact solution.

    Figure 1: Exact vs. computed solution with N = 200 points.

    We also compute the error in x at time t = 10 given by |xexact (t = 10)− xτN |, where τ = 10/N andN is the total number of points used in the computation. Figure (2) shows the second order asymptoticconvergence in x.

    Similarly, we compute the error in ψ at time t = 10 given by |ψexact (t = 10)− ψτN |. Figure (3) showsthe second order asymptotic convergence in ψ.

    Finally, for a fixed number of points N = 200, we observed that

    ∣∣∣∣ maxi=1···N−1ψτi − mini=1···N−1ψτi∣∣∣∣ ≈ 5.4 · 10−14,

    thus confirming the discrete conservation property of the multiplier method presented in this paper.

    21

  • Figure 2: Convergence plot for x (t).

    Figure 3: Convergence plot for ψ (t).

    22

    IntroductionConservation law of PDEs and conservation law multipliersConservative finite difference schemes for PDEsScalar PDE with one conservation lawSystem of m PDEs with m conservation lawsSystem of m PDEs with s conservation laws, 0