+ All Categories
Home > Documents > Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf ·...

Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf ·...

Date post: 01-May-2018
Category:
Upload: ngoxuyen
View: 224 times
Download: 3 times
Share this document with a friend
31
Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam 6 May 2009 Numerical Methods for Time-Dependent PDEs
Transcript
Page 1: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Numerical discretization of Hamiltonian PDEs

Jason FrankCWI, Amsterdam

6 May 2009Numerical Methods for Time-Dependent PDEs

Page 2: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Hamiltonian Systems

Page 3: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

OutlineSymplectic integrators for Hamiltonian ODEs

Hamiltonian systems

Conservation laws

Symplectic integrators

Examples

Symplectic integrators for Hamiltonian PDEs

Infinite dimensional Hamiltonian systems

Hamiltonian semi-discretizations

Examples

Page 4: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Hamiltonian SystemsA Hamiltonian system of ordinary differential equations

Compact notation

More compact

The J above is “canonical”. A non-canonical H.S. is defined equivalently, but with arbitrary skew-symmetric matrix J:

Page 5: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Examples of Hamiltonian ODEsNonlinear pendulum:

Kepler problem

N-body problem

Page 6: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Properties of Hamiltonian ODEsEnergy conservation. The Hamiltonian typically represents the total energy. Along a solution,

The phase flow preserves volume. The divergence of a Hamiltonian vector field is zero.

Page 7: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Flow mapGiven an autonomous ordinary differential equation

define the flow map to be the operator such that

Properties:

Semi-group property:

Mapping of sets:

Page 8: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Symplectic mapsA symplectic map is one whose Jacobian satisfies

The flow map of a Hamiltonian system is symplectic:

The quantity is a quadratic first integral of the coupled system

Page 9: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Symplectic numerical methodA numerical method describes a discrete flow map. For example, Euler’s method:

The numerical map is symplectic if

To prove method is symplectic, it is sufficient to show:

That the derivative of the numerical flow with respect to the initial condition is equivalent to the method applied to the variational equation, and

That the method conserves the invariant S, i.e.

Page 10: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Symplectic numerical methodsFor the implicit midpoint rule

This is equivalent to implicit midpoint applied to the coupled system

Implicit midpoint preserves arbitrary quadratic invariants. Suppose is a first integral. Hence,

Page 11: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Symplectic numerical methodsFor the canonical case, , the quadratic invariant S can

be simplified. Partition , then

It follows that methods for canonical problems which preserve invariants of the following form are symplectic:

The Störmer-Verlet method is

You can check that this method preserves arbitrary quadratic invariants of the above partitioned form.

Page 12: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Backward error analysisClassical error analysis for numerical integrators compares the numerical solution with the exact solution through the initial value.

In backward error analysis we try to find a modified problem for which the numerical trajectory is exact.

This modified differential equation is an expansion in the stepsize parameter:

Forward Euler agrees with the first two terms on the left. But it is a more accurate approximation of the modified equation if we choose:

Page 13: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Backward error analysisFor Hamiltonian systems, it can be shown that the modified vector field associated to a symplectic method has the form

That is, the modified equations are also Hamiltonian with a perturbed energy function.

The asymptotic expansion generally diverges, but may be optimally truncated to a number of terms which grows exponentially as the stepsize is decreased.

Due to conservation of the modified Hamiltonian, the original Hamiltonian is preserved approximately: with bounded variation over exponentially long intervals. For a method of order p:

Page 14: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Compare solutions of the pendulum equations:

using Forward, Backward and Symplectic Eulers.

PendulumFE

BE SE

Page 15: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Statistical mechanicsA Lorenz model with Hamiltonian structure:

This is a simplified, “low-order” model representing some typical behavior of the atmosphere. The solutions are chaotic. Sometimes it is desirable to solve such systems on long time intervals to produce a data set for statistics.

The long time average of a function g of the first two variables is:

Page 16: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Statistical mechanicsSimulations using a standard (4th-order) time integrator show heavy dependence on the method parameters and integration time.

Page 17: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Statistical mechanicsSimulations using even a 1st-order symplectic integrator show give much better statistics.

