Upload
haley-conway
View
220
Download
0
Tags:
Embed Size (px)
Citation preview
Numerical Methods: Series-Expansion Methods
Slide 1
Slide 1
Agathe Untch
e-mail: [email protected]
(office 011)
Series-Expansion Methods Series-Expansion Methods
Numerical Methods: Series-Expansion Methods
Slide 2
Slide 2
Acknowledgement
This lecture draws heavily on lectures by Mariano Hortal (former Head of the Numerical Aspects Section, ECMWF)
and on the excellent textbook
“Numerical Methods for Wave Equations in Geophysical Fluid Dynamics” by Dale R. Durran (Springer, 1999)
Acknowledgement
This lecture draws heavily on lectures by Mariano Hortal (former Head of the Numerical Aspects Section, ECMWF)
and on the excellent textbook
“Numerical Methods for Wave Equations in Geophysical Fluid Dynamics” by Dale R. Durran (Springer, 1999)
Numerical Methods: Series-Expansion Methods
Slide 3
Slide 3
Introduction
The ECMWF model uses series-expansion methods in the horizontal and in the vertical
- It is a spectral model in the horizontal with spherical harmonics expansion with triangular truncation.
- It uses the spectral transform method in the horizontal with fast Fourier transform and Legendre transform.
- The grid in physical space is a linear reduced Gaussian grid.
- In the vertical it has a finite-element scheme with cubic B-spline expansion.
This lecture explains the concept of series-expansion methods (with focus on the spectral method), their numerical implementation, and what the above jargon all means.
Numerical Methods: Series-Expansion Methods
Slide 4
Slide 4
Schematic representation of the spectral transform method in the ECMWF model
Grid-point space -semi-Lagrangian advection -physical parametrizations -products of terms
Fourier space
Spectral space -horizontal gradients -semi-implicit calculations -horizontal diffusion
FFT
LT
Inverse FFT
Inverse LT
Fourier space
FFT: Fast Fourier Transform, LT: Legendre Transform
Numerical Methods: Series-Expansion Methods
Slide 5
Slide 5
Introduction
Series-expansion methods which are potentially useful in geophysical fluid dynamics are
- the spectral method
- the pseudo-spectral method
- the finite-element method
All these series-expansion methods share a common foundation
Numerical Methods: Series-Expansion Methods
Slide 6
Slide 6
Fundamentals of series-expansion methodsFundamentals of series-expansion methods
0)(
fHt
f
)(),( 00 xftxf
(1)
(1a)
We demonstrate the fundamentals of series-expansion methods on the followingproblem for which we seek solutions:
Partial differential equation:(with an operator H involvingonly derivatives in space.)
Initial condition:
Boundary conditions: Solution f has to fulfil some specified conditions on the boundary of the domain S.
To be solved on the spatial domain S subject to specified initial and boundary conditions.
Numerical Methods: Series-Expansion Methods
Slide 7
Slide 7
(3)
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
1
)()(),(i
ii xtatxf
The basic idea of all series-expansion methods is to write the spatial dependenceof f as a linear combination of known expansion functions )(xi
1)( ii x should span the L2 space, i.e. a HilbertThe set of expansion function space with the inner (or scalar) product of two functions defined as
dxxfxgfgS
)()(, * (4)
The expansion functions should all satisfy the required boundary conditions.
Numerical Methods: Series-Expansion Methods
Slide 8
Slide 8
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
)(),...,(1 tata N
The task of solving (1) has been transformed into the problem of finding the unknown coefficients
in a way that minimises the error in the approximate solution.
N
iii xtatxf
1
)()(),(ˆ
Numerically we can’t handle infinite sums. Limit the sum to a finite numberof expansion terms N
(3a)
f̂ is only an approximation to the true solution f of the equation (1).
=>
Numerical Methods: Series-Expansion Methods
Slide 9
Slide 9
Strategies for minimising the residual R: 1.) minimise the l2-norm of R 2.) collocation strategy 3.) Galerkin approximation (Details on the next slide.)
)ˆ()ˆ(ˆ
fRfHt
f
However, the real error in the approximate solution can’t be determined. A more practical way to try and minimise the error is to minimise the residual R instead:
ff ˆ
(5)
Each of these strategies leads to a system of N coupled ordinary differential
equations for the time-dependent coefficients ai(t), i=1,…, N.
0)(
fHt
f(1) <=>
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
R = amount by which the approximate solution fails to satisfy the governing equation.
f̂
Numerical Methods: Series-Expansion Methods
Slide 10
Slide 10
2.) Collocation method Constrain the residual by requiring it to be zero at a discrete set of grid points
2/1*
2/1
2))(ˆ())(ˆ()ˆ(),ˆ()ˆ(
S dxxfRxfRfRfRfR
NiallforxfR i ,...,10))(ˆ(
1.) Minimisation of the l2-norm of the residual Compute the ai(t) such as to minimise
3.) Galerkin approximation
Require R to be orthogonal to each of the expansion functions used in the expansion of f, i.e. the residual depends only on the omitted basis functions.
.,...,10)())(ˆ()ˆ(, * NiallfordxxxfRfRSi i
Strategies for constraining the size of the residual:
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
(6)
(7)
(8)
Numerical Methods: Series-Expansion Methods
Slide 11
Slide 11
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
Galerkin method and l2-norm minimisation are equivalent when
applied to problems of the form given by equation (1). (Durran,1999)
Different series expansion methods use one or more of this strategies to minimise the error
- Collocation strategy is used in the pseudo-spectral method
- Galerkin and l2-norm minimisation are the basis of the spectral method
- Galerkin approximation is used in the finite-element method
Numerical Methods: Series-Expansion Methods
Slide 12
Slide 12
Transform equation (1) into series-expansion form:
NjallforfRfHft jjj ,...,10)ˆ(,)ˆ(,ˆ,
=0 (Galerkin approximation)
=> NjallfordxaHdt
dadx iS
N
iij
N
i
i
S ij ,...,10)(1
*
1
*
(9)
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
)ˆ()ˆ(ˆ
fRfHt
f
(5)Start from equation (5) (equivalent to (1))
Take the scalar product of this equation with all the expansion functions and apply the Galerkin approximation:
Numerical Methods: Series-Expansion Methods
Slide 13
Slide 13
Initial state in series-expansion form:
)(),( 00 xftxf Initial condition (2)
)()()(),( 01
00 xfrxtatxfN
iii
),(ˆ0txf
),(ˆ0txf Nitai ,...,1)( 0
The same strategies used for constraining the residual R in (5) can be used tominimise the error r in (10). Using the Galerkin method gives
gives the bestCompute the coefficients such that ,,...,1),( 0 Nitai ),(ˆ0txf
)(,,),(ˆ,),(, 000 xfrtxftxf jjjj
=0 (Galerkin approximation)
).(0 xfapproximation to
for all j=1,…, N.
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
(10)
Numerical Methods: Series-Expansion Methods
Slide 14
Slide 14
dxxfxdxxxtaS ji
N
iS ji
)()()()()( 0*
1
*0
00 )( ftaW
01 0 ,)(, fta j
N
i iij
ijw , jf0
Initial state (cont):
for all j=1,…, N.
for all j=1,…, N.
=>
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
(11)
(11a)
Numerical Methods: Series-Expansion Methods
Slide 15
Slide 15
Summary of the initial value problem (1) in series-expansion form
NjallfordxaHdt
dadx iS
N
iij
N
i
i
S ij ,...,10)(1
*
1
*
(9)
Differential equation (1):
Initial condition:
NjallfordxxfxtadxS j
N
iiS ij ,...,1)()()( 0
*
10
*
(11)
Boundary conditions:
The expansion functions have to satisfy the required conditions on the boundary of the domain S => approximated solution also satisfies these boundary conditions.
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
Numerical Methods: Series-Expansion Methods
Slide 16
Slide 16
What have we gained so far from applying the series-expansion method?
Transformed the partial differential equation into ordinary differential
equations in time for the expansion coefficients ai(t).
Equations look more complicated than in finite-difference discretisation.
Main benefit from the series-expansion method comes from choosing the expansion functions judiciously depending on the form and properties of the operator H in equation (1) and on the boundary conditions.
For example, if we know the eigenfunctions ei of H, (i.e. )and we choose these as expansion functions, the problem simplifies to
iii eeH )(
Njallforadt
dadxee
N
iii
i
S ij ,...,101
*
(12)
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
Numerical Methods: Series-Expansion Methods
Slide 17
Slide 17
If the functions ei are orthogonal and normalised functions, i.e.
ijiS jij dxxexeee ,* )()(,
ji ,jifor 1jifor 0
where
then the set of coupled equations (12) decouples into N independent ordinary
differential equations in t for the expansion coefficients a
(13)
(14)
Njallfortatadt
djjj ,...,10)()( (15)
Fundamentals of series-expansion methods (cont)Fundamentals of series-expansion methods (cont)
Can be solved analytically!
Numerical Methods: Series-Expansion Methods
Slide 18
Slide 18
The Spectral MethodThe Spectral Method
The feature that distinguishes the spectral method from other series-expansion methods is that the expansion functions form an orthogonal set on the domain S(not necessarily normalised).
=> the system of equations (9) reduces to
NjallfordxaHwdt
daiS
N
iij
j
j ,...,1)(1
1
*
(17)
This is a very helpful simplification, because we obtain explicit equations in when the time derivatives are replaced with finite-differences.)( tta j
jiiS ji wdxxx ,* )()( (16)
In the more general equation (9) matrix W (defined in (11)) introduces a coupling
between all the a at the new time level => implicit equations, more costly to solve!
Numerical Methods: Series-Expansion Methods
Slide 19
Slide 19
The Spectral Method (cont)The Spectral Method (cont)
Initial condition (11) simplifies to
Njallfordxxfxw
taS j
jj ,...,1)()(
1)( 0
*0 (18)
00 )( fta
(18a)<=>
ji ,
jiforwi
1
jifor 0
Where
Numerical Methods: Series-Expansion Methods
Slide 20
Slide 20
The Spectral Method (cont)The Spectral Method (cont)
NjallfordxaHwdt
daiS
N
iij
j
j ,...,1)(1
1
*
(17)
Summary of the original problem (1) in spectral representation
Differential equation:
Njallfordxxfxw
taS j
jj ,...,1)()(
1)( 0
*0 (18)
Initial condition:
Boundary conditions:
The expansion functions have to satisfy the required conditions on the boundary of the domain S => approximated solution also satisfies these boundary conditions.
Expansion functions: Form an orthogonal set on the domain S
jiiS ji wdxxx ,* )()( (16)
Numerical Methods: Series-Expansion Methods
Slide 21
Slide 21
The Spectral Method (cont)The Spectral Method (cont)
The choice of families of orthogonal expansion functions is largely dictated by the geometry of the problem and the boundary conditions.
Examples:
Rectangular domain with periodic boundary conditions: Fourier series Non-periodic domains: (maybe) Chebyshev polynomials
Spherical geometry: spherical harmonics
Numerical Methods: Series-Expansion Methods
Slide 22
Slide 22
The Spectral Method (cont)The Spectral Method (cont)
In this case the spatial operator H in (1) is
Example 1: One-dimensional linear advection
Since u is constant, it is easy to find expansion functions that are eigenfunctions to H. => This problem is almost trivial to solve with the spectral method, but isa good case to reveal some of the fundamental strengths and weaknesses of thespectral method.
xuH
)()0,( 0 xfxf (initial condition) (19b)
),2(),( tnxftxf (periodic boundary condition) (19c)
0
x
fu
t
f(19a)(with constant advection velocity u)
20 x (domain S)
Numerical Methods: Series-Expansion Methods
Slide 23
Slide 23
The Spectral Method (cont)The Spectral Method (cont)
Example 1: One-dimensional linear advection (cont)
Fourier functions are eigenfunctions of the derivative operatorimximx eime
x
M
Mm
imxm etatxf )(),(ˆ
MmMallfortaumidt
tdam
m 0)()(
2
0
,2, mnimxinximxinx dxeeeeThey are orthogonal:
Approximate f as finite series expansion:
(20)
(21)
(22)
Insert (22) into (19a) and apply the Galerkin method => system of decoupled eqs
(23)
Numerical Methods: Series-Expansion Methods
Slide 24
Slide 24
The Spectral Method (cont)The Spectral Method (cont)
Example 1: One-dimensional linear advection (cont)
MmMallfortaumidt
tdam
m 0)()(
(23)
No need to discretise in time, can be solved analytically:tuim
mm eata )0()(
In physical space the solution is:
This is identical to the analytic solution of the 1d-advection problem with constant u. => Discretisation in space with the spectral method does not introduce any distortion of the solution: no error in phase speed or amplitude of the advected waves, i.e. no numerical dispersion or amplification/damping introduced, not even for the shortest resolved waves! (The centred finite-difference scheme in space introduces dispersion.)
)()0()0(),( 0)( tuxfeaeeatxf
M
Mm
tuxmim
M
Mm
xmitumim
(24)
Numerical Methods: Series-Expansion Methods
Slide 25
Slide 25
The Spectral Method (cont)The Spectral Method (cont)
Stability:
Integration in time by finite-difference (FD) methods when the spectral method isused for the spatial dimensions typically require shorter time steps than with FDmethods in space.This is a direct consequence of the spectral method’s ability to correctly representeven the shortest waves.
Leapfrog time integration of the 1d linear advection equation is stable if
Cx
tu
where
1C
1C
for spectral
for centred 2nd-order FD
Higher order centred FD have more restrictive CFLs,
and for infinite order FD1 C (as for spectral!)
Numerical Methods: Series-Expansion Methods
Slide 26
Slide 26
The Spectral Method (cont)The Spectral Method (cont)
Stability (cont):The reason behind the less restrictive CFL criterion for the centred 2nd-order FD scheme lies the misrepresentation of the shortest waves by the FD scheme:
xk
xku
)sin(
for centred 2nd-order FD
u for spectral (correct value!)
The stability criterion of the leapfrog scheme for the 1d linear advection is
1 xkck
The numerical phase speed ck is
1xu)max( kck = 1 xuuk
(FD)=>
(SP)
x
tu1
1 (FD)
(SP)
Numerical Methods: Series-Expansion Methods
Slide 27
Slide 27
The Spectral Method (cont)The Spectral Method (cont)
Example 2: One-dimensional nonlinear advection
)()0,( 0 xfxf (initial condition) (25b)
),2(),( tnxftxf (periodic boundary condition) (25c)
0),(
x
ftxu
t
f(25a)
20 x (domain S)
M
Mm
xkmim
k dxetxuaimdt
da
2
0
)(),(2
1
Approximate f with a finite Fourier series as in (22), insert into (25a) and apply the Galerkin procedure (alternatively, use directly (17)) =>
(26)
Numerical Methods: Series-Expansion Methods
Slide 28
Slide 28
The Spectral Method (cont)The Spectral Method (cont)
Example 2: One-dimensional nonlinear advection (cont)
Suppose that u is predicted simultaneously with f and given by the Fourier series
M
Mn
xinn etutxu )(),(
Inserting into (30) gives
Mnmkmn
mnk tatumi
dt
da
,,
)()( Compact, but costly to evaluate, convolution sum!
M
Mm
M
Mn
xkmnimn
k dxetatuimdt
da
2
0
)()()(2
1(27)
kmn ,2 <=>
Operation count for advancing the solution by one time step is O( (2M+1)2 ).With a finite-difference scheme only O(2M+1) arithmetic operations are required.
(27a)
Numerical Methods: Series-Expansion Methods
Slide 29
Slide 29
The Transform Method (TM)The Transform Method (TM)
Products of functions are more easily computed in physical space while derivatives are more accurately and cheaply computed in spectral space.
It would be nice if we could combine these advantages and get the best of both worlds!
For this we need an efficient and accurate way of switching between the two spaces.
Such transformations exist: direct/inverse Fast Fourier Transforms (FFT)
Numerical Methods: Series-Expansion Methods
Slide 30
Slide 30
The continuous Fourier Transform (FT)
Direct Fourier transform
2
0
),(2
1)( dxetxfta xim
m
Inverse Fourier transform
1
)(),(m
ximm etatxf
(28a)
(28b)
The Transform Method (cont)The Transform Method (cont)
For practical applications we need discretised analogues to these continuous Fourier transforms.
Numerical Methods: Series-Expansion Methods
Slide 31
Slide 31
The discrete Fourier Transform
The discrete Fourier transform establishes a simple relationship between the
2M+1 expansion coefficients am(t) and 2M+1 independent grid-point values f(xj,,t) at the equidistant points
12,...,1,12
2
Mj
Mjx j
The set of expansion coefficients M
Mmm ta )(
12
1),(
M
jj txfdefines the set of grid-point values
through
M
Mm
ximmj
jetatxf )(),((discrete inverse FT)
(30b)
(29)
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 32
Slide 32
The discrete Fourier Transform (cont)
the set of expansion coefficients can be computed from M
Mmm ta )(
12
1),(
M
jj txfFrom the set of grid-point values And vice versa:
12
1
),(12
1)(
M
j
ximjm
jetxfM
ta(30a)
(discrete direct FT)
The relations (30a) and (30b) are discretised analogues to the standard FT (28a)and its inverse (28b). (The integral in (28a) is replaced by a finite sum in (30a).)They are known as discrete or finite (direct/inverse) Fourier transform.
mn
M
j
ximxin Mee jj
,
12
1
)12(
Valid because a discrete analogue of the orthogonality of Fourier functions (21) holds:
(31)
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 33
Slide 33
For the discrete Fourier transformations are exact, i.e. you can transform to spectral space and back to grid-point space and exactly recover your original function on the grid. (N: number of grid points.)
The discrete Fourier Transform (cont)
12 MN
At least 2M+1 equidistant grid-points covering the interval are needed if one want to retain in the expansion of f all Fourier modes up to the maximum wave number M.
2,0
The Transform Method (cont)The Transform Method (cont)
Remarks:
Numerical Methods: Series-Expansion Methods
Slide 34
Slide 34
The Transform Method (cont)The Transform Method (cont)
Mathematically equivalent but computationally more efficient finite FTs,so-called Fast Fourier Transforms (FFTs), exist which use only O(N logN) arithmetic operations to convert a set of N grid-point values into a set of N Fourier coefficients and vice versa.
The basic idea of the transform method is to compute derivatives in spectral space (accurate and cheap!) and products of functions in grid-point space (cheap!) and use the FFTs to swap between these spaces as necessary.
The efficiency of these FFTs is key to the transform method!
Numerical Methods: Series-Expansion Methods
Slide 35
Slide 35
Instead of evaluating the convolution sum in (27a), use the Transform Methodand proceed as follows to evaluate the product term in the non-linear advection equation (25a):
x
txftxu
t
txf
),(),(
),((25a)
We have both u and f in spectral representation:
Step 1 Compute the x-derivative of f by multiplying each am by im
M
Mmm ta )( M
Mnn tu )(
M
Mmm taimx
f
)(
The Transform Method (cont)The Transform Method (cont)
Back to Example 2: One-dimensional nonlinear advection
Numerical Methods: Series-Expansion Methods
Slide 36
Slide 36
Step 2 Use inverse FFT to transform both u and to physical space, i.e. compute the values of these two functions at the grid-points
x
f
Llxl
2
L
ll txu 1),(
L
ll txf 1' ),(
M
Mnn tu )(
M
Mmm taim )(
inv. FFT
inv. FFT
Step 3 Compute the product uf’: L
lll txftxu 1' ),(),(
Step 4 Use direct FFT to transform the product back to spectral space
L
lll txftxu 1' ),(),( direct FFT M
Mnm tfu
)('
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 37
Slide 37
Question: Is the result for the product obtained with the transform method identical to the product computed by evaluating the convolution sum in (27a)?
Answer: The two ways of computing the product give identical results provided aliasing errors are avoided during the computation of the product in physical space. Aliasing errors can be avoided with a sufficiently fine spatial resolution.
How fine does it have to be? How many grid points L do we need in physical space to prevent aliasing errors in the product if we have a spectral resolution with maximum wave number M?
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 38
Slide 38
Avoiding aliasing errors:
cl
aliasing
2MM0 wave number
21 mm m~
M is the cutoff wave number of the original expansion
xlc
2
2L
x2
is the cutoff wave number of the physical grid, where
Multiplication of two waves with wave numbers m1 and m2 gives a new wave m1+m2. If m1+m2 > lc , then m1+m2 is aliased into such that appears as the symmetricreflection of m1+m2 about the cut-off wave number lc.
m~ m~
Question: How large does lc have to be so that no waves are aliased into waves < M?
MLM
Mlc 32
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 39
Slide 39
A minimum of 2M+1 grid points are needed in physical space to preventaliasing errors from quadratic terms in the equations if M is the maximum retained wave number in the spectral expansion.
Such a grid is referred to as a “quadratic grid”.
Quadratic grid = grid with sufficient resolution to avoid aliasing errors from quadratic terms. Lq = 3M+1
Linear grid = grid with L = 2M+1, which ensures exact transformation of the linear terms to spectral space and back (but with aliasing errors from quadratic and higher order terms).
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 40
Slide 40
Viewed differently:
Given a resolution in grid-point space with L grid points, the correspondingspectral resolution (maximum wave number) is
for the linear grid
for the quadratic grid
2
1
LM l
3
1
LM q
=> 1/3 less resolution in spectral space with the quadratic grid than with thelinear grid.
Using the quadratic grid is equivalent to filtering out the 1/3 largest wave numbers, i.e. the ones that would be contaminated by aliasing errors from thequadratic terms in the equations.
The Transform Method (cont)The Transform Method (cont)
Numerical Methods: Series-Expansion Methods
Slide 41
Slide 41
The Spectral Method on the SphereThe Spectral Method on the Sphere
Spherical Harmonics Expansion
Spherical geometry: Use spherical coordinates: longitude
latitude
, sin
),(),( ,, nmm mn
nm Yaf
Any horizontally varying 2d scalar field can be efficiently represented in spherical geometry by a series of spherical harmonic functions Ym,n:
imnmnm ePY )(),( ,,
associated Legendre functions Fourier functions
(40)
(41)
Numerical Methods: Series-Expansion Methods
Slide 42
Slide 42
The Spectral Method on the SphereThe Spectral Method on the Sphere
Definition of the Spherical Harmonics
imnmnm ePY )(),( ,,Spherical harmonics
0),()1()!(
)!(
2
)12()( 2/2
2/1
,
mPd
d
mn
mnnP nm
mm
nm
The associated Legendre functions Pm,n are generated from the Legendre Polynomials via the expression
nn
n
nn d
d
nP )1(
!2
1)( 2
Where Pn is the “normal” Legendre
polynomial of order n defined by
This definition is only valid for ! nm
(41)
(42)
(43)
nmm
nm PP ,, )1(
Numerical Methods: Series-Expansion Methods
Slide 43
Slide 43
The Spectral Method on the SphereThe Spectral Method on the Sphere
Some Spherical Harmonics for n=5
Numerical Methods: Series-Expansion Methods
Slide 44
Slide 44
The Spectral Method on the SphereThe Spectral Method on the Sphere
Properties of the Spherical Harmonics
lnlmnm dPP ,,
1
1 , )()(
snrmsrnm ddYY ,,
1
1
*,, ),(),(
2
1
*,,,, )1()()1()( nm
mnmnm
mnm YYPP
*,, )1( nm
mnm aa
=> the expansion coefficients of a real-valued function satisfy
Spherical harmonics are orthogonal (=> suitable as basis for spectral method!):
because the Fourier functions and the Legendre polynomials form orthogonal sets:
2
0
,2 mnimxinx dxee
(44)
(45b)(45a)
(46)
(47)
Numerical Methods: Series-Expansion Methods
Slide 45
Slide 45
The Spectral Method on the SphereThe Spectral Method on the Sphere
Properties of the Spherical Harmonics (cont)
Eigenfunctions of the derivative operator in longitude.nmnm imY
Y,
,
,)1()1( 1,,1,1,,2
nmnmnmnmnm YnYn
Y
=> Not eigenfunctions of the derivative operator in latitude!But derivatives are easy to compute via this recurrence relation.
2/1
2
22
, 14
n
mnnm
nmnm YR
nnY ,2,
2 )1(
Eigenfunctions of the horizontal Laplace operator!Very important property of the spherical harmonics! semi-implicit time integration method leads to adecoupled set of equations for the field values at the future time-level => very easy to solve in spectralspace!
R: radius of the sphere, : horizontal Laplace operatoron the sphere. (see next page)
2
(48)
(49)
(50)
Numerical Methods: Series-Expansion Methods
Slide 46
Slide 46
The Spectral Method on the SphereThe Spectral Method on the Sphere
Properties of the Spherical Harmonics (cont)
Horizontal Laplacian operator on the sphere in spherical coordinates:
222
2
22
2
2
222
11
)1(
1
coscoscos
1
RR
R
(51)
Numerical Methods: Series-Expansion Methods
Slide 47
Slide 47
The Spectral Method on the SphereThe Spectral Method on the Sphere
Computation of the expansion coefficients
),(),(),,,( ,, nmm mn
nm Ytzatzf
2
0
),,,(2
1),,( detzftza im
m
1
1
2
0
,, )(),,,(4
1),(
ddePtzftza im
nmnm
mn
nmnmm Ptzatza )(),(),,( ,,
Fourier transform followed by Legendre transform
Performing only the Fourier transform gives the Fourier coefficients:
direct Fourier transform These Fourier coefficients can also be obtained by an inverse Legendre transform
of the spectral coefficients am,n:
inverse Legendre transform
(52)
(53)
(54)
(55)
Numerical Methods: Series-Expansion Methods
Slide 48
Slide 48
The Spectral Method on the SphereThe Spectral Method on the Sphere
Truncating the spherical harmonics expansion
For practical applications the infinite series in (52) must be truncated => numerical approximation of the form
),(),(ˆ,
)(
, nm
M
Mm
mN
mnnm Yaf
Examples of truncations:
m
n
M triangular rhomboidalm
n
M
MmmN )(MmN )(
Triangular truncation is isotropic, i.e. gives uniform spatial resolution over the entire surface of the sphere. Best choice of truncation for high resolution models.
(56)
Numerical Methods: Series-Expansion Methods
Slide 49
Slide 49
The Spectral Method on the SphereThe Spectral Method on the Sphere
The Gaussian GridWe want to use the transform method to evaluate product terms in the equations in physical space.
Need to define the grid in physical space which corresponds to the spherical harmonics expansion and ensures exact numerical transformation between spherical harmonics space and physical space.
This grid is called the Gaussian Grid.
Spherical harmonics transformation is a Fourier transformation in longitudefollowed by a Legendre transformation in latitude. =>
In longitude we use the Fourier grid with L equidistant points along a latitude circle. L=2M+1 for the linear grid L=3M+1 for the quadratic grid
Numerical Methods: Series-Expansion Methods
Slide 50
Slide 50
Use Gaussian quardature: numerical integration method, invented by C.F. Gauss,that computes the integral of all polynomials of degree 2L-1 or less exactly from just L values of the integrand at special points called Gaussian quadrature points.
These quadrature points are the zeros of the Legendre polynomial of degree n
The Spectral Method on the SphereThe Spectral Method on the Sphere
The Gaussian Grid (cont)
LlP GL l
,...,1,0)(,0
How large do we have to chose L? 2L-1 >= largest possible degree of the integrand in (57) (is a polynomial!)
1
1
,, )(),,(2
1),( dPtzatza nmmnm
In latitude: Legendre transform, i.e. need to compute the following integral numerically with high accuracy
(57)
(58)
Numerical Methods: Series-Expansion Methods
Slide 51
Slide 51
The Spectral Method on the SphereThe Spectral Method on the Sphere
The Gaussian Grid (cont)
Largest possible degree of the integrand in (57) is 2M for triangular truncation. The exact evaluation of (57) by Gaussian quadrature requires a minimum of (2M+1)/2 Gaussian quadrature points for triangular truncation.
If we want to avoid aliasing errors from quadratic terms, a minimum of (3M+1)/2 Gaussian quadrature points are required (quadratic grid).
The Gaussian quadrature points (also called Gaussian latitudes) are not equidistantly spaced, but very nearly equidistant.
Summary: The total number of grid points in the Gaussian gird on the sphere is (2M+1)(2M+1)/2 for the linear grid (3M+1)(3M+1)/2 for the quadratic grid.
Numerical Methods: Series-Expansion Methods
Slide 52
Slide 52
Full Gaussian grid Reduced Gaussian grid
• Associated Legendre functions are very small near the poles for large m
About 30% reduction in number of points
Numerical Methods: Series-Expansion Methods
Slide 53
Slide 53
50°N 50°N
0°
0°
Orography at T1279
10
50
100
150
200
250
300
350
400
450
500
550
600
650
684.1
50°N 50°N
0°
0°
Orography at T799
10
50
100
150
200
250
300
350
400
450
500
550
600
634.0
25 km grid-spacing( 843,490 grid-points)Current operational resolution
16 km grid-spacing(2,140,704 grid-points)Future operational resolution (from end 2009)
T799 T1279
Numerical Methods: Series-Expansion Methods
Slide 54
Slide 54
Schematic representation of the spectral transform method in the ECMWF model
Grid-point space -semi-Lagrangian advection -physical parametrizations -products of terms
Fourier space
Spectral space -horizontal gradients -semi-implicit calculations -horizontal diffusion
FFT
LT
Inverse FFT
Inverse LT
Fourier space
FFT: Fast Fourier Transform, LT: Legendre Transform
Numerical Methods: Series-Expansion Methods
Slide 55
Slide 55
The Spectral Method on the SphereThe Spectral Method on the Sphere
Remarks about the Legendre transform:
1.) Expensive! Operation count: O(N2) operations at N different latitudes => O(N3)!
2.) So far there is no fast Legendre transform method available. But progress has been made recently in the mathematics community and there is hope that there might be a fast Legendre transform available soon.
3.) Lack of a fast Legendre transform makes the spherical-harmonics spectral model less efficient than spectral models that use 2d Fourier transforms.
Numerical Methods: Series-Expansion Methods
Slide 56
Slide 56
Cost of Legendre transforms
T511T799
T1279
T2047
Numerical Methods: Series-Expansion Methods
Slide 57
Slide 57
Comparison of cost profiles of the ECMWF model at several horizontal resolutions
0
5
10
15
20
25
30
35
40
45
50
no
rmal
ized
% c
ost
T511
T799
T1279
T2047
Numerical Methods: Series-Expansion Methods
Slide 58
Slide 58
Advantages of the spectral representation:
a.) Horizontal derivatives are computed analytically => pressure-gradient terms are very accurate => no need to stagger variables on the grid b.) Spherical harmonics are eigenfunctions of the the Laplace operator => Solving the Helmholtz equation (arising from the semi-implicit method) is straightforward and cheap. => Applying high-order diffusion is very easy.
Disadvantage: Computational cost of the Legendre transforms is high and grows faster with increasing horizontal resolution than the cost of the rest of the model.
The Spectral Method on the SphereThe Spectral Method on the Sphere
Numerical Methods: Series-Expansion Methods
Slide 59
Slide 59
The Finite-Element MethodThe Finite-Element Method
The finite-element method is not widely used in atmospheric model (hyperbolicpartial differential equations), because it generates implicit equations in the unknown variables at each new time level. Costly to solve!
It is more popular in ocean modelling, because it is easily adapted toirregularly shaped domains.
It is very widely used to solve time-independent problems (e.g. in engineering)
The ECMWF model uses finite-elements for the vertical discretisation.
Numerical Methods: Series-Expansion Methods
Slide 60
Slide 60
The Finite-Element MethodThe Finite-Element Method
The expansion functions are not usually orthogonal. However, they are non-zero only on a very small section of the domain, soeach function will have overlap only with its near neighbours the resulting “overlap matrix” W (which couples the equations) will be a banded matrix => easier to handle system of coupled equations than for global basis functions.
The finite-element method is a series-expansion method which usesexpansion function with compact support (i.e. these functions are non-zeroonly on a small localised part of the domain => well suited for non-periodic or irregular domains).
Numerical Methods: Series-Expansion Methods
Slide 61
Slide 61
The Finite-Element MethodThe Finite-Element Method
1
xxj xj+1 xj+2xj-1
ej
ej+1
xj: jth node
otherwise
xxxifxx
xx
xxxifxx
xx
jjjj
j
jjjj
j
0
11
1
11
1
ej=
j
jj xex )()(
nodal values
Pieces-linear finite-elements:
Basis functions are piecewise linear functions (“hat functions”).
Numerical Methods: Series-Expansion Methods
Slide 62
Slide 62
Cubic finite-elements: Cubic B-spline basis functions (for a regular spacing of nodes)
0
)(
)(3)(3)(3
)(3)(3)(3
)(
4
1)(
32
31
211
23
31
211
23
32
3
i
iii
iii
i
i
hhh
hhh
hB
otherwise
for
for
for
for
ii
ii
ii
ii
21
1
1
12
The Finite-Element MethodThe Finite-Element Method
Numerical Methods: Series-Expansion Methods
Slide 63
Slide 63
Cubic B-splines as basis elements
B-splines modifiedto satisfy the boundarycondition f(top)=0
Numerical Methods: Series-Expansion Methods
Slide 64
Slide 64
0
( ) ( )F f x dx
can be approximated as
Applying the Galerkin method with test functions tj =>
-1 AC Bc C A Bc
2 2
1 1 0
( ) ( )
K M
i i i ii K i M
C d c e x dx
Basis sets
2 2
1 1
1 1
1 2
0 0 0
( ) ( ) ( ) ( ) for
xK M
i j i i j ii K i M
C t x d x dx c t x e y dy dx N j N
Aji Bji
The Finite-Element Scheme in the ECMWF modelThe Finite-Element Scheme in the ECMWF model
Numerical Methods: Series-Expansion Methods
Slide 65
Slide 65
1 -c S f
F PC
1 -1 -F P A B S f J f
Including the transformation from grid-point (GP) representation tofinite-element representation (FE)
and the projection of the result from FE to GP representation
one obtains
Matrix J depends only on the choice of the basis functions and the level spacing. It does not change during the integration of the model, so it needs to be computedonly once during the initialisation phase of the model and stored.
The Finite-Element Scheme in the ECMWF modelThe Finite-Element Scheme in the ECMWF model
Numerical Methods: Series-Expansion Methods
Slide 66
Slide 66
Cubic B-splines as basis elements
Basis elementsfor the represen-tation of thefunction tobe integrated(integrand)
f
Basis elementsfor the representationof the integral
F
Numerical Methods: Series-Expansion Methods
Slide 67
Slide 67
High order accuracy (8th order for cubic elements)
Very accurate computation of the pressure-gradient term
in conjunction with the spectral computation of
horizontal derivatives
More accurate vertical velocity for the semi-Lagrangian
trajectory computation
Reduced vertical noise in the model
No staggering of variables required in the vertical: good for semi-Lagrangian scheme because winds and advected variables are represented on the same vertical levels.
Benefits from using this finite-element scheme in the vertical in the ECMWFmodel:
The Finite-Element Scheme in the ECMWF modelThe Finite-Element Scheme in the ECMWF model
Numerical Methods: Series-Expansion Methods
Slide 68
Slide 68
Thank you very much for your attention.