[R] Logistic population growth and deSolve

Thomas Petzoldt thpe at simecol.de
Wed Feb 22 14:59:53 CET 2012


Hi Thomas,

I've been out of office for a time, but maybe you are still waiting ...

As far as I see your model is a correctly implemented ODE (!!!) system 
and I don't understand what you mean with "unexpected results".

Would it be possible that your original intention was not a *continuous* 
ODE but a discrete system instead?

In this case, just use the "euler" method:


## continuous system (ordinary differential equation, ODE)
output = ode(y = state, times = times, func = logGrowth, parms = parameters)
plot(output)

## discrete system (difference equation)
output = ode(y = state, times = times, func = logGrowth, parms = 
parameters, method="euler")
plot(output)


Note also that you can write your problem more elegantly using vector 
and matrix notation.

Thomas Petzoldt



More information about the R-help mailing list