Numerical integration of a function specified numerically

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
praban
Messages
13
Reaction score
0
Dear All,

Can someone suggest me an appropriate routine (in Fortran) or command (in mathematica) to perform numerical integration of a function, which is specified numerically on a one dimensional grid with equal spacing (and we cannot generate additional data on other grid points)? There are many routines (e.g. in numerical recipe) to do numerical integration of analytical functions but I haven't found one for functions specified only numerically. I found one in NAG library (d01gaf) but NAG is not free. My numerical function is widely varying one and cannot be handled with simple numerical integration schemes (but at the same time additional data on other grid points cannot be generated).

Thanks,

Pradipta
 
Physics news on Phys.org
You need to make some assumption as to how your function behaves between grid points. Simpson's rule will suffice.