10/27/2015 1 Differentiation-Continuous Functions Computer Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.

Slides:



Advertisements
Similar presentations
Numerical Methods Lecture 14 Differentiation-Continuous Functions
Advertisements

5/1/ Finite Difference Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Civil Engineering Majors Author(s): Autar Kaw, Jai Paul
Romberg Rule of Integration
Differentiation-Discrete Functions
Major: All Engineering Majors Author(s): Autar Kaw
7/2/ Differentiation-Discrete Functions Industrial Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
7/2/ Backward Divided Difference Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati
8/8/ Euler Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
8/15/ Differentiation-Discrete Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
8/15/ Differentiation-Continuous Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
8/15/ Binary Representation Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons
8/30/ Secant Method Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
9/14/ Trapezoidal Rule of Integration Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
Newton-Raphson Method
9/20/ Secant Method Civil Engineering Majors Authors: Autar Kaw, Jai Paul
10/8/ Propagation of Errors Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons
10/11/ Differentiation-Discrete Functions Chemical Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
1 Lagrangian Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
10/21/ Bisection Method Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Newton-Raphson Method Chemical Engineering Majors Authors: Autar Kaw, Jai Paul Transforming Numerical Methods Education.
5/30/ Runge 4 th Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
11/16/ Euler Method Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
11/17/ Shooting Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
11/30/ Secant Method Industrial Engineering Majors Authors: Autar Kaw, Jai Paul
11/30/ Romberg Rule of Integration Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
12/1/ Trapezoidal Rule of Integration Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
1 Direct Method of Interpolation Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Gaussian Elimination Industrial Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
Gaussian Elimination Mechanical Engineering Majors Author(s): Autar Kaw Transforming Numerical Methods Education for.
1/19/ Runge 4 th Order Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
1/29/ Bisection Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
2/2/ Secant Method Electrical Engineering Majors Authors: Autar Kaw, Jai Paul
Newton-Raphson Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul Transforming Numerical Methods Education.
3/7/ Bisection Method Electrical Engineering Majors Authors: Autar Kaw, Jai Paul
3/12/ Trapezoidal Rule of Integration Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
3/20/ Trapezoidal Rule of Integration Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Autar Kaw Benjamin Rigsby Transforming Numerical Methods Education for STEM Undergraduates.
6/13/ Secant Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
Differentiation – Continuous Functions. Forward Difference Approximation 2 f  x  Δx   f  x  Δx lim Δx  0 f  x   For a finite 'Δx' (we can not.
Trapezoidal Rule of Integration
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
Differentiation-Discrete Functions
Differentiation-Continuous Functions
Differentiation-Discrete Functions
Central Divided Difference
Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Spline Interpolation Method
Direct Method of Interpolation
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Newton-Raphson Method
Trapezoidal Rule of Integration
Trapezoidal Rule of Integration
Newton-Raphson Method
Forward Divided Difference
Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
Simpson’s 1/3rd Rule of Integration
Simpson’s 1/3rd Rule of Integration
Simpson’s 1/3rd Rule of Integration
Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
Forward Divided Difference
Romberg Rule of Integration
Mechanical Engineering Majors Authors: Autar Kaw, Jai Paul
Romberg Rule of Integration
Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Industrial Engineering Majors Authors: Autar Kaw, Jai Paul
Differentiation-Discrete Functions
Major: All Engineering Majors Authors: Autar Kaw, Jai Paul
Presentation transcript:

10/27/ Differentiation-Continuous Functions Computer Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati Transforming Numerical Methods Education for STEM Undergraduates

Differentiation – Continuous Functions

3 Forward Difference Approximation For a finite

Figure 1 Graphical Representation of forward difference approximation of first derivative. Graphical Representation Of Forward Difference Approximation

5 Example 1 There is strong evidence that the first level of processing what we see is done in the retina. It involves detecting something called edges or positions of transitions from dark to bright or bright to dark points in images. These points usually coincide with boundaries of objects. To model the edges, derivatives of functions such as need to be found. a)Use forward divided difference approximation of the first derivative of to calculate its derivative at for. Use a step size of. Also calculate the absolute relative true error. b)Repeat the procedure from part (a) with the same data except choose. Does the estimate of the derivative increase or decrease? Also calculate the relative true error.

6 Example 1 Cont. Solution:

7 Example 1 Cont. The exact value ofcan be calculated by differentiating as

8 Knowing that Example 1 Cont. we find

9 The absolute relative true error is Example 1 Cont.

10 Example 1 Cont. b)

11 Example 1 Cont.

12 The absolute relative true error is The estimate of the derivative decreased. Example 1 Cont.

Backward Difference Approximation of the First Derivative We know For a finite, Ifis chosen as a negative number,

Backward Difference Approximation of the First Derivative Cont. This is a backward difference approximation as you are taking a point backward from x. To find the value of at, we may choose another point behind as. This gives where

