# M145L.W99, Week 2 # by ralph abraham, 09 january 1999 # file: popul02, this is a MapleVr5 worksheet # # we follow Strogatz sec 2.3, p. 21 # see also MapleV Learning Guide sec 6.2, p. 220 # # This is the population dynamics model of VerHulst, 1834, based # on the logistic function. Experiment with changes in the parameters. # Define the vectorfield > r := 3.6: > K := 1.0: > expr := r*n*(1-n/K): > f := unapply( expr, n); f := n -> 3.6 n (1 - 1.000000000 n) > plot( f(n), n=-0..1); # Setup initial conditions > myvector := subs({n=N(t)}, expr): > eq := diff(N(t),t)=myvector: > ini1 := N(0) = 2.0: > ini2 := N(0) = 1.0: > ini3 := N(0) = 0.1: # Plot the direction field and trajectories > with(DEtools): > DEplot( eq, N, t=0..1, [ [ini1] , [ini2] , [ini3] ] ); # This is the end of file: popu02