TGraph Interpolator generates crazy values

I have a very simple function which I have integrated into a CDF, which is very smooth.

I put this into a TGraph and inverted the x and y coordinates.

Then I interpolate continuously between 0 and 1. For most of the range, the interpolator works fine, however at one part it generates crazy values that are very spiky. The whole function and the integral are well-behaved so this is unexpected, and it only does it in one portion.

I suspect this comes from the TSpline3 being used for this purpose.

How can I get this to work without generating the spikes?

double y[40]; for(int i = 0; i < 40; i++) { y[i] = i+1; } TGraph* Time = new TGraph(40,m1ty,y); double t; t=Time->Eval(nu,0,"S"); delete Time;

HI,
I would need to look at your data to understand it better. Maybe try different interpolations. I would recommend you to use the interpolation class from MathMore which has different algorithms, see the class
ROOT::Math::Interpolator and in particular the example
root.cern.ch/lxr/source/math/mat … lation.cxx

Best Regards

Lorenzo

[quote=“moneta”]HI,
I would need to look at your data to understand it better. Maybe try different interpolations. I would recommend you to use the interpolation class from MathMore which has different algorithms, see the class
ROOT::Math::Interpolator and in particular the example
root.cern.ch/lxr/source/math/mat … lation.cxx

Best Regards

Lorenzo[/quote]

Is it possible to use this class even if it’s not compiled into my root? I am not administrator and I cannot recompile my ROOT.

I have tried to include the shared objects and headers with no success.

Hi,

You would need still to have a version of GSL installed in your system. If you can download and build one in your local area, you could then load these classes in ROOT and use them

Best Regards

Lorenzo