Homoclinic branch switching with HomCont

The method is based on B.E. Oldeman, A.R. Champneys and B. Krauskopf, 
``Homoclinic branch switching: a numerical implementation of Lin's
method'', Int. J. of Bifurcation and Chaos 13(10) (2003) 2977-2999.
(Preprint version available on 
http://www.enm.bris.ac.uk/anm/preprints/2001r11.html ) 
Please have a look in this paper for more details and cite it, if you use
the method.

Unfortunately, there is no official documentation of the branch switching 
method in AUTO97. You can, however, find a description (and demos) 
in the AUTO2000 manual. (Note that for use in AUTO97 you will have to 
add one to all parameter indices, i.e. use PAR(11) for the time interval of
the homoclinic orbit in AUTO97 instead of PAR[10] in AUTO2000.)

The example cir in this directory exemplarily computes 2-homoclinic orbits 
near a Shilnikov saddle-focus homoclinic orbit. It uses the equation file
and starting data from demo cir (see AUTO manual).
The starting data is saved in cir.dat and first needs to be converted into 
AUTO-format using the @fc command. Then a 2-homoclinic orbit is 
computed in several steps, which are described below. The files r.cir.n,
s.cir.n correspond to the n-th run.

1st run: Increase the time interval (PAR(11)) for the homoclinic orbit to
100.

2nd run: Continue orbit to a region in parameter space, such that the
saddle quantity of the associated equilibrium yields complex dynamics near
the orbit. This is achieved by continuation of the orbit in PAR(1), PAR(2).

3rd run: Preparation for branch-switching. 
The branch-switching method requires knowledge about the orientation of
the homoclinic orbit. Therefore, a continuation step is performed with
ITWIST=1.
Continuation is performed in a dummy parameter PAR(8), which does not 
appear in the equations. Hence, no actual continuation happens, but only
the orientation is computed.

4th run: Start of the branch switching.
We set ISTART=-2 for the computation of 2-homoclinic orbits. (In general,
set ISTART=-n for switching to n-homoclinic orbits.) Two copies, say u_0
and u_1 of the orbit are then saved. These parts are described by the time
T_1 between the `pulse' of u_0 and the `pulse' of u_1. T_1 is saved as
PAR(21). (In general, the time T_{i+1} between u_i and u_{i+1} is saved as 
PAR(19+2*i).) 
If T_1 is decreased, a break-up of the homoclinic orbit u_1 in a specified
direction is allowed. The corresponding gap epsilon_1 is saved as parameter
PAR(22). (In general, the gap of orbit u_{i+1} is saved as PAR(20+2*i).)
Now, the strategy for finding 2-homoclinic orbits is first to decrease T_1
until a big enough gap epsilon_1 is found. This is done in the 4th run. 

5th run: Continuation of the branch switching
We leave T_1 unchanged and continue the (piecewise continuous) solution in
parameter space and epsilon_1 to achieve epsilon_1=0. Then a 2-homoclinic
orbit is found.

6th run: Conversion of homoclinic solution back into standard format
We set ISTART=1 and perform a small continuation in parameter space. Note
also that the orientation of the homoclinic orbit is not needed anymore. 