Topic 6b Finite Difference Approximations

Similar documents
Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University

Math Week 5 concepts and homework, due Friday February 10

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

Numerical Analysis: Trapezoidal and Simpson s Rule

Chapter 3 Solving Nonlinear Equations

COSC 3361 Numerical Analysis I Numerical Integration and Differentiation (III) - Gauss Quadrature and Adaptive Quadrature

Lecture 19: Continuous Least Squares Approximation

ENGI 3424 Engineering Mathematics Five Tutorial Examples of Partial Fractions

Discrete Least-squares Approximations

Key words. Numerical quadrature, piecewise polynomial, convergence rate, trapezoidal rule, midpoint rule, Simpson s rule, spectral accuracy.

Math 20C Multivariable Calculus Lecture 5 1. Lines and planes. Equations of lines (Vector, parametric, and symmetric eqs.). Equations of lines

Orthogonal Polynomials and Least-Squares Approximations to Functions

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Numerical Integration Problems

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

Lecture 14: Quadrature

Best Approximation. Chapter The General Case

Chapter 2. Numerical Integration also called quadrature. 2.2 Trapezoidal Rule. 2.1 A basic principle Extending the Trapezoidal Rule DRAWINGS

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

Math 1B, lecture 4: Error bounds for numerical methods

Chapter 3 Polynomials

Best Approximation in the 2-norm

Numerical Integration - (4.3)

Chapter 6 Notes, Larson/Hostetler 3e

Quadratic Forms. Quadratic Forms

Review of Calculus, cont d

1 Linear Least Squares

Section 6.1 Definite Integral

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

Polynomial Approximations for the Natural Logarithm and Arctangent Functions. Math 230

Recitation 3: More Applications of the Derivative

Chapter Direct Method of Interpolation More Examples Civil Engineering

LECTURE 19. Numerical Integration. Z b. is generally thought of as representing the area under the graph of fèxè between the points x = a and

University of Houston, Department of Mathematics Numerical Analysis II

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

1. Gauss-Jacobi quadrature and Legendre polynomials. p(t)w(t)dt, p {p(x 0 ),...p(x n )} p(t)w(t)dt = w k p(x k ),

Lecture 20: Numerical Integration III

Solutions to Assignment #8

Taylor Series and the Mean Value Theorem of Derivatives

Math& 152 Section Integration by Parts

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

CHAPTER 6b. NUMERICAL INTERPOLATION

On Second Derivative-Free Zero Finding Methods

Midpoint Approximation

Derivatives, Finding Roots, Interpolating and Integration

Chapter 2 Differentiation

The Regulated and Riemann Integrals

Lecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

1 Error Analysis of Simple Rules for Numerical Integration

1 The Riemann Integral

Numerical Integration

Numerical Methods I Orthogonal Polynomials

Chapter 18 Two-Port Circuits

Math 113 Exam 2 Practice

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur

ODE: Existence and Uniqueness of a Solution

CHAPTER 4a. ROOTS OF EQUATIONS

Riemann Sums and Riemann Integrals

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

Numerical integration

Sections 5.2: The Definite Integral

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

1 Review: Volumes of Solids (Stewart )

Numerical Integration

Lecture Outline. Dispersion Relation Electromagnetic Wave Polarization 8/7/2018. EE 4347 Applied Electromagnetics. Topic 3c

MATH1901 Differential Calculus (Advanced)

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

Riemann Sums and Riemann Integrals

Average Rate of Change (AROC) The average rate of change of y over an interval is equal to change in

Lecture 4: Piecewise Cubic Interpolation

Section 14.3 Arc Length and Curvature

Chapters 4 & 5 Integrals & Applications

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

Construction of Gauss Quadrature Rules

Chapter 14. Matrix Representations of Linear Transformations

If u = g(x) is a differentiable function whose range is an interval I and f is continuous on I, then f(g(x))g (x) dx = f(u) du

Advanced Computational Fluid Dynamics AA215A Lecture 3 Polynomial Interpolation: Numerical Differentiation and Integration.

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

1.2. Linear Variable Coefficient Equations. y + b "! = a y + b " Remark: The case b = 0 and a non-constant can be solved with the same idea as above.

III. Lecture on Numerical Integration. File faclib/dattab/lecture-notes/numerical-inter03.tex /by EC, 3/14/2008 at 15:11, version 9

Definite integral. Mathematics FRDIS MENDELU

Review of Gaussian Quadrature method

Improper Integrals, and Differential Equations

Numerical quadrature based on interpolating functions: A MATLAB implementation

( ) as a fraction. Determine location of the highest

Disclaimer: This Final Exam Study Guide is meant to help you start studying. It is not necessarily a complete list of everything you need to know.

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

THE HANKEL MATRIX METHOD FOR GAUSSIAN QUADRATURE IN 1 AND 2 DIMENSIONS

AB Calculus Review Sheet

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

Logarithms and Exponential Functions. Gerda de Vries & John S. Macnab. match as necessary, or to work these results into other lessons.

