필터 지우기
필터 지우기

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

조회 수: 4 (최근 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 CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by