Algorithm to calculate the amount of CO2 exhaled by humans in 1 second. See it in action here: http://ahan2.github.io/co2/
The program first calculates the world population after 1 second (i.e. the population of humans in 1 second after the current time(t)).
NOTE: The world population in the program currently always begins from a defined value (7380201256), since it is not being saved, but this would be easy enough to do.
Where: N0 (initial population) = The population at time t = 0.
N (future population) = The population at time t.
r (rate) = The rate of population change as a function of t (a 1% increase is expressed as 0.01).
t (time) = The amount of time required to produce a growth in population proportional to N/N0.
SOURCE(S):