Lecture 2: Numerical Methods for Differentiations and Integrations

Similar documents
NUMERICAL DIFFERENTIATION

Lecture 13 APPROXIMATION OF SECOMD ORDER DERIVATIVES

6.3.4 Modified Euler s method of integration

Lecture 21: Numerical methods for pricing American type derivatives

2 Finite difference basics

One-sided finite-difference approximations suitable for use with Richardson extrapolation

Finite Differences, Interpolation, and Numerical Differentiation

E91: Dynamics. E91: Dynamics. Numerical Integration & State Space Representation

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

Continuous Time Markov Chain

Differentiating Gaussian Processes

Convexity preserving interpolation by splines of arbitrary degree

THE STURM-LIOUVILLE EIGENVALUE PROBLEM - A NUMERICAL SOLUTION USING THE CONTROL VOLUME METHOD

Linear Approximation with Regularization and Moving Least Squares

NON-CENTRAL 7-POINT FORMULA IN THE METHOD OF LINES FOR PARABOLIC AND BURGERS' EQUATIONS

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Numerical Methods. ME Mechanical Lab I. Mechanical Engineering ME Lab I

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Calculus of Variations Basics

Appendix B. The Finite Difference Scheme

Handout # 6 (MEEN 617) Numerical Integration to Find Time Response of SDOF mechanical system. and write EOM (1) as two first-order Eqs.

Consistency & Convergence

MATH 5630: Discrete Time-Space Model Hung Phan, UMass Lowell March 1, 2018

Chapter 3 Differentiation and Integration

The exponential map of GL(N)

Numerical Heat and Mass Transfer

Difference Equations

The Exact Formulation of the Inverse of the Tridiagonal Matrix for Solving the 1D Poisson Equation with the Finite Difference Method

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Polynomial Regression Models

COMPARISON OF SOME RELIABILITY CHARACTERISTICS BETWEEN REDUNDANT SYSTEMS REQUIRING SUPPORTING UNITS FOR THEIR OPERATIONS

ONE DIMENSIONAL TRIANGULAR FIN EXPERIMENT. Technical Advisor: Dr. D.C. Look, Jr. Version: 11/03/00

Numerical Algorithms for Visual Computing 2008/09 Example Solutions for Assignment 4. Problem 1 (Shift invariance of the Laplace operator)

Implicit Integration Henyey Method

Nice plotting of proteins II

CALCULUS CLASSROOM CAPSULES

CHAPTER 14 GENERAL PERTURBATION THEORY

Modelli Clamfim Equazione del Calore Lezione ottobre 2014

Module 3: Element Properties Lecture 1: Natural Coordinates

Ballot Paths Avoiding Depth Zero Patterns

Lecture 10 Support Vector Machines II

A new Approach for Solving Linear Ordinary Differential Equations

MA 323 Geometric Modelling Course Notes: Day 13 Bezier Curves & Bernstein Polynomials

A P PL I CA TIONS OF FRACTIONAL EXTERIOR DI F F ER EN TIAL IN THR EE- DI M ENSIONAL S PAC E Ξ

Georgia Tech PHYS 6124 Mathematical Methods of Physics I

MMA and GCMMA two methods for nonlinear optimization

Module 14: THE INTEGRAL Exploring Calculus

Lecture 12: Discrete Laplacian

Computers and Mathematics with Applications

Least squares cubic splines without B-splines S.K. Lucas

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

APPENDIX 2 FITTING A STRAIGHT LINE TO OBSERVATIONS

Suppose that there s a measured wndow of data fff k () ; :::; ff k g of a sze w, measured dscretely wth varable dscretzaton step. It s convenent to pl

2.3 Nilpotent endomorphisms

Application of B-Spline to Numerical Solution of a System of Singularly Perturbed Problems

Chapter Twelve. Integration. We now turn our attention to the idea of an integral in dimensions higher than one. Consider a real-valued function f : D

Maejo International Journal of Science and Technology

Cubic Trigonometric B-Spline Applied to Linear Two-Point Boundary Value Problems of Order Two

Integral Equation Methods for Pricing Perpetual Bermudan Options *

Formal solvers of the RT equation

Bernoulli Numbers and Polynomials

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

Lecture 5 Decoding Binary BCH Codes

Additional Codes using Finite Difference Method. 1 HJB Equation for Consumption-Saving Problem Without Uncertainty

ME 501A Seminar in Engineering Analysis Page 1

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Math1110 (Spring 2009) Prelim 3 - Solutions

Modified Mass Matrices and Positivity Preservation for Hyperbolic and Parabolic PDEs

Solution of Linear System of Equations and Matrix Inversion Gauss Seidel Iteration Method

Trees and Order Conditions

EEE 241: Linear Systems

Introduction to Vapor/Liquid Equilibrium, part 2. Raoult s Law:

FTCS Solution to the Heat Equation

% & 5.3 PRACTICAL APPLICATIONS. Given system, (49) , determine the Boolean Function, , in such a way that we always have expression: " Y1 = Y2

