# M145L.W99, Week 2 # by ralph abraham, 09 january 1999 # file: volt02, this is a MapleVr5 worksheet # # we follow Strogatz Ch. 6, p. 189 # see also MapleV Learning Guide sec 6.2, p. 232 # # This is the population dynamics model of Volterra-Lotka, 1924, based # on the logistic function. Experiment with changes in the parameters. # Define the vectorfield > r := 0.5: > xdotexpr := x*(1-y): > ydotexpr := r*y*(x-1): # Setup initial conditions > myvector1 := subs({x=X(t), y=Y(t)}, xdotexpr): > myvector2 := subs({x=X(t), y=Y(t)}, ydotexpr): > eq1 := diff(X(t),t)=myvector1: > eq2 := diff(Y(t),t)=myvector2: > ini := X(0) = 0.9, Y(0) = 0.9: # Plot the direction field and trajectories > sol1 := dsolve( {eq1, eq2, ini}, {X(t),Y(t)}, type=numeric ); sol1 := proc(rkf45_x) ... end > with(plots): > odeplot( sol1, [X(t), Y(t)], 0..10, labels=["x","y"] ); # This is the end of file: volt01