World population growth

calculusmathematical modelingstatistics

I feel like a sardine among blue whales in this community.
If that is even a proper analogy about my math knowledge compared to you mathmaticians.

Anyways, here's my naive question. I'm developing a small project to calculate the world population
within a period of time, (always assuming we will start with 2 fertile humans). My program renders a line chart in real time depending on user input:

enter image description here

I'm not sure I can provide a link to my windows executable program but I'll upload it if you want to.

It is relatively simple and it does not (yet) provide adittion to catastrophes and wars (such as 50 million deaths to flu, or 70 million in 2nd world war year range).
Also, it takes for granted that couples will not divorce, they will have the amount of babies set by reproduction ratio (float), during fertile period, live and die. It also does not count polygamy or adultery, which I believe should be ridiculously random and complex.

Honestly I thought of processing everything year by year (in the example total years = 6020), start with 2 individuals, group every single human being in a group:
before fertility, during fertility single, during fertility married (ready to go), married completed cycle (reproduced the babies it should), and then removed from the group when dead (reached lifespan).

Seems simple enough, except it is not. Honestly, I came here to ask for some ideas of how can I implement these variables mathematically: world year range, reproduction ratio, fertility years, death, fertility death ratio(amount of babies that die during pregnancy or before age of fertility, 15 in the example) and human sex ratio(male x female).

Is this such a question that is accepted in this community? If so, any ideas are appreciated. thanks

Best Answer

You can model the population growth as a simple differential equation, $$ \dfrac{dP}{dt} = \underbrace{\beta \dfrac{P}{2}}_{\text{births}} - \underbrace{\delta P}_{\text{Deaths}}. $$ If $\beta/2 > \delta$, the population grows, and otherwise it declines. Let $\gamma = \dfrac{\beta}{2}-\delta$.

The solutions to the equation is $$ \dfrac{\dot{P}}{P} = \left( \dfrac{\beta}{2} - \delta \right) $$ $$ \dfrac{d}{dt} \ln(P) = \gamma $$ $$ \ln (P(t)) = \gamma t + K $$ $$ P(t) = P_0e^{\gamma t}. $$ So if the population starts at $P_0$, it either grows to an infinite amount or crashes to zero, depending on whether $\gamma >,<0$.

You could add shocks each period, so $$ \dfrac{dP}{dt} = \underbrace{\beta \dfrac{P}{2}}_{\text{births}} - \underbrace{\delta P}_{\text{Deaths}} + \rho \varepsilon_t $$ where $\varepsilon_t$ is randomly drawn each period $t$ to account for famine, plague, war, etc. This makes the model stochastic, but you can compute the expected values of future populations conditional on the population at a given moment in time, or compute the distributions of populations over time. ( https://en.wikipedia.org/wiki/Geometric_Brownian_motion)

You can model carrying capacity so that the population doesn't become unbounded, so there is a "Malthusian" dynamic as competition for limited resources limits population size: https://en.wikipedia.org/wiki/Carrying_capacity and https://en.wikipedia.org/wiki/Competitive_Lotka%E2%80%93Volterra_equations

Anything much more complicated than these, and you have to track not just the overall size of the population, but the distribution of members of each cohort. So if you wanted people to "age out" and become infertile, you'd need to know the initial distribution of all ages, and then work out the dynamics of people moving from age bin to age bin. This eventually becomes complicated enough that you would call it (quantitative) demography.