next up previous contents
Next: Demo duff: harmonic forcing Up: Running rauto Previous: Running rauto   Contents

Demo cusp: restart labels, branch switching and scans

To create a working copy of the demo cusp change to a directory where you would like to do your computations, for example, ${HOME}/rauto. Then type `rdm cusp'. This will create the sub-directory cusp, which contains the files cusp.f, r.cusp, demo and scandemo. Change to the directory cusp.

The equations file cusp.f defines the right-hand side of the ODE $ \dot{x}=\mu + \lambda x - x^3$ with the identifications U(1)$ {}=x$, PAR(1) $ {}=\lambda$ and PAR(2)$ {}=\mu$. The master constants file is r.cusp and the files demo and scandemo are two executable shell scripts for the command interpreter bash serving as demonstration programs. The first script demo illustrates branch-switching and executes the rauto commands

rauto cusp muf
rauto cusp mub -DS -

rrun=muf
rauto cusp LPf $rrun -IRS $(splabs $rrun LP 1 1) -ISW 2
rauto cusp LPb $rrun -IRS $(splabs $rrun LP 1 1) -ISW 2 -DS -

The first two commands perform initial runs in forward (muf) and backward (mub) direction starting at the initial solution given in STPNT. During both runs a limit point (fold or saddle-node bifurcation) is detected; see Figures 5 (a) and (b). In the subsequent runs we compute the locus of limit points in the two parameters $ \lambda$ and $ \mu$ starting at the limit point found in run muf; see Figure 5 (c). This is called fold continuation. To perform such a restarted run we use an rauto command of the form


 rauto name run rrun -IRS rlab [(-auto_constant value) ...]  


Here, rrun is the name of the restart run during which the limit point was detected and rlab is the restart label that was assigned to it by AUTO (column LAB). Rrun and rlab together uniquely specify a restart solution.

Figure 5: Bifurcation diagrams of the example cusp. Initial runs in $ (\mu ,x)$ coordinates in (a) color and (b) black-and-white and (c) the fold curve in $ (\lambda ,\mu )$ coordinates with a cusp point at $ (0,0)$.
\includegraphics[width=0.32\linewidth]{cusp1.eps}  \includegraphics[width=0.32\linewidth]{cusp1bw.eps}  \includegraphics[width=0.32\linewidth]{cusp2.eps}
(a) plotbd 1:3 "[-2:2]" "[-2:2]" muf mub   
(b) plotbd -bw 1:3 "[-2:2]" "[-2:2]" muf mub   
(c) plotbd 4:1 "[-2:2]" "[-2:2]" LPf LPb   

If you look at the output of run muf you will see that the restart label of the limit point is 2, so a call like `rauto cusp LPf muf -IRS 2 -ISW 2' would do. However, specifying restart labels explicitly is not recommended as we normally can't anticipate what label will be assigned and the labels assigned may change when changing AUTO constants. We would rather like to tell rauto to `start at the limit point found in run muf'. This functionality is provided by the utility program splabs (special point labels). An invocation of splabs has the form


 splabs run type [begin [end]]  


Type is the type of the special point, here LP. The list of labels to be selected can be restricted to a subset by specifying a range of indices with begin and end. Try to select the labels of all, the first and the last end point (EP) of run muf with splabs. To substitute the output of splabs for rlab we use a simple form of command substitution.

Since we want to change the type of continuation from equilibrium point to fold continuation we have to perform branch switching by setting the AUTO constant ISW to 2. Note that ISW is a special constant in the sense that rauto always initializes ISW to 1 (normal setting) regardless of its value in a constants file. Values other than 1 must be specified on the command line.

The second script scandemo demonstrates the so-called multiple run mode of rauto for performing so-called scans. It executes the rauto commands

rauto cusp muf -UZR 2 -1
rauto cusp mub -DS -

rrun=muf
rauto cusp LPf $rrun -IRS $(splabs $rrun LP 1 1) -ISW 2
rauto cusp LPb $rrun -IRS $(splabs $rrun LP 1 1) -ISW 2 -DS -

rrun=muf
rauto cusp laf $rrun -IRS $(splabs $rrun UZ 1 1) -ICP 1 2 \
  -UZR 1 -2:0.1:2
rauto cusp lab $rrun -IRS $(splabs $rrun UZ 1 1) -ICP 1 2 \
  -UZR 1 -2:0.1:2 -DS -

rrun=laf
rauto cusp mu%02dff $rrun -IRS $(splabs $rrun UZ) -ICP 2 1
rauto cusp mu%02dfb $rrun -IRS $(splabs $rrun UZ) -ICP 2 1 -DS -
rrun=lab
rauto cusp mu%02dbf $rrun -IRS $(splabs $rrun UZ) -ICP 2 1
rauto cusp mu%02dbb $rrun -IRS $(splabs $rrun UZ) -ICP 2 1 -DS -

The first four commands are almost as before. However, the first run muf is recomputed, because a so-called user output point is defined with the option `-UZR 2 -1', which can be read as `save restart data whenever PAR(2) assumes the value -1'. The general form of defining user output points is


 -UZR [(inum drange) ...]  



 drange   :   dnum $ \mathrm \vert$ begin[:step]:last  


Inum is the index of a parameter and drange is either a double precision number or a list of double precision numbers evenly distributed within the interval $ [{\it begin\/},{\it end\/}]$ with spacing step, which is $ 1.0$ by default.

Figure: plotbd -i 1:4:3 "[-2:2]" "[-2:2]" `lsruns "mu*"` LPf LPb
r0.381

\includegraphics[width=\linewidth]{fold_mf1.eps}

The fifth and sixth run start at this user output point and perform an equilibrium point continuation in $ \lambda$ for $ \mu=-1$. These runs produce a large number of further user output points for different values of $ \lambda$. Note that you may need to recompile AUTO with NUZRX set to a sufficiently large value. The user points computed in these runs serve as starting points for a sequence of continuations in $ \mu$, scanning a two-dimensional manifold of equilibrium points above the $ (\lambda ,\mu )$ parameter plane; see Figure 6. This sequence of continuations is executed with the last four commands, where we use the multiple run mode of rauto.

In multiple run mode, that is, when a list of more than one restart label for the same restart run is specified the run name must contain a printf %d format specifier of the general form %[0[width]]d. The optional 0 forces zero-padding and width sets an optional field width for printing a zero-padded decimal integer number. Rauto will compute a qualified run name with the actual restart label substituted according to the format specifier. This creates a unique name for each run of a scan. Use lsruns as shown in the caption of Figure 6 to pass all qualified run names matching a certain pattern to plotbd. Note that this example makes use of parameter overspecification. All runs plotted in Figure 6 used the option `-ICP 2 1' which includes both parameters in the output data such that these runs can easily be combined in a single plot.


next up previous contents
Next: Demo duff: harmonic forcing Up: Running rauto Previous: Running rauto   Contents
Frank Schilder 2007-04-12