F(N) versus N plot for logistic differential equation

조회 수: 2 (최근 30일)
Orsolya Kocsis
Orsolya Kocsis 2021년 3월 26일
답변: Bjorn Gustavsson 2021년 3월 26일
How do I plot the f(N) versus N plot of this equation dN/dt=rN(1-N/K)?

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2021년 3월 26일
To solve for N you simply have to implement the ODE as a matlab-function, either as in an m-file or as an anonymous function-handle, then integrate it from some initial condition with some values of r and K over some period of interest. Something like this:
qwerty(t,N,r,K) = @(t,N) r*N*(1-N/K);
[t_out,N_out] = ode45(@(t,N) qwerty(t,N,r_yours,K_yours),[0 123],12);
How to plot f(N) vs N is not at all clear since you haven't specified f. But something like this:
plot(N,f(N),'.-')
HTH

카테고리

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