Beginner - 4 years ago 194

Python Question

I have a function which takes a dictionary and returns an acceleration

`a`

I put a list of data for a certain parameter (lets call it

`alpha`

Now I want to integrate these values one by one, to get let's say an array velocity

`v`

`alpha`

Edit:

Actually i have a mechanical problem. The ladder is placed against the wall, and because its

`friction coefficient`

So i have written a function which returns the

`acceleration`

`angle between 30° and 90°`

Anyways, I've calculated

`acceleration`

`alpha`

`a`

I tried

`scipy.integrate.simps()`

`v`

`scipy.integrate.quad()`

I would like to generate an array of velocities

`v`

`a`

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

It sounds like you want to perform cumulative quadrature on an array of values. In that case, `scipy.integrate.cumtrapz`

should do want you want. That will perform a cumulative integration using the trapezoidal rule on the supplied array, yielding an array of outputs the same size in the inputs. You control in initial value via a separate argument if it is non-zero.

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**