0
|
4718 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# Solving ordinary differential equations [growth equation]

Posted 9 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[n][t] == n^2*(1 - n/k)*r, n[t], t]  == ordinary differential equation of dn/dt = rn(1 - n/k) Help?
6 Replies
Sort By:
Posted 9 years ago
 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][]with the answer of Mathematica 10.0.1{n[t] -> (E^(r t + k C) k)/( E^(r t + k C)-1)}although the solution you might desire is{n[t] -> (E^(r t + k C) k)/( E^(r t + k C)+1)}Best regards,
Posted 9 years ago
 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] -> InverseFunction[ Log[#1]/k^2 - Log[-k + #1]/k^2 - 1/(k #1) &][(r t)/k + C]}}; 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: FullSimplify@% True 
Posted 9 years ago
 Replace "n" with "n[t]".So n^2(1 - n/k)r should be written n[t]^2(1 - n[t]/k)r.
Posted 9 years ago
 Cheers, I get...{{n[t] -> InverseFunction[Log[#1]/k^2 - Log[-k + #1]/k^2 - 1/(k #1) &][(r t)/ k + C]}}Look right?
Posted 9 years ago
 How do I do that?
Posted 9 years ago
 You need to make n a function of t everywhere.