Numerical Computation

Slides:



Advertisements
Similar presentations
Interpolation A standard idea in interpolation now is to find a polynomial pn(x) of degree n (or less) that assumes the given values; thus (1) We call.
Advertisements

Computational Modeling for Engineering MECN 6040
Computational Methods in Physics PHYS 3437
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
CISE301_Topic61 SE301: Numerical Methods Topic 6 Numerical Differentiation Lecture 23 KFUPM Read Chapter 23, Sections 1-2.
EE3561_Unit 6(c)AL-DHAIFALLAH14351 EE 3561 : Computational Methods Unit 6 Numerical Differentiation Dr. Mujahed AlDhaifallah ( Term 342)
NUMERICAL DIFFERENTIATION AND INTEGRATION
High Accuracy Differentiation Formulas
Today’s class Romberg integration Gauss quadrature Numerical Methods
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Lecture 18 - Numerical Differentiation
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
1 Part 3 Truncation Errors (Supplement). 2 Error Propagation How errors in numbers can propagate through mathematical functions? That is, what's the effect.
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.
Part 3 Truncation Errors.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 5 Approximations, Errors and The Taylor Series.
Dr. Jie Zou PHY Chapter 7 Numerical Differentiation: 1 Lecture (I) 1 Ref: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 23 Numerical Differentiation.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Numerical solution of Differential and Integral Equations PSCi702 October 19, 2005.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
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.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
Truncation Error and the Taylor Series
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University 1 Chapter 1 Mathematical.
Homework questions thus far??? Section 4.10? 5.1? 5.2?
Now that you’ve found a polynomial to approximate your function, how good is your polynomial? Find the 6 th degree Maclaurin polynomial for For what values.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
10/27/ Differentiation-Continuous Functions Computer Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
CSE Differentiation Roger Crawfis Prepaid by:
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
Today’s class Numerical Differentiation Finite Difference Methods Numerical Methods Lecture 14 Prof. Jinbo Bi CSE, UConn 1.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Sensitivity derivatives Can obtain sensitivity derivatives of structural response at several levels Finite difference sensitivity (section 7.1) Analytical.
Engineering Analysis – Computational Fluid Dynamics –
Chap. 11 Numerical Differentiation and Integration
The Convergence Problem Recall that the nth Taylor polynomial for a function f about x = x o has the property that its value and the values of its first.
In this section we develop general methods for finding power series representations. Suppose that f (x) is represented by a power series centered at.
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
1 Approximation. 2 Taylor Series 3 Truncation Error  In general, the nth order Taylor series expansion will be exact for an nth order polynomial  In.
Errors in Numerical Methods
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
NUMERICAL DIFFERENTIATION or DIFFERENCE APPROXIMATION Used to evaluate derivatives of a function using the functional values at grid points. They are.
Infinite Series 9 Copyright © Cengage Learning. All rights reserved.
1 Numerical Differentiation. 2  First order derivatives  High order derivatives  Examples.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
High Accuracy Differentiation Formulas
Finite Difference Methods
Differentiation-Continuous Functions
Interpolation.
Numerical Solutions of Ordinary Differential Equations
CSE Differentiation Roger Crawfis.
Question Find the derivative of Sol..
Chapter 23.
Sec:4.3 Total Numerical Error.
Numerical differentiation
Sec 21: Analysis of the Euler Method
SKTN 2393 Numerical Methods for Nuclear Engineers
Romberg Rule of Integration
Numerical Computation and Optimization
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Numerical Computation Lecture 15: Approximating Derivatives United International College

Last Time During the last class period we covered: Bezier Curves and Surfaces Readings: Class Slides Due Tomorrow: Bezier Surface Programming Assignment Questions?

Today We will cover: Numerical Approximations to Derivatives Readings: Pav, Chapter 7 Homework due on Friday !!