( ) where f ( x ) is a. AB Calculus Exam Review Sheet. A. Precalculus Type problems. Find the zeros of f ( x).

INTRODUCTION TO INTEGRATION

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

3.4 Numerical integration

UNIT #6 EXPONENTS, EXPONENTS, AND MORE EXPONENTS REVIEW QUESTIONS

NUMERICAL INTEGRATION

Transcription:

/8/8 Course Instructor Dr. Rymond C. Rump Oice: A 7 Pone: (95) 747 6958 E Mil: rcrump@utep.edu Topic 6b Finite Dierence Approximtions EE 486/5 Computtionl Metods in EE Outline Wt re inite dierence pproximtions? Overview o deriving inite dierence pproximtions Algoritm or clculting inite dierence pproximtions Exmples Clculting inite dierence coeicients using MATLAB Exmples

/8/8 Wt re Finite Dierence Approximtions? Wt re Finite Dierence Approximtions? ( o ) Very oten in science nd engineering we must clculte derivtive. Wen we re processing dt rom mesurements or simultions, tere my not be n nlyticl eqution to work wit symboliclly. Typiclly, we only know te unction t discrete points. x x x Slide 4

/8/8 Wt re Finite Dierence Approximtions? ( o ) Suppose we wis to numericlly clculte te irst order derivtive t x. Te irst order derivtive is slope. We cn estimte te slope s riserun using inormtion rom surrounding points. rise run x x x run = x rise = x x x Slide 5 Wt re Finite Dierence Approximtions? ( o ) We cn estimte te derivtive t te midpoint between dt points. x x.5 x.5 x Te second order derivtive is te slope o te slope. x.5 x.5 x x x x x x.5.5 x x x Slide 6

/8/8 Generl Concept o Finite Dierence Approximtions ( o ) t x, y t x, y t x, y 5 5 5 t x, y t x, y 4 4 4 t x, y 6 6 6 x i i or t xi, y i y t x, y 7 7 7 Suppose we wis to estimte te unction (x) or one o its derivtives t loction (x i,y i ). x i or y i 4 4 5 5 6 6 7 7 It is lwys possible to estimte tis rom liner sum o te unction vlues t surrounding points. Slide 7 Generl Concept o Finite Dierence Approximtions ( o ) Te trick is, ow do we clculte te coeicients n? Tese re unction o te positions o te points. x, y x y x, y,,,, 4, 5, 6, 7 x, y x, y x, y x, y Finite dierence coeicients depend only on te reltive position o te points. Tey do not depend on te bsolute positions. Sme coeicients Dierent coeicients Dierent coeicients Slide 8 4

/8/8 Types o Finite Dierences d x x Forwrd Finite Dierence Reces ed to use dt in te orwrd direction. d x.5 d x x x Centrl Finite Dierence Reces symmetriclly to use dt in bot directions or igest ccurcy. Bckwrd Finite Dierence Reces beind to use dt in te bckwrd direction. Slide 9 Continuum o Finite Dierence Approximtions Slide 5

/8/8 Two Key Considertions. Te position o te points rom wic te inite dierence pproximtion is clculted. More closely spced points improves ccurcy, but typiclly leds to more computtions.. Te loction o te point were te inite dierence is being evluted. We typiclly wnt to be s centered s possible or best ccurcy. Slide Overview o Deriving Finite Dierence Approximtions 6

/8/8 Concept o Using Polynomils We cn it n t order polynomil given + points. x x x x Ater we ve done te curve it, we cn interpolte te unction or ny o its derivtives rom tis polynomil. 4 4 4 4 6 4 6 4 x x x x x x x x x x x x x x x x 4x x Slide Fitting te Polynomil We write our polynomil t ec o our discrete points. Since our t order polynomil contins + coeicients n, we need t lest + discrete points to determine ll o tem. Tis lst point sows tt more points in te pproximtion will give better ccurcy in te inite dierence pproximtion. x xx x x x x x x x x x Slide 4 7

/8/8 Esiest Point or Evluting (x) Recll te equtions we will use to evlute (x) or one o its derivtives: 4 x xx x 4x x xxx 44x x x 6 x x x 4 Tese re most esily evluted t x = becuse te bove equtions reduce to 6 Slide 5 How to Mke Any Point Esy ow suppose we wis to evlute (x) or one o its derivtives t te generl point x = x d. To do tis, we sit our x xis by x d beore itting te polynomil. Recll tt te inite dierence coeicients depend only on te reltive position o te points. An oset will not ect teir vlues. ow we write our polynomil t ec sited point. x x x x x x x x x x x x x x x n n d In our sited coordinte system, our inite dierence is being evluted t x. 6 Slide 6 8

/8/8 Mtrix Form o Curve Fit Given our sited coordinte system, we write te polynomil t ec discrete point nd put tis lrge set o equtions in mtrix orm. 4 x xx x 4x x xxx 44x x x 6x4x x x x x x x x xx xx x x x x x x x x Slide 7 Algoritm or Clculting Finite Dierence Approximtions 8 9

