Last time: | Next time: |
Today:
And Aaron, I need a little help with your executable. I was going to run some tests, and had trouble getting it to run under my Windows....
Today's new topic is "splines".
Make sure! I just had a bad feeling later, when I wrote it down myself to do some work and put ....
Let me point out the first error that I can recall finding in the text, p. 176:
...think of not as a set but as some specific but unknown quantity such that is bounded as .
Upshot for secant method: even though its order of convergence is lower than Newton's, the routine may run in about the same time as Newton's (depends on the problem, of course).
Notice the increasing powers of . Clearly there's a risk that the coefficients will be of vastly different magnitudes, which could cause severe roundoff errors. This is one of the problems with this formulation.
Many of you may have used this notion to find the coefficients of your Muller quadratic. The problem is one of solving three equations in three unknowns; and since the equations are linear, we have a linear system to solve. More generally:
I want to remind you about and emphasize the relationship between the divided differences and the derivatives of .
It's going to be important here in a bit, so take a peek at the result at the bottom of p. 219:
In particular, we want to consider a case where we compute the divided difference , which is actually undefined if we think of it as a ratio of difference -- but this formula allows us to think of it as the appropriate derivative evaluated at , so we define it so:
, since it must be between the minimum and maximum of -- not much wiggle room!
Today I want to discuss splines.
We use splines to fit data points. The name "spline" comes from a tool used in design, to make pleasing curves go through prescribed constraints. I've brought a spline in to show you....
We used to use tables more than we generally do today. In the old days, if you needed the sine of an angle that wasn't in the table, then you would use neighboring values to determine the proper table value desired. We can think of this as our objective today: you need the value of sine between two points (and don't have a calculator handy).
Often cubic splines are used. These cubics allow us to fit four things, and what we fit depends on our objective. Today I want to talk about Hermite cubics, which fit two points and the slopes at those two points.
I can think of several ways of approaching the fitting of this data with the Hermite interpolant. How might you go about it?
You might not be surprised to learn that about the easiest formulation is Newton's, only we're going to repeat some abscissa:
Since we'll need this over and over, we should go ahead and simplify those divided difference coefficients, using the assumption that is known (use the recurrence relation at the top of p. 215 to do so).
This will have the effect of fitting the two endpoints, and the derivatives of at the two endpoints.
I'd like to discuss my implementation of this in Mathematica.
What error are we making when we use Hermite interpolation? Proposition 5.6 gives us the answer:
which is equal to a derivatives times some stuff:
where is some unknown number between the minimum and maximum of .
While my Hermite spline does the job (approximating Sine for all real numbers), one might do the same job with Taylor polynomials.