Last time: | Next time: |
Today:
Some spoke of Mathematica, but didn't share the code -- why not?
Notice the line on p. 65 -- If b is positive.... We use one formula for one root, and the other formula for the second root.
We need to be selective.
Let's have a look at my Muller's method in Mathematica.
I'd hoped that you would be making initial guesses, and computing the next best approximation. It almost never happened. For example,
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....
We're getting close to wrapping up interpolation. We'll finish it on Thursday. Today's new topic (that I hope to get to) is "splines".
We saw easy it was to interpolate points using Newton's interpolating polynomial -- you simply add an additional term higher-order term, based on divided differences, to an existing interpolator.
Question for recall: how do we use Newton's method to interpolate three points?
I also emphasized that Horner's rule (just before section 5.6.2) is the proper way to evaluate polynomials. We might occasionally explore them in other forms, but to evaluate them we use Horner's telescoping notation.
You have to be careful that you're not deceived by the form of the expression to the right. Every function is not polynomial -- that's not what it's saying. All the interesting stuff is buried in that Greek letter "xi".
A hint for part b: logs of products
An important observation is made about the computation of these polynomials. It is the introduction of Horner's rule (or method).
This is generally how all polynomials should be evaluated.
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:
Today I want to begin a discussion of 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.
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. Here's the picture.
Other methods are, of course, possible. Some popular splines include "natural" and "clamped" cubic splines. These achieve other objectives.
I can think of several ways of approaching the fitting of this data with the Hermite interpolant. How might you go about it?