High resolution entropy stable scheme for shallow water equations

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Numerical Solution of Ordinary Differential Equations

Numerical Simulation of One-Dimensional Wave Equation by Non-Polynomial Quintic Spline

TR/95 February Splines G. H. BEHFOROOZ* & N. PAPAMICHAEL

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Advanced Circuits Topics - Part 1 by Dr. Colton (Fall 2017)

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

THE VIBRATIONS OF MOLECULES II THE CARBON DIOXIDE MOLECULE Student Instructions

Finite Difference Method

Key Words: Hamiltonian systems, canonical integrators, symplectic integrators, Runge-Kutta-Nyström methods.

Numerical Solution of One-Dimensional Heat and Wave Equation by Non-Polynomial Quintic Spline

COMPOSITE BEAM WITH WEAK SHEAR CONNECTION SUBJECTED TO THERMAL LOAD

1 Introduction We consider a class of singularly perturbed two point singular boundary value problems of the form: k x with boundary conditions

Computational Astrophysics

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

Professor Terje Haukaas University of British Columbia, Vancouver The Q4 Element

Numerical Solution of two dimensional coupled viscous Burgers Equation using the Modified Cubic B-Spline Differential Quadrature Method

3 Basic boundary value problems for analytic function in the upper half plane

(c) (cos θ + i sin θ) 5 = cos 5 θ + 5 cos 4 θ (i sin θ) + 10 cos 3 θ(i sin θ) cos 2 θ(i sin θ) 3 + 5cos θ (i sin θ) 4 + (i sin θ) 5 (A1)

Modelli Clamfim Equazioni differenziali 7 ottobre 2013

As it can be observed from Fig. a) and b), applying Newton s Law for the tangential force component results into: mg sin mat

Chapter 4: Root Finding

Note 10. Modeling and Simulation of Dynamic Systems

DUE: WEDS FEB 21ST 2018

Inductance Calculation for Conductors of Arbitrary Shape

Transcription:

