F(N) versus N plot for logistic differential equation

2 visualizaciones (últimos 30 días)
Orsolya Kocsis
Orsolya Kocsis el 26 de Mzo. de 2021
Respondida: Bjorn Gustavsson el 26 de Mzo. de 2021
How do I plot the f(N) versus N plot of this equation dN/dt=rN(1-N/K)?

Respuestas (1)

Bjorn Gustavsson
Bjorn Gustavsson el 26 de Mzo. de 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

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by