3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and...

86
§3.2.3 Leapfrog Scheme (again) The numerical solution of the differential equations requires that they be transformed into algebraic form. This is done by the now-familiar method of finite differences .

Transcript of 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and...

Page 1: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

§3.2.3 Leapfrog Scheme (again)The numerical solution of the di!erential equations requiresthat they be transformed into algebraic form.

This is done by the now-familiar method of finite di!erences.

Page 2: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

§3.2.3 Leapfrog Scheme (again)The numerical solution of the di!erential equations requiresthat they be transformed into algebraic form.

This is done by the now-familiar method of finite di!erences.

The continuous variables are represented by their values ata finite set of points, and derivatives are approximated bydi!erences between values at adjacent points.

Page 3: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

§3.2.3 Leapfrog Scheme (again)The numerical solution of the di!erential equations requiresthat they be transformed into algebraic form.

This is done by the now-familiar method of finite di!erences.

The continuous variables are represented by their values ata finite set of points, and derivatives are approximated bydi!erences between values at adjacent points.

The atmosphere is partitioned into several discrete horizon-tal layers, and each layer is divided up into grid cells.

Then the variables are evaluated at the centre of each cell.

Page 4: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

§3.2.3 Leapfrog Scheme (again)The numerical solution of the di!erential equations requiresthat they be transformed into algebraic form.

This is done by the now-familiar method of finite di!erences.

The continuous variables are represented by their values ata finite set of points, and derivatives are approximated bydi!erences between values at adjacent points.

The atmosphere is partitioned into several discrete horizon-tal layers, and each layer is divided up into grid cells.

Then the variables are evaluated at the centre of each cell.

Similarly, the time interval under consideration is sliced intoa finite number of discrete time steps.

Page 5: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

§3.2.3 Leapfrog Scheme (again)The numerical solution of the di!erential equations requiresthat they be transformed into algebraic form.

This is done by the now-familiar method of finite di!erences.

The continuous variables are represented by their values ata finite set of points, and derivatives are approximated bydi!erences between values at adjacent points.

The atmosphere is partitioned into several discrete horizon-tal layers, and each layer is divided up into grid cells.

Then the variables are evaluated at the centre of each cell.

Similarly, the time interval under consideration is sliced intoa finite number of discrete time steps.

Thus, the continuous evolution of the variables is approxi-mated by the change from step to step.

Page 6: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

In a sense, the finite di!erence method corre-sponds to a reversal of history.

2

Page 7: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

In a sense, the finite di!erence method corre-sponds to a reversal of history.

Lewis Fry Richardson described the procedure:

Although the infinitesimal calculus has beena splendid success, yet there remain problemsin which it is cumbrous or unworkable. Whensuch di!culties are encountered it may bewell to return to the manner in which theydid things before the calculus was invented,postponing the passage to the limit until af-ter the problem has been solved for a moder-ate number of moderately small di"erences.

(Richardson, 1927)

2

Page 8: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog time schemeWe consider again the method of advancing the solution intime known as the leapfrog scheme.

3

Page 9: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog time schemeWe consider again the method of advancing the solution intime known as the leapfrog scheme.

Let U denote a typical dependent variable, governed by anequation of the form

dU

dt= F (U) .

3

Page 10: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog time schemeWe consider again the method of advancing the solution intime known as the leapfrog scheme.

Let U denote a typical dependent variable, governed by anequation of the form

dU

dt= F (U) .

The continuous time domain t is replaced by a sequence ofdiscrete moments {0, !t, 2!t, . . . , n!t, . . . }.The solution at these moments is denoted by Un = U(n!t).

3

Page 11: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog time schemeWe consider again the method of advancing the solution intime known as the leapfrog scheme.

Let U denote a typical dependent variable, governed by anequation of the form

dU

dt= F (U) .

The continuous time domain t is replaced by a sequence ofdiscrete moments {0, !t, 2!t, . . . , n!t, . . . }.The solution at these moments is denoted by Un = U(n!t).

