Closed aornugent closed 4 years ago
Actually, that may be the correct behaviour of the environment. A similar thing happens with the FF16 model
scm$patch$environment$environment_interpolator$xy
[,1] [,2]
[1,] 0.00000000 1
[2,] 0.01267660 1
[3,] 0.02535320 1
[4,] 0.03802979 1
[5,] 0.05070639 1
[6,] 0.06338299 1
[7,] 0.07605959 1
[8,] 0.08873618 1
[9,] 0.10141278 1
[10,] 0.11408938 1
....
The reason is you've only taken a single ODE step, so nothing has had time to develop yet.
I'm just updating some other elements of the model and will push these shortly.
Some corrections to model in commit 0a7bbff1f06f7f7362c52af32cac2c35076a2644. See further comments in the commit.
Also adding some more missing features to the interface, including enabling all tests for K93 model.
These still not passing though
Awesome, thanks. Perhaps I wasn't so far off after all.
After a couple of iterations it runs into the following error:
Error in SCM___K93__K93_Env__run_next(self) : Interpolated function as refined as currently possible
which I take to mean that the difference between interpolated points is too small, given the control parameters?
Maybe this is breaking down when there's only one individual because the environment is the same for all heights less than the maximum, even after a few iterations:
> scm$patch$environment$environment_interpolator$xy
[,1] [,2]
[1, ] 0.00000000 0.9999843
[2, ] 0.06250032 0.9999843
...
[31,] 1.87500971 0.9999843
[32,] 1.93751003 0.9999843
[33,] 2.00001036 0.9999921
Maybe not, I tried introducing a second species with the same result.
Hi Andrew,
Yes, something is up with the environment. I suspect the best pathway forward is for us to first pursue #244. The FF16 model isn't yet behaving as it should, and I suspect there's something to do with the environment that's causing issues. Once we are confident that is working well, we can revisit K93 with more confidence.
Hi Andrew! Recent commits on devleop branch have updated the scaffolder, incorporating some of the changes we made on this branch. I then ported the Kohyama model to a new branch https://github.com/traitecoevo/plant/tree/kohyama-model2 working with the new scaffolder.
So I suggest checking that out, check if anything is missing then, work on that branch from hereon.
This compiles and runs, but I'm having trouble plugging competition into the right place.
Here you see the environment is the same for all interpolated heights (actually size).
I suspect I've probably got the wrong thing in here: https://github.com/traitecoevo/plant/blob/a6b7f92480dd19e9da05d19a9914bea3539a858d/inst/include/plant/models/k93_strategy.h#L52
which previously referenced
area_leaf_above(z, height)
, I believe referring to the shading an individual experiences from itself?