This commit is contained in:
2022-12-01 14:36:33 -08:00
parent 9226228a1d
commit fea9f530fa
12 changed files with 185 additions and 690 deletions

17
include/population.hpp Normal file
View File

@@ -0,0 +1,17 @@
#include <cmath>
/**
* @brief Logistic population growth
*
* @param year
* @param N_o
* @param N_f
* @param k
* @param total_duration
* @return int
*/
int logistic_population_func(int year, int N_o, int N_f, int k, int total_duration) {
// https://en.wikipedia.org//wiki/Logistic_function
return N_o + (N_f - N_o) /
(1 + exp(-k * (year - total_duration/2)));
}