Lotka-Volterra Matlab模型

时间:2013-12-18 14:14:55

标签: matlab

我必须使用matlab写一个Lotka-Volterra模型;

rabbit growth    X -> 2X              with rate k1*X
predation          X + Y -> 2Y        with rate k2*X*Y
fox death          Y -> 0                with rate k3*Y 

dX = @(k1,X,k2,Y) ((k1*X)-(k2*X*Y));
dY = @(k2,X,Y,k3) ((k2*X*Y)-(k3*Y));
funX = @ (X) dX(1,1,0.2,1);
funY = @ (Y) dY(0.2,1,1,0.5);
limits = [0 2000];

%%Plot graph
fplot (funX, limits,'R')
hold on
fplot(funY, limits, 'B')
ylabel ('Number of animals')
xlabel ('time (day)')
legend ('Rabbits', 'Foxes', 'Location', 'NorthEast')

我只是直线,这显然是不正确的。任何帮助表示赞赏。

0 个答案:

没有答案