Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168742
Image: ubuntu2004
# Madison Schaeffer # -*- coding: utf-8 -*- # import libraries from math import exp import matplotlib.pyplot as plt from random import uniform #define functions def cont_log_time(N,r,K): return N + (N*r*(1-((N/K)))) # declare data lag = input("What is the lag?") N = input("What is the initial population size?") r = input("What is the instantaneous growth rate?") K = input("What is the carrying capacity?") time = input("How long should the population grow?") pop_size = [N] * lag print pop_size # main for years in range(lag,time): pop_size.append(cont_log_time(pop_size[-lag], r, K)) print pop_size print range(time) plt.plot(range(time), pop_size) plt.show()