Solving logistic ode for bacterial population growth

조회 수: 4 (최근 30일)
Surabhi Thirumala Srinivasan
Surabhi Thirumala Srinivasan 2018년 3월 14일
답변: Athanasios Paraskevopoulos 2024년 5월 13일

Im trying to plot bacterial growth curve of this ode dN/dt = rN(K-N)/K, initial value N(0) = 1000 and parameter values r = 0.002 per sec,

  댓글 수: 2
ZAINAB
ZAINAB 2024년 5월 9일
Im trying to plot bacterial growth curve of this ode dN/dt = rN(K-N)/K, initial value N(0) = 1000 and parameter values r = 0.002 per sec,
Torsten
Torsten 2024년 5월 9일
Use "ode45" to get N and "plot" to plot the result.
If you have problems, you should invest two hours of your time to pass MATLAB Onramp, an introductory MATLAB tutorial free of costs, to learn the basics of the new language:

댓글을 달려면 로그인하십시오.

답변 (1개)

Athanasios Paraskevopoulos
Athanasios Paraskevopoulos 2024년 5월 13일
% Parameters
r = 0.002; % per second
K = 50000; % carrying capacity (assuming a value, as it is not provided)
N0 = 1000; % initial value
% Time span for the simulation
t_span = [0 10000]; % simulate for 10000 seconds
% Define the ODE function
odeFunc = @(t, N) r * N * (K - N) / K;
% Solve the ODE
[t, N] = ode45(odeFunc, t_span, N0);
% Plot the results
figure;
plot(t, N, 'LineWidth', 2);
title('Bacterial Growth Curve');
xlabel('Time (seconds)');
ylabel('Population (N)');
grid on;
legend('Bacterial Population (N)');

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by