Chapter 3 Differentiation and Integration

Similar documents
OPTIMISATION. Introduction Single Variable Unconstrained Optimisation Multivariable Unconstrained Optimisation Linear Programming

Lecture 2 Solution of Nonlinear Equations ( Root Finding Problems )

NUMERICAL DIFFERENTIATION

Shuai Dong. Isaac Newton. Gottfried Leibniz

36.1 Why is it important to be able to find roots to systems of equations? Up to this point, we have discussed how to find the solution to

CHAPTER 4d. ROOTS OF EQUATIONS

: Numerical Analysis Topic 2: Solution of Nonlinear Equations Lectures 5-11:

Single Variable Optimization

Lecture 13 APPROXIMATION OF SECOMD ORDER DERIVATIVES

ORDINARY DIFFERENTIAL EQUATIONS EULER S METHOD

Summary with Examples for Root finding Methods -Bisection -Newton Raphson -Secant

Complex Variables. Chapter 18 Integration in the Complex Plane. March 12, 2013 Lecturer: Shih-Yuan Chen

Work is the change in energy of a system (neglecting heat transfer). To examine what could

CISE301: Numerical Methods Topic 2: Solution of Nonlinear Equations

Chapter Twelve. Integration. We now turn our attention to the idea of an integral in dimensions higher than one. Consider a real-valued function f : D

Numerical Methods Solution of Nonlinear Equations

Numerical Differentiation

Inductance Calculation for Conductors of Arbitrary Shape

Spring Force and Power

Finite Difference Method

One-sided finite-difference approximations suitable for use with Richardson extrapolation

Errors for Linear Systems

Physics 2A Chapter 3 HW Solutions

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

Note 10. Modeling and Simulation of Dynamic Systems

Foundations of Arithmetic

Review of Taylor Series. Read Section 1.2

Difference Equations

A Tale of Friction Basic Rollercoaster Physics. Fahrenheit Rollercoaster, Hershey, PA max height = 121 ft max speed = 58 mph

Kernel Methods and SVMs Extension

Mathematical Economics MEMF e ME. Filomena Garcia. Topic 2 Calculus

2 Finite difference basics

Integrals and Invariants of Euler-Lagrange Equations

Nice plotting of proteins II

EE 330 Lecture 24. Small Signal Analysis Small Signal Analysis of BJT Amplifier

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

A new Approach for Solving Linear Ordinary Differential Equations

Chapter 10. Numerical Solution Methods for Engineering Analysis

University of Washington Department of Chemistry Chemistry 452/456 Summer Quarter 2014

Endogenous timing in a mixed oligopoly consisting of a single public firm and foreign competitors. Abstract

CSci 6974 and ECSE 6966 Math. Tech. for Vision, Graphics and Robotics Lecture 21, April 17, 2006 Estimating A Plane Homography

Lecture 2: Numerical Methods for Differentiations and Integrations

Advanced Circuits Topics - Part 1 by Dr. Colton (Fall 2017)

Integrals and Invariants of

Probability Theory. The nth coefficient of the Taylor series of f(k), expanded around k = 0, gives the nth moment of x as ( ik) n n!

Numerical Heat and Mass Transfer

Canonical transformations

6.3.4 Modified Euler s method of integration

Solution Thermodynamics

The KMO Method for Solving Non-homogenous, m th Order Differential Equations

A Simple Research of Divisor Graphs

PHYSICS 203-NYA-05 MECHANICS

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

CS 331 DESIGN AND ANALYSIS OF ALGORITHMS DYNAMIC PROGRAMMING. Dr. Daisy Tang

Chapter 5 Function-based Monte Carlo

Solution of Linear System of Equations and Matrix Inversion Gauss Seidel Iteration Method

General Tips on How to Do Well in Physics Exams. 1. Establish a good habit in keeping track of your steps. For example, when you use the equation

1 Matrix representations of canonical matrices

Force = F Piston area = A

Consistency & Convergence

Physics 2A Chapters 6 - Work & Energy Fall 2017

Polynomial Regression Models

Moments of Inertia. and reminds us of the analogous equation for linear momentum p= mv, which is of the form. The kinetic energy of the body is.

