Skip to main content
24-Ruby IV
March 24, 2018
Solved

cspline

  • March 24, 2018
  • 3 replies
  • 5626 views

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?

Best answer by vkofanov

I have this version.

koeff cspline.JPG

3 replies

25-Diamond I
March 24, 2018

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).

 

16-Pearl
March 24, 2018

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

25-Diamond I
March 24, 2018

@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

16-Pearl
March 25, 2018

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.

 

vkofanov1-VisitorAnswer
1-Visitor
March 24, 2018

I have this version.

koeff cspline.JPG

24-Ruby IV
March 25, 2018

Thanks Valery!

But solution without animation is not solution!

14-13-koeff-cspline.gif

24-Ruby IV
March 25, 2018

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

14-13-koeff-cspline.png