```python
import matplotlib.pyplot as plt
import math
import functools
import numpy as np
```

__Exponential Growth Equation__

$
\begin{align}
\frac{\partial N}{\partial t} = N(t) * r
\end{align}
$

Let r = 1.2 and N(0) = 10



```python
frames    = 20
timeSerie = np.linspace(1, frames, frames, endpoint=True)
```


```python
pop_exp_120 = [10]
pop_exp_125 = [10]
pop_exp_130 = [10]

for i in range(frames):
    pop_exp_120.append((pop_exp_120[-1] * (1 + 0.20)))
    pop_exp_125.append((pop_exp_125[-1] * (1 + 0.25)))
    pop_exp_130.append((pop_exp_130[-1] * (1 + 0.30)))
```


```python
fig = plt.figure('Exponential Plot', figsize=(14, 6))
ax  = fig.add_subplot(111)
plt.plot(timeSerie ,pop_exp_120[:-1], label='1.20')
plt.plot(timeSerie ,pop_exp_125[:-1], label='1.25')
plt.plot(timeSerie ,pop_exp_130[:-1], label='1.30')
ax.annotate(round(pop_exp_130[-2], 0) , xy=(timeSerie[-1], pop_exp_130[-2]), textcoords='data')
ax.annotate(round(pop_exp_125[-2], 0) , xy=(timeSerie[-1], pop_exp_125[-2]), textcoords='data')
ax.annotate(round(pop_exp_120[-2], 0) , xy=(timeSerie[-1], pop_exp_120[-2]), textcoords='data')
plt.legend(loc='best')
plt.show()
```

__Logistic Equation__

$
\begin{align}
\frac{\partial N}{\partial t} = N(t) * r * [ (K - N(t)) / K ]
\end{align}
$

Let r = 1.2, N(0) = 10 and K = 450


```python
pop_log = []

K = 80

pop_log_120 = [10]
pop_log_125 = [10]
pop_log_130 = [10]

for i in range(frames):
    pop_log_120.append((pop_log_120[-1] * (1 + (0.20 * (K - pop_log_120[-1])/K)) ))
    pop_log_125.append((pop_log_125[-1] * (1 + (0.25 * (K - pop_log_125[-1])/K)) ))
    pop_log_130.append((pop_log_130[-1] * (1 + (0.30 * (K - pop_log_130[-1])/K)) ))
```


```python
fig = plt.figure('Exponential Plot', figsize=(14, 6))
ax  = fig.add_subplot(111)
plt.plot(timeSerie ,pop_log_120[:-1], label='1.20')
plt.plot(timeSerie ,pop_log_125[:-1], label='1.25')
plt.plot(timeSerie ,pop_log_130[:-1], label='1.30')
ax.annotate(round(pop_log_130[-2], 0) , xy=(timeSerie[-1], pop_log_130[-2]), textcoords='data')
ax.annotate(round(pop_log_125[-2], 0) , xy=(timeSerie[-1], pop_log_125[-2]), textcoords='data')
ax.annotate(round(pop_log_120[-2], 0) , xy=(timeSerie[-1], pop_log_120[-2]), textcoords='data')
plt.legend(loc='best')
plt.show()
```

3c7401fb91045e8012288522c66ba74eeebf399c
ipynb
Jupyter Notebook
Population.ipynb
FeMaffezzolli/python_population_growth
82ead4a2b9c6dd55b3b9968952260e3eb572d709
MIT
Population.ipynb
FeMaffezzolli/python_population_growth
82ead4a2b9c6dd55b3b9968952260e3eb572d709
MIT
Population.ipynb
FeMaffezzolli/python_population_growth
82ead4a2b9c6dd55b3b9968952260e3eb572d709
MIT
Qwen/Qwen-72B
1. YES
2. YES