Re: Spline

*To*: mathgroup at smc.vnet.net*Subject*: [mg58298] Re: [mg58281] Spline*From*: "David Annetts" <davidannetts at aapt.net.au>*Date*: Sun, 26 Jun 2005 01:33:59 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Hi Pratik > I am trying to fit a spline through a data set ranging in > value 0 to1 incremented by step size 0.1 (i.e the "x-axis" > }, shown below. I have information for points 0.1 to 0.9 in > damprat. I know at point 0 and 1 the values for damprat is > zero. Now for presentation reasons I want the curve to pass > through the points (0,0) and {1,0). Is there a way for the > spline to be extended through those points. Any suggestions > would be greatly appreciated If you know the values at the endpoints, then tell the spline routine. There's no way of extending the spline, since it is only defined (in the original) on [.1, .9]. Ordinary fitting routines (Fit) can extrapolate, though they give warnings, << Graphics`Spline` damprat = {0., 0.014997649179748, 0.054098060220146, 0.104209568084688, 0.145267085272089, 0.160493044616599, 0.145267084912456, 0.104209571529220, 0.054098058877509, 0.014997649185286, 0.}; dat = Range[0., 1, 0.1]; data1 = Table[{dat[[s]], damprat[[s]]*10/s}, {s, 1, Length[ dat]}] ; (*The dataset i am interested in fitting a spline through*) spline = SplineFit[data1, Cubic] ; ParametricPlot[spline[u], { u, 0, 10}, Compiled -> True, PlotRange -> {0, 0.4}, Ticks -> {dat, Automatic}]; Works as you want. Regards, Dave.