If this solution is known up to time t = n!t, the right-handterm Fn = F (Un) can be computed.

Thus, we can integrate the equation forward in time.

3

Page 12: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The advection equation is, again,

dU

dt= F (U) .

4

Page 13: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The advection equation is, again,

dU

dt= F (U) .

The time derivative is approximated by a centered di!erence

Un+1 ! Un!1

2!t= Fn ,

4

Page 14: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The advection equation is, again,

dU

dt= F (U) .

The time derivative is approximated by a centered di!erence

Un+1 ! Un!1

2!t= Fn ,

Thus, the forecast value Un+1 may be computed from theold value Un!1 and the tendency Fn:

Un+1 = Un!1 + 2!t Fn .

4

Page 15: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The advection equation is, again,

dU

dt= F (U) .

The time derivative is approximated by a centered di!erence

Un+1 ! Un!1

2!t= Fn ,

Thus, the forecast value Un+1 may be computed from theold value Un!1 and the tendency Fn:

Un+1 = Un!1 + 2!t Fn .

This process of stepping forward from moment to moment isrepeated a large number of times, until the desired forecastrange is reached.

4

Page 16: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

5

Page 17: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

One problem with the leapfrog scheme (and other three-time-level schemes) is that two values of U are required tostart the computation.

5

Page 18: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

One problem with the leapfrog scheme (and other three-time-level schemes) is that two values of U are required tostart the computation.

In addition to the physical initial condition U0, a computa-tional initial condition U1 is required.

5

Page 19: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

One problem with the leapfrog scheme (and other three-time-level schemes) is that two values of U are required tostart the computation.

In addition to the physical initial condition U0, a computa-tional initial condition U1 is required.

This cannot be obtained using the leapfrog scheme, so nor-mally a simple non-centered step

U1 = U0 + !t F 0

is used to provide the value at t = !t.

5

Page 20: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

One problem with the leapfrog scheme (and other three-time-level schemes) is that two values of U are required tostart the computation.

In addition to the physical initial condition U0, a computa-tional initial condition U1 is required.

This cannot be obtained using the leapfrog scheme, so nor-mally a simple non-centered step

U1 = U0 + !t F 0

is used to provide the value at t = !t.

From then on, the leapfrog scheme can be used.

However, the errors of the first step will persist.

5

Page 21: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

For the physical equation, a single initial condition U0 issu"cient to determine the solution.

One problem with the leapfrog scheme (and other three-time-level schemes) is that two values of U are required tostart the computation.

In addition to the physical initial condition U0, a computa-tional initial condition U1 is required.

This cannot be obtained using the leapfrog scheme, so nor-mally a simple non-centered step

U1 = U0 + !t F 0

is used to provide the value at t = !t.

From then on, the leapfrog scheme can be used.

However, the errors of the first step will persist.

The computational initial condition can be defined in severalways:

5

Page 22: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

• Set U1 = U0. Since u1 = u0 + ut!t + · · · , this introduceserrors of order O(!t), and is not recommended.

6

Page 23: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

• Set U1 = U0. Since u1 = u0 + ut!t + · · · , this introduceserrors of order O(!t), and is not recommended.

• Use a forward time scheme for the first time step. Sincethe forward time step is only used once, the total error isstill of O(!t)2.

6

Page 24: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

• Set U1 = U0. Since u1 = u0 + ut!t + · · · , this introduceserrors of order O(!t), and is not recommended.

• Use a forward time scheme for the first time step. Sincethe forward time step is only used once, the total error isstill of O(!t)2.

• An alternative is to use an Euler-backwards (Matsuno)scheme for the first time step.

6

Page 25: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

• Set U1 = U0. Since u1 = u0 + ut!t + · · · , this introduceserrors of order O(!t), and is not recommended.

