フィルターのクリア

Calculating growth using ODE 45 from t=0 to t=100

1 回表示 (過去 30 日間)
Faris Amzar Mohamad Azrai
Faris Amzar Mohamad Azrai 2020 年 6 月 3 日
コメント済み: James Tursa 2020 年 6 月 3 日
Hello, I need help with my code using ODE 45. Can someone help me check my code?
t = 0:0.01:100;
r = [0.05 0.1 0.5 1 10];
k = 15;
B0 = 1;
B = @(x,y) 30-x.^2-5*(cos((x.*y)/5)).^2;
colourmap = [228 26 28; 55 126 184; 77 175 74; ...
152 78 163; 255 127 0]/255;
z = zeros(length(t),length(r));
T = zeros(length(t),length(r));
%
for i = 1:length(r)
dBdt = @(B) r.*B*(1-B./k);
[z,T] = ode45(dBdt,tspan, B0);
plotting
figure(6) %figure 6
loglog(t,T,'-','color',colourmap(i,:))
hold on
grid on
end
  1 件のコメント
James Tursa
James Tursa 2020 年 6 月 3 日
Does something seem to be wrong to you? If so, what?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by