Numercal Smulaton of Space Plasmas (I [AP-4036] Lecture 2 by Lng-Hsao Lyu March, 2018 Lecture 2: Numercal Methods for Dfferentatons and Integratons As we have dscussed n Lecture 1 that numercal smulaton s a set of carefully planed numercal schemes to solve an ntal value problem numercally. followng three types of dfferental equatons. dy(t dt dy(t dt y(x,t t Let us consder the f (t (2.1 f ( y,t (2.2 f (t, y, y 2 x, y x,..., 2 y,... (2.3 The numercal methods for tme ntegraton of these equatons wll be dscussed n the Lecture 3. Before we conduct the tme ntegraton, we need to determne the dfferentatons y x, 2 y,... and the ntegratons 2 x y,... on the rght-hand sde of the equaton (2.3 at each grd pont. In ths secton, we are gong to dscuss the followng three types of numercal methods, whch are commonly used n spatal dfferentatons and ntegratons. 1. Fnte Dfferences (based on Taylor seres expanson 2. FFT (Fast Fourer Transform 3. Cubc Splne 2.1. Fnte Dfferences For convenence, we shall use the followng notaton n the rest of ths lecture notes. For a gven tabulate functon f jk n f (x Δx, y jδy, z kδz, t nδt f (x, y j,z k,t n : 1 2... N x : x 1 x 2... x N f : f 1 f 2... f N the fnte-dfference expresson of the n-th order dervatves of the gven functon f can be obtaned from the Taylor seres expresson of f. Table 2.1 lsts examples of 2-1

Numercal Smulaton of Space Plasmas (I [AP-4036] Lecture 2 by Lng-Hsao Lyu March, 2018 fnte-dfference expresson of [d f / ] xx, [d 2 f / 2 ] xx, and [d 3 f / 3 ] xx, where the central-dfference expressons are of the frst-order accuracy, whle the forward-dfference and backword-dfference expressons are of the zeroth-order accuracy. Complete dervatons of the hgher-order fnte-dfference schemes are gven n the Appen B. Table 2.2 lsts examples of the fnte-dfference expressons of spatal ntegratons y(x x +Δx x f (x. Complete dervatons of the hgher-order fnte-dfference scheme are gven n the Appen C.1. Dervatves Table 2.1. The numercal dfferentatons based on fnte dfference method Central Dfference (Frst-order scheme Forward Dfference (Zeroth-order scheme Backward Dfference (Zeroth-order scheme d f δ f f f +1 1 xx 2Δx Δ f f f +1 Δx f f f 1 Δx d 2 f 2 xx δ 2 f f 2 f + f +1 1 Δ 2 f (Δx 2 f 2 f + f +2 +1 2 f (Δx 2 f 2 f + f 1 2 (Δx 2 d 3 f 3 xx δ 3 f f +2 2 f +1 + 2 f 1 f 2 2(Δx 3 Δ 3 f f +3 3 f +2 + 3 f +1 f (Δx 3 3 f f 3 f 1 + 3 f 2 f 3 (Δx 3 Exercse 2.1. (a Please prove that the central-dfference expressons shown n Table 2.1 are of frst-order accuracy. (b Please prove that the forward-dfference and backward-dfference expressons shown n Table 2.1 are of zeroth-order accuracy. Exercse 2.2. Determne d f /, and d 2 f / 2 of a gven analytcal functon f (x numercally based on the frst-order, the thrd-order, and the ffth-order fnte-dfference expressons lsted n the Appen B. The dfferences between the numercal solutons and the analytcal solutons are called the numercal errors. Determne the numercal errors of a gven grd sze Δx. Show (or plot that the numercal error s a functon of poston and also a functon of Δx. 2-2

Numercal Smulaton of Space Plasmas (I [AP-4036] Lecture 2 by Lng-Hsao Lyu March, 2018 Table 2.2. The spatal ntegratons based on fnte dfference method d y(x f (x, h Δx 1 st order ntegraton + h f + O(h 2 f (1 2 nd order ntegraton Trapezodal rule 4 th order ntegraton Smpson's rule 4 th order ntegraton Smpson's 3/ 8 rule + h f +1 + f 2 + O(h 3 f (2 + h( 1 6 f + 4 6 f +(1/2 + 1 6 f +1 + O(h5 f (4 + h 3 (3 8 f + 9 8 f + 9 + 1 8 f + 3 + 2 8 f +1 +O(h5 f (4 3 3 Exercse 2.3. Use the frst-order, the second-order, and the forth-order ntegraton expressons lsted n Table 2.2 to determne y(x π / 4 wth dy(x / cos(x and boundary condton y(x 0 0. Determne the numercal errors n your results. Compare the numercal errors obtaned from dfferent spatal ntegraton expressons. 2.2. FFT (Fast Fourer Transform A functon can be expanded by a complete set of sne and cosne functons. In the Fast Fourer Transform, the sne and cosne tables are calculated n advance to save the CPU tme of the smulaton. For a perodc functon f, one can use FFT to determne ts spatal dfferentatons and ntegratons,.e., d f FFT 1 {k[fft ( f ]} f FFT 1 { 1 [FFT ( f ]} for k > 0. k Exercse 2.4. Use an FFT subroutne to determne the frst dervatves of a perodc analytcal functon f. Determne the numercal errors n your results. 2-3

Numercal Smulaton of Space Plasmas (I [AP-4036] Lecture 2 by Lng-Hsao Lyu March, 2018 Exercse 2.5. Use an FFT subroutne to determne the frst dervatves of a non-perodc analytcal functon f. Determne the numercal errors n your results. 2.3. Cubc Splne A tabulate functon can be ftted by a set of pece-wse contnuous functons, n whch the frst and the second dervatves of the fttng functons are contnuous at each grd pont. One need to solve a tr-dagonal matrx to determne the pece-wse contnuous cubc splne functons. The nverson of the tr-dagonal matrx depends only on the poston of grd ponts. Thus, for smulatons wth fxed grd ponts, one can evaluate the nverson of the tr-dagonal matrx n advance to save the CPU tme of the smulaton. For a non-perodc functon f, t s good to use the cubc splne method to determne ts spatal dfferentatons and ntegratons at each grd pont. Results of the spatal dfferentatons obtaned from the cubc splne show the same order of accuracy as the results obtaned from the ffth order fnte dfferences scheme. form. The pece-wse contnuous functon n the cubc splne can be wrtten n the followng f x x k+1 f (x +1 +1 + f (x + [a k (x + b k ](x (x +1 2 The constants {a k, b k, for k 1 n 1} are chosen such that the matchng condtons for cubc splne can be fulflled,.e., df 1 x x k and df (x x x k k+1 d 2 f 1 x x k d 2 f x x k+1 2 2 One can obtan the followng two types of recurson formula f 1 + f [2 + 2( 1 ]+ f ( 1 3 f 0 1 + 3 f 0 ( 1 2-4

Numercal Smulaton of Space Plasmas (I [AP-4036] Lecture 2 by Lng-Hsao Lyu March, 2018 f 1 + f [2 + 2( ]+ f (x +1 ( 6 [ f k 1 1 h 0 f 0 1 ] k 1 where f 0 f (x f (x k+1 k and h x k+1 x k+1. k Detal dervatons of the Cubc Splne wth dfferent boundary condtons are gven n Appen A. Exercse 2.6. Use a Cubc Splne subroutne to determne the frst dervatves of an analytcal functon f. Determne the numercal errors n your results. References Hldebrand, F. B., Advanced Calculus for Applcatons, 2 nd edton, Prentce-Hall, Inc., Englewood, Clffs, New Jersey, 1976. Press, W. H., B. P. Flannery, S. A. Teukolsky, and W. T. Vetterlng, Numercal Recpes (n C or n FORTRAN and Pascal, Cambrdge Unversty Press, Cambrdge, 1988. System/360 Scentfc Subroutne Package Verson III, Programmer s Manual, 5 th edton, IBM, New York, 1970. 2-5