F(N) versus N plot for logistic differential equation
조회 수: 2 (최근 30일)
이전 댓글 표시
How do I plot the f(N) versus N plot of this equation dN/dt=rN(1-N/K)?
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!