3.2.2 the leapfrog method - ucd › ~plynch › lecture-notes › nwp-2004 › nwp... ·...

103
§3.2.2 The Leapfrog Method

Upload: others

Post on 06-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method

Page 2: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

Page 3: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

• In particular, by means of the perturbation method theequations have been linearised, making them amenableto analytical investigation.

Page 4: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

• In particular, by means of the perturbation method theequations have been linearised, making them amenableto analytical investigation.

• However, to obtain solutions in the general case, it isnecessary to solve the full nonlinear system.

Page 5: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

• In particular, by means of the perturbation method theequations have been linearised, making them amenableto analytical investigation.

• However, to obtain solutions in the general case, it isnecessary to solve the full nonlinear system.

• In numerical weather prediction (NWP) the fully nonlin-ear primitive equations are solved by numerical means.

Page 6: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

• In particular, by means of the perturbation method theequations have been linearised, making them amenableto analytical investigation.

• However, to obtain solutions in the general case, it isnecessary to solve the full nonlinear system.

• In numerical weather prediction (NWP) the fully nonlin-ear primitive equations are solved by numerical means.

• In the atmosphere, the nonlinear advection process is adominant factor.

Page 7: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

§3.2.2 The Leapfrog Method• We have studied various simple solutions of the shallow

water equations by making approximations.

• In particular, by means of the perturbation method theequations have been linearised, making them amenableto analytical investigation.

• However, to obtain solutions in the general case, it isnecessary to solve the full nonlinear system.

• In numerical weather prediction (NWP) the fully nonlin-ear primitive equations are solved by numerical means.

• In the atmosphere, the nonlinear advection process is adominant factor.

• To get some idea of the methods used, we look at the sim-ple problem of formulating time-integration algorithmsfor the solution of the simple advection equation.

Page 8: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

2

Page 9: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

Other approaches include finite element method and thespectral method.

2

Page 10: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

Other approaches include finite element method and thespectral method.

The central idea of the finite difference approach is toapproximate the derivatives in the equation by differencesbetween adjacent points in space or time, and therebyreduce the differential equation to a difference equation.

2

Page 11: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

Other approaches include finite element method and thespectral method.

The central idea of the finite difference approach is toapproximate the derivatives in the equation by differencesbetween adjacent points in space or time, and therebyreduce the differential equation to a difference equation.

• An analytical problem becomes an algebraic one.

2

Page 12: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

Other approaches include finite element method and thespectral method.

The central idea of the finite difference approach is toapproximate the derivatives in the equation by differencesbetween adjacent points in space or time, and therebyreduce the differential equation to a difference equation.

• An analytical problem becomes an algebraic one.

• A problem with an infinite degree of freedom is replacedby one with a finite degree of freedom.

2

Page 13: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving differential equations. Wewill confine ourselves to the finite difference method.

Other approaches include finite element method and thespectral method.

The central idea of the finite difference approach is toapproximate the derivatives in the equation by differencesbetween adjacent points in space or time, and therebyreduce the differential equation to a difference equation.

• An analytical problem becomes an algebraic one.

• A problem with an infinite degree of freedom is replacedby one with a finite degree of freedom.

• A continuous problem goes over to a discrete one.

2

Page 14: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Finite Difference MethodWe start by looking at the Taylor expansion of f (x):

f (x + ∆x) = f (x) + f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (1)

f (x−∆x) = f (x)− f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (2)

3

Page 15: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Finite Difference MethodWe start by looking at the Taylor expansion of f (x):

f (x + ∆x) = f (x) + f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (1)

f (x−∆x) = f (x)− f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (2)

The higher order terms, represented by O(∆x3), become lessimportant as ∆x becomes smaller.

3

Page 16: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Finite Difference MethodWe start by looking at the Taylor expansion of f (x):

f (x + ∆x) = f (x) + f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (1)

f (x−∆x) = f (x)− f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (2)

The higher order terms, represented by O(∆x3), become lessimportant as ∆x becomes smaller.

We neglect these and obtain approximations for the deriva-tive of f (x) as follows:

f ′(x) =f (x + ∆x)− f (x)

∆x+O(∆x) = f ′F +O(∆x)

f ′(x) =f (x)− f (x−∆x)

∆x+O(∆x) = f ′B +O(∆x) .

3

Page 17: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Finite Difference MethodWe start by looking at the Taylor expansion of f (x):

f (x + ∆x) = f (x) + f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (1)

f (x−∆x) = f (x)− f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (2)