x x-Δx x f(x) Figure 2 Graphical Representation of backward difference approximation of first derivative Backward Difference Approximation of the First Derivative Cont.

16 Example 2 There is strong evidence that the first level of processing what we see is done in the retina. It involves detecting something called edges or positions of transitions from dark to bright or bright to dark points in images. These points usually coincide with boundaries of objects. To model the edges, derivatives of functions such as need to be found. a)Use backward divided difference approximation of the first derivative of to calculate its derivative at for. Use a step size of. Also calculate the absolute relative true error. b)Repeat the procedure from part (a) with the same data except choose. Does the estimate of the derivative increase or decrease? Also calculate the relative true error.

17 Example 2 Cont. Solution a)

18 Example 2 Cont.

19 The absolute relative true error is Example 2 Cont.

20 b) Example 2 Cont.

21 The absolute relative true error is The estimate of the derivative decreased. Example 2 Cont.

Derive the forward difference approximation from Taylor series Taylor’s theorem says that if you know the value of a functionat a point and all its derivatives at that point, provided the derivatives are continuous betweenand, then Substituting for convenience

Derive the forward difference approximation from Taylor series Cont. Theterm shows that the error in the approximation is of the order ofCan you now derive from Taylor series theformula forbackward divided difference approximation of the first derivative? As shown above, both forward and backward divideddifference approximation of the firstderivative are accurate on the order of Can we get better approximations? Yes, another method to approximate the first derivative is called the Central difference approximation of the first derivative.

Derive the forward difference approximation from Taylor series Cont. From Taylor series Subtracting equation (2) from equation (1)

Central Divided Difference Hence showing that we have obtained a more accurate formula as the error is of the order of. x f(x) x-Δx x x+Δx Figure 3 Graphical Representation of central difference approximation of first derivative

du 26 Example 3 There is strong evidence that the first level of processing what we see is done in the retina. It involves detecting something called edges or positions of transitions from dark to bright or bright to dark points in images. These points usually coincide with boundaries of objects. To model the edges, derivatives of functions such as need to be found. a)Use central divided difference approximation of the first derivative of to calculate its derivative at for. Use a step size of. Also calculate the absolute relative true error. b)Repeat the procedure from part (a) with the same data except choose. Does the estimate of the derivative increase or decrease? Also calculate the relative true error.

du 27 Example 3 cont. Solution a)

du 28 Example 3 cont.

du 29 Example 3 cont. The absolute relative true error is

du 30 Example 3 cont. b)

du 31 Example 3 cont. The absolute relative true error is The results from the three difference approximations are given in Table 1.

du 32 Comparision Type of Difference Approximation Forward Backward Central Table 1 Summary of using different divided difference approximations

Finding the value of the derivative within a prespecified tolerance In real life, one would not know the exact value of the derivative – so how would one know how accurately they have found the value of the derivative. A simple way would be to start with a step size and keep on halving the step size and keep on halving the step size until the absolute relative approximate error is within a pre-specified tolerance. Take the example of findingfor at using the backward divided difference scheme.

Finding the value of the derivative within a prespecified tolerance Cont. Given in Table 2 are the values obtained using the backward difference approximation method and the corresponding absolute relative approximate errors. Table 2 First derivative approximations and relative errors for different Δt values of backward difference scheme

Finding the value of the derivative within a prespecified tolerance Cont. From the above table, one can see that the absolute relative approximate error decreases as the step size is reduced. At the absolute relative approximate error is %, meaning that at least 2 significant digits are correct in the answer.

Finite Difference Approximation of Higher Derivatives One can use Taylor series to approximate a higher order derivative. For example, to approximate, the Taylor series for where

Finite Difference Approximation of Higher Derivatives Cont. Subtracting 2 times equation (4) from equation (3) gives (5)

Example 4 The velocity of a rocket is given by Use forward difference approximation of the second derivative of to calculate the jerk at. Use a step size of.

Example 4 Cont. Solution

Example 4 Cont.

Example 4 Cont. The exact value ofcan be calculated by differentiating twice as and

Example 4 Cont. Knowing that and

Example 4 Cont. The absolute relative true error is Similarly it can be shown that

Higher order accuracy of higher order derivatives The formula given by equation (5) is a forward difference approximation of the second derivative and has the error of the order of. Can we get a formula that has a better accuracy? We can get the central difference approximation of the second derivative. The Taylor series for where (6)

Higher order accuracy of higher order derivatives Cont. where (7) Adding equations (6) and (7), gives

Example 5 The velocity of a rocket is given by Use central difference approximation of second derivative of to calculate the jerk at. Use a step size of.

Example 5 Cont. Solution

Example 5 Cont.

Example 5 Cont. The absolute relative true error is

Additional Resources For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit dif.html

THE END