/8/8 Step Coose x Coordintes Identiy te x coordintes o te points rom wic you wis to pproximte derivte. T x x x x 9 Step Sit x Axis Sit te unction cross te x xis until x = corresponds to te point were you wis to pproximte te derivtive. d x x d x x x x x x x x x x T

/8/8 Step Build [X] Mtrix Use te column vector x to build [X]. X x x x x x x x x x x x x x x x x x x x xx Insert s insted o x. Step 4 Invert X Clculte te inverse o X. y y y, y y y, Y X y, y, y,

/8/8 Step 5 Extrct Polynomil Coeicients X Y y y y y, y y y y, y y y y, y, y, y, y, y y y y, y y y y, y y y y, y y y y,,,, Step 6 Write Finite Dierence Approximtion x d x d x y y y y, y y y y, y y y y, y y y y,,,, 4

/8/8 Exmples 5 Exmple # Derive irst order nd second order inite dierence pproximtions tt spn cross tree points. Te pproximtions sould be evluted t te midpoint. x X x x x Y X x d d x d d xd 6

/8/8 Exmple # Derive irst order nd second order inite dierence pproximtions tt spn cross tree points. Te pproximtions sould be evluted t te irst point. x X x x x Y X.5.5 x d d x.5.5 d d xd 7 Exmple # Higer Order Accurcy ( o ) Let s evlute some derivtives t te midpoint o our discrete points. 9 7 4 8 4 8 4 8 9 7 4 8 9 9 6 6 6 6 9 9 4 8 8 4 Y X 4 4 4 4 6 6 x X x x x x 8 4

/8/8 Exmple # Higer Order Accurcy ( o ) Te coeicients re ten 9 9 6 6 6 6 9 9 4 8 8 4 4 4 4 4 4 6 6 Y 9 9 4 x.5 6 d x 7 7.5 4 4x d x.5 4 x 9 9 4 6 6 6 6 9 9 4 4 8 8 4 4 4 4 4 4 6 6 4 9 Clculting Finite Dierence Approximtions Using MATLAB 5

/8/8 Determining Finite Dierence Approximtions wit MATLAB ( o 6) We ve so r derived inite dierence pproximtions symboliclly. Wt i we wnt 6 t order ccurte inite dierences? Tis is unresonble to do symboliclly. Recll our mtrix eqution representing te polynomil written t ec discrete point. It lwys d te ollowing orm were te w s re just constnts. w w w w w w w, w, w, Slide Determining Finite Dierence Approximtions wit MATLAB ( o 6) ow, we re ble to seprte te w terms rom te terms. w w w w w w w, w, w, We were ble to put numbers to ll o tese coeicients. Tis is ully numericl mtrix. It does not contin ny symbolic vribles. Hint: W X wen X Tese re our symbolic vribles. So we build [W] by building nd pretending =. Slide 6

/8/8 Determining Finite Dierence Approximtions wit MATLAB ( o 6) Solving our mtrix eqution or [] gives w w w w w w w, w, w, V v v v v v v v v v, v, v, v, W Slide Determining Finite Dierence Approximtions wit MATLAB (4 o 6) ext we multiply our mtrices. v v v v v v v v v, v, v, v, v v v v v v v v v, v, v, v, Slide 4 7

/8/8 Determining Finite Dierence Approximtions wit MATLAB (5 o 6) ext, we red o te polynomil coeicients. v v v v v v v v v, v, v, v, vv v v v v v, v, v, Slide 5 Determining Finite Dierence Approximtions wit MATLAB (6 o 6) Lst, we write our inite dierence pproximtions rom te polynomil coeicients. vv v d v v v v v v d String t tese equtions long enoug, we relize tt te v ij coeicients cn be determined completely numericlly. We just ve to remember to divide by nd perps multiply te initedierence expression by constnt. Slide 6 8

/8/8 MATLAB Exmples 7 Exmple #4 6 t Order Accurte Finite Dierences ( o ). Here we need seven points to clculte seven polynomil coeicients. x T. To build te [W] mtrix, set = or now. x ˆ T - 9-7 8-4 79-4 -8 6-64 - - - 4 5 6 W x ˆ xˆ xˆ xˆ xˆ xˆ xˆ 4 8 6 64 9 7 8 4 79 Slide 8 9

/8/8 Exmple #4 6 t Order Accurte Finite Dierences ( o ). Invert [W]. VW. -.67.5 -.75 -..75 -.5.67.56 -.75.75 -.6.75 -.75.56.8 -.667.78. -.78.667 -.8 -.69.8 -.78.889 -.78.8 -.69 -.4.67 -.8 -..8 -.67.4.4 -.8.8 -.78.8 -.8.4 4. Write te inite dierence pproximtions, remembering to incorporte te symbolic s bck in. 4 5 6 7.67.5.75 4.75 5.5 6.67 7 x..5.5.7.5.5. x 4 5 6 7 Slide 9