NUMERICAL
tplquad
Compute a triple (definite) integral.
Example of usage
Triple integration over time, signal and depth.
Usage / limitations
+Use when: Compute approximations and solve equations.
−Limitations: Check input requirements, mathematical assumptions and version-specific behaviour before using.
Mathematical formula
See method documentation: implementation and assumptions vary.
Sample dataShow
{
"variable": "observations",
"domain": "Laboratory sensor signal integration",
"feature_names": [
"minute",
"fluorescence_au"
],
"records": [
{
"minute": 0,
"fluorescence_au": 1.0
},
{
"minute": 1,
"fluorescence_au": 2.0
},
{
"minute": 2,
"fluorescence_au": 5.0
},
{
"minute": 3,
"fluorescence_au": 10.0
},
{
"minute": 4,
"fluorescence_au": 17.0
},
{
"minute": 5,
"fluorescence_au": 26.0
},
{
"minute": 6,
"fluorescence_au": 37.0
},
{
"minute": 7,
"fluorescence_au": 50.0
},
{
"minute": 8,
"fluorescence_au": 65.0
}
]
}
Code example (Python)
observations = {'domain': 'Laboratory sensor signal integration', 'feature_names': ['minute', 'fluorescence_au'], 'records': [{'minute': 0, 'fluorescence_au': 1.0}, {'minute': 1, 'fluorescence_au': 2.0}, {'minute': 2, 'fluorescence_au': 5.0}, {'minute': 3, 'fluorescence_au': 10.0}, {'minute': 4, 'fluorescence_au': 17.0}, {'minute': 5, 'fluorescence_au': 26.0}, {'minute': 6, 'fluorescence_au': 37.0}, {'minute': 7, 'fluorescence_au': 50.0}, {'minute': 8, 'fluorescence_au': 65.0}]}
# DataLens.ai example — tplquad
# Domain: laboratory sensor measurements and numerical analysis.
# Sample input is supplied by the Copy input + code + test action.
import numpy as np
from scipy import integrate, special
# Read a labelled time-series from the sample input.
t = np.array([row["minute"] for row in observations["records"]], dtype=float)
y = np.array([row["fluorescence_au"] for row in observations["records"]], dtype=float)
# Compute the method-specific result and check a numerical property.
result, error = integrate.tplquad(lambda depth, signal, minute: minute + signal + depth, 0,1, lambda minute: 0, lambda minute: 2, lambda minute, signal: 0, lambda minute, signal: 3)
assert np.isclose(result, 18, atol=1e-10) and error < 1e-8
print("Expected output verified")
# DataLens.ai example — tplquad
# Domain: laboratory sensor measurements and numerical analysis.
# Sample input is supplied by the Copy input + code + test action.
import numpy as np
from scipy import integrate, special
# Read a labelled time-series from the sample input.
t = np.array([row["minute"] for row in observations["records"]], dtype=float)
y = np.array([row["fluorescence_au"] for row in observations["records"]], dtype=float)
# Compute the method-specific result and check a numerical property.
result, error = integrate.tplquad(lambda depth, signal, minute: minute + signal + depth, 0,1, lambda minute: 0, lambda minute: 2, lambda minute, signal: 0, lambda minute, signal: 3)
assert np.isclose(result, 18, atol=1e-10) and error < 1e-8
print("Expected output verified")