Instructions for Matlab Routines

Similar documents
T u

GENERALIZED GAUSS RADAU AND GAUSS LOBATTO FORMULAE

Orthogonal Polynomials, Quadratures & Sparse-Grid Methods for Probability Integrals

Numerical Integration (Quadrature) Another application for our interpolation tools!

1462. Jacobi pseudo-spectral Galerkin method for second kind Volterra integro-differential equations with a weakly singular kernel

Introduction. Chapter One

Rational Chebyshev pseudospectral method for long-short wave equations


In numerical analysis quadrature refers to the computation of definite integrals.

Boundary Layer Problems and Applications of Spectral Methods

MATHEMATICAL METHODS INTERPOLATION

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

PARTIAL DIFFERENTIAL EQUATIONS

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

A Gauss Lobatto quadrature method for solving optimal control problems

Numerical Methods I: Numerical Integration/Quadrature

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018

Fast Numerical Methods for Stochastic Computations

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration.

Applied Numerical Analysis

A High-Order Galerkin Solver for the Poisson Problem on the Surface of the Cubed Sphere

Preface. 2 Linear Equations and Eigenvalue Problem 22

Fast Structured Spectral Methods

PART IV Spectral Methods

Index. for Ɣ(a, z), 39. convergent asymptotic representation, 46 converging factor, 40 exponentially improved, 39

ON SPECTRAL METHODS FOR VOLTERRA INTEGRAL EQUATIONS AND THE CONVERGENCE ANALYSIS * 1. Introduction

Multistage Methods I: Runge-Kutta Methods

Integration using Gaussian Quadrature

SPECTRAL METHODS: ORTHOGONAL POLYNOMIALS

Contents. I Basic Methods 13

MONOTONICITY OF THE ERROR TERM IN GAUSS TURÁN QUADRATURES FOR ANALYTIC FUNCTIONS

arxiv: v1 [math.na] 4 Nov 2015

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

COMPUTATION OF BESSEL AND AIRY FUNCTIONS AND OF RELATED GAUSSIAN QUADRATURE FORMULAE

A Legendre Computational Matrix Method for Solving High-Order Fractional Differential Equations

Gaussian interval quadrature rule for exponential weights

Superconvergence of Jacobi Gauss-Type Spectral Interpolation

Research Article A Nonclassical Radau Collocation Method for Nonlinear Initial-Value Problems with Applications to Lane-Emden Type Equations

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Spectral Collocation Method for Parabolic Partial Differential Equations with Neumann Boundary Conditions

Numerical Solution of Linear Volterra-Fredholm Integro- Differential Equations Using Lagrange Polynomials

A note on multivariate Gauss-Hermite quadrature

Gauss Pseudospectral Method for Solving Infinite-Horizon Optimal Control Problems

GAUSS-LAGUERRE AND GAUSS-HERMITE QUADRATURE ON 64, 96 AND 128 NODES

Numerical Solution of Linear Volterra-Fredholm Integral Equations Using Lagrange Polynomials

Document downloaded from:

Accuracy, Precision and Efficiency in Sparse Grids

Gauss-Lobatto to Bernstein polynomials transformation

Mohammad Reza Eslahchi

Fast variants of the Golub and Welsch algorithm for symmetric weight functions

Research Article Analysis of IVPs and BVPs on Semi-Infinite Domains via Collocation Methods

arxiv: v3 [math.na] 30 Nov 2012

256 Summary. D n f(x j ) = f j+n f j n 2n x. j n=1. α m n = 2( 1) n (m!) 2 (m n)!(m + n)!. PPW = 2π k x 2 N + 1. i=0?d i,j. N/2} N + 1-dim.

User Guide for Hermir version 0.9: Toolbox for Synthesis of Multivariate Stationary Gaussian and non-gaussian Series

arxiv:gr-qc/ v1 6 Sep 2006

Convergence of a Gauss Pseudospectral Method for Optimal Control

Differentiation matrices in polynomial bases

MODELLING OF RECIPROCAL TRANSDUCER SYSTEM ACCOUNTING FOR NONLINEAR CONSTITUTIVE RELATIONS

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

A new class of highly accurate differentiation schemes based on the prolate spheroidal wave functions

Differentiation and Integration

Introduction to Uncertainty Quantification in Computational Science Handout #3

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

A Numerical Solution of the Lax s 7 th -order KdV Equation by Pseudospectral Method and Darvishi s Preconditioning

arxiv: v2 [math-ph] 16 Aug 2010

Preliminary Examination in Numerical Analysis

The Asymptotic Eigenvalues of First-Order Spectral Differentiation Matrices

Wojciech Czernous PSEUDOSPECTRAL METHOD FOR SEMILINEAR PARTIAL FUNCTIONAL DIFFERENTIAL EQUATIONS

An Introduction to Numerical Analysis

A fast Chebyshev Legendre transform using an asymptotic formula

Research Statement. James Bremer Department of Mathematics, University of California, Davis

Gauss Hermite interval quadrature rule

K. BLACK To avoid these diculties, Boyd has proposed a method that proceeds by mapping a semi-innite interval to a nite interval [2]. The method is co

Scientific Computing: An Introductory Survey

Four Point Gauss Quadrature Runge Kuta Method Of Order 8 For Ordinary Differential Equations

AND NONLINEAR SCIENCE SERIES. Partial Differential. Equations with MATLAB. Matthew P. Coleman. CRC Press J Taylor & Francis Croup

Pascal s Triangle on a Budget. Accuracy, Precision and Efficiency in Sparse Grids

Interpolation approximations based on Gauss Lobatto Legendre Birkhoff quadrature

Corrections and emendations for Elementary Numerical Analysis, 3rd ed. by S. D. Conte and Carl de Boor 20feb18

Section 6.6 Gaussian Quadrature

Solving the steady state diffusion equation with uncertainty Final Presentation

Special Functions of Mathematical Physics

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Ch. 03 Numerical Quadrature. Andrea Mignone Physics Department, University of Torino AA

Partial Differential Equations with MATLAB

Numerical Solution of a Class of Nonlinear Optimal Control Problems ABSTRACT 1. INTRODUCTION

RATIONAL CHEBYSHEV COLLOCATION METHOD FOR SOLVING NONLINEAR ORDINARY DIFFERENTIAL EQUATIONS OF LANE-EMDEN TYPE

F I F T H E D I T I O N. Introductory Methods of Numerical Analysis. S.S. Sastry

A Differential Quadrature Algorithm for the Numerical Solution of the Second-Order One Dimensional Hyperbolic Telegraph Equation

Chebfun and numerical quadrature

A WELL-CONDITIONED COLLOCATION METHOD USING A PSEUDOSPECTRAL INTEGRATION MATRIX

Speeding up numerical computations via conformal maps

Solving Problems in Scientific Computing Using Maple and MATLAB 9

We consider in this paper Legendre and Chebyshev approximations of the linear hyperbolic

CONVERGENCE ANALYSIS OF THE JACOBI SPECTRAL-COLLOCATION METHODS FOR VOLTERRA INTEGRAL EQUATIONS WITH A WEAKLY SINGULAR KERNEL

Syllabus for Applied Mathematics Graduate Student Qualifying Exams, Dartmouth Mathematics Department

Orthogonal polynomials

A Fast Spherical Filter with Uniform Resolution

Projection Methods. Michal Kejak CERGE CERGE-EI ( ) 1 / 29

Improved Lebesgue constants on the triangle

Transcription:

Instructions for Matlab Routines August, 2011

