Sei sulla pagina 1di 8

XPPAUT lecture: an example session

6.2.2009

Introduction
This example session is only meant to introduce the most basic features of XPPAUT including simulating and displaying ordinary differential equations, depicting phase planes, nullclines and basic bifurcation diagrams. For further reading please refer to the online-tutorial (http://www.math.pitt.edu/~bard/bardware/tut/start.html) or the book Simulating, Analysing, and Animating Dynamical Systems from Bard Ermentrout.

An example session 1. Basic simulations


1. Edit and save an *.ode file. An ode-file is a simple ASCII text file that specifies the ODE to be simulated. XPPAUT is able to simulate a wide range of ordinary, partial and stochastic differential equations, also including Markoc processes. Here only the most basic directives to specify a simple ode are introduced: # a comment # specifying initial conditions of variables # several are separated by comma, no spaces! init x=2 # specify parameters and their initial values # several are separated by comma, no spaces! par lampda=1.2 # the ode system dx/dt=x*x/(1+x*x)-lambda*x # finalizing the definition file done This is already fully specified ode-file. There are much more directives and options, some of the most important are:

# defining auxiliary variables and functions f(x,p,t) aux u=f(x,p,t) # seeting xppaut parameters defining integration, # plotting etc.,. # e.g total integration time @ total=100 2. Start XPPAUT (on Windows you have to start an X-Server first). 3. Load the activator-inhibitor.ode file by one click. (by clicking on the arrows you can scroll the file browser) 4. The main window contains a large region for graphics, menus, and various other gadgets. In the upper horizontal bar, there are colored field, which are used to view and edit initial conditions (ICs), boundary condition (BCs), time delay (Delay), parameters (Param), the system equations (Eqn) and data, if specified by a single click. In order to do things, you can either enter a command with short cuts or by clicking on the menu items in the left column. The shortcuts are indicated by the capital letter in the respective commands. 5. Simulate the system: (i) (g) 6. Adjust the window: (w) (f) 7. Adjust integration/simulation time: (u) (t) ->200 (ESC) a. Then simulate and adjust the window again: (i) (g) (w) (f) 8. Plot other variable, e.g. Rp: (x) -> (rp) 9. Change color of curves: (g) (e) ->0 ->*Color:4 10. Plot several variables in new window: (m) (c) (g) (a) -> yp ->Color:2 11. Delete curves: (g) (d) 12. Delete window: (m) (d) 13. Analyse influence of S: (i) (r) Range: S Steps: 5 End: 0.2

Cycle colour: y Note: The change in amplitude between the damped oscillations and the stable oscillations is rather abrupt. This is characteristic for an hysteresisoscillator or relaxation-oscillator, which can also be characterized by subcritical Hopf-bifurcation. Remember that in this system there is subcritical Hopf-bifurcation, when a critical S-value was passed from below. What happens, when we pass the other higher critical S-value from above? 14. Erase window: (e) 15. Check for higher critical S-value by brute force: (i) (r) Steps: 10 End: 0.4 Note: The transition from stable oscillations to damped oscillation is smoother at the supercritical Hopf-bifurcation. Lets look at the oscillations of the cascade with negative feedback: 16. Quit file and load the cascade.ode: (f) (q) 17. Look at Rp(t): (i) (g) (w) (f) (x) -> Rp 18. Check influence of S: (i) (r) Range: S Steps: 3 Start: 3 End: 7 Cycle colour: y Note: Curves of Rp(t) look strange. The exhibit an abrupt change, even though we expect smooth behaviour. This indicates a numerical problem. Lets switch the solver such it can handle stiff systems. 19. Setting a stiff system solver with default setting: (u) (m) (s) ESC 20. Now run the simulations again: (i) (r), etc.,

Note that here the transitions from daigmped to stable oscillations is much smoother than in the above case of the subcrititcal Hopf-Bifurcation.

2-D phase plane analysis


21. Load the file Higgins.ode. 22. Run a simulation and fit the window: (i) (g) (w) (f) 23. Lets now look at the phase plane X(Y): (v) (2) X Lo: 0 X Hi: 20 Y lo: 0 Y Hi: 20 We see the stable limit cycle. 24. We can start simulations at different starting points in the phase plane: (i) (m) or even better (i) (i). 25. Inside the limit cycle we should have an unstable fixed point. Lets verify: (s) (g) YES Note: the window shows us the calculation of the Eigenvalues of the Jacobian. We have two zero Eigenvalues. If we have additional higher order terms then the FP is unstable. 26. The FP must be the intersection of the nullclines: (n) (n) 27. The trajectories must be tangent to the flow field: (d) (d)

3-D phase plane analysis


Note that XPPAUT only computes nullclines and vector fields meaningfully in two dimensions. 28. Now load the activator-inhibitor.ode and set the simulation time and the S loop again: (u) (t) -> 200 ESC GoTo step 13

Note: The simulated curves do not fit into the window. Even (w) (f) does not help because xppaut fits the window to the first simulated curve, which is 0 is this case. 29. Lets adjust the window manually: (w) (w) X Lo: 0 X Hi: 200 Y lo: 0 Y Hi: 3 (i) (r) 30. Lets now look at the phase plane X(R): (v) (2) Xaxis: R Y-axis: X Xmax: 2 Ymax: 2 (i) (g) Note: Obviously, we obtain a stable limit cycle for S=0.2. We can explore the system dynamics in various ways: 31. Start simulation with different starting points with the mouse: (i) (m) or (i) (i) Note: With initial value R=1.6, X=0.8 we obtain trajectories that cross. How can that be? 32. Lets look at the 3-D phase space: (v) (3) Xaxis: R Y-axis: X X-axis: Ep Xmax: 2 Ymax: 2 Zmax: 2

XLo=-1.5 XHi=1.5 YLo=-1.5 YHi=1.5 Note: In the 3-D phase space trajectories do not cross.

Bifurcation analysis
Note: For the bifurcation analysis it is paramount to have the system at a steady state! Otherwise the numerical routines to not find other equilibrium points as a function of some parameter.

33. Set ICs and parameter S to 0. 34. Start AUTO: (f) (a) 35. In order to calculate the bifurcation diagram, we have to set several parameters first: a. Parameters: We can look at several parameters in a session b. Axes: we have to choose, what to plot: Hi-lo (a) (i) Xmin:0 Ymin:0 Xmax:0.5 Ymax:2 c. The Numerics command we need to set some numerical parameters and directions of change etc. (n) rrDs: 0.001 # initial step size for the bifurcation calculation. The sign of Ds tells AUTO the direction to change the parameter. Dsmax: 0.03 Par Max: 0.5 # the maximum step size # This is the right-hand limit of the diagram for the principle parameter 36. Before we calculate the steady states of R as a function of S, we tell AUTO to give us an output at point S=0.091: (u) (1) S=0.091

37. Run, to start the numerical calculations, first of steady states: (r) (s)

Note: We obtain a plot of the steady states of R as a function of S. The diagram itself has two different lines and two different circles. Stable fixed points are thick lines, stable periodics are solid circles, unstable fixed points are thin lines, and unstable periodics are open circles. Additionally, there are crosses occasionally dispersed with numbers associated with them. These represent ``special'' points that AUTO wants to keep. There are several of them:

EP Endpoint of a branch LP Limit point or turning point of a branch TR Torus bifurcation from a periodic PD Period doubling bifurcation UZ User defined function MX Failure to converge BP Bifurcation or branch point HB Hopf bifurcation point We can have a closer look at the special points by parsing through them, using

38. Grab: (g)

TAB

Note: We obtain a cross on the first equilibrium point and some corresponding information, the branch, the point number, the type of point, the AUTO label, the parameters, and the period are given. The points marked by crosses have labels and types associated with them. The type is one of the above. The label corresponds to the number on the diagram. If point is positive, it is an unstable solution and if it is negative it is stable. As you traverse the diagram, stability is shown in the circle. We obtain two Hopf-Bifurcations (point 2 and 4).

We can grab a point and restart calculation from there: Go first Hopf-bifurcation, (lab 3) and press ENTER.

Note: When you now go to the main window and take a look at the initial conditions (ICs) and parameter values (Param), you can see that they are updated correspondingly.

39. Restart the calculation of the bifurcation diagram that the grabbed point: As it is a Hopf-bifurcation, we calculate the periodic orbits: (r) (p)

Note: We see unstable and stable periodic orbits. Even though AUTO mainly independent from XPPAUT, there is some communication. We can import solutions, e.g. orbits, into the XPPAUR main windows:

40. Go to the unstable limit cycle at S=0.091 (Lab 9) and grab it. 41. Import the orbit into XPPAUT: (f) (i) 42. Freeze the orbit and colour: (g) (f) (f) Colour: 2 43. Go back to AUTO and grap the stable limit cycle at S=0.091 (Lab 11). 44. Import the orbit into XPPAUT: (f) (i) 45. Freeze the orbit and colour: (g) (f) (f) Colour: 8 46. We can now check whether the stable and unstable limit cycles behaves as expected by starting simulations at different starting points: (i) (i) 47. Exercise: make a bifurcation diagram of following ODE: X=x^2/(1+x^2) a+x And/or substrate-depletion.ode

Potrebbero piacerti anche