Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Similar presentations


Presentation on theme: "Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display."— Presentation transcript:

1 Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

2 Concepts From Calculus Two fundamental operations: – Differentiation – Integration Differentiation: finding the rate of change (derivative) relative to a variable Integration: summing rates of change over an interval We will illustrate with linear position, velocity, and acceleration of a particle Engineering Computation: An Introduction Using MATLAB and Excel

3 Linear Motion Consider this particle (note: in mechanics, the term particle does not relate to size. A particle is simply a body for which we can neglect rotational motions. With this definition, a car or even a planet can be considered a particle). It moves along a straight line. Its position is measured from some reference point. Engineering Computation: An Introduction Using MATLAB and Excel x

4 Linear Motion As the particle moves a distance Δx during a time period Δt, we say that the average rate of change of the position is Δx /Δt The velocity, the instantaneous rate of change, is found by taking the limit as Δt approaches zero: Engineering Computation: An Introduction Using MATLAB and Excel x ΔxΔx

5 Linear Motion We say that the velocity is the derivative of position with respect to time Similarly, the acceleration of the particle is the instantaneous rate of change of velocity, or acceleration is the derivative of velocity with respect to time: Engineering Computation: An Introduction Using MATLAB and Excel

6 Linear Motion Now let’s work the other way: if we know that our speed over a period of time, can we determine how far we have gone? Start with the equation for velocity: This can be rewritten as: Engineering Computation: An Introduction Using MATLAB and Excel

7 Linear Motion So over a very small period of time dt, the change of position dx will be the velocity times dt To get the change of position over a larger time interval, we sum (integrate) v times dt for all of the small time intervals: Engineering Computation: An Introduction Using MATLAB and Excel

8 Graphical Interpretations Consider position x plotted vs. time t The change in x divided by the change in t is the average rate of change over that time interval: Engineering Computation: An Introduction Using MATLAB and Excel ΔtΔt ΔxΔx

9 Graphical Interpretations As the interval time becomes infinitesimally small, the rate of change becomes the slope of the curve at a specific point in time Engineering Computation: An Introduction Using MATLAB and Excel t Slope = derivative of x with respect to t

10 Graphical Interpretations Now consider a graph of velocity vs time The change in position over a small time interval dt is v times dt Engineering Computation: An Introduction Using MATLAB and Excel dt v

11 Graphical Interpretations The change in position is the sum of these small areas – the integral of velocity over the time interval Engineering Computation: An Introduction Using MATLAB and Excel t1t1 t2t2

12 Graphical Interpretations The derivative of a function is the slope of the curve of that function at a particular point The integral of a function is the area under the curve of that function for a given interval Engineering Computation: An Introduction Using MATLAB and Excel

13 Derivatives of Polynomials In calculus classes, you have learned (or will learn) how to differentiate many types of functions Polynomials are simplest to differentiate: for each term, reduce the exponent of the variable by one, and modify the term by the original exponent Example: Engineering Computation: An Introduction Using MATLAB and Excel

14 Integrals of Polynomials To integrate a polynomial, reverse the process: for each term, add one to the exponent of the variable and divide the term by the new exponent Note the constant term C that must be added. This term will depend on a boundary condition Engineering Computation: An Introduction Using MATLAB and Excel

15 Definite Integrals The previous integral, with no limits given, is called an indefinite integral, a general solution When upper and lower limits are defined, this is classed a definite integral To evaluate a definite integral, substitute the upper and lower limits into the general solution and subtract the value at the lower limit from that of the upper limit Engineering Computation: An Introduction Using MATLAB and Excel

16 Definite Integrals Example: Note that the constant C was ignored, its value at the lower limit is the same as at the upper limit, and so is cancelled in the subtraction Engineering Computation: An Introduction Using MATLAB and Excel

17 Numerical Integration We can get an approximate value of a definite integral of any function with a numerical approach The key is to remember that the value of the integral is simply the area under the function’s curve Engineering Computation: An Introduction Using MATLAB and Excel

18 Numerical Integration Here is the area under the curve for our example, The total area is 16 (units depend on the units of x and y) Engineering Computation: An Introduction Using MATLAB and Excel

19 Numerical Integration Consider the two values of x shown here. To find the area under the curve between these two points, we will approximate this portion of the curve with a straight line segment Engineering Computation: An Introduction Using MATLAB and Excel

20 Numerical Integration A trapezoidal area is formed: Engineering Computation: An Introduction Using MATLAB and Excel

21 Numerical Integration Example We will use four intervals of x, each one unit wide Values of y at the interval endpoints: Engineering Computation: An Introduction Using MATLAB and Excel y = -3 y = 24 y = 9 y = 0

22 Numerical Integration Example Engineering Computation: An Introduction Using MATLAB and Excel Areas: Sum = 18

23 Numerical Integration Example Engineering Computation: An Introduction Using MATLAB and Excel Notice that our trapezoids over estimate the positive area and under estimate the negative areas

24 Numerical Integration Example Engineering Computation: An Introduction Using MATLAB and Excel Using more intervals improves the accuracy: Sum = 16.5

25 Numerical Integration Example Engineering Computation: An Introduction Using MATLAB and Excel How do we know when we have used enough intervals? (Assuming that we don’t know the exact answer, which is probably why we are using a numerical solution) Try more intervals until the solution converges to a value This makes a MATLAB solution a good choice – we can change the number of intervals easily


Download ppt "Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display."

Similar presentations


Ads by Google