User Tools

Site Tools


2016:groups:g1:start

Group 1

Less is more: when positives don't sum

Plot 1

%matplotlib inline from numpy import * from matplotlib.pyplot import * from scipy.integrate import odeint ion()

t = arange(0,2., 0.01)

# parameters fr = 8.75 fa = 6.25 p = 0.7 c = 0.01 g = 0.001

# initial condition: this is an array now! x0 = array([10., 10.]) # Pr, Pa

# the function still receives only `x`, but it will be an array, not a number def LV(x, t, fr, fa, p, c, g):

  # in python, arrays are numbered from 0, so the first element 
  # is x[0], the second is x[1]. The square brackets `[ ]` define a
  # list, that is converted to an array using the function `array()`.
  # Notice that the first entry corresponds to dV/dt and the second to dP/dt
  return array([ (fr*p*x[0]) + fa*p*x[1] - ((c-g)*x[0]*(x[0]+x[1])),
                 (fa*(1-p)*x[1]) + fr*(1-p)*x[0] - ((c-3*g)*x[1]*(x[0]+x[1])) ])

# call the function that performs the integration # the order of the arguments is as below: the derivative function, # the initial condition, the points where we want the solution, and # a list of parameters x = odeint(LV, x0, t, (fr, fa, p, c, g))

# plot the solution plot(t, x) xlabel('$t [years^{-1}]$', fontsize=25) # define label of x-axis ylabel('$Plants Population$', fontsize=25) # and of y-axis legend(['$P_{r}$', '$P_{a}$'], loc='lower right', fontsize=20) savefig('foo1.pdf')

Portuguesa

t = arange(0,3., 0.01) rFec = t = arange(0,10.,1) rGam = arange(0,100.,10)

for i in range(len(rFec)):

  for j in range(len(rGam)):
      x = odeint(LV, x0, t, (fr, fa, p, c, g, i, j))
      A[i,j] = x[5,1]/(x[5,1] + x[5,0]) 

Wiki site of the practical exercise of the V Southern-Summer School on Mathematical Biology.

Here you will find the exercise assignment and the group's products.

If you are a group member login to edit this page, create new pages from it, and upload files.

Introduction

Mutualisms are ubiquitous in nature and mutualistic interactions are expected to increase the fitness of interacting species. However, species engage in multiple interactions at the same time. For instance, many plants engage in multiple mutualistic interactions with a diverse range of organisms. Pollinators assist in plant reproduction, frugivores disperse their seeds and microorganisms provide them nutrients 1). When multiple mutualistic interactions occur at the same time, it is important to understand the contribution of each interaction on species' fitness. The interplay between different interactions can be difficult to predict and might have synergistic effects.

A recent paper by Godschalx and colleagues (2015) found that nitrogen-fixing bacteria can influence mutualistic interactions that lima bean plants (Phaseolus lunatus) engage with protective ants. The authors show that the effects of different mutualistic interactions cannot be described by considering simply their individual effect.

www.mpg.de_662438_zoom.jpg Ants from the genus Crematogaster protecting lima bean plant

Assignment

Propose a simple but realist mathematical model that helps to:

  • Disentangle the role (and effect) of different mutualistic interactions for the persistence of species interactions.
  • Understand the contribution of different types of mutualistic interactions and the effect they have on interacting species when considered both in isolation and combined.

Suggested questions

  • How different types of mutualistic interactions influence the dynamics of interacting species when considered pairwise interactions?
  • How does the predictions, regarding population dynamics and species persistence, change when multiple interactions are considered at the same time?

References

  • Godschalx et al. (2015) Ants are less attracted to the extrafloral nectar of plants with symbiotic, nitrogen-fixing rhizobia Ecology 96(2), pp.348-354 link

Maria Bonita

%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
from scipy.integrate import odeint
ion()

t = arange(0,50., 0.01)

# parameters
rv = 0.8
rr = 1.5
ra = 0.6
kv = 5.
kr = 5.
ka = 5.
a = 0.15
b = 0.03
c = 0.15
d = 0.02
n = 0.1
p = 1
alfa = 0.25
beta = 0.25

# initial condition
x0 = array([1., 1., 1.]) # V, R, A

