MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Spline


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.


  • Prev by Date: Re: Clear subscripted variables
  • Next by Date: Re: Re: Asking questions
  • Previous by thread: Re: Spline
  • Next by thread: Re: Spline