The combination of energy and volume conservation is crucial for statistics.

Page 18: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Hamiltonian PDEs arise as the infinite dimensional abstraction of Hamiltonian ODEs. Instead of we consider a domain and a Hilbert space with accompanying inner product:

The Hamiltonian is a functional defined by integration over

A Hamiltonian PDE is given by

Where

Examples:

Hamiltonian PDEs

Page 19: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

The variational derivative is also defined with respect to the inner product on

For simplicity, we assume a periodic or unbounded domain. The variational derivative is

Conservation of the Hamiltonian is seen by

Variational derivative

Fine print: integration by parts--we assume the boundary terms vanish. If not, there is energy flux across the boundary, so no energy conservation.

Page 20: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Sample calculation

Variational derivative

Only the terms survive

Page 21: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Nonlinear wave equation:

Korteweg-de Vries equation:

Examples of Hamiltonian PDEs

The case V(u) = -cos(u) is the Sine-Gordon equation

Page 22: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

The main idea of discretizing Hamiltonian PDEs is to preserve the Hamiltonian structure under spatial semi-discretization, so that we can take advantage of symplectic time integrators.

To do this, it is enough to consider the discretization of the structure (mathematics) to preserve skew-symmetry, and the Hamiltonian (physics) using any convenient quadrature rule.

Define a grid:

Define a discrete inner product:

Quadrature rule:

Discrete structure:

Numerical discretization

Page 23: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

The variational derivative

The semi-discretization defines a Hamiltonian ODE

The discrete energy is a first integral of this ODE. But only that quadrature which was used to define H is exactly conserved. An issue of some confusion.

Numerical discretization

Page 24: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

The Kortweg-de Vries equation has Hamiltonian structure

Choose Euclidean inner product on

D = central difference operator

Hamiltonian quadrature

Example: KdV equation

Page 25: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Detailed calculation of the variational derivative

Example: KdV equation

Only the terms survive

Rearranging the terms of the summation, using periodicity:

Page 26: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Example: Linear wave equation can be written as a Hamiltonian PDE:

Choosing a collocated placement and central differences as used for KdV gives

The even and odd grid points decouple!

Page 27: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

A better approach is to define a staggered placement

Define dual discrete function spaces

Partition

Define dual difference operators

Discretization:

Example: Linear wave equation

Page 28: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Experiments: KdV EquationApplying the two-step leapfrog method

to the semi-discretization of the KdV equation, leads to a blow-up instability.

The same spatial discretization is stable for a symplectic time stepping method.

Page 29: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

KdV Equation

In fact, with the symplectic method we can solve the KdV on an interval more than 10x as long.

Page 30: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Statistics of fluids

The equations for an ideal fluid are Hamiltonian with a special structure.

They conserve not only energy but an infinite class of vorticity functionals.

In this experiment we compute the average vorticity and stream function fields on very long time intervals using (a) a finite difference method that conserves energy and one vorticity functional, and (b-d) a symplectic method that conserves energy in BEA sense and all vorticity integrals.

Statistical studies, weather/climate.

γ = 0

0 2 4 60

2

4

6γ = 2

0 2 4 60

2

4

6

γ = 4

0 2 4 60

2

4

6γ = 6

0 2 4 60

2

4

6

−0.4

−0.2

0

0.2

0.4

0.6

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

γ = 2

!̄−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

γ = 0

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

γ = 4

!̄−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

q̄!̄

γ = 6

Page 31: Numerical discretization of Hamiltonian PDEs - CWIhomepages.cwi.nl/~jason/Classes/HamPDE.pdf · Numerical discretization of Hamiltonian PDEs Jason Frank CWI, Amsterdam ... Along a

Exercises1. Prove that the symplectic Euler method is symplectic

2. Consider the nonlinear Schrödinger equation:

a. Show that this is Hamiltonian with

b. Show that there is an additional conserved quantity

c. Derive a Hamiltonian semi-discretization for this equation

d. Determine if your discretization preserves the second invariant

e. Which time integrator would do the best job of preserving the invariants?


Recommended