def LV(x, t, rv, rr, ra, kv, kr, ka, a, b, c, d, p, n, alfa, beta):
    return array([ rv*x[0]*(1-(x[0]/kv)) + a*x[0]*x[1] - p*(1+sin(t))*x[0]/(n+alfa*x[1]+beta*x[2]),
                   rr*x[1]*(1-(x[1]/kr)) + b*x[0]*x[1] - c*x[1]*p*(1+sin(t))*x[0]/(n+alfa*x[1]+beta*x[2]) ,
                   ra*x[2]*(1-(x[2]/ka)) + d*x[2]*p*(1+sin(t))*x[0]/(n+alfa*x[1]+beta*x[2])])

# call the function that performs the integration
# the order of the arguments is as below: the derivative function,
# the initial condition, the points where we want the solution, and
# a list of parameters
x = odeint(LV, x0, t, (rv, rr, ra, kv, kr, ka, a, b, c, d, p, n, alfa, beta))

# plot the solution
plot(t, x)
xlabel('t') # define label of x-axis
ylabel('populations') # and of y-axis
legend(['V', 'R', 'A'], loc='lower right')

Right First Model

%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
from scipy.integrate import odeint
ion()

t = arange(0,3., 0.01)

# parameters
fr = 8.75
fa = 6.25
c = 0.01
p = 0.5
g = 0.001

# initial condition
x0 = array([50., 50.]) # Pr, Pa

def LV(x, t, fr, fa, p, c, g):
    # in python, arrays are numbered from 0, so the first element 
    # is x[0], the second is x[1]. The square brackets `[ ]` define a
    # list, that is converted to an array using the function `array()`.
    # Notice that the first entry corresponds to dV/dt and the second to dP/dt
    if t > 25.:
        g = 0.
    p = 0.25 * sin(6*t) + 0.5
    return array([ (fr*p*x[0]) + fa*p*x[1] - ((c-g)*x[0]*(x[0]+x[1])),
                   (fa*(1-p)*x[1]) + fr*(1-p)*x[0] - ((c-3*g)*x[1]*(x[0]+x[1])) ])

# call the function that performs the integration
# the order of the arguments is as below: the derivative function,
# the initial condition, the points where we want the solution, and
# a list of parameters
x = odeint(LV, x0, t, (fr, fa, p, c, g))

# plot the solution
plot(t, x)
xlabel('t') # define label of x-axis
ylabel('populations') # and of y-axis
legend(['Pr', 'Pa'], loc='lower right')

Killing the Ants at t = 25

%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
from scipy.integrate import odeint
ion()

t = arange(0,50., 0.01)

# parameters
fr = 8.75
fa = 6.25
c = 0.01
p = 0.5
g = 0.001

# initial condition
x0 = array([50., 50.]) # Pr, Pa

def LV(x, t, fr, fa, p, c, g):
    # in python, arrays are numbered from 0, so the first element 
    # is x[0], the second is x[1]. The square brackets `[ ]` define a
    # list, that is converted to an array using the function `array()`.
    # Notice that the first entry corresponds to dV/dt and the second to dP/dt
    if t > 25.:
        g = 0.
    p = 0.25 * sin(t/5) + 0.5
    return array([ (fr*p*x[0]) + fa*p*x[1] - ((c-g)*x[0]*(x[0]+x[1])),
                   (fa*(1-p)*x[1]) + fr*(1-p)*x[0] - ((c-3*g)*x[1]*(x[0]+x[1])) ])

# call the function that performs the integration
# the order of the arguments is as below: the derivative function,
# the initial condition, the points where we want the solution, and
# a list of parameters
x = odeint(LV, x0, t, (fr, fa, p, c, g))

# plot the solution
plot(t, x)
xlabel('t') # define label of x-axis
ylabel('populations') # and of y-axis
legend(['Pr', 'Pa'], loc='lower right')

El Pato

%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
from scipy.integrate import odeint
ion()

t = arange(0,3., 0.01)

# parameters
fr = 8.75
fa = 6.25
p = 0.7
c = 0.01
g = 0.001

# initial condition: this is an array now!
x0 = array([10., 10.]) # Pr, Pa

