Closed Becca-90 closed 2 years ago
@pzylstra @fjrrobinson @aornugent @itowers1
This issue may have effected all of you. Have you used the function integrate_over_size_distribution
to calculate either density of individuals per unit area, or average size (by any metric). If so, numbers seem to be incorrect, due to incorrect calculation of total number of individuals. But it seems total amounts of area or biomass (e.g. leaf area, biomass) are OK.
We have a proposed fix. Just waiting to
Thanks @Becca-90 for investigating
So integrate_over_size_density will be changed in the develop branch, and then I'll redo my self-thinning stands? Or should I just test directly first with the function on my end? I've got one example stand which seems to look as you'd expect (yay!) but something is going on when I do the same with my trait-varied stands... but looks like the integrate function is fine at least!!
Actually, that's on a log scale so the diameter is still getting to a huge size I think...will check it over
addressed via #345 Test added via 974b17be395f662a0f78f66f0e86802463438a69
Let’s assume a known density wrt height, to test against. Let
$$n(H) = a \, H ^{−b}$$
Then we can directly integrate to compare results against ‘plant’ integration
$$N= \int_{1}^{20} n(H) \, dH = a \bigg[\frac{H^{1-b}}{1-b}\bigg]^{20}_{1}$$ $$H_{T}= \int_{1}^{20}N(H) \, H \, dH = a \bigg[\frac{H^{2-b}}{2-b}\bigg]^{20}_{1}$$
Now generate data to tests
Now compare solutions
So it turns out
integrate_over_size_distreibution
is getting the number of individuals wrong which is flowing onto average heightHere’s a fix: