next up previous contents
Next: Plotting the Results with Up: AUTO Demos : Tutorial. Previous: Copying the Demo Files.   Contents


Executing all Runs Automatically.

To execute all prepared runs of demo cusp, simply type the command given in Table 12.2.


Table 12.2: Executing all runs of demo cusp.
AUTO -COMMAND ACTION
demofile('cusp.auto') execute all runs of demo ab interactively


The command in Table 12.2 begins a tutorial which will proceed one step each time the user presses a key. Each step consists of a single AUTO command preceded by instructions as to what action the command performs. The tutorial script cusp.auto performs the demo by reading in a single AUTO constants file and then interactively modifying it to perform each of the demo. The essential commands in cusp.auto are given in Table 12.4.

Note that there are four separate runs, where each run command (r is an abbreviation) performs a run. In the first run, a branch of stationary solutions is traced out. Along it, one fold (LP) (limit point, or in this case, a saddle-node bifurcation) is located. The free parameter is $ \mu$. The other parameter $ \lambda$ remains fixed in this run. Note also that only special, labeled solution points are printed on the screen. More detailed results are saved in the data-files b.mu, s.mu, and d.mu.

The second run does the same thing but now in the negative direction of $ \mu$, i.e., backwards instead of forwards. The backwards continuation is appended to the forwards continuation in the data-files. Afterwards we perform a relabelling to make sure that we have unique labels for each special solution.

The results are then plotted on the screen. Pressing the enter key at the command line causes an automatic $ \mu$ vs. $ x$ display that shows the two fold points at labels 2 and 7.

In the third run, the fold detected in the first run is followed in the two parameters $ \mu$ and $ \lambda$. The commands that accomplish this must change a few constants of the constant file: the first constant is ISW, that must be set to 2 to cause a two-parameter continuation.

The second constant is the starting label for the file s.mu that we are starting from. We know that 2 is a good label. However, we did not know this number in advance, and moreover, in sensitive cases, it can be different on different computer types. Another way to specify the starting label is to use the splabs Python function: in this case splabs('mu','LP') returns the list of 'LP' labels for b.mu, and s.mu, and so the first one, splabs('mu','LP')[0] denotes label 2.

The fourth run continues this branch in opposite direction. The detailed results of these continuations are accumulated in the data-files b.cusp, s.cusp, and d.cusp. Finally, a plot of the cusp is produced.

The numerical results are given below in somewhat abbreviated form. Some differences in output are to be expected on different machines. This does not mean that the results have different accuracy, but simply that arithmetic differences have accumulated from step to step, possibly leading to different step size decisions.

Next, reset the work directory, by typing the command given in Table 12.3.


Table 12.3: Cleaning the demo cusp work directory.
AUTO -COMMAND ACTION
cl() remove temporary files of demo cusp
dl('mu') remove 'mu' data-files of demo cusp
dl('cusp') remove 'cusp' data-files of demo cusp



# Run forwards
 
  BR    PT  TY  LAB    PAR(2)        L2-NORM         U(1)        PAR(1)     
   1     1  EP    1   0.00000E+00   0.00000E+00   0.00000E+00   1.00000E+00
   1    14  LP    2   3.84900E-01   5.77360E-01  -5.77360E-01   1.00000E+00
   1    20        3   1.26582E-01   9.29410E-01  -9.29410E-01   1.00000E+00
   1    40        4  -1.38347E+00   1.40803E+00  -1.40803E+00   1.00000E+00
   1    47  EP    5  -2.07212E+00   1.53340E+00  -1.53340E+00   1.00000E+00

# Run backwards
 
  BR    PT  TY  LAB    PAR(2)        L2-NORM         U(1)        PAR(1)     
   1     1  EP    1   0.00000E+00   0.00000E+00   0.00000E+00   1.00000E+00
   1    14  LP    2  -3.84900E-01   5.77360E-01   5.77360E-01   1.00000E+00
   1    20        3  -1.26582E-01   9.29410E-01   9.29410E-01   1.00000E+00
   1    40        4   1.38347E+00   1.40803E+00   1.40803E+00   1.00000E+00
   1    47  EP    5   2.07212E+00   1.53340E+00   1.53340E+00   1.00000E+00

# Forward continuation of the first fold in two parameters
 
  BR    PT  TY  LAB    PAR(2)        L2-NORM         U(1)        PAR(1)     
   2    20       11   5.42543E-02   3.00470E-01  -3.00470E-01   2.70847E-01
   2    40       12  -9.99228E-02   3.68308E-01   3.68308E-01   4.06953E-01
   2    60       13  -5.89228E-01   6.65403E-01   6.65403E-01   1.32828E+00
   2    80       14  -1.71622E+00   9.50271E-01   9.50271E-01   2.70904E+00
   2    85  EP   15  -2.06374E+00   1.01051E+00   1.01051E+00   3.06341E+00

# Backward continuation of the fold in two parameters

  BR    PT  TY  LAB    PAR(2)        L2-NORM         U(1)        PAR(1)     
   2    20       11   1.09209E+00   8.17354E-01  -8.17354E-01   2.00420E+00
   2    34  EP   12   2.02776E+00   1.00461E+00  -1.00461E+00   3.02770E+00

The CLUI was used to generate the constants file at runtime. In the example below, the constant file c.cusp will be read in, and the CLUI will be used to make the appropriate changes to perform the calculation.


Table 12.4: Selected runs of demo ab.
AUTO -COMMAND ACTION
ld('cusp') load the problem definition cusp
r(sv='mu') execute the run and save the results
  in the files b.mu, s.mu, and d.mu
r(DS='-',ap='mu') execute the run backwards and
  append the results to the above files
rl('mu') relabel solutions in b.mu and s.mu
ld(s='mu',ISW=2,IRS=splabs('mu','LP')[0]) use s.mu as the solution file to start from,
  change ISW to 2,
  and change IRS to select the first fold in b.mu.
r(sv='cusp') execute the third run of demo cusp
r(DS='-',ap='cusp') execute the fourth run of demo cusp



next up previous contents
Next: Plotting the Results with Up: AUTO Demos : Tutorial. Previous: Copying the Demo Files.   Contents
Gabriel Lord 2007-11-19