Hi Nora,
I understrand that you want to know if it is possible to calculate the error while finding the integral using 'cumtrpz'. There are several sources of potential error to consider:
- The 'cumtrapz' function uses the trapezoidal rule for numerical integration, which approximates the area under the curve by summing up the areas of trapezoids. This method can introduce some error
- When integrating twice the initial condition is taken zero unless specified otherwise. Any error in these initial conditions will propagate through the calculations.
- Detrending can help in removing bias from the data, it can also alter the data in a way that may affect the final displacement values. If the trend removed is actually part of the true signal, this will introduce an error.
Calculating the exact error introduced by these processes can be quite complex.
To estimate or assess the error in the displacement data:
- Compare with known values: If available, to estimate the error.
- Sensitivity Analysis: Check how changes in initial conditions affect the outcome.
- Error Propagation: Estimate the uncertainty at each calculation step to find overall uncertainty.
- High-Resolution Data: Use to minimize numerical integration error.
- Detrending Analysis: Assess the impact of detrending on results.
- Simulated Data: Test the integration process on data with a known displacement.
- Alternative Methods: Consider other numerical integration methods for potentially better accuracy.
- Filtering: Apply filters to reduce noise that may accumulate during integration.