When calculating outputs from the size distribution, we will often want to specify the bounds of the integrals. While we can use a trapezoidal integration across the heights specified by the solver characteristics (previously called cohort boundaries), it's unlikely the heights of the solver correspond to the desired integral boundaries.
Suggested method is to
Create an interpolator
Interpolate to desired points (including boundaries of the integral). Could be finer than original points, which would improve accuracy if the curvature of the spline approximation reflects true non-linearities.
Integrate between these, e.g. using trapezoidal integration.
When calculating outputs from the size distribution, we will often want to specify the bounds of the integrals. While we can use a trapezoidal integration across the heights specified by the solver characteristics (previously called cohort boundaries), it's unlikely the heights of the solver correspond to the desired integral boundaries.
Suggested method is to
Note, with spline interpolators the integral can b calculated analytically between knots (https://stackoverflow.com/questions/51540182/how-to-save-and-load-spline-interpolation-functions-in-r).