Malthusian growth model with Python
Population grows exponentially in the absence of limiting factors
The Malthusian growth model is a simple exponential growth model proposed by Thomas Malthus to describe population growth. The model assumes that population grows exponentially in the absence of limiting factors, such as resources or environmental constraints. The basic equation for the Malthusian growth model is:
P(t) = P0 * e ^(r * t)
where:
- P(t) is the population at time t
- P0 is the initial population at t=0
- r is the growth rate
- e is the base of the natural logarithm
- t is time
Here’s a simple implementation of the Malthusian growth model in Python using the numpy
library for numerical operations and matplotlib
for visualization:
import numpy as np
import matplotlib.pyplot as plt
def malthusian_growth_model(P0, r, t):
'''
Malthusian growth model
Arguments:
P0 (float): Initial population
r (float): Growth rate
t (array-like): Time values
Returns:
array-like: Population values at each time point
'''
return P0 * np.exp(r * t)
# Set parameters
P0 = 2 # Initial population
r = 0.1 # Growth rate
t = np.arange(0, 50, 1) # Time values from 0 to 50
# Calculate population values
population = malthusian_growth_model(P0, r, t)
# Plot the results
plt.plot(t, population, label='Malthusian Growth Model')
plt.xlabel('Time')
plt.ylabel('Population')
plt.title('Malthusian Growth Model')
plt.legend()
plt.show()
The parameters P0, r, and t are passed to the function malthusian_growth_model
to generate a plot of the population growth over time.
You can see this plot as the first image in this post.
Here some cool videos about population dynamics:
The Malthusian trap refers to the point in the Malthusian growth model where the population exceeds the available resources, leading to a decline in living standards and an increase in mortality rates. In the Malthusian crisis, the population is constrained by the limited availability of resources, and the model assumes that the population cannot sustain its exponential growth due to these limitations.
For example if we assume that the rate at which resources are produced is linear:
import numpy as np
import matplotlib.pyplot as plt
def malthusian_trap_model(P0, r_population, R0, r_resources, t):
'''
Malthusian trap model
Parameters:
P0 (float): Initial population
r_population (float): Population growth rate
R0 (float): Initial resources
r_resources (float): Resources growth rate
t (array-like): Time values
Returns:
array-like: Population and resources values at each time point
'''
population = P0 * np.exp(r_population * t)
resources = r_resources * t + R0
return population, resources
# Set parameters
P0 = 2 # Initial population
r_population = 0.1 # Population growth rate
R0 = 10 # Initial resources
r_resources = 2 # Resources growth rate
t = np.arange(0, 50, 1) # Time values from 0 to 50
# Calculate population and resources values
population, resources = malthusian_trap_model(P0, r_population, R0, r_resources, t)
# Plot the results
plt.plot(t, population, label='Population')
plt.plot(t, resources, label='Resources')
plt.xlabel('Time')
plt.ylabel('Population/Resources')
plt.title('Malthusian Trap Model')
# Intersection points
idx = np.argwhere(np.diff(np.sign(population - resources))).flatten()
plt.plot(t[idx], resources[idx], 'ro', label='Point of crisis')
plt.legend()
plt.show()
The parametersP0, r_population, R0, r_resources and t are passed to the function malthusian_trap_model
to generate a plot.
Of course in a more realistic model after the point of crisis the population should decrease. I suggest you to read this web page from Michael Minn.
Pierre Francois Verhulst in 1838 after reading Malthus’ essay developed the logistic function to model population growth bounded by resource limitations.
Outro
I hope the story was interesting and thank you for taking the time to read it. On my Blogspot you can find the same post in Italian. Let me know if you have any question and if you like the content that I create feel free to buy me a coffee.