The higher order terms, represented by O(∆x3), become lessimportant as ∆x becomes smaller.

We neglect these and obtain approximations for the deriva-tive of f (x) as follows:

f ′(x) =f (x + ∆x)− f (x)

∆x+O(∆x) = f ′F +O(∆x)

f ′(x) =f (x)− f (x−∆x)

∆x+O(∆x) = f ′B +O(∆x) .

These are called the forward and backward differences.

3

Page 18: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Finite Difference MethodWe start by looking at the Taylor expansion of f (x):

f (x + ∆x) = f (x) + f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (1)

f (x−∆x) = f (x)− f ′(x).∆x + 12f

′′(x)∆x2 + [O(∆x3)] (2)

The higher order terms, represented by O(∆x3), become lessimportant as ∆x becomes smaller.

We neglect these and obtain approximations for the deriva-tive of f (x) as follows:

f ′(x) =f (x + ∆x)− f (x)

∆x+O(∆x) = f ′F +O(∆x)

f ′(x) =f (x)− f (x−∆x)

∆x+O(∆x) = f ′B +O(∆x) .

These are called the forward and backward differences.

Keeping only leading terms, we incur errors of order O(∆x).

3

Page 19: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We can do better than this: subtracting (2) from (1) yields:

f ′(x) =f (x + ∆x)− f (x−∆x)

2∆x+O(∆x2) = f ′C +O(∆x2)

4

Page 20: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We can do better than this: subtracting (2) from (1) yields:

f ′(x) =f (x + ∆x)− f (x−∆x)

2∆x+O(∆x2) = f ′C +O(∆x2)

This is O(∆x2), therefore more accurate for small ∆x.

4

Page 21: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We can do better than this: subtracting (2) from (1) yields:

f ′(x) =f (x + ∆x)− f (x−∆x)

2∆x+O(∆x2) = f ′C +O(∆x2)

This is O(∆x2), therefore more accurate for small ∆x.

Adding (1) and (2) gives the corresponding expression forthe second derivative:

f ′′(x) =f (x + ∆x)− 2f (x) + f (x−∆x)

∆x2+O(∆x2)

These centered differences are of accuracy O(∆x2).

4

Page 22: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We can do better than this: subtracting (2) from (1) yields:

f ′(x) =f (x + ∆x)− f (x−∆x)

2∆x+O(∆x2) = f ′C +O(∆x2)

This is O(∆x2), therefore more accurate for small ∆x.

Adding (1) and (2) gives the corresponding expression forthe second derivative:

f ′′(x) =f (x + ∆x)− 2f (x) + f (x−∆x)

∆x2+O(∆x2)

These centered differences are of accuracy O(∆x2).

We can continue taking more and more terms, but obviouslythere is a trade-off between accuracy and efficiency.

4

Page 23: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We can do better than this: subtracting (2) from (1) yields:

f ′(x) =f (x + ∆x)− f (x−∆x)

2∆x+O(∆x2) = f ′C +O(∆x2)

This is O(∆x2), therefore more accurate for small ∆x.

Adding (1) and (2) gives the corresponding expression forthe second derivative:

f ′′(x) =f (x + ∆x)− 2f (x) + f (x−∆x)

∆x2+O(∆x2)

These centered differences are of accuracy O(∆x2).

We can continue taking more and more terms, but obviouslythere is a trade-off between accuracy and efficiency.

Fourth-order accurate schemes are sometimes used in NWP,but second order accuracy is more popular.

4

Page 24: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Exercise:

Consider the function f (x) = A sin(kx).

We know that the derivative is kA cos(kx).

5

Page 25: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Exercise:

Consider the function f (x) = A sin(kx).

We know that the derivative is kA cos(kx).

• Show that a forward difference approximation gives

f ′F (x) = kA cos[k(x + ∆x/2)] ·[sin(k∆x/2)

k∆x/2

]

5

Page 26: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Exercise:

Consider the function f (x) = A sin(kx).

We know that the derivative is kA cos(kx).

• Show that a forward difference approximation gives

f ′F (x) = kA cos[k(x + ∆x/2)] ·[sin(k∆x/2)

k∆x/2

]

• Show that the centered difference approximation yields

f ′C(x) = kA cos[kx] ·[sin(k∆x)

k∆x

]

5

Page 27: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Exercise:

Consider the function f (x) = A sin(kx).

We know that the derivative is kA cos(kx).

• Show that a forward difference approximation gives

