The Spectral Method

of 29 /29
1 The Spectral Method

Embed Size (px)


The Spectral Method. Definition. where (e m ,e n )= δ m,n. e n = basis of a Hilbert space (.,.): scalar product in this space. In L 2 space. where f * : complex conjugate of f. Discretization: limit the sum to a finite number of terms. - PowerPoint PPT Presentation

Transcript of The Spectral Method

  • The Spectral Method

  • Definition where (em,en)=m,n en= basis of a Hilbert space(.,.): scalar product in this spaceIn L2 space where f*: complex conjugate of fDiscretization: limit the sum to a finite number of terms (consistent if the ems are appropriately ordered)

  • The Galerkin procedureLinear case

    If ems are eigenfunctions of H: Hem=mem

    H: linear space operatorR: discretization errorwe assume R to be a function of the omitted ems onlytherefore R is orthogonal to em (m M) (alternatively we minimize ||R||2) ||m,n||||0 analytical solution (no need to discretize in t) compute once and store

  • One-dimensional linear advection equation Analytical solution phase speed: =cte (rad/s) Basis functions: Fourier functions eim (eigenfunctions of /) being a real field ==> -m(t)= m*(t); we need to solve only for 0m M Galerkin procedure this is a system of 2M+1 equations (decoupled) for the(complex) n coefficients

  • One-dimensional linear advection equation (2) Exact solution- in physical spacethe same form as the analytical solutionno dispersion due to the space discretizationbecause the derivatives are computed analytically

  • Calculation of the initial conditions computation of m(0) given (,0)- Direct Fourier transform where Am: normalization factor- Inverse Fourier transformBm: normalization factors Discrete Fourier transforms- Direct :- Inverse :Transformations are exact if K2M+1Procedure: Fast Fourier Transform (FFT) algorithmProducts of two functions have no aliassing if K3M+1

  • The linear gridUnfitted functionFitted withquadraticgridFitted withlineargrid3M+1 points in ensure noaliassing in computations ofquadratic terms (case ofEulerian advection) Quadratic grid2M+1 points in ensureexact transforms of linearterms to grid-point and backLinear grid

  • Stability analysis Leapfrog schemeno need to discretizein time if we do nothave other terms in theequationSubstituting and dividing by W(n-1) conditionally stable and neutral- Comparison with finite differencesU0=RM~N/2x=2R/N if using the quadratic grid M~N/3 ---->

  • Graphical representation

  • Non-linear advection equation= there are more wavenumbers on the r.h.s. than in the original functionGalerkin procedurek=0 . Mtherefore Fm m>M are not usedbut no aliassing produced because of misrepresentation

  • Non-linear advection equation (cont)Calculation of Fk Interaction coefficientsIjnk ---> interaction coeff. matrixI is not a sparse matrix Transform methodI. FFTf(l); l=1, Lg(l); l=1, LI. FFTF(l) = - f(l)g(l)D. FFT can be shown to have no aliassing if L 3M+1

  • One-dimensional gravity-wave equations Galerkin procedure no need to discretize in time

  • One-dimensional gravity-wave equations (cont) Explicit time stepping (leapfrog)no need to transformto grid-point space Stability and dispersion (von Neumann method)assume substituting:smaller thanwith finitedifferencesdispersion due solelyto the time discretization

  • One-dimensional gravity-wave equations (cont) Implicit time stepping substitutingDecoupled set of equations because the basis functions eim are eigenfunctions of the space operator / with eigenvalues im Stability and dispersion using von Neumann we getstabledispersion larger thanin leapfrog scheme

  • Shallow water equationsLinearize about a basic state U0, V0, 0 and assume f=cte=f0 (f-plane approx)substitute and neglect productsof perturbations

  • Leapfrog (explicit) time schemeStability according to von Neumann assume and substitute

  • Leapfrog (explicit) time scheme stability (cont) or, calling where

  • Leapfrog (explicit) time scheme stability (cont) calling this system has non-trivial solutions if for to have a real solutionThe most restrictive case is when which gives

  • Semi-implicit time scheme stabilityFollowing the same steps as in the explicit scheme we arrive at:thereforeif

  • Spherical harmonicsOrthogonal basis for spherical geometry m: zonal wavenumber n: total wavenumber= longitude= sin() : latitudePnm: Associated Legendre functions of the first kind

  • Spectral representation n-|m|: effective meridional wavenumberspectral transformSince X is a real field, Xn-m=(Xnm)* Fourier coefficients direct Fourier transform orinverse Legendretransform

  • Some spherical harmonics (n=5)

  • Spherical harmonics (cont) Properties of the spherical harmonics eigenfunctions of the operator / eigenfunctions of the laplacian operatorsemi-implicit method leads to a decoupledset of equations latitudinal derivatives easy to compute although the spherical harmonics are not eigenfunctions of the latitudinal derivative operator

  • Spherical harmonics (cont.) Usual truncationsN=min(|m|+J, K) pentagonal truncationM=J=K triangularK=J+M rhomboidalK=J>M trapezoidalmnMmnMmnMmnM pentagonal triangular rhomboidaltrapezoidalK=J=MKKK=JJJ

  • Gaussian gridUse of the transform method for non-linear terms Integrals with respect to ---> 3M+1 points equally spaced in Integrals with respect to computed exactly by means of Gaussian quadrature using the values at the points whereGaussian latitudesIn triangular truncation NG (3N+1)/2Gaussian latitudes are approximately equally spacedsame spacing as for

  • The reduced Gaussian gridFull gridReduced grid Triangular truncation is isotropic Associated Legendre functions are very small when m is large and || near 1

  • The linear Gaussian grid





    Exact transforms

    to g.p. and back




    computation of

    quadratic terms



    Number of

    degrees of


    at least


    at least


    Ratio of degrees

    of freedom

    g.p. / spec


    at T213


    at TL319





    but to a lesser


  • Two resolutions using the same Gaussian gridT213 orographyTL319 orography

  • Diffusion very simple to apply- LeapfrogStabilityphysical solution 01 stablecomputational solution -1 unstable- Forward- Backward (implicit)decoupled systemof equations01 Stable