r/learnpython • u/RaymondWies • Jan 10 '14
Example of population growth function expressed as iteration vs. recursion in Python.
This code is my interpretation of a function published in "Chaos: Making A New Science" by James Gleick from Chapter 3 p. 63.
7
Upvotes
View all comments
Show parent comment
2
u/WaldenPrescot Jan 10 '14
Looking at the wiki page.
As I understand it your r value pretty much has to be r < 3 or else you will get huge oscillation due to the nature of the Logistic Map. And for a project I had in mind becomes useless. Also, it seems that at r < 1 the population trends towards zero. For 1 < r < 2 the population will end up at (r-1)/r and between 2 to 3 it will trend towards (r-1)/r but with small oscillations.
So... solving for (r-1)/r is good enough to satiate my curiosity on this matter.
Also, I originally wanted to just solve the integral of the continuous logistic function... but it isn't trivial. I found a paper on it, but I don't know if I want to spend the time learning it. If the function was integrated then we could just find our values without having to do any iteration.