• Use a forward time scheme for the first time step. Sincethe forward time step is only used once, the total error isstill of O(!t)2.

• An alternative is to use an Euler-backwards (Matsuno)scheme for the first time step.

• Use half of the initial time step for the forward time step,followed by leapfrog time steps. This will reduce the errorintroduced in the unstable first step.

Schematic of the leapfrog scheme with a small starting step.

6

Page 26: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Computational Mode: Simple CaseWe analyse the oscillation equation with ! = 0:

dU

dt= 0

The true solution is U = U0, constant.

7

Page 27: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Computational Mode: Simple CaseWe analyse the oscillation equation with ! = 0:

dU

dt= 0

The true solution is U = U0, constant.

The leapfrog approximation to this is just

Un+1 = Un!1 with the forward step U1 = U0 .

7

Page 28: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Computational Mode: Simple CaseWe analyse the oscillation equation with ! = 0:

dU

dt= 0

The true solution is U = U0, constant.

The leapfrog approximation to this is just

Un+1 = Un!1 with the forward step U1 = U0 .

We consider two particular choices of U1.

First, suppose the exact value U1 = U0 is chosen. Then thenumerical solution is Un = U0 for all n, which is exact.

7

Page 29: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Computational Mode: Simple CaseWe analyse the oscillation equation with ! = 0:

dU

dt= 0

The true solution is U = U0, constant.

The leapfrog approximation to this is just

Un+1 = Un!1 with the forward step U1 = U0 .

We consider two particular choices of U1.

First, suppose the exact value U1 = U0 is chosen. Then thenumerical solution is Un = U0 for all n, which is exact.

Second, suppose U1 = !U0. The solution is Un = (!1)nU0,which is comprised entirely of the computational mode.

7

Page 30: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Computational Mode: Simple CaseWe analyse the oscillation equation with ! = 0:

dU

dt= 0

The true solution is U = U0, constant.

The leapfrog approximation to this is just

Un+1 = Un!1 with the forward step U1 = U0 .

We consider two particular choices of U1.

First, suppose the exact value U1 = U0 is chosen. Then thenumerical solution is Un = U0 for all n, which is exact.

Second, suppose U1 = !U0. The solution is Un = (!1)nU0,which is comprised entirely of the computational mode.

This illustrates the importance of a careful choice of thecomputational initial condition.

7

Page 31: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Robert-Asselin time filterThe second problem is that, for nonlinear equations, theleapfrog scheme has a tendency to increase the amplitudeof the computational mode with time.

This can separate the space dependence in a checkerboardfashion between the even and odd time steps.

8

Page 32: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Robert-Asselin time filterThe second problem is that, for nonlinear equations, theleapfrog scheme has a tendency to increase the amplitudeof the computational mode with time.

This can separate the space dependence in a checkerboardfashion between the even and odd time steps.

The problem can be solved by restarting every 50 steps orso, or by applying a Robert–Asselin time filter.

8

Page 33: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Robert-Asselin time filterThe second problem is that, for nonlinear equations, theleapfrog scheme has a tendency to increase the amplitudeof the computational mode with time.

This can separate the space dependence in a checkerboardfashion between the even and odd time steps.

The problem can be solved by restarting every 50 steps orso, or by applying a Robert–Asselin time filter.

After Un+1 is obtained, a slight time smoothing is appliedto Un:

Un = Un + "(Un+1 ! 2Un + Un!1)

8

Page 34: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Robert-Asselin time filterThe second problem is that, for nonlinear equations, theleapfrog scheme has a tendency to increase the amplitudeof the computational mode with time.

This can separate the space dependence in a checkerboardfashion between the even and odd time steps.

The problem can be solved by restarting every 50 steps orso, or by applying a Robert–Asselin time filter.

After Un+1 is obtained, a slight time smoothing is appliedto Un:

Un = Un + "(Un+1 ! 2Un + Un!1)

Note that the added term is like smoothing in time, anapproximation of an ideally time-centered smoother:

