##
Continuation and output

The syntax of the continuer is:

> `[x,v,s,h,f] = cont(@curve, x0, v0, options);`

`curve` is a MATLAB m-file where the problem is specified (cf. section 3.3). Evaluating a function by means of a function handle replaces the earlier MATLAB mechanism of evaluating a function through a string containing the function name.
`x0` and `v0` are respectively the initial point and the tangent vector at the initial point where the continuation starts.
`options` is a structure as described in section 3.4.
The arguments `v0` and `options` can be omitted. In this case the tangent vector at `x0` is computed internally and default options are used.
The function returns a series of matrices:

`x` and `v` are the points and their tangent vectors along the curve. Each column in `x` and `v` corresponds to a point on the curve.

`s` is an array with structures containing information about the found singularities. Its first and last elements always refer to the first and last points of the curve, respectively, since for convenience these are also considered "special".

Each element of this structure array `s` has the following fields:

`s.index` | index of the singularity point in `x`, so `s(1).index` is always equal to and
| `s(end).index` is the number of computed points.
`s.label` | label of the singularity; by convention `s(1).label` is "00" and `s(end).label` is
| "99".
`s.msg` | a string that may contain any information which is useful for the user,
| for example the full name of the detected special point.
`s.data` | For each special point it contains fields with additional
| information, depending on the type of point, and accumulating with increasing
| codimension:

- Equilibrium: s.data.v = tangent vector at the bifurcation
  - Hopf point: s.data.lyapunov = first Lyapunov coefficient
  - Limit point: s.data.a = normal form coefficient
    - Bogdanov-Takens / Zero Hopf / Double Hopf / Generalized Hopf / Cusp : s.data.c = normal form coefficient
- Limit cycle:

  s.data.multipliers = multipliers at the bifurcation

  s.data.timemesh = time mesh of the orbit at the bifurcation

  s.data.ntst = number of test intervals

  s.data.ncol = number of collocation points

  s.data.parametervalues = parameter values at the bifurcation

  s.data.T = period of the orbit at the bifurcation

  s.data.phi = bordering vector for locating PD bifurcations

  - Period-doubling point: s.data.pdcoefficient = normal form coefficient
  - Limit point of cycles: s.data.lpccoefficient = normal form coefficient
  - Neimark-Sacker point: s.data.nscoefficient = normal form coefficient
- Homoclinic to hyperbolic saddle / Homoclinic to saddle-node:

  s.data.timemesh = time mesh of the orbit at the bifurcation

  s.data.ntst = number of test intervals

  s.data.ncol = number of collocation points

  s.data.parametervalues = parameter values at the bifurcation

  s.data.T = period of the orbit at the bifurcation

`h` contains some information on the continuation process. Its columns are related to the computed points, and have the following components:

Stepsize | Stepsize used to calculate this point (zero for initial
| point and singular points)
Half the number of correction itera- | For singular points this is the number of locator
tions, rounded up to the next integer | iterations
User function values | The values of all active user functions
Test function values | The values of all active test functions

`f` contains different information, depending on the continuation run. For noncycle-related continuations, the `f`-vector just contains the eigenvalues, if asked for. For limit cycle continuations, it begins with the mesh points of the time- discretization, followed by, if they were asked for, the PRC- and dPRC-values in all points of the periodic orbit (cf. section 7.8). Then, if required, follow the multipliers.
It is also possible to extend the most recently computed curve with the same options (also same number of points) as it was first computed. The syntax to extend this curve is:

> `[x, v, s, h, f] = cont( x, v, s, h, f, cds);`

`x, v, s, h` and `f` are the results of the previous call to the continuer and `cds` is the global variable that contains the curve description of the most recently computed curve (note that this variable has to be defined as `global cds` in the calling command). The function returns the same output as before, extended with the new results.

In MATCONT, all curves that have been computed using a specific system are stored in separate `.mat`-files, in a directory called diagram, under a subdirectory named after the system. For example, curves of the Connor system will be kept in `.mat`-files under the subdirectory `Systems/Connor/diagram/`. For continuation runs, each such `mat`-file contains the computed `x,v,s,h,f` arrays, plus the `cds` structure and a structure related to the curve type. Also, it contains the variables point, ctype and num. To understand their meaning, suppose that we are computing curves of limit cycles that we start from Hopf points. The first such computed curve then gets the name "H_LC(1)", point stores the string "H" and ctype stores the string "LC". Furthermore, num stores the index in `s` of the last selected point of the curve (the default is ). The second curve of the same type is called "H_LC(2)" and so on. In fact, to save storage space, only a limited number of curves of a certain type is stored. This number can be set by the user and the default is . To save a computed curve permanently, the user must change its name.

For time integration runs, cf. §5.1 (Curve Type O), the `mat`-file contains `ctype`, `option`, `param`, `point`, `s`, `t`, `x`. Here `t` is the vector of time points and `x` is the corresponding array of computed points. `s` contains data on the first and last computed points. The meaning of `point,ctype` is similar to the case of continuation curves. Finally, `param` is the vector of parameters of the ODE (constant during time integration) and `option` is a structure that contains optional settings for time integration.

To export the computed results of a system to a different installation of MATCONT one has to copy the corresponding `m`-file, the `mat`-file and the directory of the system.

These files also contain all information needed to export the computed results to the general MATLAB environment, so MATCONT is really an open system.

MATCONT also produces graphical output. 2D and 3D graphs are plotted in MATLAB figure windows. Such a graph can be handled as any other graph that is produced in MATLAB. It can be selected using the arrow-function of the MATLAB figure, and the line width, line style and colour can be altered. Markers can be set on the curve. It can be copy-pasted into another MATLAB figure. In a figure, textboxes can be inserted and axes labels can be added. Thus the user has a plethora of possibilities to combine different MATCONT output graphs into one figure.

Finally, we note that users often want to introduce new systems that are modifications of existing systems, but with slightly different sets of state variables and/or parameters. The best strategy to do this in MATCONT is first to edit the existing system, change its name to a new one and click "OK" to build an m-file with a different name and no associated directory of computed curves. Afterwards, one can edit the newly created system, make all desired changes and click "OK" again. For CL/SMALL>_MATCONT see §4