Welcome! Log In Create A New Profile

Advanced

Ideas for "Is f(x) a cubic spline"

Posted by lhristov 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Ideas for "Is f(x) a cubic spline"
April 28, 2011 03:51PM
Does anyone know how to approach questions like: is f(x) a cubic spline. Show necessary calculations? This is from 2008 exam paper.

[Edit]
Are we looking to show that f(x) = f1(x) for the boundary value of 2, and also show that the first and second derivatives are equal?
If that is the case then this isn't a spline since the function values aren't equal though the derivatives are?

[Edited2] can't post a new message.
Thanks slow_eddy. The question is:
f(x) = 11 ? 24x + 18x^2 ? 4x^3, for x [1;2]
f(x) = ?54 + 72x ? 30x^2 + 4x^3, for x [2;3]

It just seems to me that for 6 marks question showing the value for f and the derivatives is very little work
avatar Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 04:06PM
Just off the top of my head, I suppose first thing is:

"Is f(x) a piecewise defined function whose pieces are all cubic (or lower) polynomials?"

If all the pieces are indeed cubic polynomials, then you can ask where for each of these matches the condition f(xi)= yi

If one of them fails, it can't be a cubic spline interpolation between the points (due to not being one on some point); if f matches, you move on to check the derivative, second derivative ... I need to go and look at the book, because I see I've missed "point 2" == something to do with plain f, before one gets to the derivatives.

Perhaps supply a bit more data from the question? I seem to have lost a helleva lot of my old stuff somewhere.

»edit« Ye gads!! I double click "Tuts233" and I find I'm back at the point where I chickened out of The Rime of the Ancient Mariner:
...
Her lips were red, her looks were free,
Her locks were yellow as gold:
Her skin was as white as leprosy,
...
(Spooky part of the ghost story where the old perv is checking out this hot chick, and suddenly he sees she's actually Death's squeeza.)

I seem to have some problem with my filesystem here.
avatar Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 06:32PM
Ha! Found something like it in the 2009 paper (which was in another directory). OK. So we have two cubic polynomials. Tick that off.

My idea of meeting "condition 1" doesn't quite work, because there are no data points shown to which the supposed splines should fit. The way to deal with that, I suppose, is to say that the points would be whatever points these curves happen to pass through at their knots and endpoints.

Right. So now take x = 2. Feed it into the first equation, feed it to the second equation. If you get the same f value, it's possible that you have splines here. (Though surely to say "Yes" we'd have to have yi to examine for "condition 1 compliance"winking smiley.

Take f'(x), and do x = 2 similarly to above.

Take f''(x), and ditto, mutatis mutandis.

How does that sound to you? What important point have I missed. (Rather tell me what I've done wrong than what I've done right, eh?).
Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 08:34PM
Ja, I asked the same question of the lecturer - her response was:

"Correct! The function values plus the two first derivatives have to be continuous at the joint point so the fact that the derivatives don’t give the same value is enough for it not to be a (cubic) spline.

Regards, ER
---------------------------------------------
Dr E Rapoo"

[EDIT]

To elaborate:
1) Make sure f(x) is continuous on the joint
2) Determine if the first derivatives are the same

She said this was enough to determine whether f(x) formed a cubic spline.
avatar Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 09:54PM
Okie dokie. Well then maybe I shouldn't be back here with my "fussy reading" of the relevant paragraphs then. Basically it seems to me that it's not ("fussily"winking smiley possible to establish that these equations are a cubic spline.

The test of continuity on the knot is basically taking "condition 2" and applying it. Without some given yi "condition 1" doesn't stand a chance.

"Condition 2" compares gi (the label of "this" piece of curve) to gi+1 (the label on the next piece of curve), each applied to the same x value, xi+1, where the two would meet if they were continous. Obviously there's going to be a discontinuity if they don't give the exact same value. In that case one would be able to prove these were not cubic splines...

... and so on...

But I think I'll keep any mention of this down to a minimum in such a question in the exam, because I'm pretty sure the purpose of the exam would be to test if you understood what the "knot idea" was, not whether you'd found some logical hair to split.

So basically we've got this one reasonably well, eh?

To round off nicely, they must meet (continuity), and furthermore they must have the same slope on that itsy little point where they collide. There must not be one line heading skyward sharply up from an incoming line heading downward in the direction of Hell. To manage that trick we need equal derivatives just on that point. What the lines do with themselves thereafter is their own cubic business.

And then finally (and this is why we're using cubics instead of quadratics --- to get enough further derivatives to pretty things up like this) they should have the same curvature/ concavity where they meet.

What will it be? Just concavity properties? (Both concave up, perhaps ... sounds wrong) ... Anyone care to say what happens to the curvature when you specify that second derivatives are equal?
Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 10:02PM
I think the whole point of a cubic spline is the smoothness of the interpolating polynomial. Its much better than a quadratic.

I've got no idea what it means if the second derivatives are equal - have you checked to see whether the second derivatives on a joint of a cubic spline are equal?
avatar Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 10:20PM
I'll go and look at the Calculus I book, then. Look at "condition 4" re: your second point.

... Cough!! Cough!! This dust!!...

Second derivative's sign tells you the concavity of the curve. Negative is downward, positive is up.

Change from one to another and you have an inflection point ...

So zero would do ON the point. A negative value from one side and a positive value from the other side ON the point would be like unto a discontinuity, though. It would mean that at that same point this graph is both concave up and concave down.

To get the smoothness you need the concavity condition? Otherwise for a split second your curve is "stiff" (just like it is on its ends if you take the natural spline assumption when solving the matrix).

Is a second derivative of large magnitude "very curvy", I wonder?

A first derivative of large magnitude is "very steep", so I should imagine the magnitudes matter to some extent. Not that this is directly relevant here....
Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 10:22PM
Thanks guys, that's very helpful
Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 10:24PM
Oh yes I remember this second derivative vs concavity property. I saw this somewhere but it wasn't Calculus 1. Will do some googling. It's probably where it turned up in my hunting around.
avatar Re: Ideas for "Is f(x) a cubic spline"
April 28, 2011 10:44PM
There's something like a problem with the number of points here?

Looking more closely at the conditions in the text book I see they only apply to "inner" points. The last point in is point xn-2. Now if we count from zero along the points the intervals suggest (at least in the 2009 paper, which had just two equations), we get 0-->1 1-->2 2-->3. And "point xn-2" would be x0, right?

Is the condition vacuously met or something? "There is no real n-2nd point, so the last conditions don't come into it?" That sounds ridiculous to me. What am I missing here? Dang! Thought I had it all neat and explained.

«Edit» All the last 3 conditions relate to xi+1. So then that means the last point to which the conditions apply is xn-2+1 = xn-1 = x1 = 2(in this case). Eish! Isn't that nice and contorted?

Anyway what it means is that you run right up to the last point that is a knot, as you'd expect. For some reason the subscripts just don't say so nice and simply like that.
Sorry, only registered users may post in this forum.

Click here to login