# Phase diagrams for 1st order ODEs are considered and studied. # # Art Belmonte # Mon, 27/May/96 # Math 308-509 [Maple V Release 4] # Section 2.6: Population Dynamics and Some Related Problems # # T-62/3-1: > with(DEtools): # dN/dt = F > F:=n->n * (n-1) * (n-2); F := n -> n (n - 1) (n - 2) > plot(F(n), n=0..3, y=-1..2, labels=[`n`, `dn/dt`], > xtickmarks=3, ytickmarks=2); # T-62/3-2: NOTE: Capital 'N' appears to be reserved by the system! It # would appear that within the context of DEplot, N = #differential # equations. Accordingly, we'll use lower case 'n.' > unassign('n'); > deq:=diff(n(t), t) = n(t) * (n(t) - 1) * (n(t) - 2); d deq := -- n(t) = n(t) (n(t) - 1) (n(t) - 2) dt > inits:={ [0, 0.2], [0, 0.8], [0, 1.7], [0, 2.1] }; inits := {[0, .2], [0, .8], [0, 2.1], [0, 1.7]} > DEplot(deq, n(t), t=-1..3, n=-1..3, inits); # T-62/3-3: Here are implicit and explicit solutions from dsolve. (It # this case dsolve COULD explicitly solve for n(t). This may not always # be the case.) Note that this NONLINEAR equation has three equilibrium # solutions which are NOT accounted for in the dsolve solutions: n(t) = # 0, n(t) = 1, and n(t) = 2. This is why we can't speak of a "general" # solution to a nonlinear differential equation like we can for a linear # one. > unassign('n', 't'); > deq; dsolve(deq, n(t)); d -- n(t) = n(t) (n(t) - 1) (n(t) - 2) dt - 1/2 ln(n(t)) + ln(n(t) - 1) - 1/2 ln(n(t) - 2) + t = _C1 > sol:=dsolve(deq, n(t), explicit); 2 sol := n(t) = %1 , 2 2 n(t) = -%1 (1 - %1 - exp(2 t - 2 _C1) + %1 exp(2 t - 2 _C1)) 4 %1 := RootOf((-1 + exp(2 t - 2 _C1)) _Z 2 + (2 - 2 exp(2 t - 2 _C1)) _Z + exp(2 t - 2 _C1)) # T-63/9-1: See whiteboard (your written notes) for discussion of # equilibrium points and stability. > unassign('n'); > F:=n->n^2 * (n^2-1); 2 2 F := n -> n (n - 1) > plot(F(n), n=-2..2, y=-1..2, labels=[`n`, `dn/dt`], > xtickmarks=3, ytickmarks=2); # T-63/9-2 > unassign('n'); > deq:=diff(n(t), t) = n(t)^2 * (n(t)^2 - 1); d 2 2 deq := -- n(t) = n(t) (n(t) - 1) dt > inits:=[ [0, 0.2], [0, 0.8], [0, 1.1], [0, -0.3], [0, -1.7] ]; inits := [[0, .2], [0, .8], [0, 1.1], [0, -.3], [0, -1.7]] > DEplot(deq, n(t), t=0..3, n=-2..2, inits); # T-63/9-3: Here is an implicit solution to the D.E. Note that dsolve # was not able to isolate an explicit solution. Note that this NONLINEAR # equation has three equilibrium solutions which are NOT accounted for # in the dsolve solution: N(t) = -1, N(t) = 0, and N(t) = 1. This is why # we can't speak of a "general" solution to a nonlinear differential # equation like we can for a linear one. > deq; dsolve(deq, n(t)); d 2 2 -- n(t) = n(t) (n(t) - 1) dt 1 - ---- - 1/2 ln(n(t) - 1) + 1/2 ln(1 + n(t)) + t = _C1 n(t) > dsolve(deq, n(t), explicit); n(t) = exp(RootOf(_Z exp(_Z) - _Z - 2 - ln(exp(_Z) - 2) exp(_Z) + ln(exp(_Z) - 2) + 2 t exp(_Z) - 2 t - 2 _C1 exp(_Z) + 2 _C1)) - 1 > allvalues(", dependent); Error, (in allvalues/rootseq) cannot evaluate with symbolic coefficients >