32
UW Applied Mathematics Computing Spectra of Linear Operators Using Finite Differences J. Nathan Kutz Department of Applied Mathematics University of Washington Seattle, WA 98195-2420 Email: ([email protected]) Stability Workshop, Seattle, September 6-8, 2006

Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

UW

App

lied

Mat

hem

atic

s

Computing Spectra of Linear Operators

Using Finite Differences

J. Nathan Kutz

Department of Applied Mathematics University of WashingtonSeattle, WA 98195-2420 Email: ([email protected])

Stability Workshop, Seattle, September 6-8, 2006

Page 2: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Introduction: Spectral Stability

Consider the nonlinear PDE evolution

Equilibrium solution

Linear stability

UW

App

lied

Mat

hem

atic

s

perturbation

B. Deconinck and J. N. Kutz, J. Comp. Phys. (2006)

Page 3: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Associated Eigenvalue Problem

Separation of variables

Eigenvalue problem

Linear stability

Re(λ) ≤ 0Re(λ) > 0

spectrally stable

spectrally unstable

UW

App

lied

Mat

hem

atic

s

Page 4: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Finite Differences and Taylor Series

Taylor expand

slope formula with error

UW

App

lied

Mat

hem

atic

s

Adderrorapproximation

Page 5: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Higher-Order Accuracy

Taylor expand again

slope formula with improved error

UW

App

lied

Mat

hem

atic

s

8 x (first) and subtracterrorapproximation

Page 6: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Finite Difference Tables

neighboring points determine accuracy

UW

App

lied

Mat

hem

atic

s

Page 7: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Forward and Backward Differences

asymmetric neighboring points

UW

App

lied

Mat

hem

atic

s

Required for incorporating boundary conditions

Page 8: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Numerical Round-Off

round-off error dominates below

UW

App

lied

Mat

hem

atic

s

Consider the error in approximating the first derivative

The error includes round-off and truncation

Assume round-off and

minimum at

truncationround-off

Page 9: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Boundary Conditions: Pinned

tri-diagonal matrix structure

UW

App

lied

Mat

hem

atic

s

pinned boundaries

Page 10: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Boundary Conditions: Periodic

tri-diagonal matrix structure with corners

UW

App

lied

Mat

hem

atic

s

periodic boundaries

Page 11: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Boundary Conditions: No Flux

no longer symmetry matrix

UW

App

lied

Mat

hem

atic

s

no flux condition

Page 12: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

General Boundaries

no longer symmetry matrix

UW

App

lied

Mat

hem

atic

s

General (Sturm-Liouville) boundary conditions

Difficult to incorporate into matrix structure

• shooting methods

• relaxation methods

Page 13: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Algorithm

Easily extends to vectors and higher dimensions

• choose domain length and discretization size

• construct linear operator

• implement boundary conditions

• use eigenvalue/eigenvector solver: O(N3) (or shooting/relaxation methods)

• construct eigenfunctionsUW

App

lied

Mat

hem

atic

s

Page 14: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Example: Mathieu Equation

compute with matlab, maple, mathematica, or homemade code

UW

App

lied

Mat

hem

atic

s

Classic Example

Operator is self-adjoint (real spectrum)

Page 15: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Spectrum for Mathieu Equation

a is eigenvalue

q

a

UW

App

lied

Mat

hem

atic

s

Page 16: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Computing the Ground StateU

W A

pplie

d M

athe

mat

ics

Convergence study and CPU time (q=2)

0.43 sec0.01 sec

1 hour0.77 sec

- 2.5 min

• increase domain length

• Floquet theory

beyond Matlab7’s ability

What about band-gap structure

Page 17: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Calculating the Bands: Domain LengthU

W A

pplie

d M

athe

mat

ics

Increase the domain length (q=2)

traditional way: very costly for recovering bands

doubling gives 8x computational increase

Page 18: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Calculating the Bands: Floquet TheoryU

W A

pplie

d M

athe

mat

ics

Make use of Floquet (Bloch) theory

with Floquet (characteristic) exponents

• keep fixed domain

• discretize

• solve D O(N3) equations

larger period solutions

Page 19: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Implementing Floquet TheoryU

W A

pplie

d M

athe

mat

ics

Floquet theory modifies matrix corners

with Floquet slices

Page 20: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Floquet Theory vs. Domain LengthU

W A

pplie

d M

athe

mat

ics

Compare methods for computing band (q=2)

band density

beyond Matlab7’s ability

9 min8 sec

-1 min

-10 min

Use Floquet Theory!

Page 21: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Example: Periodic NLS

Consider the system

with

UW

App

lied

Mat

hem

atic

s

and Jacobi sine function

Page 22: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Spectrum of Periodic NLS

k=0.7k=0 k=0.9 k=1

UW

App

lied

Mat

hem

atic

s

Page 23: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Importance of Floquet Slicing

µ ≠ 0

µ = 0

UW

App

lied

Mat

hem

atic

s

Page 24: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Accuracy and Convergence U

W A

pplie

d M

athe

mat

ics

Page 25: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Example: 2D Mathieu Equation

Consider

with

UW

App

lied

Mat

hem

atic

s

Operation Count: O((N2)3)=O(N6)

Page 26: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Laplacian in 2DU

W A

pplie

d M

athe

mat

ics

must stack 2D data: periodic boundaries add structure

Consider

Discretize:

Let

Page 27: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Laplacian in 2DU

W A

pplie

d M

athe

mat

ics

nx=ny=4

Page 28: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Laplacian in 2DU

W A

pplie

d M

athe

mat

ics

Matlab easily builds 2D Laplacian

nx=ny=4

Page 29: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Band Gap Structure

Quasi-momentum representation

First three band-gap structures

UW

App

lied

Mat

hem

atic

s

A=1A=-0.3 A=0

Page 30: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

2D Dominant Eigenfunctions

First three eigenfunctions for µx = µy=0UW

App

lied

Mat

hem

atic

s

Page 31: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

2D Eigenfunctions

First three eigenfunctions for µx = µy=1/4

UW

App

lied

Mat

hem

atic

s

Page 32: Computing Spectra of UW Applied Mathematics Using Finite ...depts.washington.edu/bdecon/workshop2012/c1_stability.pdf · UW Applied Mathematics Computing Spectra of Linear Operators

Summary and ConclusionsU

W A

pplie

d M

athe

mat

ics

• simple, simple, simple

• boundary conditions at edge of matrices

• eigenvalue solvers make use of sparse structure

• Floquet theory for resolution of bands

• costly/impractical for 2D-3D problems

B. Deconinck and J. N. Kutz, J. Comp. Phys. (2006)