Department of Computer Science: Celestijnenlaan 200A (B-3001 Heverlee (Belgium)
Department of Computer Science: Celestijnenlaan 200A (B-3001 Heverlee (Belgium)
Department of Computer Science: Celestijnenlaan 200A (B-3001 Heverlee (Belgium)
K. Engelborghs
K. Engelborghs
Abstract
DDE-BIFTOOL is a collection of Matlab routines for numer-
ical bifurcation analysis of systems of delay dierential equations
with several xed, discrete delays. The package allows to compute,
continue and analyse stability of steady state solutions and peri-
odic solutions. It further allows to compute and continue steady
state fold and Hopf bifurcations and to switch, from the latter, to
an emanating branch of periodic solutions. To analyse the stabil-
ity of steady state solutions, approximations are computed to the
rightmost, stability-determining roots of the characteristic equation
which can subsequently be used as starting values in a Newton pro-
cedure. For periodic solutions, approximations to the Floquet mul-
tipliers are computed. We describe the structure of the package, its
routines, and its data and method parameter structures. We illus-
trate its use through a step-by-step analysis of an example system.
2 Structure of DDE-BIFTOOL
The structure of the package is depicted in gure 1. It consists of four layers. Layer 0 contains the system
denition and consists of routines which allow to evaluate the right hand side f and its derivatives and
1
USER
Layer 3 : BRANCH MANIPULATION
Figure 1: The structure of DDE-BIFTOOL. Arrows indicate the calling ( ) or writing ( ) of routines in a
certain layer.
to set or get the parameters and the delays. It should be provided by the user and is explained in more
detail in section 5. All le names in this layer start with "sys ".
Layer 1 forms the numerical core of the package and is (normally) not directly accessed by the user.
The numerical methods used are explained brie
y in section 10, more details can be found in the papers
[25, 10, 9] and in [11]. Its functionality is hidden by and used through layers 2 and 3.
Layer 2 contains routines to manipulate individual points. Names of routines in this layer start
with "p ". A point has one of the following four types. It can be a steady state point (abbreviated
"stst"), steady state Hopf (abbreviated "hopf") or fold (abbreviated "fold") bifurcation point or a periodic
solution point (abbreviated "psol"). Furthermore a point can contain additional information concerning
its stability. Routines are provided to compute individual points, to compute and plot their stability and
to convert points from one type to another.
Layer 3 contains routines to manipulate branches. Names of routines in this layer start with "br ".
A branch is the combination of an array of (at least two) points, three sets of method parameters and
specications concerning the free parameters. The array contains points of the same type ordered along
the branch. The method parameters concern the computation of individual points, the continuation
strategy and the computation of stability. The parameter information includes specication of the free
parameters (which are allowed to vary along the branch), parameter bounds and maximal step sizes.
Routines are provided to extend a given branch (that is, to compute extra points using continuation), to
(re)compute stability along the branch and to visualize the branch and/or its stability.
Layers 2 and 3 require specic data structures, explained in section 6, to represent points, stability
information, branches, to pass method parameters and to specify plotting information. Usage of these
layers is demonstrated in section 7 through a step-by-step analysis of the example system. Descriptions
of input/output parameters and functionality of all routines in layers 2 and 3 are given in sections 8
respectively 9.
2
where x(t) 2 Rn , f : Rn(m+1) Rp ! Rn is a nonlinear smooth function depending on a number of
parameters 2 Rp , and delays i > 0, i = 1; : : : ; m. Call the maximal delay,
= i=1max :
;:::;m i
The linearization of (1) around a solution x (t) is the variational equation, given by,
d y(t) = A (t)y(t) + X m
dt 0 Ai (t)y(t i ); (2)
i=1
where, using f f (x0 ; x1 ; : : : ; xm ; ),
@f
Ai (t) = @x ; i = 0; : : : ; m: (3)
i
(x (t);x (t 1 );:::;x (t m );)
If x (t) corresponds to a steady state solution,
x (t) x 2 Rn ; with f (x ; x ; : : : ; x ; ) = 0;
then the matrices Ai (t) are constant, Ai (t) Ai , and the corresponding variational equation (2) leads to
a characteristic equation. Dene the n n-dimensional matrix as
m
X
() = I A0 Ai e i :
i=1
Then the characteristic equation reads,
det(()) = 0: (4)
Equation (4) has an innite number of roots 2 C which determine the stability of the steady state
solution x . The steady state solution is (asymptotically) stable provided all roots of the characteristic
equation (4) have negative real part; it is unstable if there exists a root with positive real part. It is
known that the number of roots in any right half plane <() >
,
2 R is nite, hence, the stability is
always determined by a nite number of roots.
Bifurcations occur whenever roots move through the imaginary axis as one or more parameters are
changed. Generically a fold bifurcation (or turning point) occurs when the root is real and a Hopf
bifurcation occurs when it is a complex pair.
A periodic solution x (t) is a solution which repeats itself after a nite time, that is,
x (t + T ) = x (t); for all t:
Here T > 0 is the period. The stability around the periodic solution is determined by the time integration
operator S (T; 0) which integrates the variational equation (2) around x (t) from time t = 0 over the
period. This operator is called the monodromy operator and its (innite number of) eigenvalues, which
are independent of the starting moment t = 0, are called the Floquet multipliers. Furthermore, if T
then S (T; 0) is compact.
For autonomous systems there is always a trivial Floquet multiplier at 1, corresponding to a perturb-
ation around the periodic solution. The periodic solution is stable provided all multipliers (except the
trivial one) have modulus smaller than 1, it is unstable if there exists a multiplier with modulus larger
than 1.
5 System denition
To dene a system, the user should provide the following Matlab functions, given here for system (5).
sys init.m:
Before investigating a given system, a single call is made to a routine sys init.m which has no
arguments and returns the name and dimension n of the system under study. This routine also adds
the directory in which the package resides to the current path variable. Hence, after calling this
routine, DDE-BIFTOOL can be used from within the directory of the system (being preferably
dierent from the directory of the package). The specic directory entered into the path command
depends on the platform used (see help path in Matlab). If necessary some global variables used
in the system denition can also be declared here.
function [name,dim]=sys_init()
name='neuron';
dim=2;
path=path(path,'/home/koen/DELAY/matlab/dde_biftools/');
return;
sys rhs.m:
The right hand side of the system is dened in sys rhs.m. It has two arguments, xx 2 Rn(m+1)
which contains the state variable(s) at the present and in the past, xx = [x(t) x(t 1 ) : : : x(t m )],
and par 2 R1p which contains the parameters, par = . The delays i , i = 1 : : : ; m are considered
to be part of the parameters (i = j(i) , i = 1; : : : ; m). This is natural since the stability of steady
solutions and the position and stability of periodic solutions depend on the values of the delays.
Furthermore delays can occur both as a 'physical' parameter and as delay, as in x_ = x(t ).
From these inputs the right hand side f is evaluated at time t. Notice that the parameters have a
specic order in par indicated in the comment line.
function f=sys_rhs(xx,par)
f(1,1)=-par(1)*xx(1,1)+par(2)*tanh(xx(1,4))+par(3)*tanh(xx(2,3));
f(2,1)=-par(1)*xx(2,1)+par(2)*tanh(xx(2,4))+par(4)*tanh(xx(1,2));
return;
sys deri.m:
Several derivatives of the right hand side function f need to be evaluated and should be supplied
via a routine sys deri.m. The function sys deri has as input variables xx and par (with ordering
of state variables and parameters as before), nx, np and v. Here, v 2 C n1 or empty. The result J
is a matrix of partial derivatives of f which depends on the type of derivative requested via nx and
np multiplied with v (when nonempty), see table 1.
4
J is informally dened as follows. Initialize J with f . If nx is nonempty take the derivative of
J with respect to each of its elements. Each element is a number between 0 and m based on
f f (x0 ; x1 ; : : : ; xm ; ). E.g., if nx has only one element take the derivative with respect to xnx1(1) .
If it has two elements, take, of the result, the derivative with respect to xnx1(2) and so on. Similarly,
if np is nonempty take, of the resulting J, the derivative with respect to np (i) where i ranges over
all the elements of np, 1 i p. Finally, if v is not an empty vector multiply the result with v. The
latter is used to prevent J from being a tensor if two derivatives with respect to state variables are
taken (when nx contains two elements). Not all possible combinations of these derivatives should be
provided. In the current version, nx has at most two elements and np at most one. The possibilities
are further restricted as listed in table 1.
In the last row of table 1 the elements of J are given by,
n !
@ @ X @fi v ;
Ji;j =
@xnx(2) Anx(1) v i;j
=
@xnxj (2) nx(1) k
k=1 @xk
with Al as dened in (3).
length(nx) length(np) v J
@f = A nn
1 0 empty @xnx(1) @f nx(1) 2 R
n1
0 1 empty @np2 (1) 2 R
@f nn
1 1 empty @xnx(1) @np 2R
2 0 2 C n1 @x
@nx(2) Anx(1) v 2 C nn
Table 1: Results of the function sys deri depending on its input parameters nx, np and v using f
f (x0 ; x1 ; : : : ; xm ; ).
The resulting routine is quite long, even for the small system (5). Furthermore, implementing so
many derivatives is an activity prone to a number of typing mistakes. Hence a default routine
df deriv.m is available which implements nite dierence formulas to approximate the requested
derivatives (using several calls to sys rhs). A copy of this le can be used to replace sys deri.m.
It is, however, recommended to provide at least the rst order derivatives with respect to the state
variables using analytical formulas. These derivatives occur in the determining systems for fold
and Hopf bifurcations and in the computation of characteristic roots and Floquet multipliers. All
other derivatives are only necessary in the Jacobians of the respective Newton procedures and thus
in
uence only the convergence speed.
5
function J=sys_deri(xx,par,nx,np,v)
J=[];
6
elseif length(nx)=0 & length(np)==1 & isempty(v)
% first order derivatives wrt parameters
if np==1 % derivative wrt kappa
J(1,1)=-xx(1,1);
J(2,1)=-xx(2,1);
elseif np==2 % derivative wrt beta
J(1,1)=tanh(xx(1,4));
J(2,1)=tanh(xx(2,4));
elseif np==3 % derivative wrt a12
J(1,1)=tanh(xx(2,3));
J(2,1)=0;
elseif np==4 % derivative wrt a21
J(2,1)=tanh(xx(1,2));
elseif np==5 | np==6 | np==7 % derivative wrt tau
J=zeros(2,1);
end;
elseif length(nx)==2>0 & length(np)==0 & ~isempty(v)
% second order derivatives wrt state variables
if nx(1)==0 % first derivative wrt x(t)
J=zeros(2);
elseif nx(1)==1 % first derivative wrt x(t-tau1)
if nx(2)==1
th=tanh(xx(1,2));
J(2,1)=-2*par(4)*th*(1-th*th)*v(1);
J(2,2)=0;
else
J=zeros(2);
end;
elseif nx(1)==2 % derivative wrt x(t-tau2)
if nx(2)==2
th=tanh(xx(2,3));
J(1,2)=-2*par(3)*th*(1-th*th)*v(2);
J(2,2)=0;
else
J=zeros(2);
end;
elseif nx(1)==3 % derivative wrt x(t-tau_s)
if nx(2)==3
th1=tanh(xx(1,4));
J(1,1)=-2*par(2)*th1*(1-th1*th1)*v(1);
th2=tanh(xx(1,4));
J(2,2)=-2*par(2)*th2*(1-th2*th2)*v(2);
else
J=zeros(2);
end;
end;
end;
if isempty(J)
err=[nx np size(v)]
error('SYS_DERI: requested derivative could not be computed!');
end;
return;
7
sys tau.m:
As a last system routine a function is required which returns the position of the delays in the
parameter list. The order in this list corresponds to the order in which they appear in xx as passed
to the functions sys rhs and sys deri.
function tau=sys_tau()
tau=[5 6 7];
return;
sys cond.m: A system routine sys cond can be used to add extra conditions during corrections
and continuation, see section 10.2.
6 Data structures
In this section we describe the data structures used to present individual points, stability information,
branches of points, method parameters and plotting information.
The Matlab structure array is an array of elds each of which is a named variable containing some
value(s) (similar to the struct in C and the record in the Pascal programming language). The structure
allows to group variables into a combined entity using meaningful names. Individual elds are addressed
by appending a dot and the eld name to the structure array variable name. Dening for instance a
steady state point as a structure containing the elds 'type', 'parameter', 'x' and 'stability' (see also
further) can be done using the following Matlab commands.
>> stst.type='stst';
>> stst.parameter=[1 2 -0.1 5];
>> stst.x=[0 0]';
>> stst.stability=[];
>> stst
stst = type: 'stst'
parameter: [1 2 -0.1000 5]
x: [2x1 double]
stability: []
More information about the Matlab structure array can be obtained by typing help struct on the Matlab
command line.
Point structures Table 2 describes the structures used to represent a single steady state, fold, Hopf
and periodic solution point.
A steady state solution is represented by the parameter values (which contain also the delay values,
see section 5) and x . A fold bifurcation is represented by the parameter values , its position x and a
null-vector of the characteristic matrix (0). A Hopf bifurcation is represented by the parameter values
, its position x , a frequency ! and a (complex) null-vector of the characteristic matrix (i!).
A periodic solution is represented by the parameter values , the period T and a time-scaled prole
x (t=T ) on a mesh in [0,1]. The mesh is an ordered collection of interval points f0 = t0 < t1 < : : : < tL =
1g and representation points ti+ dj , i = 0; : : : ; L 1, j = 1; : : : ; d 1 which need to be chosen in function
of the interval points as
ti+ dj = ti + dj (ti+1 ti ):
8
eld content eld content eld content
type 'stst' type 'fold' type 'hopf'
parameter R1p parameter R1p parameter R1p
x Rn1 x Rn1 x Rn1
stability empty or struct v Rn1 v C n1
stability empty or struct omega R
stability empty or struct
eld content
type 'psol'
parameter R1p
mesh [0; 1] 1 (Ld +1) or empty
degree N0
prole Rn(Ld+1)
period R+0
stability empty or struct
Table 2: Field names and corresponding content for the point structures used to represent steady state solutions,
fold and Hopf points and periodic solutions. Here, n is the system dimension, p is the number of parameters, L
is the number of intervals used to represent the periodic solution and d is the degree of the polynomial on each
interval.
Note that this assumption is not checked but needs to be fullled for correct results! The
prole is a continuous piecewise polynomial on the mesh. More specically, it is a polynomial of degree
d on each subinterval [ti ; ti+1 ], i = 0; : : : ; L 1. Each of these polynomials is uniquely represented by its
values at the points fti+ dj gj=0;:::;d. Hence the complete prole is represented by its value at all the mesh
points,
x (ti+ dj ); i = 0; : : : ; L 1; j = 0; : : : ; d 1; and x (tL ):
Because polynomials on adjacent intervals share the value at the common interval point, this represent-
ation is automatically continuous (it is, however, not continuously dierentiable). (As indicated in table
2, the mesh may be empty, which indicates the use of an equidistant, xed mesh.)
The point structures are used as input to the point manipulation routines (layer 2) and are used inside
the branch structure (see further). The order of the elds in the point structures is important (because
they are used as elements of an array inside the branch structure). No such restriction holds for the other
structures (method, plot and branch) described in the rest of this section.
Stability structures Each of the point structures contains a stability eld. If no stability was com-
puted this eld is empty, otherwise, it contains the computed stability information in the form described
in table 3.
For steady state, fold and Hopf points, approximations to the rightmost roots of the characteristic
equation are provided in eld 'l0' in order of decreasing real part. The steplength that was used to obtain
the approximations is provided in eld 'h'. Corrected roots are provided in eld 'l1' and the number
of Newton iterations applied for each corrected root in a corresponding eld 'n1'. If unconverged roots
are discarded, 'n1' is empty and the roots in 'l1' are ordered with respect to real part; otherwise the
order in 'l1' corresponds to the order in 'l0' and an element 1 in 'n1' signals that no convergence was
reached for the corresponding root in 'l0' and the last computed iterate is stored in 'l1'. The collection of
uncorrected roots presents more accurate yet less robust information than the collection of approximate
roots, see section 10. For periodic solutions only (uncorrected) approximations to the Floquet multipliers
are provided in a eld 'mu' (in order of decreasing modulus).
9
eld content eld content
h R mu C nm
l0 C nl
l1 C nc
n1 (f 1g [ N 0 )nc or empty
Table 3: Stability structures for roots of the characteristic equation (in steady state, fold and Hopf structures)
(left) and for Floquet multipliers (in the periodic solutions structure) (right). Here, nl is the number of approx-
imated roots, nc is the number of corrected roots and nm is the number of Floquet multipliers.
Method parameters To compute a single steady state, fold, Hopf or periodic solution point several
method parameters have to be passed to the appropriate routines. These parameters are collected into a
structure with the elds given in table 4.
eld content default value
newton max iterations N0 5
newton nmon iterations N 1
halting accuracy R+ (1e-10,1e-9,1e-9,1e-8)
minimal accuracy R+0 (1e-8,1e-7,1e-7,1e-6)
extra condition f0; 1g 0
print residual info f0; 1g 0
Table 4: Point method structure: elds and possible values. When dierent, default values are given in the order
('stst','fold','hopf','psol').
Table 5: Point method structure: extra elds and possible values for the computation of periodic solutions.
For the computation of periodic solutions, additional elds are necessary, see table 5. The meaning
of the dierent elds in tables 4 and 5 is explained in section 10.
Similarly, for the approximation and correction of roots of the characteristic equation respectively for
the computation of the Floquet multipliers method parameters are passed using a structure of the form
given in table 6.
Branch structures A branch consists of an ordered array of points (all of the same type), and three
method structures containing point method parameters, continuation parameters respectively stability
computation parameters, see table 7.
The branch structure has three elds. One, called 'point', which contains an array of point structures,
one, called 'method', which is itself a structure containing three subelds and a third, called 'parameter'
which contains four subelds. The three subelds of the method eld are again structures. The rst,
called 'point', contains point method parameters as described in table 4. The second, called 'stability',
contains stability method parameters as described in table 6 and the third, called 'continuation' contains
continuation method parameters as described in table 8. Hence the branch structure incorporates all
necessary method parameters which are thus automatically kept when saving a branch variable to le. The
10
eld content default value
lms parameter alpha Rk time lms('bdf',4)
lms parameter beta Rk time lms('bdf',4)
lms parameter rho R+0 time saf(alpha,beta,0.01,0.01)
interpolation order N0 4
minimal time step R+0+ 0.01
maximal time step R0 0.1
max number of eigenvalues N0 100
minimal real part R or empty empty
max newton iterations N 6
root accuracy R+ 0 1e-6
remove unconverged roots f0; 1g 1
eld content default value
collocation parameters [0; 1]d or empty empty
max number of eigenvalues N 100
minimal modulus R+ 0.01
Table 6: Stability method structures: elds and possible values for the approximation and correction of roots of
the characteristic equation (top), or for the approximation Floquet multipliers (bottom). The LMS-parameters
are default set to the fourth order backwards dierentiation LMS-method.
eld subeld content
point array of point struct
method point point method struct
method stability stability method struct
method continuation continuation method struct
parameter free N pf
parameter min bound [N R]pi
parameter max bound [N R]pa
parameter max step [N R]ps
Table 7: Branch structure: elds and possible values. Here, pf is the number of free parameters; pi , pa and ps are
the number of minimal parameter values, maximal parameter values respectively maximal parameter steplength
values. If any of these values are zero, the corresponding subeld is empty.
parameter eld contains a list of free parameter numbers which are allowed to vary during computations,
and a list of parameter bounds and maximal steplengths. Each row of the bound and steplength subelds
consists of a parameter number (rst element) and the value for the bound or steplength limitation.
Examples are given in section 7.
A default, empty branch structure can be obtained by passing a list of free parameters and the point
type (as 'stst', 'fold', 'hopf', or 'psol') to the function df brnch. A minimal bound zero is then set for each
delay. The method contains default parameters (containing appropriate point, stability and continuation
elds) obtained from the function df mthod with as only argument the type of solution point.
Scalar measure structure After a branch has been computed some possibilities are oered to plot
its content. For this a (scalar) measure structure is used which denes what information should be taken
and how it should be processed to obtain a measure of a given point (such as the amplitude of the prole
of a periodic solution, etc...), see table 9. The result applied to a variable point is to be interpreted as
scalar_measure=func(point.field.subfield(row,col));
11
eld content default value
steplength condition f0; 1g 1
plot f0; 1g 1
prediction f1g 1
steplength growth factor R+
0 1.2
plot progress f0; 1g 1
plot measure struct or empty empty
halt before reject f0; 1g 0
where 'eld' presents the eld to select, 'subeld' is empty or presents the subeld to select, 'row' presents
the row number or contains one of the functions mentioned in table 9. These functions are applied
columnwise over all rows. The function 'all' species that the all rows should be returned. The meaning
of 'col' is similar to 'row' but for columns. To avoid ambiguity it is required that either 'row' or 'col'
contains a number or that both contain the function 'all'. If nonempty, the function 'func' is applied to
the result. Note that 'func' can be a standard Matlab function as well as a user written function. Note
also that, when using the value 'all' in the elds 'col' and/or 'row' it is possible to return a non-scalar
measure (possibly but not necessarily further processed by 'func').
eld content meaning
eld f'parameter','x','v','omega',... rst eld to select
'prole','period','stability'g
subeld f",'l0','l1','mu'g " or second eld to select
row N or f'min','max','mean','ampl','all'g row index
col N or f'min','max','mean','ampl','all'g column index
func f",'real','imag','abs'g function to apply
Table 9: Measure structure: elds, content and meaning of a structure describing a measure of a point.
7 An illustrative ride-through
After the system has been implemented (see section 5), bifurcation analysis can be performed using the
point and branch manipulation layers. Specication of the functions in these layers is given in sections 8
respectively 9. Here we outline an illustrative ride-through using the example (5).
The commands below are listed in the le demo1.m. The gures shown are produced during its
execution. Some of these gures have important colour coding and others are gradually built up. Hence
the reader is advised to read this section while observing the gures from the Matlab run of demo1.
After starting Matlab in the directory of the system denition, we install the system by calling its
initialization le,
>> [name,n]=sys_init
name = neuron
n = 2
It is clear that (5) has a steady state solution (x1 ; x2 ) = (0; 0) for all values of the parameters. We
dene a rst steady state solution using the parameter values = 0:5, = 1, a12 = 1, a21 = 2:34,
1 = 2 = 0:2 and s = 1:5.
>> stst.kind='stst';
>> stst.parameter=[1/2 -1 1 2.34 0.2 0.2 1.5];
12
>> stst.x=[0 0]'
stst = kind: 'stst'
parameter: [0.5000 -1 1 2.3400 0.2000 0.2000 1.5000]
x: [2x1 double]
25
2
20
1.5
15
1
10
0.5 5
ℑ(λ)
ℑ(λ)
0
0
−5
−0.5
−10
−1
−15
−1.5 −20
−25
−2 −2 −1.5 −1 −0.5 0 0.5
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4
ℜ(λ) ℜ(λ)
Figure 2: Approximated () and corrected () roots of the characteristic equation of system (5) at its steady
state solution (x1 ; x2 ) = (0; 0). Real parts computed up to <() 1 (left), <() 2 (right).
We get default point method parameters and correct the point,
>> method=df_mthod('stst')
method = continuation: [1x1 struct]
point: [1x1 struct]
stability: [1x1 struct]
>> [stst,success]=p_correc(stst,[],[],method.point)
stst = kind: 'stst'
parameter: [0.5000 -1 1 2.3400 0.2000 0.2000 1.5000]
x: [2x1 double]
success = 1
>> stst.x
ans = 0
0
which, being already a correct solution, remains unchanged. Computing and plotting stability of the
corrected point reveals it has one unstable real mode, see gure 2 (left).
>> stst.stability=p_stabil(stst,method.stability);
>> figure(1); clf;
>> p_splot(stst);
Seeing that only a few characteristic roots were computed we set minimal real part to a more negative
value (it is default empty which means that roots are computed up to <() 1= ) and recompute
stability to obtain gure 2 (right).
>> method.stability.minimal_real_part=-2;
>> stst.stability=p_stabil(stst,method.stability);
>> figure(2); clf;
>> p_splot(stst);
In both gures, approximations () and corrections () are nearly indistinguishable.
We will use this point as a rst point to compute a branch of steady state solutions. First, we obtain
an empty branch with free parameter a21 limited by a21 2 [0; 5] and a21 0:2 between points.
13
>> branch1=df_brnch(4,'stst')
branch1 = method: [1x1 struct]
parameter: [1x1 struct]
point: []
>> branch1.parameter
ans = free: 4
min_bound: [3x2 double]
max_bound: []
max_step: []
>> branch1.parameter.min_bound
ans = 5 0
6 0
7 0
>> branch1.parameter.min_bound(4,:)=[4 0];
>> branch1.parameter.max_bound(1,:)=[4 5];
>> branch1.parameter.max_step(1,:)=[4 0.2];
To obtain a second starting point we change parameter value a21 slightly and correct again.
>> branch1.point(1)=stst;
>> stst.parameter(4)=stst.parameter(4)+0.1;
>> [stst,success]=p_correc(stst,[],[],method.point);
>> branch1.point(2)=stst;
Because we know how the branch of steady state solutions continued in a21 looks like (it is constant
at (x1 ; x2 ) = (0; 0)) we disable plotting during continuation by setting the corresponding continuation
method parameter to zero.
>> branch1.method.continuation.plot=0;
With two starting points and suitable method parameters we are ready to continue the branch in
parameter a21 (number 4), allowing it to vary in the interval [0; 5] using a maximum stepsize of 0.2 and
a maximum of 100 corrections.
>> [branch1,s,f,r]=br_contn(branch1,100)
BR_CONTN warning: boundary hit.
branch1 = method: [1x1 struct]
parameter: [1x1 struct]
point: [1x16 struct]
s = 15
f = 0
r = 0
During continuation, sixteen points were successfully computed (s = 16) before the right boundary
a21 = 5 was hit (signalled by a warning). No corrections failed (f = 0) and no computed points were
later rejected (r = 0). Reversing the order of the branch points allows to continue to the left.
>> branch1=br_rvers(branch1);
>> [branch1,s,f,r]=br_contn(branch1,100);
BR_CONTN warning: boundary hit.
After obtaining suitable measure structures we plot the real part of the approximated and corrected
roots of the characteristic equation along the branch, see gure 3 (left).
14
>> [xm,ym]=df_measr(1,branch1);
>> figure(3); clf;
>> br_plot(branch1,xm,ym,'b');
>> ym
ym = field: 'stability'
subfield: 'l1'
row: 'all'
col: 1
func: 'real'
>> ym.subfield='l0';
>> br_plot(branch1,xm,ym,'c');
>> plot([0 5],[0 0],'-.');
>> axis([0 5 -2 1.5]);
Again approximations and corrections are nearly indistinguishable. From this gure alone it is not
clear which real parts correspond to real roots respectively complex pairs of roots. For this it is useful
to compare gures 2 and 3 (left). Notice the strange behaviour (coinciding of several complex pairs of
roots) at a21 = 0. At this parameter value one of the couplings between the neurons is broken. In fact,
for a21 = 0, the evolution of the second component is independent of the evolution of the rst. Where
1.5
1.5
1
1
0.5
0.5
0
0
ℜ(λ)
ℜ(λ)
−0.5
−0.5
−1
−1
−1.5
−1.5
−2
0 1 2 3 4 5 −2
a21 0 5 10 15 20 25 30
point number
Figure 3: Real parts of the approximated (left) and corrected (left,right) roots of the characteristic equation
versus a21 (left) respectively the point number along the branch (right).
lines cross the zero line, bifurcations occur. If we want to compute the Hopf bifurcation near a21 0:8
we need its point number. This is most easily obtained by plotting the stability versus the point numbers
along the branch, see gure 3 (right).
>> figure(4); clf;
>> br_plot(branch1,[],ym,'b');
>> br_plot(branch1,[],ym,'b.');
>> plot([0 30],[0 0],'-.');
We correct the Hopf point using appropriate method parameters and one free parameter (a21 ). We
then copy the corrected point to keep it for later use.
>> method=df_mthod('hopf');
>> [hopf,success]=p_correc(hopf,4,[],method.point)
hopf = kind: 'hopf'
parameter: [0.5000 -1 1 0.8071 0.2000 0.2000 1.5000]
x: [2x1 double]
15
2
1.5
0.5
ℑ(λ)
0
−0.5
−1
−1.5
−2
−0.35 −0.3 −0.25 −0.2 −0.15 −0.1 −0.05 0 0.05
ℜ(λ)
Figure 4: Characteristic roots at Hopf point: a pair of pure imaginary eigenvalues is clearly visible.
v: [2x1 double]
omega: 0.7820
success = 1
>> first_hopf=hopf;
Computing and plotting stability of the Hopf point clearly reveals the pair of pure imaginary eigen-
values, see gure 4
>> hopf.stability=p_stabil(hopf,method.stability);
>> figure(5); clf;
>> p_splot(hopf);
In order to follow a branch of Hopf bifurcations in the two parameter space (a21 ; s ) we again need
two starting points. Hence we use the Hopf point already found and one perturbed in s and corrected
in a21 , to start on a branch of Hopf bifurcations. For the free parameters, a21 and s , we provide suitable
intervals, a21 2 [0; 4] and s 2 [0; 10], and maximal stepsizes, 0:2 for a21 and 0:5 for s .
>> branch2=df_brnch([4 7],'hopf');
>> branch2.parameter.min_bound(4:5,:)=[[4 0]' [7 0]']';
>> branch2.parameter.max_bound(1:2,:)=[[4 4]' [7 10]']';
>> branch2.parameter.max_step(1:2,:)=[[4 0.2]' [7 0.5]']';
>> branch2.point(1)=hopf;
>> hopf.parameter(7)=hopf.parameter(7)+0.1;
>> [hopf,success]=p_correc(hopf,4,[],method.point);
>> branch2.point(2)=hopf;
We continue the branch on both sides by an intermediate order reversal and a second call to br contn.
>> figure(6); clf;
>> [branch2,s,f,r]=br_contn(branch2,40);
BR_CONTN warning: boundary hit.
>> branch2=br_rvers(branch2);
>> [branch2,s,f,r]=br_contn(branch2,20);
As we did not change continuation method parameters, predictions and corrections will be plotted
during continuation. The nal result is shown in gure 5 (left). At the top, the branch hits the boundary
s = 10. To the right, however, it seemingly turned back onto itself. We compute and plot stability along
the branch.
>> branch2=br_stabl(branch2,0,0);
16
11 11
9 9
7 7
s
s
τ
τ
5 5
3 3
1 1
−0.5 0 0.5 1 1.5 2 2.5 −0.5 0 0.5 1 1.5 2 2.5
a a
21 21
Figure 5: Predictions and corrections in the (a21 ; s )-plane after computation of a rst branch of Hopf bifurcations
(left) and a second, intersecting branch of Hopf bifurcations (right).
If, during these computations we would have obtained warnings of the kind,
TIME_H warning: h_min is reached.
it would indicate that the time integration step required to obtain good approximations to the requested
rightmost characteristic roots is too small. By default, characteristic roots are computed up to <()
1= .
We also notice a double Hopf point on the left but nothing special at the right end, which could explain
the observed turning of the branch. Plotting the frequency ! versus s reveals what has happened, see
gure 6 (right). For small s , ! goes through zero, indicating the presence of a Bogdanov-Takens point.
The subsequent turning is a recomputation of the same branch with negative frequencies.
>> figure(8); clf;
>> [xm,ym]=df_measr(0,branch2);
>> ym
ym = field: 'parameter'
subfield: ''
row: 1
col: 7
func: ''
>> ym.field='omega';
>> ym.col=1;
>> xm
xm = field: 'parameter'
subfield: ''
row: 1
col: 4
func: ''
>> xm.col=7;
>> br_plot(branch2,xm,ym,'c');
>> grid;
Selecting the double Hopf point we produce an approximation of the second Hopf point.
17
1
0.2
0.75
0.1
0.5
0
0.25
−0.1
ℜ(λ)
ω
0
−0.2
−0.25
−0.3
−0.5
−0.4
−0.5 −0.75
−0.6 −1
1 2 3 4 5 6 7 8 9
0 10 20 30 40 50 τ
point number s
Figure 6: Left: Real part of characteristic roots along the branch of Hopf bifurcations shown in gure 5 (left).
Right: The frequency of the Hopf bifurcation along the same branch.
>> hopf=p_tohopf(branch2.point(4));
>> [hopf,success]=p_correc(hopf,4,[],method.point)
hopf = kind: 'hopf'
parameter: [0.5000 -1 1 -0.0103 0.2000 0.2000 8.5530]
x: [2x1 double]
v: [2x1 double]
omega: 0.9768
success = 0
However, without success. Printing residual information gives a list of the Newton iteration number
and the norm of the residual. This reveals at least temporarily divergence of the correction process.
>> method.point.print_residual_info=1;
>> format short e;
>> hopf=p_tohopf(branch2.point(4));
>> [hopf,success]=p_correc(hopf,4,[],method.point);
norm_residual = 1.0000e+00 9.3116e-03
norm_residual = 2.0000e+00 5.4574e-01
norm_residual = 3.0000e+00 6.2629e-02
norm_residual = 4.0000e+00 1.8903e-03
norm_residual = 5.0000e+00 3.2357e-05
Or we did not allow enough Newton iterations, or the free parameter is not so appropriate. We
successfully try again using s as a free parameter.
>> hopf=p_tohopf(branch2.point(4));
>> [hopf,success]=p_correc(hopf,7,[],method.point)
norm_residual = 1.0000e+00 9.3116e-03
norm_residual = 2.0000e+00 6.8069e-04
norm_residual = 3.0000e+00 2.3169e-07
norm_residual = 4.0000e+00 4.3066e-13
hopf = kind: 'hopf'
parameter: [5.0000e-01 -1 1 2.0657e-01 2.0000e-01 2.0000e-01 8.6340e+00]
x: [2x1 double]
v: [2x1 double]
omega: 9.1581e-01
success = 1
Using the second Hopf point we compute the intersecting branch of Hopf points depicted in gure 5
(right). Setting plot progress to zero disables intermediate plotting such that we see only the end result.
18
>> branch3=df_brnch([4 7],'hopf');
>> branch3.parameter=branch2.parameter;
>> branch3.point(1)=hopf;
>> hopf.parameter(4)=hopf.parameter(4)-0.05;
>> method.point.print_residual_info=0; format short;
>> [hopf,success]=p_correc(hopf,7,[],method.point);
>> branch3.point(2)=hopf;
>> branch3.method.continuation.plot_progress=0;
>> figure(6);
>> [branch3,s,f,r]=br_contn(branch3,100);
BR_CONTN warning: boundary hit.
>> branch3=br_rvers(branch3);
>> [branch3,s,f,r]=br_contn(branch3,100);
BR_CONTN warning: boundary hit.
We use the rst Hopf point we computed (rst hopf ) to construct a small amplitude (1e 2) periodic
solution on an equidistant mesh of 18 intervals with piecewise polynomial degree 3.
>> intervals=18;
>> degree=3;
>> [psol,stepcond]=p_topsol(first_hopf,1e-2,degree,intervals);
This steplength condition returned ensures the branch switch from the Hopf to the periodic solution
as it avoids convergence of the amplitude to zero during corrections. Due to the presence of the steplength
condition we also need to free one parameter, here a21 .
>> method=df_mthod('psol');
>> [psol,success]=p_correc(psol,4,stepcond,method.point)
psol = kind: 'psol'
parameter: [0.5000 -1 1 0.8072 0.2000 0.2000 1.5000]
mesh: [1x55 double]
degree: 3
profile: [2x55 double]
period: 8.0354
success = 1
The result, along with a degenerate periodic solution with amplitude zero is used to start on the
emanating branch of periodic solutions, see gure 7 (left). We avoid adaptive mesh selection and save
memory by clearing the mesh eld. An equidistant mesh is then automatically used which is kept xed
during continuation. Simple clearing of the mesh eld is only possible if it is already equidistant. This is
the case here as p tohopf returns a solution on an equidistant mesh.
>> branch4=df_brnch(4,'psol');
>> branch4.parameter.min_bound(4,:)=[4 0];
>> branch4.parameter.max_bound(1,:)=[4 5];
>> branch4.parameter.max_step(1,:)=[4 0.1];
>> deg_psol=p_topsol(first_hopf,0,degree,intervals);
>> deg_psol.mesh=[];
>> branch4.point(1)=deg_psol;
>> psol.mesh=[];
>> branch4.point(2)=psol;
>> figure(9); clf;
>> [branch4,s,f,r]=br_contn(branch4,50);
Notice how computing periodic solution branches takes considerably more computational time. Zoom-
ing shows erratic behaviour of the last computed branch points, shortly beyond a turning point, see gure
7 (right).
>> axis([2.3 2.4 0.95 1.15]);
19
1.4 1.15
1.2
1.1
1
max x1(t) − min x1(t)
1.05
0.6
1
0.4
1
0.2
0 0.95
0.6 1 1.4 1.8 2.2 2.6 2.3 2.32 2.34 2.36 2.38 2.4
a a
21 21
Figure 7: Branch of periodic solutions emanating from a Hopf point (left). The branch turns at the far right and
a zoom (right) indicates computational diculties at the end.
Plotting some of the last solution proles shows that smoothness and thus also accuracy are lost, see
gure 9 (left).
>> ll=length(branch4.point);
>> figure(10); clf;
>> subplot(3,1,1);
>> p_pplot(branch4.point(ll-10));
>> subplot(3,1,2);
>> p_pplot(branch4.point(ll-5));
>> subplot(3,1,3);
>> p_pplot(branch4.point(ll-1));
From a plot of the period along the branch we could suspect a homoclinic or heteroclinic bifurcation
scenario, see gure 8 (left).
170 700
600
140
500
110
400
T
T
300
80
200
50
100
20 0
2.2 2.24 2.28 2.32 2.36 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6
a a21
21
Figure 8: Left: Period along the computed branch shown in gure 7. Right: Added period predictions and
corrections during recalculations using adaptive mesh selection.
20
col: 'ampl'
func: ''
>> ym.field='period';
>> ym.col=1;
>> br_plot(branch4,xm,ym,'b');
>> axis([2.2 2.36 20 170]);
1 1
x (t), x (t)
0.5
2
x1(t), x2(t)
0
1
0
−1
0 0.2 0.4 0.6 0.8 1 −0.5
t/T
1
−1
x (t), x (t)
0 t/T
1
x1(t+0.02T), x2(t+0.02T)
−1
0 0.2 0.4 0.6 0.8 1 0.5
t/T
1
0
x (t), x (t)
2
0 −0.5
1
−1 −1
0 0.2 0.4 0.6 0.8 1 −1 −0.5 0 0.5 1
t/T x1(t), x2(t)
Figure 9: Some solution proles using equidistant meshes (left) and adapted meshes right (right) along the branch
of periodic solutions shown in gure 7.
The result of computing and plotting stability (Floquet multipliers) just before and after the turning
point is shown in gure 10. The second spectrum is clearly unstable but no accurate trivial Floquet
multiplier is present at 1.
>> psol=branch4.point(ll-11);
>> psol.stability=p_stabil(psol,method.stability);
>> figure(12); clf;
>> subplot(2,1,1);
>> p_splot(psol);
>> axis image;
>> psol=branch4.point(ll-8);
>> psol.stability=p_stabil(psol,method.stability);
>> subplot(2,1,2);
>> p_splot(psol);
21
1
0.5
ℑ(µ)
0
−0.5
−1
−1 −0.5 0 0.5 1
ℜ(µ)
1
0.5
ℑ(µ)
0
−0.5
−1
−10 0 10 20 30 40 50 60
ℜ(µ)
Figure 10: Floquet multipliers for a periodic solutions before (top) and just after (bottom) the turning point
visible in gure 7.
Then we recompute the branch using adaptive mesh selection (with reinterpolation and additional
corrections) after correcting every point, see gure 8 (right).
>> branch5=df_brnch(4,'psol');
>> branch5.parameter=branch4.parameter;
>> branch5.point(1)=psol;
>> psol.parameter(4)=psol.parameter(4)+0.01;
>> [psol,success]=p_correc(psol,[],[],method.point,1);
>> branch5.point(2)=psol;
>> branch5.method=method;
>> [xm,ym]=df_measr(0,branch5);
>> ym.field='period';
>> ym.col=1;
>> figure(11); axis auto; hold on;
>> branch5.method.continuation.plot_measure.x=xm;
>> branch5.method.continuation.plot_measure.y=ym;
>> branch5=br_contn(branch5,25);
Increasing mesh sizes and using adaptive mesh selection also improves the accuracy of the computed
Floquet multipliers.
>> psol=branch5.point(6);
>> psol.stability=p_stabil(psol,method.stability);
>> psol.stability.mu
ans = 241.2300
1.0000
Plotting of a point clearly shows the (double) homoclinic nature of the solutions, see gure 9 (right).
>> figure(13); clf;
>> subplot(2,1,1);
>> ll=length(branch5.point);
>> psol=branch5.point(ll-5);
>> plot(psol.mesh,psol.profile);
>> subplot(2,1,2);
>> psol1=p_remesh(psol,degree,0:0.001:1);
>> psol2=p_remesh(psol,degree,(0:0.001:1)+0.02);
>> plot(psol1.profile',psol2.profile');
>> psol.period
ans = 399.7466
22
In this case, using the le df deriv.m instead of the analytical derivatives le given in section 5,
yields results which are visually the same as the ones given above.
8 Point manipulation
Several of the point manipulation routines have already been used in the previous section. Here we outline
their functionality and input and output parameters. A brief description of parameters is also contained
within the source code and can be obtained in Matlab using the help command. Note that a vector of
zero elements corresponds to an empty matrix (written in Matlab as []).
function [point,success]=p_correc(point0,free_par,step_cnd,method,adapt)
Function p stabil computes stability of a given point by approximating its stability-determining eigen-
values.
point: a solution point as a point structure (see table 2).
method: a stability method structure (see table 6).
stability: the computed stability of the point through a collection of approximated eigenvalues (as
a structure described in table 3). For steady state, fold and Hopf points both approximations and
corrections to the rightmost roots of the characteristic equation are provided. For periodic solutions
approximations to the dominant Floquet multipliers are computed.
function p_splot(point)
Function p splot plots the characteristic roots respectively Floquet multipliers of a given point (which
should contain nonempty stability information). Characteristic root approximations and Floquet multi-
pliers are plotted using '', corrected characteristic roots using ''.
23
function stst_point=p_tostst(point)
function fold_point=p_tofold(point)
function hopf_point=p_tohopf(point)
function [psol_point,stepcond]=p_topsol(point,ampl,degree,nr_int)
function [psol_point,stepcond]=p_topsol(point,ampl,coll_points)
The functions p tostst, p tofold, p tohopf and p topsol convert a given point into an approximation
of a new point of the kind indicated by their name. They are used to switch from a steady state point to
a Hopf point or fold point, from a Hopf point to a fold point or vice versa, from a (nearby double) Hopf
point to the second Hopf point, from a Hopf point to the emanating branch of periodic solutions and
from a periodic solution near a period doubling bifurcation to the period-doubled branch. When starting
a periodic solution branch from a Hopf point, an equidistant mesh is produced with nr int intervals and
piecewise polynomials of degree col degree and a steplength condition stepcond is returned which should
be used (together with a corresponding free parameter) in correcting the returned point. This steplength
condition (normally) prevents convergence back to the steady state solution (as a degenerate periodic
solution of amplitude zero). When jumping to a period-doubled branch, a period-doubled solution prole
is produced using collp oints for collocation points and a mesh which is the (scaled) concatenation of two
times the original mesh. A steplength condition is returned which (normally) prevents convergence back
to the single period branch.
function rm_point=p_remesh(point,new_degree,new_mesh)
Function p remesh changes the piecewise polynomial representation of a given periodic solution point.
point: initial point, containing old mesh, old degree and old prole.
new degree: new degree of piecewise polynomials.
new mesh: mesh for new representation of periodic solution prole either as a (non-scalar) row
vector of mesh points (both interval and representation points, with the latter chosen equidistant
between the former, see section 6) or as the new number of intervals. In the latter case the new
mesh is adaptively chosen based on the old prole.
rm point: returned point containing new degree, new mesh and an appropriately interpolated (but
uncorrected!) prole.
The following routines are used within branch routines but are less interesting for the general user.
function sc_measure=p_measur(p,measure)
Function p measur computes the (scalar) measure measure of the given point p (see table 9).
function p=axpy(a,x,y)
Function p axpy performs the axpy-operation on points. That is, it computes p = ax + y where a is a
scalar, and x and y are two point structures of the same type. p is the result of the operation on all
appropriate elds of the given points. If x and y are periodic solutions on dierent meshes, interpolation
is used and the result is obtained on the mesh of x. Stability information, if present, is not passed onto
p.
function n=p_norm(point)
Function p normlz performs some normalization on the given point structure p. In particular, fold and
Hopf determining eigenvectors are scaled to norm 1.
24
9 Branch manipulation
Usage of most of the branch manipulation routines has already been illustrated in section 7. Here we
outline their functionality and input and output variables. As for all routines in the package, a brief
description of the parameters is also contained within the source code and can be obtained in Matlab
using the help command.
function [c_branch,succ,fail,rjct]=br_contn(branch,max_tries)
The function br contn computes (or rather extends) a branch of solution points.
branch: initial branch containing at least two points and computation, stability and continuation
method structured and a free parameter structure as described in table 7.
max tries: maximum number of corrections allowed.
c branch: the branch returned is a copy of the initial branch containing further the extra points
computed (starting from the end of the point array in the initial branch).
succ: number of successfull corrections.
fail: number of failed corrections.
rjct: number of rejected points.
Note also that successfully computed points are normalized using the procedure p normlz (see section
8).
function br_plot(branch,x_measure,y_measure,line_type)
25
y measure: default scalar measure to use for the y-axis. If stability is zero, the following choices
are made for y measure. For steady state solutions, the rst component which varies along the
branch; for fold and Hopf bifurcations the rst parameter value (dierent from the one used for
x measure) which varies along the branch. For periodic solutions, the amplitude of the st varying
component. If stability is nonzero, y measure selects the real part of the characteristic roots (for
steady state solutions, fold and Hopf bifurcations) or the modulus of the Floquet multipliers (for
periodic solutions).
function st_branch=br_stabl(branch,skip,recompute)
To continue a branch in the other direction (from the beginning instead of from the end of its point
array), br rvers reverses the order of the points in the branches point array.
function recmp_branch=br_recmp(branch,point_numbers)
26
10 Numerical methods
This section contains short descriptions of the numerical methods and the method parameters used in
DDE-BIFTOOL. More details on the methods can be found in the articles [25, 10, 9] or in [11].
27
where u is the current solution and u its correction. The collocation points are obtained as
ci;j = ti + cj (ti+1 ti ); i = 0; : : : ; L 1; j = 1; : : : ; d;
from the interval points ti , i = 0; : : : ; L 1 and the collocation parameters cj , j = 1; : : : ; d. The prole u
is discretized as a piecewise polynomial as explained in section 6. This representation has a discontinuous
derivative at the interval points. If ci;j coincides with ti the right derivative is taken in (9), if it coincides
with ti+1 the left derivative is taken. In other words the derivative taken at ci;j is that of u restricted to
[ti ; ti+1 ].
Point method parameters The point method parameters (see table 4) specify the following options.
newton max iterations: maximum number of Newton iterations.
newton nmon iterations: during a rst phase of newton nmon iterations + 1 Newton iterations the
norm of the residual is allowed to increase. After these iterations, corrections are halted upon
residual increase.
halting accuracy: corrections are halted when the norm of the last computed residual is less than or
equal to halting accuracy is reached.
minimal accuracy: a corrected point is accepted when the norm of the last computed residual is less
than or equal to minimal accuracy.
extra condition: this parameter is nonzero when extra conditions are provided in a routine sys cond.m
which should border the determining systems during corrections. The routine accepts the current
point as input and produces an array of condition residuals and corresponding condition derivatives
(as an array of point structures) as illustrated below (x10.2).
print residual info: when nonzero, the Newton iteration number and resulting norm of the residual
are printed to the screen during corrections.
For periodic solutions, the extra periodic solution parameters (see table 5) provide the following inform-
ation.
phase condition: when nonzero the integral phase condition (10) is used.
collocation parameters: this parameter contains user given collocation parameters. When empty,
Gauss-Legendre collocation points are chosen.
adapt mesh before correct: before correction and if the mesh inside the point is nonempty, adapt
the mesh every adapt mesh before correct points. E.g.: if zero, do not adapt; if one, adapt every
point; if two adapt the points with odd point number.
adapt mesh after correct: similar to adapt mesh before correct but adapt mesh after successfull cor-
rections and correct again.
28
As an example, suppose we want to compute a branch of periodic solutions of system (5) subject to
the following extra conditions
T = 200;
a212 + a221 = 1;
that is, we wish to continue a branch with xed period T = 200 and parameter dependence a212 + a221 = 1.
The following routine implements these conditions by evaluating and returning each residual for the given
point and the derivatives of the conditions w.r.t. all unknowns (that is, w.r.t. to all the components of
the point structure).
function [resi,condi]=sys_cond(point)
if point.kind=='psol'
% fix period at 200:
resi(1)=point.period-200;
% derivative of first condition wrt unknowns:
condi(1)=p_axpy(0,point,[]);
condi(1).period=1;
% parameter condition:
resi(2)=point.parameter(3)^2+point.parameter(4)^2-1;
% derivative of second condition wrt unknowns:
condi(2)=p_axpy(0,point,[]);
condi(2).parameter(3)=2*point.parameter(3);
condi(2).parameter(4)=2*point.parameter(4);
else
error('SYS_COND: point is not psol.');
end;
return;
10.3 Continuation
During continuation, a branch is extended by a combination of predictions and corrections. A new point
is predicted based on previously computed points using secant prediction over an appropriate steplength.
The prediction is then corrected using the determining systems (6), (7), (8) or (9) bordered with a
steplength condition which requires orthogonality of the correction to the secant vector. Hence one extra
free parameter is necessary compared to the numbers mentioned in the previous section.
The following continuation and steplength determination strategy is used. If the last point was
successfully computed, the steplength is multiplied with a given, constant factor greater than 1. If
corrections diverged or if the corrected point was rejected because its accuracy was not acceptable, a new
point is predicted, using linear interpolation, halfway between the last two successfully computed branch
points. If the correction of this point succeeds, it is inserted in the point array of the branch (before the
previously last computed point). If the correction of the interpolated point fails again, the last successfully
computed branch point is rejected (for fear of branch switch) and the interpolation procedure is repeated
between the (new) last two branch points. Hence, if, after a failure, the interpolation procedure succeeds,
the steplength is approximately divided by a factor two. Test results indicate that this procedure is quite
eective and proves an ecient alternative to using only (secant) extrapolation with steplength control.
The reason for this is mainly that the secant extrapolation direction is not in
uenced by halving the
steplength but it is by inserting a newly computed point in between the last two computed points.
The continuation method parameters (see table 8) have the following meaning.
plot: if nonzero, plot predictions and corrections during continuation.
29
prediction: this parameter should be 1, indicating that secant prediction is used (being currently
the only alternative).
steplength growth factor: grow the steplength with this factor in every step except during interpol-
ation.
plot progress: if nonzero, plotting is visible during continuation process. If zero, only the nal result
is drawn.
plot measure: if empty use default measures to plot. Otherwise plot measure contains two elds, 'x'
and 'y', which contain measures (see table 9) for use in plotting during continuation.
halt before reject: If this parameter is nonzero, continuation is halted whenever (and instead of)
rejecting a previously accepted point based on the above strategy.
30
Since the LMS-method forms an approximation of the time integration operator over the time step
h, so do the roots approximate the eigenvalues of S (h; 0). The eigenvalues of S (h; 0) are exponential
transforms of the roots of the characteristic equation (4),
= exp(h):
Hence, once is found, can be extracted using,
<() = ln(hjj) : (14)
The imaginary part of is found modulo =h, using
arcsin( =j(j) )
=() h (mod h ): (15)
For small h, 0 < h 1, the smallest representation in (15) is assumed the most accurate one (that is,
we let arcsin map into [ =2; =2]).
The parameters r and s (from formula (12)) are chosen such that r s r + 2 (see [17]). The choice
of h is based on the related heuristic outlined in [11].
Approximations for the rightmost roots obtained from the LMS-method using (14), (15) can be
corrected using a Newton process on the system,
()v = 0 (16)
cT v 1 = 0
A starting value for v is the eigenvector of () corresponding to its smallest eigenvalue (in modulus).
Note that the collection of successfully corrected roots presents more accurate yet less robust inform-
ation than the set of uncorrected roots. Indeed, attraction domains of roots of equations like (16) can be
very small and hence corrections may diverge or approximations of dierent roots may be corrected to a
single 'exact' root thereby missing part of the spectrum. The latter does not occur when computing the
(full) spectrum of a discretization of S (h; 0).
Stability information is kept in the structure of table 3 (left). The time step used is kept in eld
h. Approximate roots are kept in eld l0, corrected roots in eld l1. If unconverged corrected roots are
discarded, eld n1 is empty. Otherwise, the number of Newton iterations used is kept for each root in
the corresponding position of n1. Here, 1 signals that convergence to the required accuracy was not
reached. The stability method parameters (see table 6 (top)) now have the following meaning.
lms parameter alpha: LMS-method parameters j ordered from past to present, j = 0; 1; : : :; k.
lms parameter beta: LMS-method parameters j ordered from past to present, j = 0; 1; : : : ; k.
lms parameter rho: safety radius LMS; of the LMS-method stability region. For a precise denition,
see [11, xIII.3.2].
interpolation order: order of the interpolation in the past, r + s = interpolation order.
minimal time step: minimal time step relative to maximal delay, h minimal time step.
maximal time step: maximal time step relative to maximal delay, h minimal time step.
max number of eigenvalues: maximum number of rightmost eigenvalues to keep.
minimal real part: choose h such as to approximate eigenvalues with <() minimal real part well,
discard eigenvalues with <() < minimal real part. If h is smaller than its minimal value, it is set
to the minimal value and a warning is uttered. If it is larger than its maximal value it is reduced
to that number without warning. If minimal and maximal value coincide, h is set to this value
without warning. If minimal real part is empty, the value minimal real part = 1 is used.
31
max newton iterations: maximum number of Newton iterations during the correction process (16).
root accuracy: required accuracy of the norm of the residual of (16) during corrections.
remove unconverged roots: if this parameter is zero, unconverged roots are discarded (and stability
eld n1 is empty).
11 Concluding comments
The rst aim of DDE-BIFTOOL is to provide a portable, user-friendly tool for numerical bifurcation
analysis of steady state solutions and periodic solutions of systems of delay equations of the kind (1).
Part of this goal was fullled through choosing the portable, programmer-friendly environment oered
by Matlab. Robustness with respect to the numerical approximation is achieved through automatic
steplength selection in approximating the rightmost characteristic roots and through collocation using
piecewise polynomials combined with adaptive mesh selection.
Although the package has been successfully tested on a number of realistic examples, a word of caution
may be appropriate. First of all, the package is essentially a research code (hence we accept no reliability)
in a quite unexplored area of current research. In our experience up to now, new examples did not fail
to produce interesting theoretical questions (e.g., concerning homoclinic or heteroclinic solutions) many
of which remain unsolved today. Unlike for ordinary dierential equations, discretization of the state
space is unavoidable during computations on delay equations. Hence the user of the package is strongly
advised to investigate the eect of discretization using tests on dierent meshes and with dierent method
parameters; and, if possible, to compare with analytical results and/or results obtained using simulation.
Although there are no 'hard' limits programmed in the package (with respect to system and/or mesh
sizes), the user will notice the rapidly increasing computation time for increasing system dimension and
mesh sizes. This exhibits itself most profoundly in the stability and periodic solution computations. In-
deed, eigenvalues are computed from large sparse matrices without exploiting sparseness and the Newton
procedure for periodic solutions is implemented using direct methods. Nevertheless the current version
is sucient to perform bifurcation analysis of systems with reasonable properties in reasonable execution
times. Furthermore we hope future versions will include routines which scale better with the size of the
problem.
Other future plans include a graphical user interface and the extension to other types of delay equations
such as state-dependent, distributed delay and neutral functional dierential equations.
32
Acknowledgements
This report presents results of the research project OT/98/16, funded by the Research Council K.U.Leuven;
of the research project G.0270.00 funded by the Fund for Scientic Research - Flanders (Belgium) and
of the research project IUAP P4/02 funded by the programme on Interuniversity Poles of Attraction,
initiated by the Belgian State, Prime Minister's Oce for Science, Technology and Culture. The author,
K. Engelborghs, is a research assistant of the Fund for Scientic Research - Flanders (Belgium).
Thanks to T. Luzyanina and B. Haegeman for being the rst users and testers of DDE-BIFTOOL.
Thanks to D. Roose for being my promoter during the research that culminated into this package.
References
[1] J. Argyris, G. Faust, and M. Haase. An Exploration of Chaos | An Introduction for Natural
Scientists and Engineers. North Holland Amsterdam, 1994.
[2] N. V. Azbelev, V. P. Maksimov, and L. F. Rakhmatullina. Introduction to the Theory of Functional
Dierential Equations. Nauka, Moscow, 1991. (in Russian).
[3] A. Back, J. Guckenheimer, M. Myers, F. Wicklin, and P. Worfolk. DsTool: Computer assisted
exploration of dynamical systems. AMS Notices, 39:303{309, 1992.
[4] R. Bellman and K. L. Cooke. Dierential-Dierence Equations, volume 6 of Mathematics in science
and engineering. Academic Press, 1963.
[5] O. Diekmann, S. A. van Gils, S. M. Verduyn Lunel, and H.-O. Walther. Delay Equations: Functional-
, Complex-, and Nonlinear Analysis, volume 110 of Applied Mathematical Sciences. Springer-Verlag,
1995.
[6] E. J. Doedel, A. R. Champneys, T. F. Fairgrieve, Y. A. Kuznetsov, B. Sandstede, and X. Wang.
AUTO97: Continuation and bifurcation software for ordinary dierential equations; available by
FTP from ftp.cs.concordia.ca in directory pub/doedel/auto.
[7] R. D. Driver. Ordinary and Delay Dierential Equations, volume 20 of Applied Mathematical Science.
Springer-Verlag, 1977.
[8] L. E. El'sgol'ts and S. B. Norkin. Introduction to the Theory and Application of Dierential Equations
with Deviating Arguments, volume 105 of Mathematics in science and engineering. Academic Press,
1973.
[9] K. Engelborghs, T. Luzyanina, K. J. in t Hout, and D. Roose. Collocation methods for the compu-
tation of periodic solutions of delay dierential equations. SIAM J. Sci. Comput., 2000. Accepted.
[10] K. Engelborghs and D. Roose. Numerical computation of stability and detection of Hopf bifurcations
of steady state solutions of delay dierential equations. Advances in Computational Mathematics,
10(3{4):271{289, 1999.
[11] Koen Engelborghs. Numerical Bifurcation Analysis of Delay Dierential Equations. PhD thesis,
Department of Computer Science, Katholieke Universiteit Leuven, Leuven, Belgium, May 2000.
[12] W. H. Enright and H. Hayashi. A delay dierential equation solver based on a continuous Runge-
Kutta method with defect control. Numer. Algorithms, 16:349{364, 1997.
[13] B. Ermentrout. XPPAUT3.91 - The dierential equations tool. University of Pittsburgh, Pittsburgh,
(http://www.pitt.edu/phase/) 1998.
[14] J. Guckenheimer and P. Holmes. Nonlinear Oscillations, Dynamical Systems and Bifurcations of
Vector Fields. Springer-Verlag New York, 1983.
33
[15] J. K. Hale. Theory of Functional Dierential Equations, volume 3 of Applied Mathematical Sciences.
Springer-Verlag, 1977.
[16] J. K. Hale and S. M. Verduyn Lunel. Introduction to Functional Dierential Equations, volume 99
of Applied Mathematical Sciences. Springer-Verlag, 1993.
[17] T. Hong-Jiong and K. Jiao-Xun. The numerical stability of linear multistep methods for delay
dierential equations with many delays. SIAM Journal of Numerical Analysis, 33(3):883{889, June
1996.
[18] The MathWorks Inc. MATLAB 5.3. 1999.
[19] A. I. Khibnik, Yu. A. Kuznetsov, V. V. Levitin, and E. N. Nikolaev. LOCBIF: Interactive Local
Bifurcation Analyzer, version 2.2. Institute of Mathematical Problems in Biology, Russian Academy
of Sciences, Pushchino, 1992.
[20] V. Kolmanovskii and A. Myshkis. Applied Theory of Functional Dierential Equations, volume 85
of Mathematics and Its Applications. Kluwer Academic Publishers, 1992.
[21] V. B. Kolmanovskii and A. Myshkis. Introduction to the theory and application of functional dif-
ferential equations, volume 463 of Mathematics and its applications. Kluwer Academic Publishers,
1999.
[22] V. B. Kolmanovskii and V. R. Nosov. Stability of functional dierential equations, volume 180 of
Mathematics in Science and Engineering. Academic Press, 1986.
[23] Yu. A. Kuznetsov. Elements of Applied Bifurcation Theory, volume 112 of Applied Mathematical
Sciences. Springer-Verlag, 1995.
[24] Yu. A. Kuznetsov and V. V. Levitin. CONTENT: A multiplatform environment for analyzing dy-
namical systems. Dynamical Systems Laboratory, Centrum voor Wiskunde en Informatica; available
via ftp.cwi.nl in directory pub/CONTENT.
[25] T. Luzyanina and D. Roose. Numerical stability analysis and computation of Hopf bifurcation points
for delay dierential equations. Journal of Computational and Applied Mathematics, 72:379{392,
1996.
[26] C. A. H. Paul. A user-guide to Archi - an explicit Runge-Kutta code for solving delay and neutral
dierential equations. Technical Report 283, The University of Manchester, Manchester Center for
Computational Mathematics, December 1995.
[27] J. Hale S.-N. Chow. Methods of Bifurcation Theory. Springer-Verlag, 1982.
[28] Rudiger Seydel. Practical Bifurcation and Stability Analysis | From Equilibrium to Chaos, volume 5
of Interdisciplinary Applied Mathematics. Springer-Verlag Berlin, 2 edition, 1994.
[29] L. F. Shampine and S. Thompson. Solving delay dierential equations with dde23. Submitted, 2000.
[30] L. P. Shayer and S. A. Campbell. Stability, bifurcation and multistability in a system of two coupled
neurons with multiple time delays. SIAM J. Applied Mathematics, 1999. To appear.
[31] S. Thompson, S. P. Corwin, and D. Sarafyan. DKLAG6: A code based on continuously imbedded
sixth order Runge-Kutta methods for the solution of state dependent functional dierential equations.
Applied Numerical Mathematics, 24(2{3):319{330, 1997.
34
Appendix A: List of les
Version 1.00 of DDE-BIFTOOL contains the following les.
Layer 0 Layer 1 Layer 2 Layer 3 Extra
sys cond auto cnt p axpy br contn df brnch
sys deri auto eqd p correc br measr df deriv
sys init auto msh p measur br plot df measr
sys rhs auto ord p norm br recmp df mthod
fold jac p normlz br rvers demo1
hopf jac p pplot br stabl
mult app p remesh
mult dbl p secant
mult int p splot
mult plt p stabil
poly del p tofold
poly dla p tohopf
poly elg p topsol
poly gau p tostst
poly lgr
poly lob
psol eva
psol jac
psol msh
root app
root cha
root int
root nwt
root plt
stst jac
time h
time lms
time nrd
time saf
35
Appendix B: Obtaining the package
DDE-BIFTOOL is freely available for scientic (non-commercial) use. It was written by the author as
a part of his PhD at the Computer Science Department of the K.U.Leuven under supervision of Prof. D.
Roose.
The following terms cover the use of the software package DDE-BIFTOOL:
1. The package DDE-BIFTOOL can be used only for the purpose of internal research excluding any
commercial use of the package DDE-BIFTOOL as such or as a part of a software product.
2. K.U.Leuven, Department of Computer Science shall for all purposes be considered the
owner of DDE-BIFTOOL and of all copyright, trade secret, patent or other intellectual property
rights therein.
3. The package DDE-BIFTOOL is provided on an "as is" basis and for the purposes described in
paragraph 1 only. In no circumstances can K.U.Leuven be held liable for any deciency, fault or
other mishappening with regard to the use or performance of the package DDE-BIFTOOL.
4. All scientic publications, for which the package DDE-BIFTOOL has been used, shall mention
usage of the package DDE-BIFTOOL, and shall refer to the following publication:
K. Engelborghs. DDE-BIFTOOL: a Matlab package for bifurcation analysis of delay
dierential equations. Technical Report TW-305, Department of Computer Science,
K.U.Leuven, Leuven, Belgium, 2000.
Upon acceptance of the above terms, one can obtain the package DDE-BIFTOOL (version 1.00) by
mailing your full name, aliation and address to [email protected]. The package
will then be forwarded to you.
36