Un = Un + "(Un+1 ! 2Un + Un!1)

8

Page 35: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

9

Page 36: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

Exercise: Prove this. Hint: write Un = U0 exp(i#n!t).

$ $ $

9

Page 37: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

Exercise: Prove this. Hint: write Un = U0 exp(i#n!t).

$ $ $

The computational mode, whose period is 2!t, is reducedby (1! 4") every time step.

9

Page 38: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

Exercise: Prove this. Hint: write Un = U0 exp(i#n!t).

$ $ $

The computational mode, whose period is 2!t, is reducedby (1! 4") every time step.

Because the field at t = (n! 1)!t is replaced by the alreadyfiltered value, the R-A filter introduces a slight distortionof the pure centered filter.

9

Page 39: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

Exercise: Prove this. Hint: write Un = U0 exp(i#n!t).

$ $ $

The computational mode, whose period is 2!t, is reducedby (1! 4") every time step.

Because the field at t = (n! 1)!t is replaced by the alreadyfiltered value, the R-A filter introduces a slight distortionof the pure centered filter.

A full analysis requires that the combined leapfrog schemeand time filter be analysed together (Asselin, 1972).

9

Page 40: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The smoother

Un = Un + "(Un+1 ! 2Un + Un!1)

reduces the amplitude of di!erent frequencies # by a factor(1! 4" sin2(#!t/2)).

$ $ $

Exercise: Prove this. Hint: write Un = U0 exp(i#n!t).

$ $ $

The computational mode, whose period is 2!t, is reducedby (1! 4") every time step.

Because the field at t = (n! 1)!t is replaced by the alreadyfiltered value, the R-A filter introduces a slight distortionof the pure centered filter.

A full analysis requires that the combined leapfrog schemeand time filter be analysed together (Asselin, 1972).

This filter is widely used with the leapfrog scheme, with "of the order of 0.01.

9

Page 41: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Time schemes for dU/dt = F (U)

10

Page 42: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Time schemes for dU/dt = F (U)

11

Page 43: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Time schemes for dU/dt = F (U)

For schemes (j) and (k), the right hand side is split intotwo terms: F (U) = F1(U) + F2(U).

12

Page 44: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Break here

13

Page 45: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Two Toy EquationsThe following two “toy equations” serve as prototypes fordissipative and for wave-like process in the atmosphere.

14

Page 46: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Two Toy EquationsThe following two “toy equations” serve as prototypes fordissipative and for wave-like process in the atmosphere.

• The Friction Equation

dU

dt= !%U , % > 0

with solution U = U0 exp(!%t) decaying with time.

14

Page 47: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Two Toy EquationsThe following two “toy equations” serve as prototypes fordissipative and for wave-like process in the atmosphere.

• The Friction Equation

dU

dt= !%U , % > 0

with solution U = U0 exp(!%t) decaying with time.

• The Oscillation Equation

dU

dt= i!U ,

with solution U = U0 exp(i!t), oscillating in time.

14

Page 48: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Two Toy EquationsThe following two “toy equations” serve as prototypes fordissipative and for wave-like process in the atmosphere.

• The Friction Equation

dU

dt= !%U , % > 0

with solution U = U0 exp(!%t) decaying with time.

• The Oscillation Equation

dU

dt= i!U ,

with solution U = U0 exp(i!t), oscillating in time.

If we substitute U = & exp(i') in the oscillation equation, then

d&

dt= 0 and ' = !

14

Page 49: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Two Toy EquationsThe following two “toy equations” serve as prototypes fordissipative and for wave-like process in the atmosphere.

• The Friction EquationdU

dt= !%U , % > 0

with solution U = U0 exp(!%t) decaying with time.

• The Oscillation EquationdU

dt= i!U ,

with solution U = U0 exp(i!t), oscillating in time.

If we substitute U = & exp(i') in the oscillation equation, thend&

dt= 0 and ' = !

Thus the solution U has a constant modulus, and a phasethat increases or decreases linearly with time.

14

Page 50: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Friction EquationWe consider now the friction equation:

dU

dt= !%U , % > 0 with U = U0 at t = 0

15

Page 51: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Friction EquationWe consider now the friction equation:

dU

dt= !%U , % > 0 with U = U0 at t = 0

Of course, the analytical solution is U(t) = U0 exp(!%t), whichdecays monotonically with time.

15

Page 52: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Friction EquationWe consider now the friction equation:

dU

dt= !%U , % > 0 with U = U0 at t = 0

Of course, the analytical solution is U(t) = U0 exp(!%t), whichdecays monotonically with time.

The simplest numerical scheme is the Euler forward method.The time derivative in the di!erential equation is approxi-mated by a forward di!erence:

Un+1 ! Un

!t= !%Un .

15

Page 53: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Friction EquationWe consider now the friction equation:

dU

dt= !%U , % > 0 with U = U0 at t = 0

Of course, the analytical solution is U(t) = U0 exp(!%t), whichdecays monotonically with time.

The simplest numerical scheme is the Euler forward method.The time derivative in the di!erential equation is approxi-mated by a forward di!erence:

Un+1 ! Un

!t= !%Un .

It is easy to find the solution of this di!erence equation:Un = U0(1! %!t)n.

15

Page 54: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Friction EquationWe consider now the friction equation:

dU

dt= !%U , % > 0 with U = U0 at t = 0

Of course, the analytical solution is U(t) = U0 exp(!%t), whichdecays monotonically with time.

The simplest numerical scheme is the Euler forward method.The time derivative in the di!erential equation is approxi-mated by a forward di!erence:

Un+1 ! Un

!t= !%Un .

It is easy to find the solution of this di!erence equation:Un = U0(1! %!t)n.

This solution decays monotonically in time provided

%!t < 115

Page 55: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, the solution decays monotonically in time provided

%!t < 1

16

Page 56: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, the solution decays monotonically in time provided

%!t < 1

The Euler scheme is stable for this friction equation.

16

Page 57: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, the solution decays monotonically in time provided

%!t < 1

The Euler scheme is stable for this friction equation.

However, the scheme is only first-order accurate: for a fixedtime ( = n!t, the error is

)(( ) = |U0(1! %!t)n ! U0 exp(!%n!t)| = 12U

0(%2!t + O(!t2) .

$ $ $

16

Page 58: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, the solution decays monotonically in time provided

%!t < 1

The Euler scheme is stable for this friction equation.

However, the scheme is only first-order accurate: for a fixedtime ( = n!t, the error is

)(( ) = |U0(1! %!t)n ! U0 exp(!%n!t)| = 12U

0(%2!t + O(!t2) .

$ $ $

Exercise: Prove this.

$ $ $

16

Page 59: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, the solution decays monotonically in time provided

%!t < 1

The Euler scheme is stable for this friction equation.

However, the scheme is only first-order accurate: for a fixedtime ( = n!t, the error is

)(( ) = |U0(1! %!t)n ! U0 exp(!%n!t)| = 12U

0(%2!t + O(!t2) .

$ $ $

Exercise: Prove this.

$ $ $

We might attempt to obtain a more accurate solution byusing a centered di!erence for the time derivative, as in theleapfrog scheme.

Let us look at this possibility now.

16

Page 60: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

17

Page 61: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

A solution in the form of a geometric progression, Un = U0&n

for some constant &, will decrease monotonically provided0 < & < 1.

17

Page 62: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

A solution in the form of a geometric progression, Un = U0&n

for some constant &, will decrease monotonically provided0 < & < 1.

This is the condition for the character of the finite di!erencesolution to resemble that of the continuous equation.

17

Page 63: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

A solution in the form of a geometric progression, Un = U0&n

for some constant &, will decrease monotonically provided0 < & < 1.

This is the condition for the character of the finite di!erencesolution to resemble that of the continuous equation.

Substituting this solution into the FDE, there are two pos-sibilities:

&+ = !%!t +!

1 + %2!t2 and &! = !%!t!!

1 + %2!t2 .

17

Page 64: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

A solution in the form of a geometric progression, Un = U0&n

for some constant &, will decrease monotonically provided0 < & < 1.

This is the condition for the character of the finite di!erencesolution to resemble that of the continuous equation.

Substituting this solution into the FDE, there are two pos-sibilities:

&+ = !%!t +!

1 + %2!t2 and &! = !%!t!!

1 + %2!t2 .

It is easy to see that |&+| < 1 for all !t so that a decayingsolution is obtained.

$ $ $

17

Page 65: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The leapfrog scheme for the Friction Equation is:

Un+1 ! Un!1

2!t= !%Un .

A solution in the form of a geometric progression, Un = U0&n

for some constant &, will decrease monotonically provided0 < & < 1.

This is the condition for the character of the finite di!erencesolution to resemble that of the continuous equation.

Substituting this solution into the FDE, there are two pos-sibilities:

&+ = !%!t +!

1 + %2!t2 and &! = !%!t!!

1 + %2!t2 .

It is easy to see that |&+| < 1 for all !t so that a decayingsolution is obtained.

$ $ $

Exercise: Prove this. Hint: if y = !x +"

1 + x2, theny(0) = 1; y > 0; y# < 0 so 0 < y $ 1.

17

Page 66: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

18

Page 67: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

18

Page 68: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

18

Page 69: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

The computational mode has no counterpart in the physi-cal equation; it is a spurious numerical artifact.

18

Page 70: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

The computational mode has no counterpart in the physi-cal equation; it is a spurious numerical artifact.

Since &! < 0, its sign alternates each time-step and, since itgrows with time, it leads to numerical instability.

18

Page 71: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

The computational mode has no counterpart in the physi-cal equation; it is a spurious numerical artifact.

Since &! < 0, its sign alternates each time-step and, since itgrows with time, it leads to numerical instability.

Thus, despite its second-order accuracy, the leapfrog schemeproduces unacceptable errors for the friction equation.

18

Page 72: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

The computational mode has no counterpart in the physi-cal equation; it is a spurious numerical artifact.

Since &! < 0, its sign alternates each time-step and, since itgrows with time, it leads to numerical instability.

Thus, despite its second-order accuracy, the leapfrog schemeproduces unacceptable errors for the friction equation.

The instability of the leapfrog scheme would appear to makeit unsuitable for use.

18

Page 73: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

However, |&!| = [%!t +"

1 + %2!t2] > 1 for all !t, so thissolution grows without limit with n.

The first solution (&+) gives the physical mode, which is sim-ilar in character to the solution of the di!erential equation.

The second solution (&!) is called the computational mode.It appears as a result of replacing a first-order derivative bya second-order di!erence.

The computational mode has no counterpart in the physi-cal equation; it is a spurious numerical artifact.

Since &! < 0, its sign alternates each time-step and, since itgrows with time, it leads to numerical instability.

Thus, despite its second-order accuracy, the leapfrog schemeproduces unacceptable errors for the friction equation.

The instability of the leapfrog scheme would appear to makeit unsuitable for use.

But we know better: read on!

18

Page 74: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Oscillation EquationIf we apply the leapfrog scheme to the oscillation equation

dU

dt= i!U , with U = U0 at t = 0 ,

a markedly di!erent result is obtained.

19

Page 75: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Oscillation EquationIf we apply the leapfrog scheme to the oscillation equation

dU

dt= i!U , with U = U0 at t = 0 ,

a markedly di!erent result is obtained.

The analytical solution is U(t) = U0 exp(i!t).

19

Page 76: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Oscillation EquationIf we apply the leapfrog scheme to the oscillation equation

dU

dt= i!U , with U = U0 at t = 0 ,

a markedly di!erent result is obtained.

The analytical solution is U(t) = U0 exp(i!t).

Using the leapfrog scheme and again seeking a solution Un =U0&n for constant &, there are again two possibilities:

&± = i!!t ±!

1! !2!t2 .

19

Page 77: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Oscillation EquationIf we apply the leapfrog scheme to the oscillation equation

dU

dt= i!U , with U = U0 at t = 0 ,

a markedly di!erent result is obtained.

The analytical solution is U(t) = U0 exp(i!t).

Using the leapfrog scheme and again seeking a solution Un =U0&n for constant &, there are again two possibilities:

&± = i!!t ±!

1! !2!t2 .

For |!!t| $ 1, it is clear that |&±| = 1 so that two oscillatingsolutions are obtained.

19

Page 78: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

The Oscillation EquationIf we apply the leapfrog scheme to the oscillation equation

dU

dt= i!U , with U = U0 at t = 0 ,

a markedly di!erent result is obtained.

The analytical solution is U(t) = U0 exp(i!t).

Using the leapfrog scheme and again seeking a solution Un =U0&n for constant &, there are again two possibilities:

&± = i!!t ±!

1! !2!t2 .

For |!!t| $ 1, it is clear that |&±| = 1 so that two oscillatingsolutions are obtained.

For small !!t we have &+ % +1 and &! % !1.

19

Page 79: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, for small !!t we have &+ % +1 and &! % !1.

20

Page 80: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, for small !!t we have &+ % +1 and &! % !1.

The former approximates the analytical solution. The latteris the computational mode, which alternates in sign fromstep to step.

20

Page 81: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, for small !!t we have &+ % +1 and &! % !1.

The former approximates the analytical solution. The latteris the computational mode, which alternates in sign fromstep to step.

For |!!t| > 1, either |&+| > 1 or |&!| > 1. Thus the leapfrogscheme is unstable in this case.

20

Page 82: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, for small !!t we have &+ % +1 and &! % !1.

The former approximates the analytical solution. The latteris the computational mode, which alternates in sign fromstep to step.

For |!!t| > 1, either |&+| > 1 or |&!| > 1. Thus the leapfrogscheme is unstable in this case.

The leapfrog scheme is stable for the oscillation equation,provided

|!!t| < 1 .

20

Page 83: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Again, for small !!t we have &+ % +1 and &! % !1.

The former approximates the analytical solution. The latteris the computational mode, which alternates in sign fromstep to step.

For |!!t| > 1, either |&+| > 1 or |&!| > 1. Thus the leapfrogscheme is unstable in this case.

The leapfrog scheme is stable for the oscillation equation,provided

|!!t| < 1 .

20

Page 84: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Matlab Exercises• Write a matlab program to solve the oscillation equation

dU

dt= iU , U0 = 1 (! = 1)

the analytical solution of which is U(t) = exp(it), using

– the Euler forward method

– the leapfrog method

Draw conclusions about the stability of the two schemes.

21

Page 85: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Matlab Exercises• Write a matlab program to solve the oscillation equation

dU

dt= iU , U0 = 1 (! = 1)

the analytical solution of which is U(t) = exp(it), using

– the Euler forward method

– the leapfrog method

Draw conclusions about the stability of the two schemes.

• Write a matlab program to solve the friction equationdU

dt= !U , U0 = 1 (% = 1)

the analytical solution of which is U(t) = exp(!t), using

– the Euler forward method

– the leapfrog method

Draw conclusions about the stability of the two schemes.21

Page 86: 3.2 .3 Leapfr og Scheme (agai n) - UMD | Atmospheric and ...ekalnay/syllabi/AOSC614/NWP-CH03-2-3.pdf¤3.2 .3 Leapfr og Scheme (agai n) The n um erical sol uti on of the di!er en tial

Conclusion of §3.2.3

22