Derivatives The derivative represents the rate of change of a dependent variable y (= f(x) ) with respect to an independent variable x. (derivative = f '(x) ) Example: For f(x) = sin(x) , we have f '(1)= cos(1) For computational algorithms, we can seldom find the exact value of f '(x) as this involves symbolic calculations, so we have to estimate the value of f '(x).

Numerical Estimates of f’(x) There are three basic ways to estimate derivatives: Forward finite divided difference Backward finite divided difference Center finite divided difference All based on the Taylor Series Another form of this result is the following, where is some point between x and h.

Numerical Estimates of f’(x) Rearranging this last equation gives We will estimate the derivative by dropping the last term. If we can bound the second derivative by some constant, then this last term is O(h) and we get

Forward Divided Difference Formula for f’(x) Thus, This formula is called the first forward divided difference formula and the error in this formula is of order O(h). The error in this approximation is due to truncation of the last term (the second derivative term).

Forward Divided Difference Formula for f’(x) The truncation error can be made small by making h small. However, as h gets smaller, precision will be lost in this equation due to subtractive cancellation. The error in calculation for small h is called roundoff error. Generally the roundoff error will increase as h decreases.

Forward Divided Difference Formula for f’(x) Forward difference True derivative Approximation h x x -h x x +h

Backward Divided Difference Formula for f’(x) Backward difference True derivative Approximation h x x -h x x +h

Backward Divided Difference Formula for f’(x) Solving for f’(x) gives: Or, This is called the Backward Divided Difference Formula for f’(x).

Centered Divided Difference Formula for f’(x) Consider the Taylor series expansions for the forward and backward approximations, extended to the degree 3 terms: If we subtract these two and solve for f’(x) we get:

Centered Divided Difference Formula for f’(x) If f’’’ is continuous, we can find a bound on f’’’ and we get the centered divided difference formula: Note: Since the error is O(h2), this is a better approximation than the forward or backward approximations!

Centered Divided Difference Formula for f’(x) Centered difference True derivative Approximation 2h x x -h x x +h

f(x) f(x) x x f(x) f(x) x x forward finite divided difference approx. true derivative x x f(x) f(x) backward finite divided difference approx. centered finite divided difference approx. x x

Divided Difference Formula for f’’(x) Consider the Taylor series expansions for the forward and backward approximations, extended to the degree 4 terms: If we add these two and solve for f’’(x) we get:

Richardson Extrapolation Formula Recall: The forward difference formula for f’(x) had error O(h), while the centered difference formula had error O(h2). Can we do better? Consider again the Taylor expansions: Let Then,

Richardson Extrapolation Formula Also, We can use and to get: Note: This approximation for f’(x) has error of O(h4)!!

Ex19.2: Richardson Extrapolation Richardson Extrapolation Example We will use the extrapolation method above on the central difference approximation to estimate the first derivative of at x = 0.5 with h = 0.5 and 0.25 (exact sol. = -0.9125)

Ex19.2: Richardson Extrapolation General Richardson Extrapolation We can use the Richardson method to increase the accuracy of numerical estimates to any series-based quantity. Suppose we want to calculate some quantity L and have found, through theory, an approximation to L: Let

Ex19.2: Richardson Extrapolation General Richardson Extrapolation Define: Theorem: (Richardson Extrapolation). There are constants akm such that Proof: By induction. (Skipped) Corollary:

Ex19.2: Richardson Extrapolation General Richardson Extrapolation Example: Consider f(x) = arctan(x). Suppose we want to find . Let and start with h = 0.01 Then, we compute D(n,m) in a pyramid fashion (as we did for Newton’s divided differences). The first column is just Class Exercise: Verify that these values are correct. Best Approximation is D(2,2) = 0.333333333333313 Actual Answer is ?

Ex19.2: Richardson Extrapolation General Richardson Extrapolation Example: Consider f(x) = arctan(x). What if we just used smaller and smaller values of h?

Ex19.2: Richardson Extrapolation General Richardson Extrapolation Example: The graph has values of h along the bottom and total error (truncation + roundoff) on the vertical axis. What can you conclude from this graph?