Hi mathematica people!
So i am looking for the best way to interpolate a function given a list of its values. I have an iterative algorithm which needs high precision otherwise the numerical noise is going to increase exponentially. It works like this(not the exact code, but just to illustrate):
Nmax := 10;
Tmax := 1000;
K[t_, s_] := s^2 (PolyGamma[2, 1 - (t-s)] - 0.5 PolyGamma[2, 1 - (t-s)/2])
Table[{t, NIntegrate[ K[t,s] (PolyGamma[1, 1 - 2 I s] - 0.5 PolyGamma[1, 1 - I s]) ,{s, 0, t-1} ]}, {t, 1, Tmax} ]
f[0]:= Interpolation[ %, InterpolationOrder -> 1 ];
For[ i = 1 , i < Nmax , i++ ,
Table[{t, NIntegrate[ K[t,s] f[i][s] ,{s, 0, t-1} ]}, {t, 1, Tmax} ];
f[i+1] := Interpolation[ %, InterpolationOrder -> 1 ];
]
The problem with this is that each function f[i] is coming from integrating f[i-1], so errors are going to be multiplied and enhanced. Is there a better way to integrate numerical interpolation? Or perhaps a better way to interpolate?
In the end i am interested in obtaining a plot of
f := Sum[ f[i] , {i , 0 , Nmax } ]