time integration methods for the heat equation solution u for t=0.0035 1tobias köppl tum

37
Time integration methods for the Heat Equation Solution u for t=0.0035 1 f u u t Tobias Köppl TUM

Upload: cecil-atkinson

Post on 26-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Time integration methods for the Heat Equation

Solution u for t=0.0035

1

fuut

Tobias Köppl TUM

Agenda:

Tobias Köppl TUM

2

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

1.2. Convergence theory for Onestep Methods

2. The Heat Equation

2.1. Discretization of the Laplacian operator

2.2. Application of Time integration methods

2.3. Courant-Friedrichs-Levy condition

3. Outlook

4. Literature

Tobias Köppl TUM

3

Notation:

)],,([ 01 dTtCy y: is a differentiable function, which maps from the intervall

],[ 0 Tt into d

d : vector space of d dimensional vectors with components, which are in

: field of real numbers

and whose derivative function is continous

:yt partial derivative of y with respect to t

:y Laplacian operator of y

d

i i

i

x

yy

12

2

: Machine accuracy 1610

:)( fOg

[,0[:, fg

0, RC with )()( xfCxg Rx

1. Time integration methods

Tobias Köppl TUM

4

1.1. Implicit and explicit Onestep Methods

00 )(

),()(

xtx

xtftxdt

d

d

dd

x

xtfxt

tf

0

0

),(),(

[,[:

Goal: Find numerical approximations of functions )],,([ 01 dTtCx

which are solutions of an ODE with an initial value:

(IVP)

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

5Tobias Köppl TUM

)()( txtxdt

d

1)0( x )exp()( ttx

Example (IVP):

Dahlquist‘s Testequation

Tobias Köppl TUM

6

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

Construction of a time integration method

Divide the continous intervall ],[ 0 Tt by 1n discrete timepoints:

Tttt n ...10

Grid },...,{ 0 ntt on ].,[ 0 Tt

tfor all)()( txtx

}0|max{ 1 njtt jjj Stepsize of grid :

by a gridfunction Approximation of the solution at the gridpoints jtdx :

1t 2t 3t 2nt1ntt

0t 1 ntT

321 2n 1n

Tobias Köppl TUM

7

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

)()(...)()( 100 Txtxtxxtx n

Such algorithms are called Onestep Methods.

Additionaly: Computation of the gridfunction by recursion, should be possible.

Reason: For the computation of )( 1 jtx only )( jtx from the timepoint

before is needed.

Further possibility: Multistep Methods.

See literature for more information f.e. [DB II] Chapter 7 or [QSS] Chapter 11

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

Tobias Köppl TUM

8

Two popular Onestep Methods are the explicit and the implicit Euler Method:

))(,()()( 111 jjjjj txtftxtx

explicit Euler Method:

implicit Euler Method:

00 )( xtx

))(,()()( 1 jjjjj txtftxtx

1. Time integration methods

1.1. Implicit and explicit Onestep Methods

Tobias Köppl TUM

9

Geometry of the explicit Euler Method:

The explicit Euler Method is creating a path (Euler path).

2l

1l

t

Construction of: ).( 1 jtx

t)( jtx

Compute the tangent vector t in).( jtx

Compute the intersection point between:

tt

txl

j

j

)(:1

and

01

0: 1

2jtl

First component of thisintersection point is the next value of the gridfunction ).( 1 jtx

Source: [DB II]

1. Time integration methods

Tobias Köppl TUM

10

1.2. Convergence theory for Onestep Methods

Issue: Under which conditions does a Onestep Method converge towards the exact solution of an ODE with an initial value?

Definition (local discretization error):

The local discretization error of a gridfunction fora grid on the intervall is defined as:

)(l

dx :],[ 0 Tt

)()(max)( 1)(

10

j

jj

njtxtxl

)( jx is the solution of the IVP:

)()(

),()(

jj txtx

xtftxdt

d

on ],[ 1jj tt

1. Time integration methods

1.2. Convergence theory for Onestep Methods

Tobias Köppl TUM

11

Definition:A Onestep Method is called constistent, if:

0)( l for .0

Theorem:The explicit and the implicit Euler Method are consistent.

Proof: See f. e. [DB II] Chapter 4.

1. Time integration methods

1.2. Convergence theory for Onestep Methods

Tobias Köppl TUM

12

Defintion (convergence):

A Onestep Method is called convergent towards the exact solution of an IVP, if:

0)( e .0for

Definition (global discretization error):

The global discretization error is the maximum error between the computedapproximations and the corresponding values of the exact solution

)( jtx).( jtx

)(e

)()(max)( 110

jj

njtxtxe

1. Time integration methods

1.2. Convergence theory for Onestep-Methods

Tobias Köppl TUM

13

Comparison of local and global Discretization error:

Source: [Bun]

1. Time integration methods

1.2. Convergence theory for Onestep-Methods

Tobias Köppl TUM

14

Defintion (stability):A numerical algorithm is called (numerically) stable, if for all permitted input data perturbed in the size of computational accuracy ( ) acceptable results are produced under the influence of rounding and method errors.

)(O

Maintheorem of Numerics:

A Onestep Method is convergent, if and only if it is consistent.

1. Time integration methods

1.2. Convergence theory for Onestep-Methods

Tobias Köppl TUM

15

Remark:Stability of a Onestep Method is an essential condition for getting qualitatively correct solutions, when using practical stepsizes. See numerical experiment.

Proof: See f. e. [Jun] Chapter 4.

Theorem:

The implicit Euler Method is stable for any stepsize

The explicit Euler Method is only stable for small .

.

Example:

If , the explicit Euler Method is a stable integrator for Dahlquist‘s testequation.

2

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

16

Goal: Find a numerical approximation of the two dimensional Laplacian operator in order to solve the Poisson equation:

21,0

fu 0u

:f

(PE)

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

17

Discretization Method: Finite Differences

Main idea: Replace differential operators by difference operators

Further discretization methods: Finite Volumes or Finite Elements

See literature for more information f.e. [QSS] or [Wa]

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

18

Discretization of :

Discretizationpoints: ),( ji yxihxi and ,jhy j

hji1

,0

Uniform grid with grid parameter h

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

19

Source: [Hu]

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

20

),(, jiji yxuu

),(, jiji yxff

expand ihxi ),( ji yhxu in a Taylor series aroundand ),( ji yhxu

Discretization of the two dimensional Laplacian operator:

jihjijijijiji

ji uh

uuuuuu ,2

,1,11,1,,,

4

expand jhy j ),( hyxu ji in a Taylor series aroundand ),( hyxu ji

Discretization error: )( 4hO

),( ji yx is an interior point of the unit square

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

21

jijijijijiji f

h

uuuuu,2

,1,11,1,,4

hji1

,0

In order to get a numerical solution of the (PE) we have to solve the following System of linear equations:

Matrix- Vectornotation:

fAu (SLSE)

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

22

Structure of the Matrix A:A ist a sparse Matrix

Use fast iterative solverslike Jacobi Method or GaußSeidel Methodfor the solution of (SLSE)

See f.e. [El]

Source: [Hu]

2. The Heat Equation

2.1. Discretization of the Laplacian operator

Tobias Köppl TUM

23

22

1,0

)sin()sin(2

yxu

0u

Example:

Solution: See numerical example

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

24

21,00

uut0u

2)1,0(:g )(),0( xgxu

Goal: Find numerical approximations of functions u which are solutions of the homogenous Heat Equation:

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

25

Solution of the Heat Equation depends on time and space.

Discretization of time andspace is necessary

Both time and space can be discretized by an uniform grid

Source: [SK]

h

h

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

26

Discretization of :

Discretizationpoints: ),( ji yxihxi and ,jhy j

hji1

,0

Uniform grid (2D) with grid parameter h

Discretization of :],[ 0 Tt

Uniform grid (1D) with stepsize k and n timepoints

timepoints: kmtm

nm 0

jimjim uyxtu ,,),,(

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

27

uuuu tt 0

Construct a local IVP for every ),( ji yxh

ji1

,0

Tt

yxgyxu

yxtuyxtudt

d

jiji

jiji

,0

),(),,0(

),,(),,(

(IVP(ij))

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

28

Solve IVP(ij) with the implicit Euler Method:

jimjimjim

jiji

ukuu

yxgu

,,1,,,,1

,,0 ),(

Use the discretization of the two dimensional Laplacian Operator:

2

,1,1,1,11,,11,,1,,1,,1

4

h

uuuuuu jimjimjimjimjim

jim

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

29

jimjimjimjimjimjim uk

huuuuu

k

h,,

2

,1,1,1,11,,11,,1,,1

2

4

We have to solve the following system of linear equations for every timestep:

nm 0h

ji1

,0

Use again fast iterative solvers like Jacobi Method or Gauß Seidel Method for the solution of (SLSE II)

(SLSE II)

2. The Heat Equation

2.2. Application of Time integration methods

Tobias Köppl TUM

30

21,00

uut0u 1),0( xu

25.0,0t

Numerical Example: (Cooling of a heated plate)

2. The Heat Equation

2.3. Courant-Friedrichs-Levy condition

Tobias Köppl TUM

31

(IVP(ij)) can be solved by the explicit Euler Method, too.

Chapter 1.2.: explicit Euler Method is only stable for a small stepsize k

Maintheorem of Numerics: Stability is an essential condition for getting qualitatively correct solutions, when using practical stepsizes.

2. The Heat Equation

2.3. Courant-Friedrichs-Levy condition

Tobias Köppl TUM

32

h

h

Theorem (CFL condition):

The explicit Euler Method is astable solver for the Heat Equation if:

142

h

k

Proof: See [CFL]

Source: [SK]

2. The Heat Equation

2.3. Courant-Friedrichs-Levy condition

Tobias Köppl TUM

33

21,00

uut0u 1),0( xu

25.0,0t

Numerical Example: (Cooling of a heated plate,solved with the explicit Euler Method and a discretizationwhich is not conform with the CFL condition)

3. Outlook

Tobias Köppl TUM

Let x(t) be the solution of an (IVP):

Adaptive discretization algorithms, with a good error measurement are required

34

Source: [DH I]

x(t)

x(t)

t

An uniform discretization of the time axis, would lead to a Onestep Methodwith slow convergence

3. Outlook

Tobias Köppl TUM

35

Further topics:

Optimization of the algorithms, solving the sparse linear equation systems,with respect to storage and number of floating point operations

Traversing a certain grid efficiently (peano curves)

Preconditioning of the Matrix representing the mentioned SLSE

4. Literature:

Tobias Köppl TUM

36

[DH I]: Numerische Mathematik I, Deuflhard/Hohmann, 2002, 3. edition[DB II]: Numerische Mathematik II, Deuflhard/Bornemann, 2002, 2. edition[Jun]: Lecture on Numerische Mathematik, Junge, 2007[SK]: Numerische Mathematik, Schwarz/Köckler, 2006, 6. edition[QSS]: Numerische Mathematik 2, Quateroni/Sacco/Saleri, 2002, 2. edition[Wa]: Lecture on Finite Elements, Wall, 2007, 2. edition[Hu]: Numerics for computer sience students, Huckle/Schneider, 2002, 3. edition[Bun]: Lecture on numerical programming, Bungartz, 2007[El]: Finite Elements and Fast Iterative Solvers, Elman/Silvester/Wathen, 2005, 2. ed.[Fo I]: Analysis I, Forster, 1976, 6. edition[Fo II]: Analysis II, Forster, 1976, 6. edition[Fei]: Introduction into the theory of partial differential equations, 2000 [CFL]: Über die partiellen Differentialgleichungen der mathematischen Physik, Courant, Friedrichs, Levy, 1928

Thank you for your attention!!!

Tobias Köppl TUM

37