Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.

- swissgirl

Is anyone familiar with Cubic splines?

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your **free** account and access **expert** answers to this

and **thousands** of other questions.

Get your **free** account and access **expert** answers to this and **thousands** of other questions

- swissgirl

Is anyone familiar with Cubic splines?

- jamiebookeater

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your **free** account and access **expert** answers to this

and **thousands** of other questions

- swissgirl

I tottally dont follow cubic splines maybe someone can explain the concept a little

- anonymous

I never covered the topic too deeply in any of my courses, but I can offer a bit of explanation:
A spline is used to fit a function to data. Your data behaves poorly (for whatever reason), but you'd still like to be able to make a continuous assumption out of it. So, one way is to fit lines to the data points. However, linear splines don't work all that well, because you can't differentiate at the points. Quadratics are similar, except you cannot determine concavity (the second derivative) at your points. So, the ideal polynomial is a cubic, which allows you to retain continuity, differentiability, and curvature.
I guess that's kind of a brief explanation. Do you have any specific questions?

- swissgirl

I understand like the general concept I guess but I am stuck on the process. I went thru alot on google and its quite confusing I cldnt exactly follow

Looking for something else?

Not the answer you are looking for? Search for more explanations.

- anonymous

Well, you first need 3 points at the minimum. I'm only going to explain it given three points, because adding more points makes it much more computationally painful:
You have 3 points: x1, x2, and x3. You want to fit a cubic from x1 to x2. Similarly, you want to fit a cubic from x2 to x3. So, you'll have something like:
S1(x) = a1 + b1x + c1x^2 + d1x^3 and
S2(x) = a2 + b2x + c2x^3 + d2x^4
S1 is your cubic from x1 to x2 and S2 is your cubic from x2 to x3. Now, the idea is to find those coefficients. You have 8 unknowns, so you'll have 8 equations at the minimum.
Are you following so far?

- swissgirl

Yes

- anonymous

Okay, now you want to define those 8 equations. The first four come straight from the definition:
y1 = S1(x1) = a1 + b1x1 + c1x1^2 + d1x1^3
y2 = S1(x2) = a1 + b1x2 + c1x2^2 + d1x2^3
y2 = S2(x2) = a2 + b2x2 + c2x2^2 + d2x2^3
y3 = S2(x3) = a2 + b2x3 + c2x3^2 + d2x3^3
Okay. So, for your cubic to fit properly, it should work on the endpoints of the cubic, correct? So, your first cubic (S1) should work for x1 and x2, and your second cubic (S2) should work for x2 and x3. Does that make sense?

- swissgirl

okkkkkkk

- anonymous

That doesn't sound like a very concrete reply. Are you sure you understand? I can draw a picture (hopefully) if that will help.

- swissgirl

hahah I get it. I just had to read it a few times. Now I get it lol

- anonymous

Okay. Remember, you know (x1,y1); (x2,y2); and (x3,y3). You're solving for the abcd's. So, now, we need 4 more equations to be able to determine our coefficients. So, let's look at the first derivative. If we take the first derivative of S1 at x2, it should equal the first derivative of S2 at x2, right?
Similarly, for the second derivative. So, now you have:
S1'(x2) = b1 + 2c1x2 + 3d1x2^2 = b2 + 2c2x2 + 3d2x2^2 = S2'(x2)
and
S1''(x2) = 2c1 + 6d1x2 = 2c2 + 6d2x2 = S2''(x2)
So, there's two more equations. Two left to go.
I can draw a picture for this one too if you don't quite see it.

- swissgirl

OKKKKKKK I am getting it soo far
btw did u ever come across this before or u just researched this?

- anonymous

I took an undergraduate course in mathematical modeling as one of my math electives. So, it was mostly taught and I had to solve problems (however, I used a computer program to solve them usually).
Okay, now for the last two equations, you don't have much left to look at except the endpoints. The last two equations come from how you want your polynomial to behave after (or before) the endpoints. The two common ones (I think there's more) are natural and clamped. Natural allows the endpoints to be free, going in whatever direction the cubic would go if no restrictions were placed on that point. Clamped forces the endpoints to maintain a certain direction. You can research the different methods if you want and when to use them, but I'm going to go with natural (I find it the easiest and I prefer it the most). So, for natural:
S1''(x1) = 2c1 + 6d1x1 = 0
and
S2''(x3) = 2c2 + 6d2x3 = 0
So, from definition of second derivative, this is neither concave up or concave down at the endpoints, which allows your line to continue to move in a (temporarily) "straight" direction, acting as it naturally would.
If that makes sense, I'll generalize it a bit afterwards.

- swissgirl

No i got it

- swissgirl

at least i think i do :)

- anonymous

Okay. So, can you tell me how many unknowns you would have if you had 4 points?

- swissgirl

12

- anonymous

Great. So, how many would you have of the first set of equations? And how many of the second set? And, then, finally the third? (By that, I mean the way I broke it up in my explanations into three pieces.)

- swissgirl

First equation we will have 6

- swissgirl

Or in other words S_1,S_2 and S_3

- anonymous

Correct. Unless you have any more questions, I think you have a pretty good understanding of it.

- swissgirl

Thannkkssss I realllllyyy appreciiiatteeeee youuuurrr heellpppp.

- swissgirl

I was stuck on it all day and you have thanfully pretty much removed my confusion :)

- anonymous

You're welcome.

Looking for something else?

Not the answer you are looking for? Search for more explanations.