I have a large array {x,y,z}
sigma = {{x1,y1,z1},{x2,y2,z2}, ......}
where z is a function of x,y: z = f(x,y); the function is known only through its numerical values. Next I do a numerical Interpolation over this array
F = Interpolation[sigma]
and obtain an InterpolatingFunction F(x,y). Now I perform a numerical integration over one of the coordinates, say y, this defines a new function g(x):
g[x_]:= NIntegrate[F[x,y],{y,0.,2.5}]
This new function g(x) is used quite frequently in the later parts of the program. I would thus like to avoid redoing the time-consuming integration over and over again. How can I store this function g(x) so that it becomes available later on without having to redo the Interpolation and the Integration?
InterpolatingFunction
s can be integrated symbolically, yielding a newInterpolatingFunction
. Just dog[x_] = Integrate[F[x,y],{y,0.,2.5}]
. $\endgroup$