38
Integration

Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Embed Size (px)

Citation preview

Page 1: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

Page 2: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

Problem:

• An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem may be to determine the number of particles that entered in the first second.

Page 3: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

Problem:

• An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem may be to determine the number of particles that entered in the first second.

dttdt

dNN

1

0

1

Page 4: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• Integration is an important in Physics. • used to determine the rate of growth in

bacteria or to find the distance given the velocity (s = ∫vdt) as well as many other uses.

• The most familiar practical (probably the 1st usage) use of integration is to calculate the area.

Page 5: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• Generally we use formulae to determine the integral of a function:

• F(x) can be found if its antiderivative, f(x) is known.

aFbFdxxfb

a

Page 6: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• when the antiderivative is unknown we are required to determine f(x) numerically.

Page 7: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• when the antiderivative is unknown we are required to determine f(x) numerically.

• To determine the definite integral we find the area between the curve and the x-axis.

• This is the principle of numerical integration.

Page 8: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• The traditional way to find the area is to divide the ‘area’ into boxes and count the number of boxes or quadrilaterals.

Page 9: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• One simple way to find the area is to integrate using midpoints.

Page 10: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

Figure shows the area under a curve using the midpoints

Page 11: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• One simple way to find the area is to integrate using midpoints.

• The midpoint rule uses a Riemann sum where the subinterval representatives are the midpoints of the subintervals.

• For some functions it may be easy to choose a partition that more closely approximates the definite integral using midpoints.

Page 12: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• The integral of the function is approximated by a summation of the strips or boxes.

• where

n

ii

iin

ii

b

a

xxx

fxxfdxxfi

1

1

1

*

2

1 ii xxx

Page 13: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• Practically this is dividing the interval (a, b) into vertical strips and adding the area of these strips.

Figure shows the area under a curve using the midpoints

Page 14: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• The width of the strips is often made equal but this is not always required.

Page 15: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Integration

• There are various integration methods: Trapezoid, Simpson’s, Milne, Gaussian Quadrature for example.

• We’ll be looking in detail at the Trapezoid and variants of the Simpson’s method.

Page 16: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

Page 17: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• is an improvement on the midpoint implementation.

Page 18: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• is an improvement on the midpoint implementation.

• the midpoints is inaccurate in that there are pieces of the “boxes” above and below the curve (over and under estimates).

Page 19: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• Instead the curve is approximated using a sequence of straight lines, “slanted” to match the curve.

fi

fi+1

Page 20: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• By doing this we approximate the curve by a polynomial of degree-1.

Page 21: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• Clearly the area of one rectangular strip from xi to xi+1 is given by

iiii xxff 11 I 1...

Page 22: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• Clearly the area of one rectangular strip from xi to xi+1 is given by

• Generally is used. h is the width of a strip.

iiii xxff 11 I

) x- (x ½ h i1i

1...

Page 23: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• The composite Trapezium rule is obtained by applying the equation .1 over all the intervals of interest.

Page 24: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• The composite Trapezium rule is obtained by applying the equation .1 over all the intervals of interest.

• Thus,

,if the interval h is the same for each strip.

n1-n2102 f 2f 2f 2f f I h

Page 25: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• Note that each internal point is counted and therefore has a weight h, while end points are counted once and have a weight of h/2.

)f 2f

2f 2f (fdx xf

n1-n

2102

x

x

n

0

h

Page 26: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• Given the data in the following table use the trapezoid rule to estimate the integral from x = 1.8 to x = 3.4. The data in the table are for ex and the true value is 23.9144.

Page 27: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Trapezoidal Rule

• As an exercise show that the approximation given by the trapezium rule gives 23.9944.

Page 28: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

Page 29: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The midpoint rule was first improved upon by the trapezium rule.

Page 30: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The midpoint rule was first improved upon by the trapezium rule.

• A further improvement is the Simpson's rule.

Page 31: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The midpoint rule was first improved upon by the trapezium rule.

• A further improvement is the Simpson's rule.

• Instead of approximating the curve by a straight line, we approximate it by a quadratic or cubic function.

Page 32: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• Diagram showing approximation using Simpson’s Rule.

Page 33: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• There are two variations of the rule: Simpson’s 1/3 rule and Simpson’s 3/8 rule.

Page 34: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The formula for the Simpson’s 1/3,

n1-n32103

x

x

f 4f 4f 2f 4f fdx xfn

0

h

Page 35: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The integration is over pairs of intervals and requires that total number of intervals be even of the total number of points N be odd.

Page 36: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• The formula for the Simpson’s 3/8,

n1-n321083

x

x

f 3f 2f 3f 3f fdx xfn

0

h

Page 37: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• If the number of strips is divisible by three we can use the 3/8 rule.

Page 38: Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem

Simpson’s Rule

• http://metric.ma.ic.ac.uk/integration/techniques/definite/numerical-methods/exploration/index.html#