( ) [ ( k) ( k) ( x) ( ) ( ) ( ) [ ] ξ [ ] [ ] [ ] ( )( ) i ( ) ( )( ) 2! ( ) = ( ) 3 Interpolation. Polynomial Approximation.

SENSITIVITY APPROACH TO OPTIMAL CONTROL FOR AFFINE NONLINEAR DISCRETE-TIME SYSTEMS

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

More metrics on cartesian products

ME 501A Seminar in Engineering Analysis Page 1

Root Finding

Restricted divisor sums

Linear Feature Engineering 11

PHYS 1443 Section 004 Lecture #12 Thursday, Oct. 2, 2014

ADVANCED MACHINE LEARNING ADVANCED MACHINE LEARNING

Physics 5153 Classical Mechanics. Principle of Virtual Work-1

Math1110 (Spring 2009) Prelim 3 - Solutions

Physics 5153 Classical Mechanics. D Alembert s Principle and The Lagrangian-1

P A = (P P + P )A = P (I P T (P P ))A = P (A P T (P P )A) Hence if we let E = P T (P P A), We have that

Lecture 12: Discrete Laplacian

ONE-DIMENSIONAL COLLISIONS

EEE 241: Linear Systems

Solutions to Problem Set 6

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

Section 8.3 Polar Form of Complex Numbers

12. The Hamilton-Jacobi Equation Michael Fowler

ECEN 5005 Crystals, Nanocrystals and Device Applications Class 19 Group Theory For Crystals

Global Sensitivity. Tuesday 20 th February, 2018

Numerical Methods. ME Mechanical Lab I. Mechanical Engineering ME Lab I

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

Formal solvers of the RT equation

Chapter Newton s Method

Module 14: THE INTEGRAL Exploring Calculus

Lecture 10 Support Vector Machines II

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Unit 5: Quadratic Equations & Functions

Chapter - 2. Distribution System Power Flow Analysis

8.323 Relativistic Quantum Field Theory I

Four Bar Linkages in Two Dimensions. A link has fixed length and is joined to other links and also possibly to a fixed point.

Chapter 7: Conservation of Energy

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Solutions to Homework 7, Mathematics 1. 1 x. (arccos x) (arccos x) 1

Transcription:

MEE07 Computer Modelng Technques n Engneerng Chapter Derentaton and Integraton Reerence: An Introducton to Numercal Computatons, nd edton, S. yakowtz and F. zdarovsky, Mawell/Macmllan, 990. Derentaton and ntegraton are the two basc processes o calculus. One or both o these processes wll generally be encountered n applcatons where models are descrbed n terms o rates. In prncple, t s always possble to determne an analytc orm o a dervatve or a gven uncton. In some cases, however, the analytc orm s very complcated, and a numercal appromaton o the dervatve may be sucent or our purposes. For unctons whch are descrbed only n terms o tabulated data, numercal derentaton s the only means o computng a dervatve. Numercal ntegraton s used to ntegrate tabulated unctons or to ntegrate unctons whose ntegrals are ether mpossble or very dcult to obtan analytcally.. Numercal Derentaton One approach to numercal derentaton s to t a curve wth a smple orm to the uncton, and then to derentate the curve-t uncton. For eample, the polynomal or splne methods can be used to t a curve to tabulated data or the uncton, and the resultng polynomal or splne can then be derentated. Another approach s to obtan an appromaton o a dervatve drectly n terms o the uncton values. The resultng epresson or the appromaton s known as a derence ormular. Such ormulars are especally useul or solvng derental equatons and may be derved ether rom curve ttng or rom the Taylor seres... Derence Formulas The Taylor seres epanson or a uncton s [(h/! (d / d + (h /! (d /d + L] ( + h ( + (.a We can also wrte the Taylor seres wth a remander term R n+ as (h /! (d / d + (h /! (d I dx +... (h' ln! (d' ld" (.b + + ( h (X + + Rn+

MEE07 Computer Modelng Technques n Engneerng n whch the remander term s gven by n+ n+ ( h [ n + ] d ( n+ ( d R ; ξ + h (.c n+! ξ The error that occurs when the Taylor seres s truncated mmedately ater the term contanng the n-th dervatve s R n+ and s sad to be o order h n+ or 0(h n+. Smple derence ormulas may be obtaned by truncatng the Taylor seres ater -- the rst dervatve term. That s, by wrtng ( ± h ( ± h ( + 0(h ( d (/d (.d we obtan the appromatons Forward Derence: [ ( + h ]/ h O( ( + h (. Backward Derence: [ ( h ]/ h O( ( + h (. The ormulas n Eqs. (. ans (. have truncaton error o order h and are epressed n terms o two uncton values. Hgher-order appromatons may be derved by usng addtonal uncton values. For eample, we use Roman superscrpts to denote the dervatves o the uncton at and wrte epansons or two uncton values as ( + h ( + h + h + h + ( h / + (4h / + O( h + O( h (.4 (.5 We then elmnate the second dervatve term and solve or to obtan [ + 4 ( + h ( + h ]/[ h] O( h ( + (.6 A smlar second-order ormula n terms o (, ( h, and ( h s [ 4 ( h + ( h ]/[ h] O( h ( + (.7

MEE07 Computer Modelng Technques n Engneerng Another way to obtan hgher-order ormulas s to recognze that the sgns n the terms o the Taylor seres epansons or ( + h and ( - h can produce cancellatons. Thus we wrte ( + h ( h + h h + ( h + ( h / / + O( h + O( h (.8 (.9 Subtracton gves the rst-dervatve ormula Central Derence: [ ( + h ( h ]/[ h] O( h ( + (.0 Addton o the epansons or ( + h and ( - h through the thrd-dervatve terms gves a central-derence ormula or the second dervatve as ( [ ( h + ( + h ]/ h + O( h (. The ormulas nvolvng three uncton values have been derved so ar wth constant spacng h between the values. The Taylor seres approach can also be used wth unequal spacng as llustrated n the ollowng eample. Eample. A partcle crosses three sensors whch are spaced at ntervals o 0.m. Measurements o the tme to travel rom sensor to sensor and rom sensor to sensor are 0.0550s and 0.0554s, respectvely. Estmate the speed and acceleraton o the partcle as t crosses the second sensor. Let denote poston, let t denote tme, and let subscrpts denote the sensors. Then Speed at sensor d / dt at tme t ; Acceleraton at sensor d / dt at tme t From Eqs. (.b and (.c, we have epansons about t : 0.0550 ( d/dt + ( 0.0550 / ( d / dt + O ( 0.0550 + 0.0554 ( d/dt + ( 0.0554 / ( d / dt + O ( 0.0554

MEE07 Computer Modelng Technques n Engneerng We neglect the remander terms and solve the resultng lnear equatons by Cramer s rule to obtan the estmate: where v d/dt [( ( 0.0554 / ( ( 0.0550 / ] / D; a d /dt [( ( -0.0550 ( ( 0.0554 ] / D; D -( 0.0550 ( 0.0554 (0.0554 + 0.0550 / ; -0.m; 0.m The results are Speed v 5.4495m/s; acceleraton a -0.7460m/s The estmates or the speed and acceleraton n Eample. could have been ound ( to a slghtly derent level o accuracy by derentaton wth respect to. The procedures are shown n Eample.. Eample. Repeat eample. by usng dervatves wth respect to poston. v d / dt / ( dt / d. From the central-derence ormula o Eq. (.0, v / [( t t / ( ] 5.478m/s a dv / dt ( dv / d ( d / dt v ( dv / d. Thus a v [( v v / ( ] We compute v and v rom Eq. (.4 and (.5 as ollows : v / [ ( -t + 4t t / ( ] 5.474456m/s v / [(t 4t + t / ( ] 5.95685m/s Then a v ( 5.95685 5.474456 / ( 0.6-0.7489m/s The computaton o partal dervatves s the same s or ordnary dervatves when derentaton s wth respect to only one varable. For cross dervatves such as [ /( y], we may derve buld ormulars rom the Taylor seres or several varables, or we may buld up the dervatve rom one-varable orms. For eample, we may use the central-derence ormular to obtan 4

MEE07 Computer Modelng Technques n Engneerng (, y /( y [ (, y / ] / y {[ ( +, y + y (, y + y] /( [ ( +, y + y ( +, y y]/( }/( y (.. Numercal Integraton Integrals arse when we wsh to determne the change n a quantty y whose rate o change wth respect to another varable s descrbed as a uncton (. I we have a relaton dy / d (. the change n y rom y a at equal to a to y b at equal to b s b y b ya d (.4 The relaton n Eq.(. s a smple orm o an ordnary derental equaton. Its soluton s descrbed by the dente ntegral n Eq.(.4. The ntegraton process s a summaton process. We may thnk o the quantty [(d] as the area o a rectangle wth heght ( and wth an nntesmally small wdth d. The dente ntegral n Eq. (. s the same o all such areas or values rom a to b. Numercal ntegraton methods are used when ( s dcult or mpossble to ntegrate analytcally, or when ( s gven as a set o tabulated values... The Trapezodal Rule Consder a uncton ( as vares rom to +. I we use Lagrange nterpolaton to appromate the uncton rom ( to ( by the straght lne [ ] [ ], +, + [( ( ] ( + [( ( ] ( + + + + (.4 and we ntegrate the appromate uncton analytcally, we obtan [ ][ ( ( / d + + + ] + (.5 5

MEE07 Computer Modelng Technques n Engneerng The appromaton gven n Eq. (.5 s known as the trapezodal rule because the rght sde s the area o a trapezod wth base equal to ( + - and parallel sdes equal to ( and ( + as shown n Fg... A smplstc use o the trapezodal rule to evaluate ntegrals o the orm n Eq. (. s as ollows. Dvde the nterval rom a to b nto n subntervals by choosng values 0 through n, that satsy a 0 < < < n- < n b The ponts should he chosen so that the part o the curve ( between and + can be appromated well by a straght lne. Then we have a b d n 0 + d n { [ + ][ ( + ( + ]/ } 0 (.6 Fg.. Illustraton o the trapezodal rule The result gven by Eq. (.6 does not contan any mechansm or controllng the accuracy o the appromaton. It should thereore be used only or quck, normal estmates, or when eperence allows the user to choose the control ponts wth good spacngs, or when ( s descrbed by data values at speced control ponts. Applcatons o the trapezodal rule to obtan estmates that are controlled by a crteron depend on equal spacngs between control ponts and +. I we have equal spacngs, the appromaton n Eq. 6. may be rewrtten as I a d ( / [ ( 0 + ( n ] + [ + ( + L + ( n ] (.7 b 6

MEE07 Computer Modelng Technques n Engneerng The rst term on the rght-hand sde s the trapezodal rule appromaton wth only the end ponts as the control ponts. We begn wth ths term as the ntal estmate o the ntegral I. Then we repeatedly rene our estmate by addng more control ponts at the mdponts o estng ntervals untl successve estmates show no sgncant change. An llustraton o the process through two renements s shown n Fg... For any renement r (greater than zero, the spacng r s equal to ( r- /, the number k o new control ponts s equal to r-, and the new control ponts are located at m- ( a + [m ] r ; m,,, k (.8 Fg.. Rened estmates o an ntegral wth the trapezod rule. The quantty ε n the trapezodal rule pseudo code s used to end the renement process when the change n the estmate o I becomes sucently small. The quantty r na s used to lmt the number o renements n case ε s chosen to be unrealstcally small. In general, the applcaton that we have descrbed s best used or ntervals onwhch the values o the ntegrand ( are ether all nonnegatve or all non-postve. I we observe ths restrcton, we can change the termnaton crteron to one n whch the magntude o I becomes smaller than a small racton o the magntude o I. Ths racton can be based easly on the precson level o the machne and s not as arbtrary as the choce o the quantty ε. 7

MEE07 Computer Modelng Technques n Engneerng I we do not observe the restrcton on the uncton values, we should specy a mnmum number o renements; otherwse, the renement loop may be termnated too quckly and may produce an ncorrect result. For eample, consder the ntegrand ( e - sn and ntegraton lmts a, equal to 0 and b equal to π. Because ( s zero at a, and at b and also at ( a + b /, the estmates I 0 and I wll both be zero and wll cause premature termnaton o the process. To overcome that problem, we should ether specy a mnmum number o renements or splt the ntegral nto two ntegrals rom 0 to π and rom π to π... Smpson's Rule An obvous way to mprove the appromaton o an ntegral s to use a better model or the ntegrand (. One attempt at a better model s to use a quadratc nstead o a lnear appromaton. A Lagrange nterpolatng polynomal through the ponts [, ( ], [ +, ( + ], and [ +, ( + ] provdes a quadratc appromaton. When the spacngs ( + and ( + - + are chosen to be equal, analytcal ntegraton o the appromatng quadratc yelds Smpson's rule: + d [ + ][ ( + 4 ( + + ( + ]/ 6 (.9 As wth the trapezodal rule, we may apply Smpson s rules n a smplstc way to ntegrals o the orm n Eq. (.4 by dvdng the nterval rom a to b nto an even number o subntervals. We do so by choosng control ponts 0 through j that satsy a+0<< <Xj-<jb The Smpson's rule appromaton o the ntegral s then; b a d j p 0 p+ p d j { [ p+ p ][ ( p + 4 ( p+ + ( p+ ]/ 6} p 0 (.0 8