SYLLABUS Previous: 2.3 LaxWendroff
Up: 2 FINITE DIFFERENCES
Next: 2.5 Implicit CrankNicholson
2.4 Leapfrog, staggered grids
Slide : [ Staggered leapfrog
Scheme 
Code 
Run 
VIDEO
login]
The leapfrog algorithm is often used for the propagation of waves, where
a low numerical damping is required with a relatively high accuracy.
Relying on two functions
to approximate the scalar
wave equation (1.3.1#eq.2) in fluxconservative form,
staggered grids (where the mesh points are shifted with respect
to each other by half an interval, as in fig.2.4#fig.4) are
used to evaluate centered differences with an accuracy in
:
Figure 2.4#fig.4:
Staggered grids.


(2.4.0#eq.9) 
The construction of the leapfrog algorithm suggests how the Maxwell
equations can be discretized using finite differences in the time
domain (FDTD) to solve vector equations in terms of the electric and
the magnetic fields evaluated on staggered grids (exercise 2.08).
The leapfrog algorithm has been implemented
in JBONE as
for (int j=1; j<=n; j++) { //1st equation
fp[j]=f[j] beta*(g[j]g[j1]); }
fp[0]=f[0] beta*(g[0]g[n]);
for (int j=0; j<=n1; j++) { //2nd equation
gp[j]=g[j] beta*(fp[j+1]fp[j]); }
gp[n]=g[n] beta*(fp[0]fp[n]);
Special care is required when
starting
the integration, since the initial condition
determines the direction of propagation (exercise 2.04).
In addition to the periodic boundaries shown here above, Dirichlet and
absorbing boundary conditions are also frequently used (exercises 2.04
and 2.08).
JBONE applet: press Start/Stop
to simulate the propagation a scalar wave in a periodic domain
using two functions f (in black) and g (in blue).

By substitution, note that the leapfrog scheme is equivalent to the
implicit 3 levels scheme

(2.4.0#eq.10) 
where the linear problem has been solved explicitly in an elegant manner.
SYLLABUS Previous: 2.3 LaxWendroff
Up: 2 FINITE DIFFERENCES
Next: 2.5 Implicit CrankNicholson