2 A. Introduction This note is devoted to some instructions to the Matlab routines for the fundamental spectral algorithms presented in the book: Jie Shen, Tao Tang and Li-Lian Wang. Spectral Methods: Algorithms, Analysis and Applications. Springer Series in Computational Mathematics, 41, Springer, 2011. This package consists of a collection of Matlab functions which are indispensable for spectral-galerkin/collocation approximations of partial differential equations. These include routines for Evaluation of Legendre polynomials, Jacobi polynomials, (generalized) Laguerre polynomials/functions and Hermite polynomials/functions. Computation of the Gaussian-type quadrature nodes and weights associated with these orthogonal polynomials/functions. Differentiation in the physical space via differentiation matrix. Implementation of pseudospectral techniques: discrete transforms and differentiation in frequency spaces. Applications of these basic algorithms for solving PDEs. We attempt to provide one-to-one correspondence between the codes and the equations, formulas and algorithms in the book, and have made significant efforts to test these functions. However, the users are advised to choose the underlying degree of modes and parameters from the range of standard setting. You are more than welcome to email us if you find bugs or have comments. We also refer to the readers to the following online software in Fortran or Matlab on spectral methods: Fortran Routines for Spectral Methods by D. Funaro, which are available at http://cdm.unimo.it/home/matematica/funaro.daniele/rout.htm A Matlab Differentiation Matrix Suite by J. Weideman and S. Reddy, which is downloadable at http://dip.sun.ac.za/ weideman/research/differ.html PseudoPack by W.S. Don and B. Costa, which can be found at http://www.math.hkbu.edu.hk/ wsdon/ Some codes for Spectral Methods in Matlab by L. Trefethen, which can be downloaded from http://people.maths.ox.ac.uk/trefethen/spectral.html

3 B. Instructions 1. Legendre Spectral Methods (1) [dy, y]=lepoly(n,x); Evaluate the Legendre polynomial and its first-order derivative of degree n at a vector-valued x. (2) [DY, Y]=lepolym(n,x); Evaluate the Legendre polynomials and their first-order derivatives of degree n 1 at a vector-valued x. Note: {Y (i, j) = L i 1 (x j )} 1 i,j n. (3) [x, w]=legs(n); Compute the Legendre-Gauss quadrature nodes and weights {x j, w j } n j=1, where the Newton s method is used for computing the nodes. (4) x=legsndm(n); Compute the Legendre-Gauss points {x j } n j=1 by the eigen-method. (5) [x, w]=legslb(n); Compute the Legendre-Gauss-Lobatto quadrature nodes and weights {x j, w j } n j=1, where the Newton s method is used for computing the nodes. (6) x=legslbndm(n); Compute the Legendre-Gauss-Lobatto points {x j } n j=1 by the eigen-method. (7) w=legslbwt(n); Compute the Legendre-Gauss-Lobatto weights {w j } n j=1 by the weight expression in Yakimiw [3]. (8) [x, w]=legsrd(n); Compute the Legendre-Gauss-Radau quadrature nodes and weights {x j, w j } n j=1, where the eign-method is used for computing the nodes. (9) D=legsdiff(n,x); D=legslbdiff(n,x); D=legsrddiff(n,x); Compute the first-order differentiation matrix D (of size n n) associated with the Legendre-Gauss, Legendre-Gauss-Lobatto and Legendre-Gauss-Radau points {x j } n j=1, respectively. (10) s=ledisctran(n,x,w,p,iflag); Perform discrete Legendre transforms on the Legendre-Gauss-Lobatto points and weights {x j, w j } n j=1. If iflag=0, it conducts the forward transform from the physical values (stored in p) to the Legendre expansion coefficients (output in s), while if iflag 0, it conducts the backward transform from the

4 Legendre expansion coefficients (stored in p) to the physical values (output in s). See Page 101 of [1]. (11) duh=lefreqdiff(n,uh); Perform spectral differentiation in the frequency space. Given the Legendre expansion coefficients (stored in uh), it returns the Legendre expansion coefficients of the first-order derivative (output in duh). See Page 105 of [1]. 2. Chebyshev Spectral Methods (1) D=chebdiff(n); Compute the first-order differentiation matrix (of size (n + 1) (n + 1)) associated with the Chebyshev-Gauss-Lobatto points. See Page 80 of [2]. (2) w=chebfft(v); Perform Chebyshev spectral differentiation via FFT. Given the physical values (stored in v) on the Chebyshev-Gauss-Lobatto points, it returns the first-order derivative values (output in w). See Page 81 of [2]. - Many More Routines Are Coming

Bibliography [1] J. Shen, T. Tang and L.L. Wang. Spectral Methods: Algorithms, Analysis and Applications. Springer Series in Computational Mathematics, Volumn 41, Springer, 2011. [2] L. Trefethen. Spectral Methods in Matlab, Volumn 10, SIAM, 2000. [3] E. Yakimiw. Accurate computation of weights in classical Gauss-Christoffel quadrature rules,journal of Computational Physics, 129(2), 406-430, 1996. 5