Host-Parasitoid System

4060 days ago by medlock

def NB(N, P, g, a, c): return (g * N * exp(-a * P), c * N * (1 - exp(-a * P))) 
       
g = 1.2 a = 1. c = 1.2 N0 = 1. P0 = 0.1 NOld = N0 POld = P0 N = [N0] P = [P0] t = range(101) for i in t[1 : ]: (NNew, PNew) = NB(NOld, POld, g, a, c) NOld = NNew POld = PNew N.append(NNew) P.append(PNew) show(line(zip(t, N), color = 'green') + point(zip(t, N), color = 'green') + line(zip(t, P), color = 'red') + point(zip(t, P), color = 'red')) show(line(zip(N, P)) + point(zip(N, P)))