f ′F (x) = kA cos[k(x + ∆x/2)] ·[sin(k∆x/2)

k∆x/2

]

• Show that the centered difference approximation yields

f ′C(x) = kA cos[kx] ·[sin(k∆x)

k∆x

]

• Compare these to the true derivative f ′(x) and investigatetheir behaviour for small ∆x.

5

Page 28: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Exercise:

Consider the function f (x) = A sin(kx).

We know that the derivative is kA cos(kx).

• Show that a forward difference approximation gives

f ′F (x) = kA cos[k(x + ∆x/2)] ·[sin(k∆x/2)

k∆x/2

]• Show that the centered difference approximation yields

f ′C(x) = kA cos[kx] ·[sin(k∆x)

k∆x

]• Compare these to the true derivative f ′(x) and investigate

their behaviour for small ∆x.

• Demonstrate thus that the centered difference is of higherorder accuracy.

5

Page 29: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Grid Resolution and AccuracyThe size of the gridstep ∆x determines the accuracy of thenumerical scheme.

For the simple sine function the error depended on k∆x =2π∆x/L, that is, on the ratio of the grid size ∆x to the wave-length L.

6

Page 30: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Grid Resolution and AccuracyThe size of the gridstep ∆x determines the accuracy of thenumerical scheme.

For the simple sine function the error depended on k∆x =2π∆x/L, that is, on the ratio of the grid size ∆x to the wave-length L.

For synoptic scale waves in the atmosphere a typical valueof L is 1000 km.

6

Page 31: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Grid Resolution and AccuracyThe size of the gridstep ∆x determines the accuracy of thenumerical scheme.

For the simple sine function the error depended on k∆x =2π∆x/L, that is, on the ratio of the grid size ∆x to the wave-length L.

For synoptic scale waves in the atmosphere a typical valueof L is 1000 km.

To make the ratio equal to 0.1 we need to have a grid sizeof about 100 km.

This is larger than the typical gridsizes used in operationalNWP models.

6

Page 32: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Grid Resolution and AccuracyThe size of the gridstep ∆x determines the accuracy of thenumerical scheme.

For the simple sine function the error depended on k∆x =2π∆x/L, that is, on the ratio of the grid size ∆x to the wave-length L.

For synoptic scale waves in the atmosphere a typical valueof L is 1000 km.

To make the ratio equal to 0.1 we need to have a grid sizeof about 100 km.

This is larger than the typical gridsizes used in operationalNWP models.

The higher the resolution, that is, the smaller the grid-size,the heavier the computational burden.

There is a trade-off between resolution and accuracy.

6

Page 33: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Leapfrog MethodWe consider the equation describing the conservation of aquantity Y (x, t) following the 1D motion of a fluid flow:

dY

dt≡(∂Y

∂t+ u

∂Y

∂x

)= 0 .

7

Page 34: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Leapfrog MethodWe consider the equation describing the conservation of aquantity Y (x, t) following the 1D motion of a fluid flow:

dY

dt≡(∂Y

∂t+ u

∂Y

∂x

)= 0 .

If the velocity is taken to be constant, u = c, or if we lineariseabout a mean flow u = c, the equation becomes

∂Y

∂t+ c

∂Y

∂x= 0 .

7

Page 35: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Leapfrog MethodWe consider the equation describing the conservation of aquantity Y (x, t) following the 1D motion of a fluid flow:

dY

dt≡(∂Y

∂t+ u

∂Y

∂x

)= 0 .

If the velocity is taken to be constant, u = c, or if we lineariseabout a mean flow u = c, the equation becomes

∂Y

∂t+ c

∂Y

∂x= 0 .

This is the linear advection equation.

7

Page 36: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The Leapfrog MethodWe consider the equation describing the conservation of aquantity Y (x, t) following the 1D motion of a fluid flow:

dY

dt≡(∂Y

∂t+ u

∂Y

∂x

)= 0 .

If the velocity is taken to be constant, u = c, or if we lineariseabout a mean flow u = c, the equation becomes

∂Y

∂t+ c

∂Y

∂x= 0 .

This is the linear advection equation.

It is analogous to a factor of the wave equation:(∂2

∂t2− c2

∂2

∂x2

)Y =

(∂

∂t+ c

∂x

)(∂

∂t− c

∂x

)Y = 0 ,

and its general solution is Y = Y (x− ct).

7

Page 37: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Since the advection equation is linear, we can construct ageneral solution from Fourier components

