In [1]:
# importamos bibliotecas cómputo de matrices
import numpy as np
# importamos bibliotecas para plotear
import matplotlib
import matplotlib.pyplot as plt
# para desplegar los plots en el notebook
%matplotlib inline
In [2]:
def predation(B, alfa=5, beta=100):
return (beta * B**2)/float(alfa**2 + B**2)
In [3]:
beta = 100
pmin = 2
pmax = 100
for alfa in range(5,125, 25):
plt.plot( [predation(b, alfa, beta) for b in range(pmin, pmax)])
In [6]:
# tasa de cambio de la población
alfa = 0.05
beta = 1
def fprima(B, rB, KB):
return (rB*B*(1-(B/KB)))-predation(B, alfa, beta)
# la poblacion en t=0 es 200
pop = [200,] + [0 for n in range(500)]
K = 2000 # capacidad de carga
rB = 0.03 # tasa de crecimiento malthusiana
for t in range(1,501):
b = pop[t-1]
pop[t] = b + fprima(b, rB, K)
# plotear poblacion
figura = plt.plot( pop )
In [15]:
# tasa de cambio de mu
def muprima(B, rB, KB):
mu = B/alfa
R = (alfa * rB)/beta
Q = KB/alfa
return (R*mu*(1-(mu/Q)))-(mu**2/(1+mu**2))
mus = []
for b in pop:
mus.append(muprima(b, rB, K))
# plotear poblacion
figura = plt.plot( mus )
#figura1 = plt.plot([b for b in pop])