Try to establish what the equilibrium seed rain is.

Set model parameters

Some output seed rains, given an input seed rain:

## [1] 19.82443
## [1] 17.63104
## [1] 16.58796

When below the equilibrium, run returns a seed rain that is greater than the input, when above it, run returns a seed rain that is less than the input.

1: Approach to equilibrium:

Equilibrium seed rain is right around where the last two values from run were producing

## [1] 17.31512

From a distance, these both hone in nicely on the equilibrium, and rapidly, too.

2: Near the equilibrium point:

Then, in the vicinity of the root we should look at what the curve actually looks like, without adaptive refinement.

Here is input seeds vs. output seeds:

4. Global function shape

This takes quite a while to compute.

seed_rain_out_global <-
  unlist(mclapply(seed_rain_in_global, run_new_schedule, p))

This is pretty patchy, which is due to incompletely refining the cohort schedule, I believe. Tighten schedule_eps to make the curve smoother, at the cost of potentially a lot more effort.

5. Multiple species at once:

From a distance, these both hone in nicely on the equilibrium, and rapidly, too.

Note that the first guess position of the red species is higher than the black species, but in the end the output seed rain is lower. This is the difficulty in computing multi species equilibria - the different solutions affect each other. In general multi-dimensional root finding is difficult; even knowing that there are roots is not straightforward, much less proving that we’ve converged on the “correct” root (for example [0,0] is a root in this case but that root is not stable). plant uses some heuristics to try to ensure that the root returned is an attracting point but sequentially applying rounds of iteration and non-linear root finding algorithms, as well as rescaling seed rains to repel from known unstable roots.

To illustrate this a little further, though still in the fairly trivial 2d case, first identify the other two equilibria.

Here’s the seed rains of each species when alone:

So that means that we have four equilibria: 1: The trivial equilibrium:

## [1] 0 0

2: Species 1 alone

## [1] -0.009399603  0.000000000

3: Species 2 alone

## [1] 0.000000000 0.007976816

4: Species 1 and 2 together:

## [1] 0.0011239196 0.0003123585

(note that the approximations here mean that these equilibria are not terribly well polished - there are a set of nested approximations that make this difficult. Possibly the biggest culprit is the cohort refinement step).

NOTE: I’m not sure why the point really close to the equilibrium here looks like it’s moving so quickly, and possibly in the wrong direction. Cohort instability perhaps?