3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and...

103
§3.2.2 The Leapfrog Method

Transcript of 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and...

Page 1: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§3.2.2 The Leapfrog Method

Page 2: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

§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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

2

Page 9: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

Other approaches include finite element method and thespectral method.

2

Page 10: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

Other approaches include finite element method and thespectral method.

The central idea of the finite di!erence approach is toapproximate the derivatives in the equation by di!erencesbetween adjacent points in space or time, and therebyreduce the di!erential equation to a di!erence equation.

2

Page 11: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

Other approaches include finite element method and thespectral method.

The central idea of the finite di!erence approach is toapproximate the derivatives in the equation by di!erencesbetween adjacent points in space or time, and therebyreduce the di!erential equation to a di!erence equation.

• An analytical problem becomes an algebraic one.

2

Page 12: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

Other approaches include finite element method and thespectral method.

The central idea of the finite di!erence approach is toapproximate the derivatives in the equation by di!erencesbetween adjacent points in space or time, and therebyreduce the di!erential equation to a di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recap. of Discretization MethodsThere are several distinct approaches to the formulation ofcomputer methods for solving di!erential equations. Wewill confine ourselves to the finite di!erence method.

Other approaches include finite element method and thespectral method.

The central idea of the finite di!erence approach is toapproximate the derivatives in the equation by di!erencesbetween adjacent points in space or time, and therebyreduce the di!erential equation to a di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The Finite Di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The Finite Di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The Finite Di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The Finite Di!erence 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 di!erences.

3

Page 18: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The Finite Di!erence 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 di!erences.

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

3

Page 19: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erences are of accuracy O(!x2).

4

Page 22: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erences are of accuracy O(!x2).

We can continue taking more and more terms, but obviouslythere is a trade-o! between accuracy and e"ciency.

4

Page 23: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erences are of accuracy O(!x2).

We can continue taking more and more terms, but obviouslythere is a trade-o! between accuracy and e"ciency.

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

4

Page 24: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

• Show that a forward di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

• Show that a forward di!erence approximation gives

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

k!x/2

"

• Show that the centered di!erence approximation yields

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

k!x

"

5

Page 27: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

• Show that a forward di!erence approximation gives

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

k!x/2

"

• Show that the centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

• Show that a forward di!erence approximation gives

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

k!x/2

"

• Show that the centered di!erence 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.

• Demonstrate thus that the centered di!erence is of higherorder accuracy.

5

Page 29: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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-o! between resolution and accuracy.6

Page 33: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation by a finitedi!erence equation (FDE) using centered di!erences for boththe space and time derivatives.

8

Page 40: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation by a finitedi!erence equation (FDE) using centered di!erences for boththe space and time derivatives.

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

8

Page 41: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation by a finitedi!erence equation (FDE) using centered di!erences for boththe space and time derivatives.

The continuous variables are replaced by discrete gridpointsat their integral values and the problem is solved on a finitedi!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

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

%Y n+1

m " Y n"1m

2!t

&+ c

#Y n

m+1 " Y nm"1

2!x

$= 0 .

10

Page 45: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

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

%Y n+1

m " Y n"1m

2!t

&+ c

#Y n

m+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 n

m+1 " Y nm"1)

10

Page 46: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

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

%Y n+1

m " Y n"1m

2!t

&+ c

#Y n

m+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 n

m+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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

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

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

%Y n+1

m " Y n"1m

2!t

&+ c

#Y n

m+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 n

m+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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 n

m"1 and Y nm+1 .

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

11

Page 49: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erence grid splits into two sub-grids.

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

12

Page 50: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recall the (CTCS) finite di!erence approximation:%

Y n+1m " Y n"1

m

2!t

&+ c

#Y n

m+1 " Y nm"1

2!x

$= 0 .

13

Page 51: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recall the (CTCS) finite di!erence approximation:%

Y n+1m " Y n"1

m

2!t

&+ c

#Y n

m+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 n

m+1 " Y nm"1)

or, using the Courant Number,

Y n+1m = Y n"1

m " µ(Y nm+1 " Y n

m"1)

13

Page 52: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recall the (CTCS) finite di!erence approximation:%

Y n+1m " Y n"1

m

2!t

&+ c

#Y n

m+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 n

m+1 " Y nm"1)

or, using the Courant Number,

Y n+1m = Y n"1

m " µ(Y nm+1 " Y n

m"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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Recall the (CTCS) finite di!erence approximation:%

Y n+1m " Y n"1

m

2!t

&+ c

#Y n

m+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 n

m+1 " Y nm"1)

or, using the Courant Number,

Y n+1m = Y n"1

m " µ(Y nm+1 " Y n

m"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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Question:Under what conditions does the solution of the finite di!er-ence equation approximate that of the original di!erentialequation?

# # #

14

Page 55: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Question:Under what conditions does the solution of the finite di!er-ence equation approximate that of the original di!erentialequation?

# # #

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Question:Under what conditions does the solution of the finite di!er-ence equation approximate that of the original di!erentialequation?

# # #

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Question:Under what conditions does the solution of the finite di!er-ence equation approximate that of the original di!erentialequation?

# # #

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Question:Under what conditions does the solution of the finite di!er-ence equation approximate that of the original di!erentialequation?

# # #

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

Y nm = a An exp[ikm!x]

15

Page 60: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

Y nm = a An 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

Y nm = a An 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

Y nm = a An 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 coe"cients.

15

Page 63: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

Y nm = a An 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 coe"cients.

We write

A± = "i$ ±(

1" $2 where $ # µ sin k!x

We consider in turn the two cases.15

Page 64: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation.

18

Page 74: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation.

The second term is called the computational mode.

18

Page 75: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation.

The second term is called the computational mode.

It arises through the use of centered di!erences resulting inthe approximation of a first order di!erential equation by asecond order di!erence equation (with an extra solution).

18

Page 76: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation.

The second term is called the computational mode.

It arises through the use of centered di!erences resulting inthe approximation of a first order di!erential equation by asecond order di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 di!erential equation.

The second term is called the computational mode.

It arises through the use of centered di!erences resulting inthe approximation of a first order di!erential equation by asecond order di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence approximation cannot be used forthe first timestep: We don’t know the values at time t = "!t.

19

Page 79: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

The centered di!erence 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 di"cult.

19

Page 85: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

0

20

Page 88: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

0

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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

0

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

In case of computational instability, the solution of thefinite di!erence equation cannot possibly resemble thephysical solution.

21

Page 91: 3.2 .2 The Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

In case of computational instability, the solution of thefinite di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

In case of computational instability, the solution of thefinite di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

In case of computational instability, the solution of thefinite di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

In case of computational instability, the solution of thefinite di!erence 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Unconditionally Stable Schemes.A large part of the research e!ort 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Unconditionally Stable Schemes.A large part of the research e!ort 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Unconditionally Stable Schemes.A large part of the research e!ort 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

Unconditionally Stable Schemes.A large part of the research e!ort 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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

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 Leapfro g Meth od - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-2.pdf¤3.2 .2 The Leapfro g Meth od ¥ W e ha v e st udied v ar ious sim ple so lut io ns

End of §3.2.2

24