CSE 541 - Differentiation Roger Crawfis.

Slides:



Advertisements
Similar presentations
DERIVATIVES 3. DERIVATIVES In this chapter, we begin our study of differential calculus.  This is concerned with how one quantity changes in relation.
Advertisements

THE DERIVATIVE AND THE TANGENT LINE PROBLEM
Difference Quotient (4 step method of slope) Also known as: (Definition of Limit), and (Increment definition of derivative) f ’(x) = lim f(x+h) – f(x)
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
Numerical Computation
Lecture 2: Numerical Differentiation. Derivative as a gradient
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.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
2.4 Rates of Change and Tangent Lines
The Secant-Line Calculation of the Derivative
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Chapter 2 Section 2 The Derivative!. Definition The derivative of a function f(x) at x = a is defined as f’(a) = lim f(a+h) – f(a) h->0 h Given that a.
Numerical Methods on Partial Differential Equation Md. Mashiur Rahman Department of Physics University of Chittagong Laplace Equation.
Lecture 2 Number Representation and accuracy
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
1.6 – Tangent Lines and Slopes Slope of Secant Line Slope of Tangent Line Equation of Tangent Line Equation of Normal Line Slope of Tangent =
CSE Differentiation Roger Crawfis Prepaid by:
AP Calculus AB/BC 3.2 Differentiability, p. 109 Day 1.
§3.2 – The Derivative Function October 2, 2015.
Section 2.1 – Average and Instantaneous Velocity.
§3.1 – Tangent Lines, Velocity, Rate of Change October 1, 2015.
Index FAQ The derivative as the slope of the tangent line (at a point)
Gradients & Curves On a straight line the gradient remains constant, however with curves the gradient changes continually, and the gradient at any point.
Ch. 2 – Limits and Continuity 2.4 – Rates of Change and Tangent Lines.
INTEGRALS 5. INTEGRALS In Chapter 3, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.
1. Definition of Derivative
Calculus Section 3.1 Calculate the derivative of a function using the limit definition Recall: The slope of a line is given by the formula m = y 2 – y.
Calculating Derivatives From first principles!. 2.1 The Derivative as a Limit See the gsp demo demodemo Let P be any point on the graph of the function.
Machine arithmetic and associated errors Introduction to error analysis Class II.
CALCULUS AND ANALYTIC GEOMETRY CS 001 LECTURE 03.
NUMERICAL DIFFERENTIATION Forward Difference Formula
Ch. 2 – Limits and Continuity
1.1 A Preview of Calculus What is Calculus????????????????????
ME 142 Engineering Computation I
Table of Contents 9. Section 3.1 Definition of Derivative.
Warm Up a) What is the average rate of change from x = -2 to x = 2? b) What is the average rate of change over the interval [1, 4]? c) Approximate y’(2).
MTH1150 Tangents and Their Slopes
Ch. 11 – Limits and an Introduction to Calculus
Section 11.3A Introduction to Derivatives
5.3 The Fundamental Theorem of Calculus
Applied Numerical Methods
Machine arithmetic and associated errors Introduction to error analysis (cont.) Class III.
Section 12.3.
Warm-Up: October 2, 2017 Find the slope of at.
Taylor series in numerical computations (review)
3.2 Differentiability, p. 109 Day 1
Definition of the Derivative
Bell-Ringer.
Class Notes 18: Numerical Methods (1/2)
CSE Differentiation Roger Crawfis.
THE DERIVATIVE AND THE TANGENT LINE PROBLEM
Tangent Lines and Derivatives
Tangent line to a curve Definition: line that passes through a given point and has a slope that is the same as the.
Tangent line to a curve Definition: line that passes through a given point and has a slope that is the same as the.
Taylor’s Theorem: Error Analysis for Series
f(a+h) Slope of the line = Average Rate of Change = f(a+h) – f(a) h
Section 2.1 – Average and Instantaneous Velocity
MATH 174: NUMERICAL ANALYSIS I
30 – Instantaneous Rate of Change No Calculator
CIS 541 – Numerical Methods
Limits and Continuity A BRIEF PREVIEW OF CALCULUS: TANGENT LINES AND THE LENGTH OF A CURVE 1.2 THE CONCEPT OF LIMIT 1.3 COMPUTATION OF LIMITS 1.4.
What is a limit?.
The derivative as the slope of the tangent line
The Fundamental Theorems of Calculus
Differentiation from first principles
Unit 2 - Derivatives.
Difference Quotient (4 step method of slope)
Differentiation from first principles
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

CSE 541 - Differentiation Roger Crawfis

Numerical Differentiation The mathematical definition: Can also be thought of as the tangent line. x x+h December 9, 2018 OSU/CIS 541

Numerical Differentiation We can not calculate the limit as h goes to zero, so we need to approximate it. Apply directly for a non-zero h leads to the slope of the secant curve. x x+h December 9, 2018 OSU/CIS 541

Numerical Differentiation This is called Forward Differences and can be derived using Taylor’s Series: Theoretically speaking December 9, 2018 OSU/CIS 541

Truncation Errors Let f(x) = a+e, and f(x+h) = a+f. Then, as h approaches zero, e<<a and f<<a. With limited precision on our computer, our representation of f(x)  a  f(x+h). We can easily get a random round-off bit as the most significant digit in the subtraction. Dividing by h, leads to a very wrong answer for f’(x). December 9, 2018 OSU/CIS 541

Error Tradeoff Using a smaller step size reduces truncation error. However, it increases the round-off error. Trade off/diminishing returns occurs: Always think and test! Point of diminishing returns Total error Log error Round off error Truncation error Log step size December 9, 2018 OSU/CIS 541

Numerical Differentiation This formula favors (or biases towards) the right-hand side of the curve. Why not use the left? x-h x x+h December 9, 2018 OSU/CIS 541

Numerical Differentiation This leads to the Backward Differences formula. December 9, 2018 OSU/CIS 541

Numerical Differentiation Can we do better? Let’s average the two: This is called the Central Difference formula. Forward difference Backward difference December 9, 2018 OSU/CIS 541

Central Differences This formula does not seem very good. It does not follow the calculus formula. It takes the slope of the secant with width 2h. The actual point we are interested in is not even evaluated. x x+h x-h December 9, 2018 OSU/CIS 541

Numerical Differentiation Is this any better? Let’s use Taylor’s Series to examine the error: December 9, 2018 OSU/CIS 541

Central Differences The central differences formula has much better convergence. Approaches the derivative as h2 goes to zero!! December 9, 2018 OSU/CIS 541

Warning Still have truncation error problem. Consider the case of: Build a table with smaller values of h. What about large values of h for this function? December 9, 2018 OSU/CIS 541

Partial Derivatives Remember: Nothing special about partial derivatives: December 9, 2018 OSU/CIS 541

Calculating the Gradient For lab 2, you need to calculate the gradient. Just use central differences for each partial derivative. Remember to normalize it (divide by its length). December 9, 2018 OSU/CIS 541