Skip to content
Prev 564 / 696 Next

[R-sig-dyn-mod] Competition models

Hi,

I'm trying to fit bacterial competition models to experimental data.

The experimental data is expressed in natural logarithm scale. I would 
like to implement in R the Lotka-Volterra model:

dN1/dt = r1*N1*(1 - N1/K1 - a12*N2/K1)

dN2/dt = r2*N2*(1 - N2/K2 - a12*N1/K2)

We now that: dN1/dt*1/N1 = d(ln(N1))/dt since data is in ln() scale I do 
the transformation:

ln(N1) = Y1 thus N1 = exp(Y1)

Considering K1 = N1max and K2=N2max

The Competition model becomes:

dY1/dt = r1*(1 - exp(Y1)/exp(Y1max) - a12*exp(Y2)/exp(Y1max))

dY2/dt = r2*(1 - exp(N2)/exp(Y2max) - a12*exp(N1)/exp(Y2max))

In R, I implemented this model as:


LV <- function(time, state, parms){
   with(as.list(c(state, parms)), {
     dY1 <- r1*(1 - Y1/Y1max - a12*Y2/Y1max)
     dY2 <- r*(1 - Y2/Y2max + a21*Y1/Y2max)
     return (list(c(dY1, dY2)))
   })
}

So, I would like to know if this implementation of the model is correct.

Thanks

Vasco