asPlankBridge
asPlankBridge

Reputation: 1082

Numerical integration over non-uniform Grids

I have a function which I want to integrate. I have two numpy arrays, one with the x-values and one with the function f(x). I am looking for a function F(x) which is the antiderivative of f(x), defined on the same grid x. This grid x is non-uniform.

Is there some numpy or scipy function giving me the array F(x)?

Upvotes: 1

Views: 2630

Answers (1)

pv.
pv.

Reputation: 35145

You are likely looking for scipy.integrate.cumtrapz.

Upvotes: 3

Related Questions