Y = a exp[ik(x− ct)] ; k = 2π/L .

8

Page 38: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Since the advection equation is linear, we can construct ageneral solution from Fourier components

Y = a exp[ik(x− ct)] ; k = 2π/L .

We take the following initial condition for Y :

Y (x, 0) = a exp[ikx]

8

Page 39: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Since the advection equation is linear, we can construct ageneral solution from Fourier components

Y = a exp[ik(x− ct)] ; k = 2π/L .

We take the following initial condition for Y :

Y (x, 0) = a exp[ikx]

Next, we approximate the differential equation by a finitedifference equation (FDE) using centered differences for boththe space and time derivatives.

8

Page 40: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Since the advection equation is linear, we can construct ageneral solution from Fourier components

Y = a exp[ik(x− ct)] ; k = 2π/L .

We take the following initial condition for Y :

Y (x, 0) = a exp[ikx]

Next, we approximate the differential equation by a finitedifference equation (FDE) using centered differences for boththe space and time derivatives.

The continuous variables are replaced by discrete gridpointsat their integral values and the problem is solved on a finitedifference grid.

8

Page 41: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Since the advection equation is linear, we can construct ageneral solution from Fourier components

Y = a exp[ik(x− ct)] ; k = 2π/L .

We take the following initial condition for Y :

Y (x, 0) = a exp[ikx]

Next, we approximate the differential equation by a finitedifference equation (FDE) using centered differences for boththe space and time derivatives.

The continuous variables are replaced by discrete gridpointsat their integral values and the problem is solved on a finitedifference grid.

Let the variables x and t be represented by the horizontaland vertical axes. Positive time corresponds to the upperhalf plane. The initial data occur on the x-axis.

8

Page 42: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Space-Time Grid: Space axis horizontalTime axis vertical

n = 5 +——–+——–+——–+——–+——–+——–+I I I I I I II I I I I I I

n = 4 +——–+——–+——–+——–+——–+——–+I I I I I I II I I I I I I

n = 3 +——–+——–+——–+——–+——–+——–+I I I I I I II I I I I I I

n = 2 +——–+——–+——–+——–+——–+——–+I I I I I I II I I I I I I

n = 1 +——–+——–+——–+——–+——–+——–+I I I I I I II I I I I I I

n = 0 +——–+——–+——–+——–+——–+——–+m=-3 m=-2 m=-1 m=0 m=1 m=2 m=3

9

Page 43: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We denote the value of Y at a grid point by:

Y (m∆x, n∆t) = Y nm .

10

Page 44: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We denote the value of Y at a grid point by:

Y (m∆x, n∆t) = Y nm .

