Message Boards Message Boards

6 Replies
0 Total Likes
View groups...
Share this post:

Solving ordinary differential equations [growth equation]

Posted 10 years ago

Hello, Im having trouble trying to solve this equation(question). I used Dsolve but I think im inputting it wrong.

dn/dt=r n(1-n/k)

r is called the growth rate, and k is called the carrying capacity. n is the population, t is time. initial condition n = n0 at t = 0.

------> What is the symbolic solution? Also, If k = 100, n0 = 1 and r = 0.1, how long(t) until n = 50?

What I've tried...

DSolve[Derivative[1][n][t] == n^2*(1 - n/k)*r, n[t], t]

== ordinary differential equation of dn/dt = rn(1 - n/k)


POSTED BY: Brendan John
6 Replies

Dear Brendan,

Please take into account that you are trying to solve a wrong equation: be aware of the n[t]^2 factor which should be n[t].

Just try this:

DSolve[D[n[t], t] == r n[t] (1 - n[t]/k), n[t], t][[1]]

with the answer of Mathematica 10.0.1

{n[t] -> (E^(r t + k C[1]) k)/( E^(r t + k C[1])-1)}

although the solution you might desire is

{n[t] -> (E^(r t + k C[1]) k)/( E^(r t + k C[1])+1)}

Best regards,

POSTED BY: Arturo Ramos

Inverse functions are tricky. The inverse function of a function that is one-to-one can cause problems. You'll want to be careful about that.

In general, to verify the solution, plug it back into the differential equation and see if it comes back with "True" :

solution = {{n[t] -> 
       Log[#1]/k^2 - Log[-k + #1]/k^2 - 1/(k #1) &][(r t)/k + C[1]]}};

diffEquation = HoldForm[D[n[t], t] == n[t]^2 (1 - n[t]/k) r]

ReleaseHold[diffEquation /. First[solution]]

I've used HoldForm to make sure that the subsitution worked. Without it, Mathematica might try to simplify D[n[t], t] to n'[t] which doesn't match the pattern. ReleaseHold is used after n[t] has been properly substituted with the proposed solution. The result of this is an enormous complicated equality. Fortunately, FullSimplify can handle it:


POSTED BY: Sean Clarke
Posted 10 years ago

Cheers, I get...

{{n[t] -> InverseFunction[Log[#1]/k^2 - Log[-k + #1]/k^2 - 1/(k #1) &][(r t)/ k + C[1]]}}

Look right?

POSTED BY: Brendan John

Replace "n" with "n[t]".

So n^2(1 - n/k)r should be written n[t]^2(1 - n[t]/k)r.

POSTED BY: Sean Clarke
Posted 10 years ago

How do I do that?

POSTED BY: Brendan John

You need to make n a function of t everywhere.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract