# XPPAUT: Plotting a bifurcation diagram for a map Using the .ode file ```XPPAUT: Plotting a bifurcation diagram for a map
Using the .ode file (where c is a parameter):
#a2_bif.ode
#bifurcation diag of the discrete map from Assignment 2, problem 3
x(t+1)=c*x+x^3
par c=0
init x=0
@ total=200,method=discrete,nout=2
@ autoxmin=-2.2,autoxmax=1.5,autoymin=-2,autoymax=2
@ dsmax=0.05,dsmin=.00001,parmin=-2.2,parmax=2
@ maxstor 10000000,
@ xlo=-2.5,xhi=2,ylo=-3,yhi=3,xp=t,yp=x
done
1. Start up XPPAUT using the .ode file.
2. Either start at a fixed point or cycle point, or converge to a fixed point or cycle point using
“Initial condition → Go” followed by Initial condition → Last” repeatedly until you definitely
converged. Use the data window to check convergence.
3. Either include the option nout=2 in our .ode file or once in XPPAUT “Numerics → nOutput”
and change it from 1 to 2 to obtain 2 cycles in your bifurcation diagram. You would choose
3 for 3 cycles, 4 for 4 cycles etc.
4. Start up the AUTO window using “File → Auto”
5. Select “Axes → Hi-lo” and edit the box that appears appropriately.
6. Select “Numerics” Make sure the interval [Par Min, Par Max] includes the range of the
parameter that you are interested in. Choose Ds &gt; 0 to draw the part of the bifurcation
diagram to the right and Ds &lt; 0 to draw it to the left. Choose 0 &lt; Dsmin &lt; |Ds| &lt; Dsmax,
and all small enough so that bifurcations are not jumped over, but not too small so that
XPPAUT takes too long to run or crashes.
7. Choose “Run” and part of the diagram will appear.
8. Choose “‘Grab” and then Tab to a point from which you wish to continue your diagram and
hit enter. (In this case Grab the first point and hit enter.)
9. Change the sign of Ds appropriately. In this case you will want it to be negative.
10. Select “Run”
11. To save the diagram “File → postscript”
12. There is information about the special bifurcation points detected in the AUTO window (see
the bottom of the window as you tab) as well as in the command window. LP usually denotes
a saddle-node bifurcation and BP a period doubling bifurcation or pitchfork bifurcation. EP
is just an end point (not significant).
X
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
c
Figure 1: The graph of the bifurcation diagram for Gc (x) = cx + x3 , showing all fixed points
and 2 cycles. There is a pitchfork bifurcation of the fixed point x̄ = 0 at c = 1 and a period
doubling bifurcation at c = −1, At c = −2 there is a pitchfork bifurcation of the 2-cycle producing
2 additional 2-cycles when c &lt; −2. In a bifurcation diagram both stable and unstable fixed points
and cycle points are shown. XPPAUT uses red to indicate stable points and black to indicate
unstable points.
```