simulation of continuous logistic growth with time lag produces unexpected results?

9 views (last 30 days)
So I wrote a function for the continuous logistic growth model with time lag, and surprisingly, the average of the fluctuations is greater than the carrying capacity (K). Also, the fluctuations are periodic and don't become chaotic at high r*lag values. This is contrary to what I was expecting; with a discrete model, the average fluctuations were below the carrying capacity.
Here is the code for the function:
function [ dNdt ] = lagged_logistic( t, N, Nlag )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
r = 1;
K = 2000;
dNdt = r*N.*(1-Nlag/K);
where Nlag resemples N at a previous time (i.e. t - lagtime)
I used dde23 to solve the equation because of constant time delay.
clear all;
close all;
clc
lags = 1;
sol = dde23(@lagged_logistic,lags,1,[0,40])
tint = linspace(0,40,100);
y = deval(sol,tint);
plot(tint,y, 'r-');
% small lag
lags = 0.2;
sol = dde23(@lagged_logistic,lags,1,[0,40])
tint = linspace(0,40,100);
y = deval(sol,tint);
plot(tint,y, 'k-');
Is there something wrong with the code? As you can see, the red line fluctuations average above the carrying capacity (the constant black line at 2000), contrary to what is expected.

Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!