Numerical Tools
codechembook.numericalTools
integrateRange(y, x, limits, method='trapezoid')
Integrate a numeric function over a range less than the full extent of the function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
ndarray
|
y-values for integration. |
required |
x
|
ndarray
|
x-values for integration. (need not be evenly spaced) |
required |
limits
|
list of numeric
|
Lower and upper limits of integration. |
required |
method
|
str
|
which approach to use (default: 'trapezoid', options: 'rectangle', 'simpson'). |
'trapezoid'
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
Value of the integral. |
Source code in src/codechembook/numericalTools.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |