Last time | Next time |
The worst confusion is between continuity (connectedness) and differentiability (smoothness).
But that assumes that we have a function. What if you just have data?
I've created a worksheet that we can use to take a first crack at this problem: let's take a look at that first.
The first Mathematica file describes the problem of trying to use linear functions on panels of four points, and then solves the first page of your worksheet. It will help us to check our math!
Fubini's theorem is particularly useful when you have a function $f(x,y)$ to work with. In this case you'll have a linear function to integrate, which is about as easy as it gets.
The swimming pool depth data of problem #6, section 15.1, has us starting at this more primitive level -- without a function.
So let's go back there for a moment, and I want to start by thinking more generally about discrete approximations to partial derivatives. Dustin came by last Friday to ask me some questions about estimating $f_{xy}$; several others have asked the same thing. I told Dustin that one good way of thinking about partial derivatives comes by thinking about their discretization, and that it would tie in well with my objective of extending integration methods.
This is the theme of that other half of the worksheet. Let's take a look at that now.
We want to think about extending the trapezoidal rule. We'll see how Mathematica might work with that swimming pool data, and we'll derive one of their methods. Then we'll think about how to do integration on discrete data.
In particular it's useful to think in terms of masks. For example, let's revisit the idea of using simple methods:
Any individual "rectangular method" would use the a 4x6 matrix mask,
1 | 1 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 1 |
1 | 2 | 2 | 2 | 2 | 2 | 1 |
2 | 4 | 4 | 4 | 4 | 4 | 2 |
2 | 4 | 4 | 4 | 4 | 4 | 2 |
2 | 4 | 4 | 4 | 4 | 4 | 2 |
1 | 2 | 2 | 2 | 2 | 2 | 1 |
We'll see that we get the same thing by using even quadratic functions on the grid. This is a simple generalization of the trapezoidal rule.
By the way, one author (and mathematician) had this to say about generalizing univariate methods beyond two dimensions:
"In more than two dimensions, generalizations of quadrature rules are not practical, since the number of function evaluations needed to attain sufficient accuracy grows very rapidly as the number of dimensions increases. An alternative is the Monte Carlo method, which samples the integrand at $n$ randomly selected points and attempts to compute the mean value of the integrand on the entire domain. The method converges rather slowly but its convergence rate depends only on $n$, not the number of dimensions."
But that author was evidently not thinking about the need to do integrals on discrete data, not generated by a function. That's a little different issue, because we can't refine the mesh by taking more function values -- it is what it is.
We'll do some examples from section 15.2, then see how to do integrals on more general regions (probably next time).