F(N) versus N plot for logistic differential equation
2 views (last 30 days)
Show older comments
How do I plot the f(N) versus N plot of this equation dN/dt=rN(1-N/K)?
0 Comments
Answers (1)
Bjorn Gustavsson
on 26 Mar 2021
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!