Then the (CTCS) finite difference approximation to the dif-ferential equation may be written as follows:(

Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

10

Page 45: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We denote the value of Y at a grid point by:

Y (m∆x, n∆t) = Y nm .

Then the (CTCS) finite difference approximation to the dif-ferential equation may be written as follows:(

Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

10

Page 46: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We denote the value of Y at a grid point by:

Y (m∆x, n∆t) = Y nm .

Then the (CTCS) finite difference approximation to the dif-ferential equation may be written as follows:(

Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

The value at the time (n+1)∆t is obtained by adding a termto the value at (n−1)∆t; the method is known as the leapfrogmethod because of this leap over the time n∆t.

10

Page 47: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

We denote the value of Y at a grid point by:

Y (m∆x, n∆t) = Y nm .

Then the (CTCS) finite difference approximation to the dif-ferential equation may be written as follows:(

Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

The value at the time (n+1)∆t is obtained by adding a termto the value at (n−1)∆t; the method is known as the leapfrogmethod because of this leap over the time n∆t.

The ratio µ ≡ c∆t

∆xwill be found to be crucial.

10

Page 48: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Inter-dependency of Points

n + 1 + ⊕ +

n ⊕ • ⊕

n - 1 + ⊕ +

m-1 m m+1

The evaluation of the equation at point • involves values ofthe variable at points ⊕. Solving for Y n+1

m thus requires

Y n−1m , Y nm−1 and Y nm+1 .

The leapfrog scheme splits the grid into two independent sub-grids.

11

Page 49: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Grid Splitting

n = 4 •———⊕——–•——–⊕———•I I I I II I I I I

n = 3 ⊕———•——–⊕——–•———⊕I I I I II I I I I

n = 2 •———⊕——–•——–⊕———•I I I I II I I I I

n = 1 ⊕———•——–⊕——–•———⊕I I I I II I I I I

n = 0 •———⊕——–•——–⊕———•m=-2 m=-1 m=0 m=1 m=2

The finite difference grid splits into two sub-grids.

Steps must be taken to avoid divergence of the two solutions.

12

Page 50: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recall the (CTCS) finite difference approximation:(Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

13

Page 51: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recall the (CTCS) finite difference approximation:(Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

or, using the Courant Number,

Y n+1m = Y n−1

m − µ(Y nm+1 − Y nm−1)

13

Page 52: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recall the (CTCS) finite difference approximation:(Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

or, using the Courant Number,

Y n+1m = Y n−1

m − µ(Y nm+1 − Y nm−1)

Assuming that we know the solution up to time n∆t, thevalues at time (n + 1)∆t can be calculated, and the solutionadvanced by one timestep in this way.

13

Page 53: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Recall the (CTCS) finite difference approximation:(Y n+1m − Y n−1

m

2∆t

)+ c

(Y nm+1 − Y nm−1

2∆x

)= 0 .

Solving for the value at time (n + 1)∆t gives

Y n+1m = Y n−1

m −(c∆t

∆x

)(Y nm+1 − Y nm−1)

or, using the Courant Number,

Y n+1m = Y n−1

m − µ(Y nm+1 − Y nm−1)

Assuming that we know the solution up to time n∆t, thevalues at time (n + 1)∆t can be calculated, and the solutionadvanced by one timestep in this way.

Then the whole procedure can be repeated to advance thesolution to (n + 2)∆t, and so on.

13

Page 54: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Question:Under what conditions does the solution of the finite differ-ence equation approximate that of the original differentialequation?

? ? ?

14

Page 55: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Question:Under what conditions does the solution of the finite differ-ence equation approximate that of the original differentialequation?

? ? ?

Intuitively, we would expect that a good approximationwould be obtained provided the grid steps ∆x and ∆t aresmall enough.

14

Page 56: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Question:Under what conditions does the solution of the finite differ-ence equation approximate that of the original differentialequation?

? ? ?

Intuitively, we would expect that a good approximationwould be obtained provided the grid steps ∆x and ∆t aresmall enough.

However, it turns out that this is not enough, and that the

value of the ratio

µ =c∆t

∆xis found to be of critical importance.

14

Page 57: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Question:Under what conditions does the solution of the finite differ-ence equation approximate that of the original differentialequation?

? ? ?

Intuitively, we would expect that a good approximationwould be obtained provided the grid steps ∆x and ∆t aresmall enough.

However, it turns out that this is not enough, and that the

value of the ratio

µ =c∆t

∆xis found to be of critical importance.

This “surprising result” has important practicalimplications for operational NWP.

14

Page 58: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Question:Under what conditions does the solution of the finite differ-ence equation approximate that of the original differentialequation?

? ? ?

Intuitively, we would expect that a good approximationwould be obtained provided the grid steps ∆x and ∆t aresmall enough.

However, it turns out that this is not enough, and that the

value of the ratio

µ =c∆t

∆xis found to be of critical importance.

This “surprising result” has important practicalimplications for operational NWP.

Break here

14

Page 59: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The CFL Stability CriterionLet us assume a solution of the FDE in the form

Y nm = aAn exp[ikm∆x]

15

Page 60: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The CFL Stability CriterionLet us assume a solution of the FDE in the form

Y nm = aAn exp[ikm∆x]

Substituting this in the equation, defining µ = c∆t/∆x anddividing by a common factor gives

A2 + (2iµ sin k∆x)A− 1 = 0

15

Page 61: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The CFL Stability CriterionLet us assume a solution of the FDE in the form

Y nm = aAn exp[ikm∆x]

Substituting this in the equation, defining µ = c∆t/∆x anddividing by a common factor gives

A2 + (2iµ sin k∆x)A− 1 = 0

This is a quadratic for the amplitude A, with solutions

A± = −iµ sin k∆x±√

1− µ2 sin2 k∆x .

15

Page 62: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The CFL Stability CriterionLet us assume a solution of the FDE in the form

Y nm = aAn exp[ikm∆x]

Substituting this in the equation, defining µ = c∆t/∆x anddividing by a common factor gives

A2 + (2iµ sin k∆x)A− 1 = 0

This is a quadratic for the amplitude A, with solutions

A± = −iµ sin k∆x±√

1− µ2 sin2 k∆x .

The roots of a quadratic equation may be either real orcomplex, depending on the value of the coefficients.

15

Page 63: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The CFL Stability CriterionLet us assume a solution of the FDE in the form

Y nm = aAn exp[ikm∆x]

Substituting this in the equation, defining µ = c∆t/∆x anddividing by a common factor gives

A2 + (2iµ sin k∆x)A− 1 = 0

This is a quadratic for the amplitude A, with solutions

A± = −iµ sin k∆x±√

1− µ2 sin2 k∆x .

The roots of a quadratic equation may be either real orcomplex, depending on the value of the coefficients.

We write

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

We consider in turn the two cases.15

Page 64: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case I: |µ| ≤ 1The quantity under the square-root sign is positive, so themodulus of A is given by

|A|2 = (1− σ2) + σ2 = 1 .

16

Page 65: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case I: |µ| ≤ 1The quantity under the square-root sign is positive, so themodulus of A is given by

|A|2 = (1− σ2) + σ2 = 1 .

The modulus of A is seen to be unity. Thus, we may write

A = exp(iψ) where ψ is real .

16

Page 66: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case I: |µ| ≤ 1The quantity under the square-root sign is positive, so themodulus of A is given by

|A|2 = (1− σ2) + σ2 = 1 .

The modulus of A is seen to be unity. Thus, we may write

A = exp(iψ) where ψ is real .

Note that

<{A+} = +√

1− σ2 ={A+} = −σ<{A−} = −

√1− σ2 ={A+} = −σ

16

Page 67: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case I: |µ| ≤ 1The quantity under the square-root sign is positive, so themodulus of A is given by

|A|2 = (1− σ2) + σ2 = 1 .

The modulus of A is seen to be unity. Thus, we may write

A = exp(iψ) where ψ is real .

Note that

<{A+} = +√

1− σ2 ={A+} = −σ<{A−} = −

√1− σ2 ={A+} = −σ

The two values of the phase are

ψ1 = − arcsinσ

andψ2 = π − ψ1 .

16

Page 68: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The solution of the equation may now be written

Y nm =[D exp(iψ1n) + E exp[i(−ψ1 + π)n]

]exp(ikm∆x)

where D and E are arbitrary constants.

17

Page 69: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The solution of the equation may now be written

Y nm =[D exp(iψ1n) + E exp[i(−ψ1 + π)n]

]exp(ikm∆x)

where D and E are arbitrary constants.

Setting n = 0, this implies

Y 0m = [D + E] exp(ikm∆x)

which, on account of the initial condition, means D+E = a.

17

Page 70: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The solution of the equation may now be written

Y nm =[D exp(iψ1n) + E exp[i(−ψ1 + π)n]

]exp(ikm∆x)

where D and E are arbitrary constants.

Setting n = 0, this implies

Y 0m = [D + E] exp(ikm∆x)

which, on account of the initial condition, means D+E = a.

Thus, we may write the solution as

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

? ? ?

17

Page 71: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The solution of the equation may now be written

Y nm =[D exp(iψ1n) + E exp[i(−ψ1 + π)n]

]exp(ikm∆x)

where D and E are arbitrary constants.

Setting n = 0, this implies

Y 0m = [D + E] exp(ikm∆x)

which, on account of the initial condition, means D+E = a.

Thus, we may write the solution as

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

? ? ?

Exercise:Check in detail the algebra leading to this solution.

17

Page 72: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

18

Page 73: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

The first term of this solution is called the physical modeand corresponds to the solution of the differential equation.

18

Page 74: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

The first term of this solution is called the physical modeand corresponds to the solution of the differential equation.

The second term is called the computational mode.

18

Page 75: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

The first term of this solution is called the physical modeand corresponds to the solution of the differential equation.

The second term is called the computational mode.

It arises through the use of centered differences resulting inthe approximation of a first order differential equation by asecond order difference equation (with an extra solution).

18

Page 76: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

The first term of this solution is called the physical modeand corresponds to the solution of the differential equation.

The second term is called the computational mode.

It arises through the use of centered differences resulting inthe approximation of a first order differential equation by asecond order difference equation (with an extra solution).

For µ and k∆x small we have

ψ1 ≈ −µk∆x = −kc∆t and ψ2 ≈ π + µk∆x = π + kc∆t

18

Page 77: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Once again, the solution is

Y nm = (a− E) exp[ik(m∆x + ψ1n/k)]︸ ︷︷ ︸Physical Mode

+ (−1)nE exp[ik(m∆x− ψ1n/k)]︸ ︷︷ ︸Computational Mode

The first term of this solution is called the physical modeand corresponds to the solution of the differential equation.

The second term is called the computational mode.

It arises through the use of centered differences resulting inthe approximation of a first order differential equation by asecond order difference equation (with an extra solution).

For µ and k∆x small we have

ψ1 ≈ −µk∆x = −kc∆t and ψ2 ≈ π + µk∆x = π + kc∆t

If the ratio µ is small, the physical mode solution is givenapproximately by

Y ≈ a exp[ik(m∆x− cn∆t)]

which is just the analytical solution.18

Page 78: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

19

Page 79: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

19

Page 80: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

In essence, this amounts to specifing another “initial con-tition”, the computational initial condition, at t = ∆t.

19

Page 81: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

In essence, this amounts to specifing another “initial con-tition”, the computational initial condition, at t = ∆t.

The value of the additional “initial condition” determinesthe amplitude of the computational mode. It should bechosen to minimize this.

19

Page 82: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

In essence, this amounts to specifing another “initial con-tition”, the computational initial condition, at t = ∆t.

The value of the additional “initial condition” determinesthe amplitude of the computational mode. It should bechosen to minimize this.

The above solution implies

Y 0m = a exp(ikm∆x)

Y 1m = [a exp(iψ1)− 2E cosψ1] exp(ikm∆x)

19

Page 83: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

In essence, this amounts to specifing another “initial con-tition”, the computational initial condition, at t = ∆t.

The value of the additional “initial condition” determinesthe amplitude of the computational mode. It should bechosen to minimize this.

The above solution implies

Y 0m = a exp(ikm∆x)

Y 1m = [a exp(iψ1)− 2E cosψ1] exp(ikm∆x)

Requiring E = 0, we find that Y 1m = exp(iψ1)Y

0m.

19

Page 84: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The centered difference approximation cannot be used forthe first timestep: We don’t know the values at time t = −∆t.

Instead, we must use another approximation for the firststep, typically an uncentered forward time step.

In essence, this amounts to specifing another “initial con-tition”, the computational initial condition, at t = ∆t.

The value of the additional “initial condition” determinesthe amplitude of the computational mode. It should bechosen to minimize this.

The above solution implies

Y 0m = a exp(ikm∆x)

Y 1m = [a exp(iψ1)− 2E cosψ1] exp(ikm∆x)

Requiring E = 0, we find that Y 1m = exp(iψ1)Y

0m.

In this simple case, we can eliminate the computationalmode. In general, it is much more difficult.

19

Page 85: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case II: |µ| > 1Recall that the roots of the quadratic are

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

20

Page 86: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case II: |µ| > 1Recall that the roots of the quadratic are

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

If |µ| > 1, there will be some wavelengths for which

σ2 = µ2 sin2 k∆x > 1 .

20

Page 87: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case II: |µ| > 1Recall that the roots of the quadratic are

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

If |µ| > 1, there will be some wavelengths for which

σ2 = µ2 sin2 k∆x > 1 .

Then the two roots of the quadratic are pure imaginary

A = i(−σ ±

√σ2 − 1

)

20

Page 88: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case II: |µ| > 1Recall that the roots of the quadratic are

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

If |µ| > 1, there will be some wavelengths for which

σ2 = µ2 sin2 k∆x > 1 .

Then the two roots of the quadratic are pure imaginary

A = i(−σ ±

√σ2 − 1

)Therefore either |A+| > 1 or |A−| > 1, i.e., the modulus ofone of the roots will exceed unity.

In that case the amplitude of the solution of the finite dif-ference equation will grow without bound for large time.

20

Page 89: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Case II: |µ| > 1Recall that the roots of the quadratic are

A± = −iσ ±√

1− σ2 where σ ≡ µ sin k∆x

If |µ| > 1, there will be some wavelengths for which

σ2 = µ2 sin2 k∆x > 1 .

Then the two roots of the quadratic are pure imaginary

A = i(−σ ±

√σ2 − 1

)Therefore either |A+| > 1 or |A−| > 1, i.e., the modulus ofone of the roots will exceed unity.

In that case the amplitude of the solution of the finite dif-ference equation will grow without bound for large time.

This phenomenon is called computational instability.

20

Page 90: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

In case of computational instability, the solution of thefinite difference equation cannot possibly resemble thephysical solution.

21

Page 91: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

In case of computational instability, the solution of thefinite difference equation cannot possibly resemble thephysical solution.

The physical solution remains of constant amplitude for alltime. The numerical solution grows without limit with time.

21

Page 92: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

In case of computational instability, the solution of thefinite difference equation cannot possibly resemble thephysical solution.

The physical solution remains of constant amplitude for alltime. The numerical solution grows without limit with time.

We thus require that |µ| ≤ 1. This condition for stability is

known as the CFL Criterion:

c∆t

∆x≤ 1

after Courant, Friedichs and Lewy (1928), who first pub-lished the result.

21

Page 93: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

In case of computational instability, the solution of thefinite difference equation cannot possibly resemble thephysical solution.

The physical solution remains of constant amplitude for alltime. The numerical solution grows without limit with time.

We thus require that |µ| ≤ 1. This condition for stability is

known as the CFL Criterion:

c∆t

∆x≤ 1

after Courant, Friedichs and Lewy (1928), who first pub-lished the result.

It implies that, if we refine the space grid, that is, decrease∆x, we must also shorten the time step ∆t.

21

Page 94: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

In case of computational instability, the solution of thefinite difference equation cannot possibly resemble thephysical solution.

The physical solution remains of constant amplitude for alltime. The numerical solution grows without limit with time.

We thus require that |µ| ≤ 1. This condition for stability is

known as the CFL Criterion:

c∆t

∆x≤ 1

after Courant, Friedichs and Lewy (1928), who first pub-lished the result.

It implies that, if we refine the space grid, that is, decrease∆x, we must also shorten the time step ∆t.

Thus, halving the grid size in a two dimensional domainresults in an eightfold increase in computation time.

21

Page 95: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Unconditionally Stable Schemes.A large part of the research effort in Met Eireann recentlyhas been devoted to the development of integration schemeswhich are free of the CFL constraint.

22

Page 96: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Unconditionally Stable Schemes.A large part of the research effort in Met Eireann recentlyhas been devoted to the development of integration schemeswhich are free of the CFL constraint.

The semi-Lagrangian scheme for advection is based on theidea of approximating the Lagrangian form of the time deriva-tive.

22

Page 97: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Unconditionally Stable Schemes.A large part of the research effort in Met Eireann recentlyhas been devoted to the development of integration schemeswhich are free of the CFL constraint.

The semi-Lagrangian scheme for advection is based on theidea of approximating the Lagrangian form of the time deriva-tive.

It is so formulated that the numerical domain of dependencealways includes the physical domain of dependence. Thisnecessary condition for stability is satisfied automaticallyby the scheme.

22

Page 98: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

Unconditionally Stable Schemes.A large part of the research effort in Met Eireann recentlyhas been devoted to the development of integration schemeswhich are free of the CFL constraint.

The semi-Lagrangian scheme for advection is based on theidea of approximating the Lagrangian form of the time deriva-tive.

It is so formulated that the numerical domain of dependencealways includes the physical domain of dependence. Thisnecessary condition for stability is satisfied automaticallyby the scheme.

The semi-Lagrangian algorithm has enabled us to integratethe primitive equations using a time step of 15 minutes.

This can be compared to a typical timestep of 2.5 minutesfor Eulerian schemes.

22

Page 99: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The consequential saving of computation time means thatthe operational numerical guidance is available to the fore-casters much earlier than would otherwise be the case.

23

Page 100: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The consequential saving of computation time means thatthe operational numerical guidance is available to the fore-casters much earlier than would otherwise be the case.

Lagrangian time-stepping is now used in the majority ofglobal and regional NWP Models.

23

Page 101: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The consequential saving of computation time means thatthe operational numerical guidance is available to the fore-casters much earlier than would otherwise be the case.

Lagrangian time-stepping is now used in the majority ofglobal and regional NWP Models.

The Irish Meteorological Service (now Met Eireann) wasthe first NWP centre to implement such a scheme in anoperational setting.

23

Page 102: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

The consequential saving of computation time means thatthe operational numerical guidance is available to the fore-casters much earlier than would otherwise be the case.

Lagrangian time-stepping is now used in the majority ofglobal and regional NWP Models.

The Irish Meteorological Service (now Met Eireann) wasthe first NWP centre to implement such a scheme in anoperational setting.

We discuss semi-Lagrangian schemes in a later lecture.

23

Page 103: 3.2.2 The Leapfrog Method - UCD › ~plynch › LECTURE-NOTES › NWP-2004 › NWP... · 2017-08-28 · §3.2.2 The Leapfrog Method • We have studied various simple solutions of

End of §3.2.2

24