# lotka-volterra eqns x'=a*x-b*x*y y'=-c*y+d*x*y par a=1,b=1,c=1,d=1 init x=1,y=.1 doneRun XPPAUT by typing xpp lv.ode. Click into the Main Window and tap to integrate the equations (On the menu, .) Tap and to plot the variable x against time. (On the menu it is .) Note the periodic behavior. Add y(t) to the picture by choosing ( ) and fill the dialog box as
Now lets look at the phase-plane. In the Main Window , click on ( ). Change the view by clicking on ( ). Fill in the dialog box as follows:
Click on ( ) and accept the default of 10. A 10x10 array of small lines will be drawn showing the direction field. Now Click on ( ) to draw the nullclines. There are 2 fixed points, (0,0) and (1,1). Let's check the stability of the (1,1) fixed point. Click on ( ) and click the mouse near the (1,1) fixed point. Click on No (don't print the eigenvalues) and a new window will appear showing the fixed point and the structure of the eigenvalues. ( c+ is the number of complex eigenvalues with positive real parts, and so on, with im the number of pure imaginary eigenvalues.) Note the equilibrium point has neutral stability. Quit XPPAUT by tapping .
Now let's solve the next simplest predator-prey model in which the
prey has a finite carrying capacity:
# predator-prey with carrying capacity x'=a*x*(1-x/k -b*y) y'=y*(-c+d*x) par a=1,b=1,c=1,d=.4,k=2 init x=1.9,y=.2 @ xlo=-.1,xhi=3,ylo=-.1,yhi=3,xp=x,yp=y doneThis file has an added line that starts with the @ symbol. This tells XPPAUT that some control commands follow. The ones here tell XPPAUT the dimensions of the plotting window and which variables to plot. There are many other control commands that eliminate the necessity of calling up dialog boxes.
Start the program by typing xpp pp.ode. Here are some things to try:
Here is another example for you to try. This is a predator prey model
that has growth of the prey increasing at low populations and then
decreasing at high rates.
The model is similar to our other models in other respects:
# a simple model that obeys Kolmogorov's assumptions par a=2,b=1,c=1,d=.35 x'=x*(1+a*x-x^2-b*y) y'=y*(-c+d*x) @ xlo=-.1,ylo=-.1,xhi=3,yhi=3,xp=x,yp=y @ total=40 doneAs in the previous file, I have set up the file so that it comes up in the phaseplane. Draw the nullclines and the direction fields. Draw some representative trajectories. Here d is so small that the y-nullcline x=c/d does not intersect the x-nullcline in the positive quadrant. Thus, the predators die out and the prey go to their maximum value of around 2.5. Increase d to 0.6. Erase the screen and draw the nullclines and direction fields. Draw some representative trajectories. Note that now, the prey and predators co-exist. Finally, increase d to 1.2. Now erase the screen and look at the nullclines, etc? The nullclines indicate that this system now satisfies Kolmogorov's criterion for limit cycles.
At what value of d do limit cycles appear? The way to figure this
out is to see at what value of d the coexistent state loses
stability. This will happen when the y-nullcline intersects the
x-nullcline to the left of the maximum and the x-nullcline has a
positive slope. The x-nullcline is