Numerical Differentiation UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under.

Slides:



Advertisements
Similar presentations
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
Advertisements

Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Numerical Computation
High Accuracy Differentiation Formulas
Lecture 18 - Numerical Differentiation
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Trees UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Lecture 2: Numerical Differentiation. Derivative as a gradient
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.
4.2 The Mean Value Theorem.
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.
Solving ODEs UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Derivatives and Differential Equations
Numerical Differentiation
Numerical Integration UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Solving Linear Equations UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Debugging UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Time Complexity UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Regression UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Cell Arrays UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Consider the following: Now, use the reciprocal function and tangent line to get an approximation. Lecture 31 – Approximating Functions
Recursion and Induction UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
Question from Test 1 Liquid drains into a tank at the rate 21e-3t units per minute. If the tank starts empty and can hold 6 units, at what time will it.
Today in Calculus Go over homework Derivatives by limit definition Power rule and constant rules for derivatives Homework.
MECN 3500 Lecture 4 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
6/3/2016 Perkins AP Calculus AB Day 10 Section 4.4.
Warm Up – NO CALCULATOR Let f(x) = x2 – 2x.
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
CSE Differentiation Roger Crawfis Prepaid by:
Sorting UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Script Files UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
IEEE Arithmetic UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Chap. 11 Numerical Differentiation and Integration
Searching UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Struct Arrays UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Polynomials UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Basics of Matlab UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Intro to Simulink April 15, Copyright , Andy Packard. This work is licensed under the Creative Commons.
Aim: How do we find the derivative by limit process? Do Now: Find the slope of the secant line in terms of x and h. y x (x, f(x)) (x + h, f(x + h)) h.
Root Finding UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Get/Set Methods UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Intro to Simulink Modified by Gary Balas 20 Feb 2011 Copyright , Andy Packard. This work is licensed under.
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
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.
4.2 The Mean Value Theorem.
NUMERICAL DIFFERENTIATION Forward Difference Formula
High Accuracy Differentiation Formulas
For/Switch/While/Try UC Berkeley Fall 2004, E77 me
The taylor series and Numerical Differentiation
Numerical Differentiation
Interpolation.
Sec:4.1 THE TAYLOR SERIES.
Class Notes 18: Numerical Methods (1/2)
Class Info E177 January 22, me. berkeley
Chapter 23.
Sec:4.3 Total Numerical Error.
Numerical Differentiation Chapter 23
Copyright © Cengage Learning. All rights reserved.
The taylor series and Numerical Differentiation
MATH 174: NUMERICAL ANALYSIS I
Function Handles UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
Section 4.2 Mean Value Theorem.
Presentation transcript:

Numerical Differentiation UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Differentiation For a function f, the derivative of f at x is defined as the limit The “derivative of f at x” is the slope of the graph of the function at x.

Numerical Differentiation A common manner to numerically estimate of the derivative is a “finite-difference” of the quotient The forward difference at x with stepsize h (h>0) is The backward difference at x with stepsize h (h>0) is The centered difference at x with stepsize h (h>0) is No limit, just a “ fixed ”, nonzero h

Numerical Differentiation If the function values are only available as data pairs With each y i = f(x i ), then the finite differences are computed with the data (assuming the x i are sorted)

What are we actually computing? Average values: If g is integrable, then the average value of g over the interval [a,b] is defined as In other words, is the constant which satisfies ie., the only constant function which has the same integral over [a,b] as does g is the constant function whose value is

What are we actually computing? If f is differentiable, then If a≠b, then Average value of f ’ over the interval (a,b)

What are we computing? (cont’d) Mean-Value Theorem: If f is –differentiable on (a,b) –continuous on [a,b] then there is an y  (a,b) such that

What are we computing? (cont’d) This gives two interpretations of the finite-difference Average value of f ’ over the interval (a,b) exact value of f ’ at some point in interval (a,b)

What are we computing? (cont’d) So, two interpretations of the finite-difference Average value of f ’ over the interval (x,x+h)

Bounding the Errors The second derivative of f gives how “quickly” the first derivative is changing. Bound the error between the finite difference estimate and the actual derivative using –finite difference is the exact answer for some intermediate value –intermediate first-derivative values differ because of 2 nd derivative. –use Taylor series to bound the error as Error between finite difference and actual derivative

Higher Order derivatives Use the finite difference estimates of the 1 st derivative to “compute” the 2 nd derivative, based on Example: Use backward formula, with forward derivatives

Matlab functions There’s not much in the way of functions for numerical differentiation. Essentially, you employ the expressions we introduced today. If X is a row vector, then diff(X) returns [X(2)-X(1) X(3)-X(2) … X(end)-X(end-1)] Given row vectors Xdata, Ydata (each 1-by-N) Z = diff(Ydata)./diff(Xdata) Z is 1-by-(N-1). Element Z(i) is the forward derivative at X(i)