From charlesreid1

Background

When might we need to evaluate an integral with data?

Numerical routine to integrate two functions and find a centroid - Magrab p. 154 (uses quadc() routine)

Expectations:

  • Answers with complete sentences
  • Some analytical work, some numerical work
  • Final answers in report!
  • Plot/chart to answer question

PowerPoint Problem Setup

Explanation of numerical integration background, equation derivation

Cover the questions

Cover strategy, writing out what to do before implementing, how to implement in a spreadsheet

Spend a day working in a computer lab

Worksheet Content

Simpson's Rule to approximate the integral of a function,

$ I = int_{a}^{b} f(x) dx $

We can approximate this by splitting up the interval into sub-intervals, constructing strips, and approximating the area of each strip

Left Hand, Right Hand, and Midpoint Rules

Chapter 5, first introduction to integration: we explored the left-hand, right-hand, and midpoint rules.

These use a constant function. 1 parameter, 1 function evaluation.

Trapezoid Rule

Trapezoid rule: extends the technique by approximating with a line. 2 parameters, 2 function evaluations. 1 rectangle strip.

$ A = \Delta x \left( \frac{1}{2} y_0 + y_1 + y_2 + \dots + y_{N-1} + \frac{1}{2} y_{N} \right) $

Recurrence relation:

$ A_j = A_{j-1} + \frac{\Delta x}{2} \left( y_{j-1} + y_{j} \right) $

Simpson's Rule

Simpson's Rule: extension to quadratic polynomial approximation. 3 parameters, 3 function evaluations. 2 rectangle strips.

For the simplest case of two intervals, Simpson's Rule is given by:

$ A = \Delta x \left( \frac{1}{3} y_0 + \frac{4}{3} y_1 + \frac{1}{3} y_2 \right) $

Combining these expressions for a large number of intervals, we can get a general expression for Simpson's Rule:

$ A = \Delta x \left( \frac{1}{3} y_0 + \frac{4}{3} y_1 + \frac{2}{3} y_2 + \frac{4}{3} y_3 + \dots + \frac{4}{3} y_{2k-1} + \frac{2}{3} y_{2k} + \dots + \frac{4}{3} y_{N-3} + \frac{2}{3} y_{N-2} + \frac{4}{3}y_{N-1} + \frac{1}{3} y_{N} \right) $

Similarly, a recurrence relation that's easier to program is:

$ A_{2n} = A_{2(n-1)} + \Delta x \left( \frac{1}{3} y_{2n-2} + \frac[4}{3} y_{2n-1} + \frac{1}{3} y_{2n} \right) $

To approximate the total area, simply sum all of the $ A_i $ terms.