cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

cspline

ValeryOchkov
24-Ruby IV

cspline

Has somebody Mathcad sheet which return coefficient a, b, c and d of the equations y=a*x^3+b*x^2+c*x+d of the cspline?

1 ACCEPTED SOLUTION

Accepted Solutions

I have this version.

koeff cspline.JPG

View solution in original post

8 REPLIES 8

In the good old Mathsoft days we were offered "The Mathcad Treasury" and there Paul Lorczak shed some light on the meaning of the vector produced by "cspline". Unfortunately at the time I have no access to the Treasury but as a long time Mathcad user you probably have it lying (3 1/2 " disks !!) around in a drawer. Find it and look up "Computational insights_Think before you spline" or maybe "Cubic splines and alternative curve fitting techniques" - not sure.

Chances are that you will find the information, you are looking for, right there.

According to the Mathcad documentation (yes folks, there were times when Mathcad would come with a good solid user guide and complete reference) the vector created by cspline contains, among other things, the second derivatives for the spline curve(s).

 

You'll consider this cheating, but we can work backwards from the spline mathcad produces.  Probably not what you want, but you do get the coefficients.  Here - I let MC do the fit, take 100 points along each segment and create a fit for each segment.  Seems to work. Attached is the file, along with another that seems to imitate lspline quite well.

2018-03-24_13-55-09.jpg

Werner_E
24-Ruby V
(To:DJF)


@DJF wrote:

You'll consider this cheating, but we can work backwards from the spline mathcad produces.

Its sure cheating, but its a very clever cheat 😉

After playing around with your sheet and knowing that the vector created by cspline contains the second derivatives, it was quite easy to derive the coefficients directly from that vector:

Bild.png

DJF
16-Pearl
16-Pearl
(To:Werner_E)

Here is a non-cheating version (i.e. never using cspline). Bit crude but seems to work. See: 

https://www.researchgate.net/publication/236029592_Cubic_spline_interpolation_using_Mathcad 

for a good paper on how cspline, pspline and lspline work.

4.0 and pdf attached.

 

I have this version.

koeff cspline.JPG

Thanks Valery!

But solution without animation is not solution!

14-13-koeff-cspline.gif

One picture for more understanding: 4 equations with 4 unknown (coefficients a, b, c and).

14-13-koeff-cspline.png

Or so! Like ODE but not ODE

14-13-koeff-cspline-d.png

Top Tags