Ask Your Question

zasdfgbnm's profile - activity

2021-02-05 00:03:34 +0200 received badge  Famous Question (source)
2018-04-16 14:05:46 +0200 received badge  Notable Question (source)
2018-04-16 14:05:46 +0200 received badge  Popular Question (source)
2012-11-01 06:10:08 +0200 received badge  Student (source)
2012-10-24 12:38:41 +0200 received badge  Supporter (source)
2012-10-24 01:22:14 +0200 commented answer how to convert Spline to Piecewise?

thanks for your reply

2012-10-24 01:21:52 +0200 marked best answer how to convert Spline to Piecewise?

spline from GSL is a numerical tool. To obtain symbolic values you can use maxima:

sage: maxima('load(interpol)') 
sage: maxima('p:[[7,2],[8,2],[3,2],[6,7]]')
[[7,2],[8,2],[3,2],[6,7]]
sage: # Sage symbolic expressions
sage: p1=maxima('part(cspline(p),1,1)').sage();p1
-95/279*x^3 + 95/31*x^2 - 415/93*x - 3
sage: p2=maxima('part(cspline(p),2,1)').sage();p2
-140/93*x^3 + 1120/31*x^2 - 26740/93*x + 23582/31
sage: p3=maxima('part(cspline(p),3,1)').sage();p3
235/93*x^3 - 1505/31*x^2 + 28385/93*x - 19293/31
sage: # maxima expression for comparison 
sage: maxima('cspline(p)')
(-95*x^3/279+95*x^2/31-415*x/93-3)*charfun2(x,minf,6)+(-140*x^3/93+1120*x^2/31-26740*x/93+23582/31)*charfun2(x,7,inf)+(235*x^3/93-1505*x^2/31+28385*x/93-19293/31)*charfun2(x,6,7)
2012-10-24 01:21:52 +0200 received badge  Scholar (source)
2012-10-23 02:20:06 +0200 asked a question how to convert Spline to Piecewise?

I want to get the result analytic expression of a spline. How to get it? Thanks for help.