We've been given the difference equation
$$a_{n+1}-a_n=k(M-a_n)(a_n-m)$$
and asked to explain the model, what each term represents, and the relationship between the terms.
I'm assuming $k$ is some kind of growth factor.
M is the carrying capacity of the environment (i.e. if $a_n$ exceeds $M$, then that term becomes negative, and the population begins to decrease.
$m$ is the minimum population level. If $a_n$ is less than $m$, then that term becomes negative, and the population level decreases.
However this doesn't really make sense mathematically, because when I pick some values for $k, M$, and $m$ ($0.1, 100000$, and $500$) the population level quickly goes negative.
Can anyone help me understand what I'm missing here? I've obviously made a mistake with one of my assumptions.
This is for a seminar class in Advanced Engineering Math. We're building up toward differential equations.
Consider the maximum value of $a_{n+1}-a_{n}$ in your problem. The RHS is a quadratic, so we can quickly see that $$ \Delta a_n \le k\left(\frac{M-m}{2}\right)^2 $$ For your problem, this maximum is about $2.5\cdot 10^8$. This is far larger than the difference between the minimum and maximum values, so no wonder it's going out of range almost instantly. Instead, you should pick your values such that the difference is significantly smaller than $M - m$. That way it will take many steps to reach $M$, and you won't have a problem with overshooting it. Given the bound above, this means your parameters should satisfy $$ k \ll \frac{4}{M-m}. $$ (An exact bound can be found by transforming the recurrence to the logistic map, which has known stability properties. In particular, your recurrence will behave "nicely" as long as $k(M-m) < 1$.)
As an aside, this phenomenon is closely related to numerical instability in differential equations, which you will learn about later in the course.