help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

system of ODE's carrying capacity and population dynamics


From: William Christopher Carleton
Subject: system of ODE's carrying capacity and population dynamics
Date: Thu, 20 Nov 2008 12:44:46 -0500

I'm slowly progressing with Octave and figuring out how to have systems 
demonstrate the behaviour I want, but I'm now completely stumped. Here's the 
system so far (in Octave code);

function xdot=f(x,t)
k=0.01
xdot(1)=x(1) * k * ((x(2) - x(1)) / x(2))
xdot(2)=x(2) * (-k * (x(1) / x(2))
endfunction

t=linspace(0,500,500)
x0=[10 1000]
x=lsode('f',x0,t)

which demonstrates a decreasing carrying capacity as the population increases. 
The next step, that I've been stuck on, is having the carrying capacity recover 
when the population drops (after the functions cross). This is likely more of a 
math question than a specifically 'Octave' one, but I might be doing something 
wrong with the code as well... Any help is greatly appreciated,

Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]