This document is designed to provide guidance for the use of XPP. (1) Getting started on an ITAP PC: After logging in, go to START then to ALL PROGRAMS then to COURSE SOFTWARE then to SCIENCE then to MA then to XPP This should get XPP ready to run on your machine from the command line window. In your home directory, you will need to have created a ".ode" file with the information about the system you are trying to examine. It should be a "text" file; in your home directory you can use "notepad" to create the file. (To start "notepad", go to "run" and type "notepad" or go to "accessories" and double click on "notepad".) In "notepad", you should save your file as " type 'all files' " and name it myfile.ode To start XPP running that file, you need to get XPP to find the ode file. On the command line, type xpp h:/[your path]/myfile.ode You will know you are successful when xpp starts up the the X vs T graphics window with the menu down the left side. (2) General information (see also the xpp_doc.pdf file that can be downloaded from Bart Ermentrout's web page) XPP is an application that reads in a system of ode's with parameter values and initial conditions. The program solves the system numerically using a good solver, e.g. runge kutta All functions are assumed to be functions of time. Program file includes functions, parameter values (lines begin with p), initial conditions (lines begin with i), user defined functions and differential equations Each differential equation defines a function whose symbol is the differentiated variable, the other functions are defined by the an equation that gives an explicit formula in terms of other known quantities. These functions are for convenience of input and model description. Line continuation is not allowed... just use a long line, or define functions for the pieces. line beginning with @ specifies internal parameters, like the step size, the maximum and minimum values of the variables, and plots To RUN the program, at prompt, enter xpp file.ode if there are errors in programming, xpp will complain, if not, the graphics window, with the control buttons, will appear. Choose Initial conditions, then choose go. The solution should be displayed. It is enough to type I (for Initial conditions) and G (for Go). Viewaxes can be used to display the graph differently, e.g. x vs t, or y vs t or y vs x, along with scaling and positioning the axes. In general, typing in one of the boxes will obliterate the current contents. Choosing OK will display the old data in the new setting. To change the parameters, choose the button "parameter" from the top of the screen. Note that you must position the cursor in the box, then move it left with the arrow keys, then absorb stuff using the delete key from the right (i.e. with the cursor on the left)! Hit return after changing the parameter value, then hitting OK will put the new parameters in place. Use Initial conditions again to re-solve the equations. Numerics allows you to change the internal parameters, for example, the program complains that the step size is too small, you can change dt in the Numerics menu. The File menu contains Quit and Auto. hitting the Auto button brings up the Auto screen. Note that you must have already achieved a steady state or a periodic solution before Auto will begin. Auto is quite sensitive to this... to get to a steady state solution, if you are close to one, choose Initialconditions+Last over and over again. This completes the convergence to a steady state solution. When you have converged to a steady state solution and you have gotten the Auto screen, adjust the parameters if necessary, and hit "Run" If it is working successfully, Auto will produce a curve with nodes marked with + signs and a number. Often, it is a good idea to restart the program by starting with one of these nodes and adjusting the parameters. To start at a node, choose "Grab" then to the node you wish to start with and hit to choose that node. When the point has been 'grabbed' and the parameters adjusted hit "Run" again. Simultaneously to the pictures, there will be output on the window from which XPP was called that gives the coordinates of each of the points in the bifurcation diagram, the eigenvalues of the derivative, and the kind of bifurcation point (e.g. HB means it is a Hopf Bifurcation). To print your graphs, choose "postscript" from the File menu in Auto, name your file, and then print the postscript file from outside the program using your machines standard postscript printing utility. (3) The Morris-Lecar Example %%%%%%%% MorrisLecar.ode begins below this line %%%%%%%%%% # Morris Lecar Model as in book and my notes # # p Iapp=50 p C=20 p Vk=-84 p gk=8 p Vca=120 p gca=4.4 p Vlk=-60 p glk=2 p phi=.04 p v1=-1.2 p v2=18 p v3=2 p v4=30 i v=-50 i w=.5 minf(v)=.5*(1+tanh((v-v1)/v2)) winf(v)=.5*(1+tanh((v-v3)/v4)) tau(v)=1/cosh((v-v3)/(2*v4)) v'=(-gca*minf(v)*(v-Vca)-gk*w*(v-Vk)-glk*(v-Vlk)+Iapp)/C w'=phi*(winf(v)-w)/tau(v) done %%%%%%%% MorrisLecar.ode Ends above this line %%%%%%%%%% Load MorrisLecar.ode into XPP This should bring up the graphics window with the label "V vs T" and the menu along the left side Choose "Viewaxes" and change Axes so that V (that is, the Y axis) runs from -80 to 80. Choose Initialconds, then Go. With the parmeters as above, this will produce a curve starting at -50, dipping down below -60, then gradually increasing to about -55. Repeatedly choose Initialconds and Last. This uses the final conditions as the intial conditions for another run. You will need to repeat this many times, maybe 10 or 15, until the new line is straight across the graph (at about -42 or so). If you do not do this often enough, Auto will not recognize that you have reached a fixed point and will not be able to do the bifurcation diagram. Choose File, then choose Auto. This will bring up the window "It's AUTO man!" The graph should be labelled Iapp and V. (because Iapp was the first parameter in the list, and v was the first variable, I think). If not, you need to choose Parameter to change the choices. Use Axes to change the scale for Iapp from 0 to 350 and for V from -80 to 80. Choosing Run now will produce a point on the graph labeled with a + and the number 1. Doing it again will produce no discernable change except the number labeling the + may change to 2, 3, etc, all of which are stacked on top of each other! This means that the program is not happy with something in trying to create the bifurcation diagram. It might not think you have reached a fixed point, but if you were patient enough in the earlier step, that is probably not it. Probably, the default "Numerics" are not useful in this context. Choose "Numerics" to change some of the parameters. (For me, this is voodoo, except Ds is the step size and you may need to change it from positive to negative to get all of the bifurcation diagram.) For the data above, I found changing Ds to 2, Dsmax to 2, Par Min to 0 and Par Max to 350 worked. After changing the numerics parameters, choose OK. This puts you back in the Auto window. Choose Run now and you should get a nice curve, part of the bifurcation diagram; mine had points labelled 1,2, 3,4,5,6, and the curve changed from "stable" to "unstable" at 2 and back again at 4. The fact that there is a change instability means that there might be a bifurcation at 2 and 4 (and perhaps other places as well). Use "Grab" to select a new starting point. This makes the + labelled 1 large; use "tab" to cycle through the labelled points until you reach a good point to look for a bifurcation point to get more of the bifurcation diagram. When you have the one you want highlighted, hit "return" to select that one. Then try "Run" again. I chose 2, which looks like a bifurcation point because of the shift in stability. When I hit "Run", instead of running, it brings up a new window; it has highlighted "Periodic" which looks good to me. This creates a new, large piece of the bifurcation diagram! (I think it is done now.) Notice that when you choose "Grab", there is information below the graph about the point that is selected, in particular, the values of Iapp and V that the point represents. Going back to the main window (click on it, or close Auto), we want to display the phase plane and the null clines. To do so, we need to change the axes (with Viewaxes) to be V and W; note that this means we want V to go from -80 to 80 and W to go from 0 to 1. Chooseing "Nullcline" and "New" gives the nullclines on the graph. Choosing "Initialconds" and "New" makes it possible to change the initial conditions to what you want instead of what Auto left them as. If you want to change the parameters to something besides what Auto left them as, you should choose the BUTTON at the TOP labeled "PARAM" to do so. It looks like this should be done first. When you have choosen "Initialconds" and hit return, you'll get a trajectory in the phase plane as far as the interval for T you have selected (default is 20) will take you. Repeatedly choosing "Initialconds" and "Last" will take you on a longer path.