I want to solve the function
function Change = logisticGrowth( t,Population )
Limit=100;
MaxGrowthRate=0.2;
LossRate=0.02;
Density = Population / Limit;
Loss = Population * LossRate;
Change=Population*MaxGrowthRate*(1-Density)-Loss;
end
with a delay of 5 years using
delay=5;
before=2;
timespan=[0 100];
dde23(@logisticGrowth,delay,before,timespan)
and Matlab tells: "Error using logisticGrowth. Too many input arguments."
I appreciate your hints.

 採用された回答

Heinz_M
Heinz_M 2016 年 4 月 21 日

0 投票

There is a possible solution.
function solution
delay=5;
before=2; % history
timespan=[0, 100];
Limit=100;
MaxGrowthRate=0.2;
LossRate=0.02;
dde_options = ddeset('RelTol',1e-07);
sol=dde23(@logistic,delay,before,timespan,dde_options,Limit,MaxGrowthRate,LossRate);
plot(sol.x,sol.y)
grid on
title('Logistic Growth with delayed impact of density')
xlabel('t')
ylabel('y')
end
function Change = logistic( t,Population,Z,Limit,MaxGrowthRate,LossRate )
Loss = Population * LossRate;
Change=Population*MaxGrowthRate*(1-Z/Limit)-Loss;
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Network Parameters についてさらに検索

製品

タグ

質問済み:

2016 年 4 月 14 日

回答済み:

2016 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by