Lecture 18 - Numerical Differentiation

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

Numeriska beräkningar i Naturvetenskap och Teknik 1. Numerical differentiation and quadrature Discrete differentiation and integration Trapezoidal and.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Computational Methods in Physics PHYS 3437
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
EE3561_Unit 6(c)AL-DHAIFALLAH14351 EE 3561 : Computational Methods Unit 6 Numerical Differentiation Dr. Mujahed AlDhaifallah ( Term 342)
NUMERICAL DIFFERENTIATION AND INTEGRATION
Numerical Computation
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Numerical Integration
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
Lecture 2: Numerical Differentiation. Derivative as a gradient
Chapter 19 Numerical Differentiation §Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete.
Computer-Aided Analysis on Energy and Thermofluid Sciences Y.C. Shih Fall 2011 Chapter 6: Basics of Finite Difference Chapter 6 Basics of Finite Difference.
Lecture 3: Integration. Integration of discrete functions
MECH300H Introduction to Finite Element Methods Lecture 2 Review.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.
Differential Equations and Boundary Value Problems
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Numerical Solution of Ordinary Differential Equation
PART 7 Ordinary Differential Equations ODEs
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Part 6 Calculus.
Numerical Differentiation
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
1 Numerical Analysis Lecture 12 Numerical Integration Dr. Nader Okasha.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Numerical Methods on Partial Differential Equation Md. Mashiur Rahman Department of Physics University of Chittagong Laplace Equation.
Chapter 17 Boundary Value Problems. Standard Form of Two-Point Boundary Value Problem In total, there are n 1 +n 2 =N boundary conditions.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
Review Taylor Series and Error Analysis Roots of Equations
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Integration of 3-body encounter. Figure taken from
AP Calculus 2005: 240,000 Currently growing at ~13,000/year.
Elliptic PDEs and the Finite Difference Method
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Today’s class Numerical Differentiation Finite Difference Methods Numerical Methods Lecture 14 Prof. Jinbo Bi CSE, UConn 1.
Engineering Analysis – Computational Fluid Dynamics –
Chap. 11 Numerical Differentiation and Integration
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 7 - Chapter 25.
The purpose of Chapter 5 is to develop the basic principles of numerical integration Usefule Words integrate, integral 积分(的), integration 积分(法), quadrature.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
NUMERICAL DIFFERENTIATION or DIFFERENCE APPROXIMATION Used to evaluate derivatives of a function using the functional values at grid points. They are.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Quadrature – Concepts (numerical integration) Don Allen.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
NUMERICAL DIFFERENTIATION Forward Difference Formula
High Accuracy Differentiation Formulas
Finite Difference Methods
CHAPTER 3 NUMERICAL METHODS.
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Chapter 22.
NUMERICAL DIFFERENTIATION AND INTEGRATION
Numerical Analysis Lecture 27.
Numerical Differentiation
Chapter 23.
CSE 245: Computer Aided Circuit Simulation and Verification
Numerical differentiation
POLYNOMIAL INTERPOLATION
MATH 174: NUMERICAL ANALYSIS I
SKTN 2393 Numerical Methods for Nuclear Engineers
Recapitulation of Lecture 11
Derivatives and Gradients
Presentation transcript:

Lecture 18 - Numerical Differentiation CVEN 302 July 19, 2002

Lecture’s Goals Finite Difference Schemes Taylor Series Expansion for Differentiation Basic Numerical Integration Trapezoidal Rule Simpson’s Rule Midpoint Gaussian Quadrature

Calculus - Numerical Methods Differentiation Integration v t dv dt v t a t y

Numerical Differentiation Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete points Ordinary differential equation (ODE) Partial differential equation (PDE)

Numerical Differentiation Represent the function by Taylor polynomials or Lagrange interpolation Evaluate the derivatives of the interpolation polynomial at selected nodal points

Numerical Differentiation A Taylor series or Lagrange interpolation of points can be used to find the derivatives. The Taylor series expansion is defined as:

First Derivative at a Point i-2 i-1 i i+1 i+2

Numerical Differentiation Use the Taylor series expansion to represent three points about single location:

Numerical Differentiation Assume that the data points are “equally spaced” and the equations can be written as:

Forward Differentiation For a forward first derivative, subtract eqn[2] from eqn[1]: Rearrange the equation:

Forward Differentiation As the Dx gets smaller the error will get smaller The error is defined as:

Backward Differentiation Subtract eqn[3] from eqn[2]: The error is defined as:

Central Differentiation Subtract eqn[3] from eqn[1]: The error is defined as:

Differential Error Notice that the errors of the forward and backward 1st derivative of the equations have an error of the order of O(Dx) and the central differentiation has an error of order O(Dx2). The central difference has an better accuracy and lower error that the others. This can be improved by using more terms to model the first derivative.

Numerical Differentiation If you want to improve the accuracy and decrease the error you will need to eliminate terms : = =

Higher Order Errors in Differentiation The terms become : The terms become A=-3, B= 4 and C=-1

Higher Order 1st Derivative Parabolic curve i-2 i-1 i i+1 i+2 Forward difference Backward difference

Higher Order Derivatives To find higher derivatives, use the Taylor series expansions of term and eliminate the terms from the sum of equations. To improve the error in the problem add additional terms.

2nd Derivative of the Function It will require three terms to get a central 2nd derivative of discrete set of data. = # = =

2nd Order Central Difference The terms become : The terms become A=1,B=-2 and C=1. Therefore

Lagrange Differentiation Another form of differentiation is to use the Lagrange interpolation between three points. The values can be determine for unevenly spaced points. Given:

Lagrange Differentiation Differentiate the Lagrange interpolation Assume a constant spacing

Lagrange Differentiation Differentiate the Lagrange interpolation Various locations

Lagrange Differentiation To find a higher order derivative from the Lagrange interpolation for a three point Lagrange Take the derivative

Partial Derivatives Straightforward extension of one-dimensional formula (i, j+2) (i-1, j+1) (i, j+1) (i+1, j+1) (i-2, j) (i-1, j) (i, j) (i+1, j) (i+2, j) (i-1, j-1) (i, j-1) (i+1, j-1) (i, j-2)

(i, j+2) (i-1, j+1) (i, j+1) (i+1, j+1) (i-2, j) (i-1, j) (i, j) (i+1, j) (i+2, j) (i-1, j-1) (i, j-1) (i+1, j-1) (i, j-2)

Partial Derivatives Laplacian Operator j+1 j j-1 i-1 i i+1

Partial Derivatives Mixed Derivative j+1 j j-1 i-1 i i+1

Bi-harmonic Operator j+2 j+1 j j-1 j-2 i-2 i-1 i+1 i+2 i

Richardson Extrapolation This technique uses the concept of variable grid sizes to reduce the error. The technique uses a simple method for eliminating the error. Consider a second order central difference technique. Write the equation in the form:

Richardson Extrapolation The central difference can be defined as Write the equation with different grid sizes

Richardson Extrapolation Expand the terms:

Richardson Extrapolation Multiply eqn [2] by 4 and subtract eqn [1] from it.

Richardson Extrapolation The equation can be rewritten as: It can be rewritten in the form

Richardson Extrapolation The technique can be extrapolated to include the higher order error elimination by using a finer grid.

Richardson Extrapolation Example The function is given: Find the first derivative at x=1.25 using a central difference scheme and Dh = 0.25. The exact solution:

Richardson Extrapolation Example The data points are: The derivatives using central difference

Richardson Extrapolation Example The results of the central difference scheme are: The Richardson Extrapolation uses these results to find a better solution

Summary Finite Difference Techniques Error Calculation Taylor Series Lagrange Polynomials Error Calculation

Summary Finite Difference Techniques Forward Difference Scheme Backward Difference Scheme Central Difference Scheme

Homework Check the Homework webpage