# the function still receives only `x`, but it will be an array, not a number
def LV(x, t, fr, fa, p, c, g):
    # in python, arrays are numbered from 0, so the first element 
    # is x[0], the second is x[1]. The square brackets `[ ]` define a
    # list, that is converted to an array using the function `array()`.
    # Notice that the first entry corresponds to dV/dt and the second to dP/dt
    return array([ (fr*p*x[0]) + fa*p*x[1] - ((c-g)*x[0]*(x[0]+x[1])),
                   (fa*(1-p)*x[1]) + fr*(1-p)*x[0] - ((c-3*g)*x[1]*(x[0]+x[1])) ])

# call the function that performs the integration
# the order of the arguments is as below: the derivative function,
# the initial condition, the points where we want the solution, and
# a list of parameters
x = odeint(LV, x0, t, (fr, fa, p, c, g))

# plot the solution
plot(t, x)
xlabel('t') # define label of x-axis
ylabel('populations') # and of y-axis
legend(['Pr', 'Pa'], loc='lower right')

)

Patolihno

%matplotlib inline from numpy import * from matplotlib.pyplot import * from scipy.integrate import odeint ion()

t = arange(0,50., 0.01)

# parameters rv = 0.8 rr = 1.5 ra = 0.6 rp = 0.2 kv = 5. kr = 5. ka = 5. kp = 4. a = 1.5 b = 3. c = 1.5 d = 2. e = 2. n = 0.6 alfa = 2.5 beta = 2.5

# initial condition x0 = array([10., 40., 8.,8.]) # V, R, A, P

def LV(x, t, rv, rr, ra, rp, kv, kr, ka, kp, a, b, c, d, e, n, alfa, beta):

  return array([ rv*x[0]*(1-(x[0]/kv)) + a*x[0]*x[1] - x[3]*x[0]/(n+alfa*x[1]+beta*x[2]),
                 rr*x[1]*(1-(x[1]/kr)) + b*x[0]*x[1] - c*x[1]*x[3]*x[0]/(n+alfa*x[1]+beta*x[2]) ,
                 ra*x[2]*(1-(x[2]/ka)) + d*x[2]*x[3]*x[0]/(n+alfa*x[1]+beta*x[2])  ,
                 rp*x[3]*(1-(x[3]/kp)) - e*x[3]*x[2] + x[3]*x[0]/(n+alfa*x[1]+beta*x[2])])

# call the function that performs the integration # the order of the arguments is as below: the derivative function, # the initial condition, the points where we want the solution, and # a list of parameters x = odeint(LV, x0, t, (rv, rr, ra, rp, kv, kr, ka, kp, a, b, c, d, e, n, alfa, beta))

# plot the solution plot(t, x) xlabel('t') # define label of x-axis ylabel('populations') # and of y-axis legend(['V', 'R', 'A', 'P'], loc='upper left')

Code

%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
from scipy.integrate import odeint
ion()

t = arange(0,10., 0.01)

# parameters
fr = 1.5 
fa = 2.
p = 0.6
c = 0.2
g = 15.

# initial condition: this is an array now!
x0 = array([50., 50.]) # Pr, Pa

# the function still receives only `x`, but it will be an array, not a number
def LV(x, t, fr, fa, p, c, g):
    # in python, arrays are numbered from 0, so the first element 
    # is x[0], the second is x[1]. The square brackets `[ ]` define a
    # list, that is converted to an array using the function `array()`.
    # Notice that the first entry corresponds to dV/dt and the second to dP/dt
    return array([ (fr*p*x[0]) + fa*p*x[1] - ((c/g)*x[0]*(x[0]+x[1])),
                   (fa*(1-p)*x[1]) + fr*(1-p)*x[0] - ((c/(3*g))*x[1]*(x[0]+x[1])) ])

# call the function that performs the integration
# the order of the arguments is as below: the derivative function,
# the initial condition, the points where we want the solution, and
# a list of parameters
x = odeint(LV, x0, t, (fr, fa, p, c, g))

# plot the solution
plot(t, x)
xlabel('t') # define label of x-axis
ylabel('populations') # and of y-axis
legend(['Pr', 'Pa'], loc='lower right')
1)
for example, Rhyzobia bacteria in root nodules provide nitrogen to plants
2016/groups/g1/start.txt · Last modified: 2024/01/09 18:45 by 127.0.0.1