1 Introduction

Measuring phase resetting is a common approach for testing neuronal responses in experiments: a brief current injection perturbs the regular spiking behaviour of a neuron, resulting generally in a shifted phase as the neuron returns to its regular oscillating behaviour. This phase shift can be advanced or delayed—meaning that the next spike arrives earlier or later compared with the unperturbed spiking oscillation—and which effect occurs also depends on the moment when the current is applied; see  [9] for more details. A plot of the shifted phase \(\vartheta _\mathrm{new}\) versus the original phase \(\vartheta _\mathrm{old}\) at which the current was applied is known as the phase transition curve (PTC). Experimentally, it is often easier to represent the reset in terms of the resulting phase difference \(\vartheta _\mathrm{new} - \vartheta _\mathrm{old}\) as a function of \(\vartheta _\mathrm{old}\), which can be measured as the time to the next spike; such a representation is called a phase response curve or phase resetting curve (PRC).

The shape of a PTC or PRC of a given system obviously depends on the size of the applied perturbation: already for quite small amplitudes, nonlinear effects can dramatically affect a PTC or PRC. The shape of the PTC or PRC has been used to classify neuronal behaviour  [1, 7, 16], where the underlying assumption is that the size of the applied perturbation is sufficiently small. Hodgkin  [17] distinguished between so-called Type-I and Type-II excitable membranes, where neurons with membranes of Type II are not able to fire at arbitrarily low frequencies. Note that transitions from Type-I to Type-II can occur when system parameters are changed  [8]. Ermentrout  [7] found that the PRC of a Type-I neuron always has the same sign, while that of a Type-II neuron changes sign; this means that the PTC is always entirely above or below the diagonal for Type-I neurons, while it intersects the diagonal for Type-II neurons. In either case, the PTC is invertible for sufficiently small perturbation amplitudes, since it can be viewed as a continuous and smooth deformation of the identity, which is the PTC in the limit of zero amplitude. Invertibility itself has also been used as a distinguishing property of PTCs: noninvertible PTCs are said to be of type 0 (or strong) and invertible PTCs are of type 1 (or weak)  [9, 37]. If an increasingly stronger perturbation is applied, for example, in the context of synchronisation, it is well known that PTCs can change from type 1 to type 0, that is, become noninvertible  [11, 37].

A motivation in recent work on phase resetting has been the idea of interpreting the PTC as defining a one-dimensional phase-reduction model that, hopefully, captures the essential dynamics of a possibly high-dimensional oscillating system. The main interest is in coupled systems, formed by two or more (planar) systems with known PRCs; for example, see  [31, 32] for mathematical as well as experimental perspectives. Unfortunately, the convergence back to the limit cycle after some perturbation can be quite slow for a coupled system, such that only (infinitesimally) small perturbations are accurately described. Furthermore, it makes physiological sense to assume a time-varying input, usually in the form of a short input pulse, rather than the instantaneous perturbation assumed for the theoretical phase reset. Moreover, the perturbation may be repeated at regular intervals. In this context, PTCs and PRCs can be useful for explaining the resetting behaviour, though strictly speaking, the theory is only valid at low firing rates  [15, 35]. More recently, the idea of a phase-amplitude description has led to a better understanding of the effects resulting from these kinds of repeated time-varying resets  [2, 3, 26, 30, 34].

From a dynamical systems perspective, the key question of phase resetting is how the perturbed initial conditions relax back to an attracting periodic orbit \(\Gamma \) with period \(T_\Gamma \) of an underlying continuous-time model, which we take here to be a vector field on \(\mathbb {R}^n\), that is, a system of n first-order autonomous ordinary differential equations. All points in its basin \(\mathcal {B}(\Gamma )\) converge to \(\Gamma \), and they do so with a given asymptotic phase. The subset of all points in \(\mathcal {B}(\Gamma )\) that converge to \(\Gamma \) in phase with the point \(\gamma _{\vartheta } \in \Gamma \), where \(\vartheta \in [0, 1)\) by convention, is called the (forward-time) isochron of \(\gamma _{\vartheta }\), which we refer to as \(I(\gamma _{\vartheta })\). Isochrons were defined and named by Winfree  [36]. Guckenheimer  [12] showed that \(I(\gamma _{\vartheta })\) is, in fact, an \((n-1)\)-dimensional invariant stable manifold of the attracting fixed point \(\gamma _{\vartheta } \in \Gamma \) under the time-\(T_\Gamma \) map. In particular, it follows that \(I(\gamma _{\vartheta })\) is tangent to the attracting linear eigenspace of \(\gamma _{\vartheta }\) and, hence, transverse to \(\Gamma \). Moreover, the \(\vartheta \)-dependent family of all isochrons \(I(\gamma _{\vartheta })\) foliates the basin \({\mathcal B}(\Gamma )\). In other words, any point in \({\mathcal B}(\Gamma )\) has a unique asymptotic phase determined by the isochron it lies on.

For a given \(\vartheta _\mathrm{old}\), consider now the perturbed point \(\gamma _{\vartheta _\mathrm{old}} +\, A \, \mathbf {d} \in {\mathcal B}(\Gamma )\), obtained from \(\gamma _{\vartheta _\mathrm{old}} \in \Gamma \) by applying the perturbation of strength A in the given direction \(\mathbf {d}\). The asymptotic phase \(\vartheta _\mathrm{new}\) is, hence, uniquely determined by the isochron \(I(\gamma _{\vartheta _\mathrm{new}})\) on which this point lies. This defines a circle map \(P : [0, 1) \rightarrow [0, 1)\) with \(P(\vartheta _\mathrm{old}) = \vartheta _\mathrm{new}\). Therefore, finding the PTC is equivalent to determining how the perturbed cycle \(\Gamma + A \, \mathbf {d} = \{ \gamma _{\vartheta _\mathrm{old}} + A \, \mathbf {d} \;|\; \vartheta _\mathrm{old} \in [0, 1) \}\) intersects the foliation of \({\mathcal B}(\Gamma )\) by the isochrons \(I(\gamma _{\vartheta _\mathrm{new}})\) for \(\vartheta _\mathrm{new} \in [0, 1)\). Notice further that the PTC is the graph of the circle map P on the unit torus \(\mathbb {T}^2\), represented by the unit square \([0, 1) \times [0, 1)\).

When considering the amplitude A of the perturbation as a parameter (while keeping the direction \(\mathbf {d}\) fixed throughout), one can deduce some important properties of the associated PTC. Suppose that \(0 < A_\mathrm{max}\) is such that \(\Gamma _A := \Gamma + A \, \mathbf {d} \subset {\mathcal B}(\Gamma )\) for all \(0 \le A < A_\mathrm{max}\). Then none of these perturbed cycles \(\Gamma _A\) intersects the boundary of the basin \({\mathcal B}(\Gamma )\) and the associated circle map \(P = P_A\) is well defined for all \(\vartheta _\mathrm{old} \in [0, 1)\). The map \(P_0\) for zero perturbation amplitude is the identity on \(\mathbb {T}^2\), which means that, as its graph, the PTC is the diagonal on \([0, 1) \times [0, 1)\) and a 1:1 torus knot on \(\mathbb {T}^2\); in particular, \(P_0\) is invertible, that is, it is injective and surjective. Because of smooth dependence on the amplitude A and the fact that \(P_A\) is a function over [0, 1), the PTC remains a 1:1 torus knot on \(\mathbb {T}^2\) and \(P_A\) is surjective for all \(0 \le A < A_\mathrm{max}\).

Since the isochrons are transverse to \(\Gamma \), the circle map \(P_A\) is \(C^1\)-close to the identity, and hence, also injective, for sufficiently small A. As the graph of a near-identity transformation, the PTC is then strictly monotone, invertible, and hence, of type 1 (or weak) in the notation of  [9, 37]. While surjectivity is preserved, injectivity may be lost before \(A = A_\mathrm{max}\) is reached. Indeed, the PTC is either invertible for all \(0 \le A < A_\mathrm{max}\), or there is a maximal \(0< A_\mathrm{inv} < A_\mathrm{max}\) such that \(P_A\) is invertible only for all \(0 < A \le A_\mathrm{inv}\). The loss of injectivity of \(P_A\) at \(A = A_\mathrm{inv}\) happens generically because of the emergence of an inflection point. For \(0 \le A < A_\mathrm{max}\) this transition creates a local minimum and a local maximum of the PTC, which is now no longer invertible and so of type 0 (or strong) in the notation of  [9, 37]. As we will show, an inflection point of \(P_A\) corresponds to a cubic tangency between the perturbed cycle \(\Gamma _A\) and an isochron. Indeed, additional inflection points and, hence, local minima and maxima may appear at subsequent cubic isochron tangencies. Since \(P_A\) is a circle map, these must come in pairs; hence, counting the number of its local maxima (or minima) would provide a further refinement of the notation of a type 0 (or strong) PTC.

The above discussion shows that, when the applied perturbation A is sufficiently weak, it suffices to consider only the linear approximation to the isochron family, which is given by the \(\vartheta \)-family of stable eigenspaces of the time-\(T_\Gamma \) map for each \(\vartheta \). In practice, nonlinear effects are essential, especially when multiple time scales are present or the phase reset involves relatively strong perturbations. Isochrons are often highly nonlinear objects of possibly very complicated geometry  [21, 36]. While the geometric idea of isochrons determining the phase resets has been around since the mid 1970s, the practical implementation has proven rather elusive. In practice, it is not at all straightforward to compute the isochrons of a periodic orbit. In planar systems, when such isochrons are curves, three different approaches have been proposed, based on Fourier averages  [23, 25], a parametrisation formulated in terms of a functional equation  [14, 18], and continuation of solutions to a suitably posed two-point boundary value problem  [21, 29]. In principle, all three approaches generalise to higher-dimensional isochrons, but there are only few explicit examples  [14, 25].

From the knowledge of the isochron foliation of \(\mathcal{B}(\Gamma )\), one can immediately deduce geometrically the phase resetting for perturbations of any strength and in any direction. However, already for planar and certainly for higher-dimensional systems, this is effectively too much information when one is after the PTC resulting from a perturbation in a fixed direction and with a specific amplitude. In essence, finding a PTC or PRC remains the one-dimensional problem of finding the asymptotic phase of all points on the perturbed cycle.

In this chapter, we show how this can be achieved with a multi-segment boundary value problem formulation. Specifically, we adapt the approach from  [21, 22] to set up the calculation of the circle map \(P_A\) by continuation, first in A from \(A=0\) for fixed \(\vartheta _\mathrm{old}\), and then in \(\vartheta _\mathrm{old} \in [0, 1)\) for fixed A. In this way, we obtain accurate numerical approximations of the PTC or PRC as continuous curves, even when the system shows strong phase sensitivity. The set-up is extremely versatile, and the direct computation of a PTC in this way does not require the system to be planar. We demonstrate our method with a constructed example going back to Winfree  [37, Chapter 6], where we also show how injectivity is lost in a first cubic tangency of \(\Gamma _A\) with an isochron. The robustness of the method is then illustrated with the computation of a PTC of a perturbed cycle that cuts through a region of extreme phase sensitivity in the (planar) FithHugh–Nagumo system; in spite of very large derivatives due to this phase sensitivity, the PTC is computed accurately as a continuous curve. Our final example of a seven-dimensional system from  [20] modelling a type of cardiac pacemaker cell shows that our approach also works in higher dimensions; this system also features phase sensitivity due to the existence of different time scales.

This chapter is organised as follows. In the next section, we provide precise details of the setting and explain the definitions used. Section 3 presents the numerical set-up for computing a resetting curve by continuation of a multi-segment boundary value problem. We then discuss two planar examples in depth, which are both taken from  [22]: a variation of Winfree’s model in Sect. 4 and the FitzHugh–Nagumo system in Sect. 5. The third and higher-dimensional example from  [20] is presented in Sect. 6. A summary of the results is given in Sect. 7, where we also discuss some consequences of our findings and directions of future research.

2 Basic Setting and Definitions

As mentioned in the introduction, we consider a dynamical system with an attracting periodic orbit \(\Gamma \). For simplicity, we assume that the state space is \(\mathbb {R}^n\) and consider the dynamical system

$$\begin{aligned} \dot{\mathbf {x}} = \mathbf {F}(\mathbf {x}), \end{aligned}$$
(1)

where \(\mathbf {F} : \mathbb {R}^n \rightarrow \mathbb {R}^n\) is at least once continuously differentiable. We assume that system (1) has an attracting periodic orbit \(\Gamma \) with period \(T_\Gamma > 0\), that is,

$$\begin{aligned} \Gamma := \{ \gamma (t) \in \mathbb {R}^n \;|\; 0 \le t \le T_\Gamma \text{ with } \gamma (T_\Gamma ) = \gamma (0) \}, \end{aligned}$$

and \(T_\Gamma \) is minimal with this property. We associate a phase \(\vartheta \in [0, 1)\) with each point \(\gamma _\vartheta \in \Gamma \), defining \(\gamma _\vartheta := \gamma (t)\) with \(t = \vartheta T_\Gamma \). Here \(\gamma _0 := \gamma (0)\) needs to be chosen, which is usually done by fixing it to correspond to a maximum in the first component. The (forward-time) isochron \(I(\gamma _{\vartheta })\) associated with \(\gamma _\vartheta \in \Gamma \) is then defined in terms of initial conditions \(\mathbf {x}(0)\) of forward trajectories \(\mathbf {x} := \{ \mathbf {x}(t) \in \mathbb {R}^n \;|\; t \in \mathbb {R} \}\) of system (1) that accumulate on \(\Gamma \), namely, as

$$\begin{aligned} I(\gamma _{\vartheta }) := \{ \mathbf {x}(0) \in \mathbb {R}^n \;|\; \lim _{k \rightarrow \infty } \mathbf {x}(k \, T_\Gamma ) = \gamma _\vartheta \text{ with } k \in \mathbb {N} \}. \end{aligned}$$

In other words, the trajectory \(\mathbf {x}\) approaches \(\Gamma \) in phase with \(\gamma _\vartheta \). Note that \(I(\gamma _{\vartheta })\) is the stable manifold of the fixed point \(\gamma _\vartheta \) of the time-\(T_\Gamma \) return map; in particular, this means that \(I(\gamma _{\vartheta })\) is of dimension \(n-1\) and tangent at \(\gamma _\vartheta \) to the stable eigenspace \(E(\gamma _\vartheta )\), which is part of the stable Floquet bundle of \(\Gamma \)  [12, 13]; we utilise this property when computing isochrons, and also when computing a PTC or PRC.

We are now ready to give formal definitions of the PTC and PRC; see also  [9].

Definition 1

(Phase Transition Curve)

The phase transition curve or PTC associated with a perturbation of amplitude \(A \ge 0\) in the direction \(\mathbf {d} \in \mathbb {R}^n\) is the graph of the map \(P : [0, 1) \rightarrow [0, 1)\) defined as follows. For \(\vartheta \in [0, 1)\), the image \(P(\vartheta )\) is the phase \(\varphi \) associated with the isochron \(I(\gamma _{\varphi })\) that contains the point \(\gamma _\vartheta + A \, \mathbf {d}\) for \(\gamma _\vartheta \in \Gamma \).

Definition 2

(Phase Response Curve)

The phase response curve or PRC associated with a perturbation of amplitude \(A \ge 0\) in the direction \(\mathbf {d} \in \mathbb {R}^n\) is the graph of the phase difference \(\Delta (\vartheta ) = P(\vartheta ) - \vartheta \, (\mathrm{mod} \ 1)\), where the map P is as above.

The definitions of the PTC and PRC are based on knowledge of the (forward-time) isochron \(I(\gamma _{\varphi })\) associated with a point \(\gamma _\varphi \in \Gamma \). We previously designed an algorithm based on continuation of a two-point boundary value problem (BVP) that computes one-dimensional (forward-time and backward-time) isochrons of a planar system up to arbitrarily large arclengths  [21, 22, 29]. Here, we briefly describe this algorithm in its simplest form, because this is useful for understanding the basic set-up, and for introducing some notation. The description is presented in the style that is used for implementation in the software package Auto  [4, 5]. In particular, we consider a time-rescaled version of the vector field (1), which represents an orbit segment \(\{ \mathbf {x}(t)\ \;|\; 0 \le t \le T \}\) of (1) as the orbit segment \(\{ \mathbf {u}(t) \;|\; 0 \le t \le 1 \}\) of the vector field

$$\begin{aligned} \dot{\mathbf {u}} = T \, \mathbf {F}(\mathbf {u}), \end{aligned}$$
(2)

so that the total integration time T is now a parameter of the system.

We approximate \(I(\gamma _0)\) as the set of initial points of orbit segments that end on the linear space \(E(\gamma _0)\), the linearised isochron of \(I(\gamma _0)\), close to \(\gamma _0\) after integer multiples of the period \(T_\Gamma \). These points are formulated as initial points \(\mathbf {u}(0)\) of orbit segments \(\mathbf {u}\) that end on \(E(\gamma _0)\) at a distance \(\eta \) from \(\gamma _0\); hence, \(\eta \) defines a one-parameter family of orbit segments. Each orbit segment in this family is a solution of system (2) with \(T = k \, T_\Gamma \) for \(k \in \mathbb {N}\); the corresponding boundary conditions are:

$$\begin{aligned} \left[ \mathbf {u}(1) - \gamma _0 \right] \cdot \mathbf {v}_0^\perp = 0, \end{aligned}$$
(3)
$$\begin{aligned} \left[ \mathbf {u}(1) - \gamma _0 \right] \cdot \mathbf {v}_0 = \eta , \end{aligned}$$
(4)

where \(\mathbf {v}_0\) is the normalised vector that spans \(E(\gamma _0)\) and \(\mathbf {v}_0^\perp \) is perpendicular to it. Note that \(\Gamma \) itself, when starting from \(\gamma _0\), is a solution to the two-point BVP (2)–(4) with \(T = T_\Gamma \) and \(\eta = 0\). This gives us a first solution to start the continuation for computing \(I(\gamma _0)\). We fix \(T = T_\Gamma \) and continue the orbit segment \(\mathbf {u}\) in \(\eta \) up to a maximum prespecified tolerance \(\eta = \eta _\mathrm{max}\). As the end point \(\mathbf {u}(1)\) is pushed away from \(\gamma _0\) along \(E(\gamma _0)\), the initial point \(\mathbf {u}(0)\) traces out a portion of \(I(\gamma _0)\).

Once we reach \(\eta = \eta _\mathrm{max}\), we can extend \(I(\gamma _0)\) further by considering points that map to \(E(\gamma _0)\) after one additional period, that is, after time \(T = 2 \, T_\Gamma \). We start the continuation with the orbit segment formed by concatenation of the final orbit segment with \(\Gamma \); here, we rescale time such that this first orbit is again defined for \(0 \le t \le 1\), we set \(T = 2 \, T_\Gamma \), and \(\eta = 0\). Note that this orbit segment has a discontinuity at \(t = \frac{1}{2}\), but it is very small and Auto will automatically correct and close it as part of the first continuation step. This correction will cause a small shift in \(\eta \) away from 0, but \(\eta \) will still be much smaller than \(\eta _\mathrm{max}\) (in absolute value). We can keep extending \(I(\gamma _0)\) further in this way, by continuation with \(T = k \, T_\Gamma \), for integers \(k > 2\). See  [21, 29] for more details on the implementation and, in particular, see  [19, 29] for details on how to find \(E(\gamma _0)\) represented by the first vector \(\mathbf {v}_0\) in the stable Floquet bundle of \(\Gamma \).

The computational set-up forms a well-posed two-point BVP with a one-parameter solution family that can be found by continuation, provided the equality \(\mathsf{NDIM} - \mathsf{NBC} + \mathsf{NPAR} = 1\) holds for the dimension NDIM of the problem, the number NBC of boundary conditions, and the number NPAR of free parameters. Indeed, for the computation of \(I(\gamma _0)\), we have \(\mathsf{NDIM} = 2\), because we assumed that the system is planar; \(\mathsf{NBC} = 2\), namely, one condition to restrict \(\mathbf {u}(1)\) to the linearised isochron of \(I(\gamma _0)\), and one condition to fix its distance to \(\gamma _0\); and \(\mathsf{NPAR} = 1\), because we free the parameter \(\eta \).

To compute \(I(\gamma _{\varphi })\) for other \(\varphi \in [0, 1)\), this same approach can be used, working with a shifted periodic orbit \(\Gamma \) so that its head point is \(\gamma _\varphi \), and determining the associated direction vector \(\mathbf {v}_\varphi \) that spans the eigenspace \(E(\gamma _\varphi )\) to which \(I(\gamma _{\varphi })\) is tangent. In  [29], approximations of \(\gamma _\varphi \) and \(\mathbf {v}_\varphi \) are obtained by interpolation of the respective mesh discretisations from Auto. We describe an alternative approach in  [21], where we consider \(I(\gamma _{\varphi })\) as the set of initial points of orbit segments that end in the linear space \(E(\gamma _0)\) of \(I(\gamma _0)\) sufficiently close to \(\gamma _0\) after total integration time \(T = k \, T_\Gamma + (1 - \varphi ) \, T_\Gamma \).

For the computation of a phase resetting curve, we use a combination of these two approaches, but rather than interpolation, we shift the periodic orbit by imposing a separate two-point BVP. More precisely, we set up a multi-segment BVP comprised of several subsystems of two-point BVPs; the set-up for this extended BVP is explained in detail in the next section.

3 Algorithm for Computing a Phase Resetting Curve

Based on the definition of PTC and PRC, one could now calculate a sufficiently large number of isochrons and determine the resetting curve numerically from data. We prefer to compute the PTC or PRC directly also with a BVP set-up and continuation. The major benefit of such a direct approach is that it avoids accuracy restrictions arising from the selection of computed isochrons; in particular, any phase sensitivity of the PTC or PRC will be dealt with automatically as part of the pseudo-arclength continuation with Auto  [4, 5].

For ease of presentation, we will formulate and discuss our continuation set-up for the case of a planar system. We remark, however, that it can readily be extended for use in \(\mathbb {R}^n\) with \(n > 2\), because the dimensionality of the problem is not determined by the dimension \(n-1\) of the isochrons but by the dimension of the PTC or PRC, which is always one; see also the example in Sect. 6.

The essential difference between calculating a resetting curve rather than an isochron is the following: for an isochron \(I(\gamma _{\vartheta })\), we compute orbit segments with total integration time \(T = T_\Gamma \) (or integer multiples), where we move the end point \(\mathbf {u}(1)\) along the linear approximation of \(I(\gamma _{\vartheta })\) to some distance \(\eta \) from \(\Gamma \), while the initial point \(\mathbf {u}(0)\) traces out a new portion of \(I(\gamma _{\vartheta })\); imagining the same set-up, if we move \(\mathbf {u}(0)\) transverse to \(I(\gamma _{\vartheta })\), the end point \(\mathbf {u}(1)\) will move to lie on the linearisation of an isochron \(I(\gamma _{\varphi })\) with a different phase \(\varphi \). (Here, one should expect that the distance to \(\Gamma \) also changes, but we assume it is still less than \(\eta _\mathrm{max}\)). The key idea behind our approach is that we find a way to determine the different phase \(\varphi \), or the phase shift \(\varphi - \vartheta \), by allowing \(\Gamma \) and its corresponding stable Floquet bundle to rotate as part of an extended system. We ensure the head point of \(\Gamma \) moves with the phase-shifted point, that is, the first point on \(\Gamma \) will be \(\gamma _\varphi \). In this way, we can determine the shifted phase \(\varphi \) along any prescribed arc traced out by \(\mathbf {u}(0)\), provided it lies in the basin of attraction of \(\Gamma \). For the PTC or PRC associated with a perturbation of amplitude \(A \ge 0\) in the direction \(\mathbf {d} \in \mathbb {R}^n\), this prescribed arc is the perturbed cycle \(\Gamma + A \, \mathbf {d}\), that is, \(\mathbf {u}(0)\) traces out the closed curve \(\{\gamma _\vartheta + A \, \mathbf {d} \;|\; \vartheta \in [0, 1) \}\).

3.1 Continuation Set-Up for Rotated Representation of \(\Gamma \)

We formulate an extended BVP that represents a rotated version of \(\Gamma \) with a particular phase, meaning that we automatically determine the phase of the head point relative to \(\gamma _0\). To this end, we assume that the zero-phase point \(\gamma _0 \in \Gamma \) and its associated linear vector \(\mathbf {v}_0\), or more practical, its perpendicular \(\mathbf {v}_0^\perp \), are readily accessible as stored parameters, or constants that do not change. Hence, even when \(\Gamma \) is rotated and its first point is \(\gamma _\varphi \) for some different \(\varphi \in [0, 1)\), we can still access the coordinates of \(\gamma _0\) and \(\mathbf {v}_0^\perp \) from the parameter/constants list.

The extended BVP consists of three components, one to define \(\Gamma \), one to define the associated (rotated) linear bundle, and one to define the associated phase. We start by representing \(\Gamma \) as a closed orbit segment \(\mathbf {g}\) that solves system (2) for \(T = T_\Gamma \). Hence, we define

$$\begin{aligned} \dot{\mathbf {g}} = T_\Gamma \, \mathbf {F}(\mathbf {g}), \end{aligned}$$
(5)

with periodic boundary condition

$$\begin{aligned} \mathbf {g}(1) - \mathbf {g}(0) = 0. \end{aligned}$$
(6)

The stable Floquet bundle of \(\Gamma \) is coupled with the BVP (5)–(6) via the first variational equation. More precisely, we consider a second orbit segment \(\mathbf {v_g}\), such that each point \(\mathbf {v_g}(t)\) represents a vector associated with points \(\mathbf {g}(t)\) of the orbit segment that solves (5). The orbit segment \(\mathbf {v_g}\) is a solution to the linearised flow such that \(\mathbf {v_g}(0)\) is mapped to itself after one rotation around \(\Gamma \). The length of \(\mathbf {v_g}(0)\) is contracted after one rotation by the factor \(\mathrm{exp}(T_\Gamma \, \lambda _\mathrm{s})\), which is the stable Floquet multiplier of \(\Gamma \). We prefer formulating this in logarithmic form, which introduces the stable Floquet exponent \(\lambda _\mathrm{s}\) to the first variational equation, rather than affecting the length of \(\mathbf {v_g}(0)\). Therefore, the BVP (5)–(6) is extended with the following system of equations:

$$\begin{aligned} \dot{\mathbf {v}}_{\mathbf {g}} = T_\Gamma \, \left[ \mathrm{D}_{\mathbf {g}} \mathbf {F}(\mathbf {g}) \, \mathbf {v_g} - \lambda _\mathrm{s} \, \mathbf {v_g} \right] , \end{aligned}$$
(7)
$$\begin{aligned} \mathbf {v_g}(1) - \mathbf {v_g}(0) = 0, \end{aligned}$$
(8)
$$\begin{aligned} \mid \!\mid \! \mathbf {v_g}(0) \!\mid \!\mid = 1. \end{aligned}$$
(9)

In particular, \(\mathbf {v_g}(0) = \mathbf {v_g}(1)\) is the normalised vector that spans the local linearised isochron associated with \(\mathbf {g}(0)\).

We have not specified a phase condition and, indeed, we allow \(\mathbf {g}\) to shift and start at any point \(\gamma _\vartheta \in \Gamma \). Consequently, the linear bundle \(\mathbf {v_g}\) will also shift such that \(\mathbf {v_g}(0)\) still spans the local linearised isochron associated with \(\mathbf {g}(0)\).

Phase shifting the periodic orbit and its linear bundle by continuation in this way has been performed before  [8]. However, the implementation in  [8] requires accurate knowledge of the coordinates of the point \(\gamma _\vartheta \) in order to decide when to stop shifting. Our approach uses another BVP set-up to monitor the phase shift, so that both \(\gamma _\vartheta \) and \(\mathbf {v}_\vartheta \) are determined up to the accuracy of the computation. To this end, we introduce a third orbit segment \(\mathbf {w}\) that lies along \(\Gamma \), with initial point \(\mathbf {w}(0)\) equal to \(\mathbf {g}(0)\), and end point \(\mathbf {w}(1)\) equal to \(\gamma _0\). The total integration time associated with this orbit segment \(\mathbf {w}\) is the fraction of the period \(T_\Gamma \) that \(\mathbf {g}(0)\) lies away from \(\gamma _0\) along \(\Gamma \); hence, it is directly related to the phase of \(\mathbf {g}(0)\). We extend the BVP (5)–(9) with the following system of equations:

$$\begin{aligned} \dot{\mathbf {w}} = \nu \, T_\Gamma \, \mathbf {F}(\mathbf {w}), \end{aligned}$$
(10)
$$\begin{aligned} \mathbf {w}(0) = \mathbf {g}(0), \end{aligned}$$
(11)
$$\begin{aligned} \left[ \mathbf {w}(1) - \gamma _0 \right] \cdot \mathbf {v}_0^\perp = 0. \end{aligned}$$
(12)

Here, we do not impose \(\mathbf {w}(1) = \gamma _0\). Instead, condition (12) allows \(\mathbf {w}(1)\) to move in the linearisation of \(I(\gamma _0)\) at \(\gamma _0\); this relaxation is necessary to ensure that the BVP remains well posed and the discretised problem has a solution. In practice, since \(\mathbf {w}(0) \in \Gamma \), the difference between \(\mathbf {w}(1)\) and \(\gamma _0\) will be of the same order as the overall accuracy of the computation. Note that it is important to ensure \(\nu \ge 0\) in Eq. (10), because \(\mathbf {w}(1)\) may diverge from \(\gamma _0\) along \(E(\gamma _0)\) otherwise. We found it convenient to start the calculation with \(\nu = 1\), which corresponds to the orbit segment \(\mathbf {w} = \mathbf {g}\).

The combined solution \(\{ \mathbf {g}, \mathbf {v_g}, \mathbf {w} \}\) to the multi-segment BVP (5)–(12) represents a rotated version of \(\Gamma \) and its stable Floquet bundle so that the head point is \(\gamma _\varphi \) with phase \(\varphi = 1 - \nu \, (\mathrm{mod} \ 1)\). We remark here that this extended set-up can also be used to compute \(I(\gamma _{\varphi })\), for any phase \(0< \varphi < 1\), with the method for \(I(\gamma _0)\) described in Sect. 2; such a computation would approximate each isochron up to the same accuracy, without introducing an additional interpolation error.

3.2 Continuation Set-Up for the Phase Reset

Recall the set-up for computing a phase reset by moving \(\mathbf {u}(0)\) transversely to \(I(\gamma _{\vartheta })\), so that the end point \(\mathbf {u}(1)\) will move and lie on the linearisation of an isochron \(I(\gamma _{\varphi })\) with a different phase \(\varphi \). Here, the orbit segment \(\mathbf {u}\) is a solution of

$$\begin{aligned} \dot{\mathbf {u}} = k \, T_\Gamma \, \mathbf {F}(\mathbf {u}), \end{aligned}$$
(13)

for some \(k \in \mathbb {N}\). The end point \(\mathbf {u}(1)\) should lie close to \(\Gamma \) on the linearisation of \(I(\gamma _{\varphi })\), for some \(\varphi \in [0, 1)\). We stipulate that the rotated version of \(\Gamma \) is shifted such that \(\mathbf {u}(1)\) lies close to \(\mathbf {g}(0)\) along the direction \(\mathbf {v_g}(0)\). Hence, we require the two boundary conditions

$$\begin{aligned} \left[ \mathbf {u}(1) - \mathbf {g}(0) \right] \cdot \mathbf {v_g}(0) = \eta , \end{aligned}$$
(14)
$$\begin{aligned} \left[ \mathbf {u}(1) - \mathbf {g}(0) \right] \cdot \mathbf {v_g}(0)^{\perp } = 0, \end{aligned}$$
(15)

where \(\mathbf {v_g}(0)^{\perp }\) is the vector perpendicular to \(\mathbf {v_g}(0)\). Here, \(\eta \) measures the (signed) distance between \(\mathbf {u}(1)\) and \(\mathbf {g}(0)\), which is along \(\mathbf {v_g}(0)\). Since \(\mathbf {u}\) is a solution of (13) and \(k \in \mathbb {N}\), the initial point \(\mathbf {u}(0)\) has the same phase as the last point \(\mathbf {u}(1)\), and the combined multi-segment BVP (5)–(15) ensures that \(\mathbf {u}(1)\) has (approximate) phase \(1 - \nu \, (\mathrm{mod} \ 1)\). In practice, we should choose \(k \in \mathbb {N}\) large enough such that \(\eta < \eta _\mathrm{max}\). If \(\mathbf {u}(0)\) lies close to \(\Gamma \), it will be sufficient to set \(k = 1\). In order to consider phase resets of large perturbations, for which \(\mathbf {u}(0)\) starts relatively far away, we need \(k > 1\), to allow for sufficient time to let \(\mathbf {u}\) converge and have \(\mathbf {u}(1)\) lie close to \(\Gamma \).

At this stage, the multi-segment BVP (5)–(15) is a system of \(\mathsf{NDIM} = 8\) ordinary differential equations (for the case of a planar system), with \(\mathsf{NBC} = 10\) boundary conditions, and \(\mathsf{NPAR} = 4\) free parameters, namely, \(T_\Gamma \), \(\lambda _\mathrm{s}\), \(\nu \), and \(\eta \); the period \(T_\Gamma \) and stable Floquet exponent \(\lambda _\mathrm{s}\) must remain free parameters to ensure that the discretised problem has a solution, but their variation will be almost zero. Hence, \(\mathsf{NDIM} - \mathsf{NBC} + \mathsf{NPAR} = 2 \ne 1\), and one more condition is needed to obtain a one-parameter family of solutions.

The final step in the set-up is to impose an extra condition that specifies how \(\mathbf {u}(0)\) moves along an arc or closed curve in the phase plane. Consequently, since \(k \, T_\Gamma \) is fixed, the orbit segment \(\mathbf {u}\) changes, so that \(\mathbf {u}(1)\) will move as well, and \(\mathbf {g}(0)\), along with \(\mathbf {v_g}(0)\) will shift accordingly. This causes a variation in \(\nu \) to maintain \(\mathbf {w}(0) = \mathbf {g}(0)\), and these \(\nu \)-values precisely define the new phase in the continuation run as a function of the position along the chosen arc or closed curve.

To compute the PRC, we need to let \(\mathbf {u}(0)\) traverse the closed curve \(\{\gamma _\vartheta + A \, \mathbf {d} \;|\; \vartheta \in [0, 1) \}\) obtained by the (instantaneous) perturbation of \(\Gamma \) in the direction \(\mathbf {d}\) for distance A. We can impose this relatively complicated path on \(\mathbf {u}(0)\) by including another system of equations to the multi-segment BVP, namely, the BVP that defines \(\Gamma \) in terms of another rotated orbit segment \(\mathbf {g_u}\). Furthermore, in order to keep track of the phase \(\vartheta \) along this path, we introduce another segment \(\mathbf {w}_{\mathbf {u}}\) that plays the same role as \(\mathbf {w}\) in Sect. 3.1; compare with equations (5)–(6) and (10)–(12). In other words, we extend the BVP (5)–(15) by the following system of equations

$$\begin{aligned} \dot{\mathbf {g}}_{\mathbf {u}} = \widehat{T}_\Gamma \, \mathbf {F}(\mathbf {g_u}), \end{aligned}$$
(16)
$$\begin{aligned} \mathbf {g_u}(1) - \mathbf {g_u}(0) = 0. \end{aligned}$$
(17)
$$\begin{aligned} \dot{\mathbf {w}}_{\mathbf {u}} = (1 - \vartheta ) \, \widehat{T}_\Gamma \, \mathbf {F}(\mathbf {w}_{\mathbf {u}}), \end{aligned}$$
(18)
$$\begin{aligned} \mathbf {w}_{\mathbf {u}}(0) = \mathbf {g_u}(0), \end{aligned}$$
(19)
$$\begin{aligned} \left[ \mathbf {w}_{\mathbf {u}}(1) - \gamma _0 \right] \cdot \mathbf {v}_0^\perp = 0. \end{aligned}$$
(20)

Here, we decrease \(\vartheta \) from 1 to 0, during which \(\mathbf {w}_{\mathbf {u}}\) grows and \(\mathbf {g_u}\) tracks \(\gamma _\vartheta \). In order for a solution to exist, the periods \(T_\Gamma \) and \(\widehat{T}_\Gamma \) must be two different free parameters, although they remain constant (and equal) to within the accuracy of the computation. The phase reset is now obtained by imposing

$$\begin{aligned} \mathbf {u}(0) = \mathbf {g_u}(0) + A \, \mathbf {d}. \end{aligned}$$
(21)

The multi-segment BVP (5)–(21) is now a system of dimension \(\mathsf{NDIM} = 12\), with \(\mathsf{NBC} = 17\) boundary conditions, and \(\mathsf{NPAR} = 6\) free parameters, which are \(T_\Gamma \), \(\lambda _\mathrm{s}\), \(\nu \), \(\eta \), \(\widehat{T}_\Gamma \), and either \(\vartheta \) or A. Since, \(\mathsf{NDIM} - \mathsf{NBC} + \mathsf{NPAR} = 1\), we obtain a one-parameter solution family by continuation. As the first solution in the continuation, we use the known solution \(\mathbf {g} = \mathbf {w} = \mathbf {u} =\mathbf {g_u} = \Gamma \), which starts with the head point \(\gamma _0\), the associated stable linear bundle \(\mathbf {v}_0\) that we assumed has been pre-computed, and \(\mathbf {w}_{\mathbf {u}} = \gamma _0\); then \(T_\Gamma = \widehat{T}_\Gamma \) and \(\lambda _\mathrm{s}\) are set to their known computed values, \(\eta = A = 0\), and \(\nu = \vartheta = 1\). Initially, \(k = 1\), and one should monitor \(\eta \) to make sure it does not exceed \(\eta _\mathrm{max}\).

To obtain the PTC or PRC we first perform a homotopy step, where we fix \(\vartheta = 1\) and vary the amplitude A until the required value is reached. This continuation run produces a one-parameter family of solutions representing the effect of a reset of varying amplitude A from the point \(\gamma _0\). In the main continuation run, we then fix A and decrease \(\vartheta \) until \(\vartheta = 0\), so that it covers the unit interval; the associated solution family of the multi-segment BVP (5)–(21), hence, provides the resulting phase \(\vartheta _\mathrm{new} := 1 - \nu \, (\mathrm{mod} \ 1)\) as a function of the phase \(\vartheta _\mathrm{old} := \vartheta \) along the perturbed periodic orbit.

4 Illustration of the Method with a Model Example

We illustrate our method for computing a PTC with a constructed example, namely, a parametrised version of the model introduced by Winfree  [37, Chapter 6], which we also used in  [22]; it is given in polar coordinates as

$$\begin{aligned} \left\{ \begin{array}{rcc} \dot{r} &{}=&{} (1-r) \, (r-a) \, r, \\ \dot{\psi } &{}=&{} -1 - \omega \, (1-r). \end{array} \right. \end{aligned}$$

In Euclidean coordinates, the system becomes

$$\begin{aligned} \left\{ \begin{array}{rcccl} \dot{x} &{}=&{} (1 - \sqrt{x^2 + y^2}) \, \left( x \, (\sqrt{x^2 + y^2} - a) + \omega y \right) + y, \\[2mm] \dot{y} &{}=&{} (1 - \sqrt{x^2 + y^2}) \, \left( y \, (\sqrt{x^2 + y^2} - a) - \omega x \right) - x. \end{array} \right. \end{aligned}$$
(22)

Note that this system is invariant under any rotation about the origin; moreover, its frequency of rotation only depends on \(r = \sqrt{x^2 + y^2}\); see  [22] for details. We now fix the parameters to \(a = 0\) and \(\omega = -0.5\), as in  [22]. Then the unit circle is an attracting periodic orbit \(\Gamma \) with period \(T_\Gamma = 2\pi \) and the origin is an unstable equilibrium \(\mathbf {x}^*\).

4.1 Computing the PTC

We choose \(\gamma _0 = (1, 0)\) and compute the normalised linear direction associated with its isochron as \(\mathbf {v}_0 \approx (-0.83, -0.55)\). As was explained in Sect. 3.2, the computation is performed in two separate continuation runs: first, we apply a perturbation to the point \(\gamma _0\) in a fixed direction \(\mathbf {d}\), where we vary the amplitude A from 0 to 0.75 during the homotopy step. Next, we fix \(A = 0.75\) and apply the same perturbation to each point \(\gamma _\vartheta \in \Gamma \). For the purpose of visualising the computational set-up, we choose the (somewhat unusual) direction \(\mathbf {d} = (-1,0)\) and set the maximum distance along the linearised isochron to the relatively large value of \(\eta _\mathrm{max} = 0.2\).

Fig. 1.
figure 1

Phase reset of system (22) at fixed \(\gamma _0\) in the direction \(\mathbf {d} = (-1, 0)\) with amplitude \(A \in [0, 0.75]\) (a), and continuation set-up at the three labelled points (b), (c), and (d). Panel (b) shows the initial set-up when \(A = 0\) and \(\vartheta _\mathrm{new} = 1\), in panel (c) the continuation has progressed to \(A = 0.4\) and \(\vartheta _\mathrm{new} = \vartheta _c \approx 0. 96\), and in panel (d) \(A = 0.75\) has been reached and \(\vartheta _\mathrm{new} = \vartheta _d \approx 0.76\).

The first continuation run of the multi-segment BVP (5)–(21) is illustrated in Fig. 1. Here, the free amplitude A increases while \(\vartheta = 1 = 0 \, (\mathrm{mod} \ 1)\) is fixed and, hence, the perturbation is always applied at \(\gamma _0\) and grows in size. Figure 1(a) shows the resulting phase \(\vartheta _\mathrm{new}\) as a function of A. Three points are labelled, indicating the three stages during the continuation that are illustrated in panels (b), (c) and (d). In each of these panels we show the periodic orbit \(\Gamma \) in black, and the current orbit segment \(\mathbf {u}\) of the continuation run in green. Note that \(\Gamma \) is rotated here and its head point \(\mathbf {g}(0)\) lies at the point on \(\Gamma \) with phase \(\vartheta _\mathrm{new}\). A short segment of the associated linearisation of the isochron of \(\gamma _{\vartheta _\mathrm{new}}\) is shown in blue. We do not plot the orbit segment \(\mathbf {w}\) that determines the value of \(\vartheta _\mathrm{new}\), but it follows \(\Gamma \) from \(\mathbf {g}(0)\) back to \(\mathbf {g}(0)\) and then extends (approximately) along \(\Gamma \) to \(\gamma _0\). Indeed, notice in Fig. 1(a) that \(\vartheta _\mathrm{new}\) is decreasing, which means that \(\nu > 1\) is increasing so that \(\mathbf {w}\) becomes longer. We also do not show the orbit segments \(\mathbf {g_u}\) and \(\mathbf {w}_{\mathbf {u}}\) that determine the phase \(\vartheta = \vartheta _\mathrm{old}\) at which the perturbation is applied, because \(\vartheta _\mathrm{old} = 1\) is fixed in this continuation run.

Figure 1(b) shows the initial set-up, with \(\mathbf {g} = \mathbf {w} = \mathbf {u} = \mathbf {g_u} = \Gamma \), \(\mathbf {w}_{\mathbf {u}} = \gamma _0\), \(T_\Gamma = \widehat{T}_\Gamma \) and \(\lambda _\mathrm{s}\) set to their known values, and \(\nu = 1\), \(\eta = A = 0\), with \(k = 1\) and \(\vartheta = 1\). The dotted line segment in Fig. 1(b) indicates the direction \(\mathbf {d}\) of the intended perturbation away from \(\gamma _0\); its length is the maximal intended amplitude \(A = 0.75\). An intermediate continuation step when \(A = 0.4\) is shown in Fig. 1(c). The perturbation has pushed \(\mathbf {u}(0)\) out along \(\mathbf {d}\), such that \(\mathbf {u}(1)\) now lies (approximately) on the linearised isochron, parametrised as \(\mathbf {g}(0) + \eta \, \mathbf {v_g}(0)\) with \(0 < \eta \le \eta _\mathrm{max}\), associated with the rotated head point \(\mathbf {g}(0) = \gamma _{\vartheta _c}\), where \(\vartheta _c \approx 0.96\). Note that the orbit segment \(\mathbf {w}\) (not shown) has now changed from its initialisation to match the solution to subsystem (10)–(12) with \(\nu \approx 1.04\). Figure 1(d) illustrates the last step of the first continuation run, when \(A = 0.75\). The head point \(\mathbf {g}(0) \in \Gamma \) has rotated further to \(\gamma _{\vartheta _d}\) with \(\vartheta _d = 1 - \nu \approx -0.24 = 0.76 \, (\mathrm{mod} \ 1)\). Notice that \(\mathbf {u}(1)\) lies quite far along the linearised isochron, because we allow a relatively large distance \(\eta \). The corresponding orbit segment \(\mathbf {u}\) is determined for an integration time of only one period, that is, for \(k = 1\). We show this case for illustration purposes, but in practice, it would be worth choosing a smaller value for \(\eta _\mathrm{max}\), so that \(\mathbf {u}\) would be extended, and the integer multiple of \(T_\Gamma \) set to \(k = 2\), before reaching \(A = 0.75\).

The second continuation run uses the fixed perturbation of size \(A = 0.75\) along \(\mathbf {d} = (-1, 0)\), and varies the phase \(\vartheta \) at which it is applied. Since \(\vartheta \) controls the integration time associated with the orbit segment \(\mathbf {w}_{\mathbf {u}}\), the multi-segment BVP (16)–(20) with solution \(\{ \mathbf {g_u}, \mathbf {w}_{\mathbf {u}} \}\) and parameter \(\widehat{T}_\Gamma \) now plays an important role. For each \(\vartheta \), the head point \(\mathbf {g_u}(0)\) of \(\mathbf {g_u}\) lies (approximately) at \(\gamma _\vartheta \in \Gamma \), and \(\mathbf {w}_{\mathbf {u}}\) represents the remaining part of \(\Gamma \) from \(\gamma _\vartheta \) to \(\gamma _0\); hence, the total integration time of \(\mathbf {w}_{\mathbf {u}}\) is the fraction \(1 - \vartheta \) of \(\widehat{T}_\Gamma \), which is equal, up to the computational accuracy, to the period \(T_\Gamma \) of \(\Gamma \).

Fig. 2.
figure 2

PTC of \(\Gamma \) in system (22) for \(\mathbf {d} = (-1, 0)\) and \(A = 0.75\) (a), and continuation set-up at \(\vartheta _\mathrm{old} = 0.9\) (b) and at \(\vartheta _\mathrm{old} = 0.1\) (c) with \(\mathbf {w}\) and \(\mathbf {w}_{\mathbf {u}}\) in (d), (d1), (d2) and (e), (e1), (e2), respectively.

Figure 2 illustrates different aspects of this continuation run. As \(\vartheta _\mathrm{old} = \vartheta \) decreases from 1, the multi-segment BVP (5)–(21) determines the orbit segment \(\mathbf {u}\) with \(\mathbf {u}(0) = \gamma _\vartheta \, +\, A \, \mathbf {d}\) and uses the rotated orbit segment \(\mathbf {g}\) and \(\mathbf {w}\) to establish the resulting phase \(\vartheta _\mathrm{new} = 1 - \nu \, (\mathrm{mod} \ 1)\) of \(\mathbf {u}(1)\). Panel (a) shows the PTC computed for \(A = 0.75\). Note that \(\nu \) takes values in the covering space \(\mathbb {R}\); the output is then folded onto the unit torus by taking \(\vartheta _\mathrm{new} = 1 - \nu \, (\mathrm{mod} \ 1)\), giving the solid curve in Fig. 2. The points labelled (b) and (c) in this panel correspond to \(\vartheta _\mathrm{old} = 0.9\) and \(\vartheta _\mathrm{old} = 0.1\), respectively. The continuation set-up for these two cases is shown in the corresponding panels (b) and (c). As in Fig. 1, the periodic orbit \(\Gamma \) is black and \(\mathbf {u}\) is green. The path traced by the initial point \(\mathbf {u}(0)\) is the magenta dotted circle, which is \(\Gamma \) shifted by \(A = 0.75\) in the direction \(\mathbf {d} = (-1, 0)\); hence, for fixed \(\vartheta \), the point \(\mathbf {u}(0)\) corresponds to the perturbation of the point \(\gamma _\vartheta \in \Gamma \) that lies horizontally to the right of \(\mathbf {u}(0)\), as indicated by the magenta dotted line segment. The end point \(\mathbf {u}(1)\) lies on the linearised isochron, parametrised as \(\mathbf {g}(0) + \eta \, \mathbf {v_g}(0)\) with \(0 < \eta \le \eta _\mathrm{max}\), associated with the rotated head point of \(\mathbf {g}\), which is determined by subsystem (5)–(9). The phase of this head point is given by \(\vartheta _\mathrm{new} = 1 - \nu \, (\mathrm{mod} \ 1)\), where \(\nu \) is determined from subsystem (10)–(12) that defines the orbit segment \(\mathbf {w}\).

Hence, the two orbit segments \(\mathbf {w}\) and \(\mathbf {w}_{\mathbf {u}}\) essentially determine the PTC, that is, the map \(P: \vartheta _\mathrm{old} \mapsto \vartheta _\mathrm{new}\). Their x-coordinates are plotted versus time in panel (d) for \(\vartheta _\mathrm{old} = 0.9\) and in panel (e) for \(\vartheta _\mathrm{old} = 0.1\), respectively, overlaid on two copies of \(\Gamma \) (black curve), that is, time t runs from 0 to \(4 \pi \). The further panels (d1) and (d2) for \(\vartheta _\mathrm{old} = 0.9\) and panels (e1) and (e2) for \(\vartheta _\mathrm{old} = 0.1\) show \(\mathbf {w}\) (yellow curve) and \(\mathbf {w}_{\mathbf {u}}\) (orange curve) individually, relative to the periods \(T_\Gamma \) and \(\widehat{T}_\Gamma \), respectively. Note that both \(\mathbf {w}\) and \(\mathbf {w}_{\mathbf {u}}\) end at \(x = 1\), for \(t = 4 \pi \) and \(t = 2 \pi \), respectively, as required, but their initial points differ. As \(\vartheta \) decreases from 1 to 0 during the continuation, the orbit segment \(\mathbf {w}_{\mathbf {u}}\) lengthens as expected, but note that \(\mathbf {w}\) lengthens as well; this is due to the (near-)monotonically increasing nature of the PTC for this example.

4.2 Loss of Invertibility

Recall that any PTC is the identity for \(A =0\), and invertible for sufficiently small amplitude A of the perturbation, because its graph remains a 1:1 torus knot on the torus parametrised by the two periodic variables \(\vartheta _\mathrm{old}\) and \(\vartheta _\mathrm{new}\). However, the PTC in Fig. 2(a) for \(A = 0.75\) is no longer near the identity: it is not injective and, hence, not invertible.

To show how injectivity of the PTC is lost as A is increased, we consider again model (22), but now with \(a = 0.25\); see also  [22]. Apart from the attracting unit circle \(\Gamma _\mathrm{s} = \Gamma \) with period \(T_\Gamma = 2 \pi \), there exists then also a repelling circle \(\Gamma _\mathrm{u}\) with radius \(r = a = 0.25\) and period \(2 \pi / (1 + \omega \, (1 - a)) = 3.2 \, \pi \); note that \(\Gamma _\mathrm{u}\) forms the boundary of the basins of attraction of both \(\Gamma _\mathrm{s}\) and the equilibrium \(\mathbf {x}^*\) at the origin, which is now attracting.

Fig. 3.
figure 3

Phase resets of \(\Gamma _\mathrm{s}\) in system (22) with \(a=0.25\) in the direction \(\mathbf {d}=(1,0)\) for amplitudes \(A \in \{0.54, 0.59, 0.64\}\) (increasingly darker shades of magenta). The three PTCs are shown in panel (a) and the corresponding PRCs in panel (b). The three perturbed cycles are shown in panel (c) together with \(\Gamma _\mathrm{s}\) and ten of its isochrons that are uniformly distributed over one period; the enlargement near \(\Gamma _\mathrm{u}\) in panel (d) shows them with 100 uniformly distributed isochrons of \(\Gamma _\mathrm{s}\) and points of tangency at \(p^*\) and \(p^\pm \). Isochrons are coloured according to the colour bar.

We consider three phase resets of \(\Gamma _\mathrm{s}\) of the form \(\Gamma _\mathrm{s} + A \, \mathbf {d}\) in the positive direction \(\mathbf {d} = (1, 0)\) and with \(A = 0.54\), \(A = 0.59\), and \(A = 0.64\). Figure 3 shows the three corresponding PTCs, the corresponding PRCs, and the perturbed cycles \(\Gamma _\mathrm{s} + A \, \mathbf {d}\) in increasingly darker shades of magenta as A increases in panels (a), (b), and (c), respectively. Panel (a) shows that the first PTC for \(A = 0.54\) is injective and invertible. As A is increased to approximately \(A = 0.59\), the graph has a cubic tangency near \((\vartheta _\mathrm{old}, \vartheta _\mathrm{new}) = (0.45, 0.24)\), because the associated map P has an inflection point at \(\vartheta _\mathrm{old} \approx 0.45\). For larger values of A, such as for \(A = 0.64\), the PTC has a local maximum followed by a local minimum and is, hence, no longer invertible. Note from Fig. 3(b) that this qualitative change of the PTC does not lead to a corresponding qualitative change of the PRC.

Figure 3(c) and the enlargement near the basin boundary \(\Gamma _\mathrm{u}\) in panel (d) show that the loss of injectivity of the PTC is due to a cubic tangency between the perturbed cycle \(\Gamma _\mathrm{s} + A \mathbf {d}\) and the foliation of the basin of \(\Gamma _\mathrm{s}\) by (forward-time) isochrons; ten isochrons are shown in panel (c) and one hundred in panel (d), distributed uniformly in phase and coloured according to the colour bar. The left-most light-magenta cycle for \(A = 0.54\) is transverse to all isochrons. The middle magenta cycle for \(A=0.59\), on the other hand, has a single cubic tangency (approximately) with the isochron \(I(\gamma _{0.24})\) of phase \(\vartheta = 0.24\) at the point \(p^* \approx (-0.33, -0.39)\), shown in panel (d). For larger A, as for the right-most dark-magenta cycle for \(A=0.64\), there are now two quadratic tangencies with two different isochrons, namely, (approximately) with \(I(\gamma _{0.22})\) and \(I(\gamma _{0.19})\) at the points \(p^+ \approx (-0.35,-0.14)\) and \(p^- \approx (-0.13,-0.64)\), respectively. As a result, all isochrons that intersect the perturbed cycle between \(p^+\) and \(p^-\) intersect three times; hence, the map P from \(\vartheta _\mathrm{old}\) to \(\vartheta _\mathrm{new}\) is no longer invertible. Note that \(p^+\) and \(p^-\) correspond to the local maximum and local minimum of the PTC in panel (a), respectively.

5 Phase Resetting in the FitzHugh-Nagumo Model

We now illustrate the capability of our method by computing the phase reset of a periodic orbit in the FitzHugh–Nagumo system  [10, 27]. This model is an iconic example that motivated early work on isochrons and phase response curves; in particular, it has a very complicated geometry of isochrons with regions of extreme phase sensitivity   [21, 37]. The FitzHugh–Nagumo system is given by the equations

$$\begin{aligned} \left\{ \begin{array}{rcl} \dot{x} &{}=&{} {\displaystyle c \, \left( y + x - \tfrac{1}{3} \, x^3 + z \right) }, \\[2mm] \dot{y} &{}=&{} {\displaystyle -\frac{x - a + by}{c}}. \end{array} \right. \end{aligned}$$
(23)

We set \(a = 0.7\), \(b = 0.8\), and \(z = -0.4\), as in  [37], and fix \(c = 2.5\), as was done in  [22]. For these parameter values, there exists an attracting periodic orbit \(\Gamma \) with period \(T_\Gamma \approx 10.71\) and a repelling equilibrium \(\mathbf {x}^* \approx (0.9066, -0.2582)\). The parameter c is a time-scale parameter, the increase of which makes the x-variable faster than the y-variable. It plays an important role in the onset of phase sensitivity due to an accumulation of isochrons in a narrow region close to the slow manifold  [21], which is associated with the occurrence of sharp turns in the isochrons of \(\Gamma \); see also  [29]. For the chosen value of \(c = 2.5\), one finds both strong phase sensitivity and sharp turns, which makes the computation of any phase resetting curve quite challenging.

Fig. 4.
figure 4

Phase reset for the FitzHugh–Nagumo model (23). Panel (a) shows the periodic orbit \(\Gamma \) (black), the perturbed cycle \(\Gamma + A \mathbf {d}\) (magenta) with \(\mathbf {d} = (1,0)\) and \(A = 0.25\), the two trajectories \(O^+\) and \(O^-\) (green), and 100 isochrons uniformly distributed in phase; isochrons are coloured according to the colour bar in Fig. 3, and the isochron \(I(\gamma _{0.62})\) is highlighted in orange. Panel (b) is an enlargement near the equilibrium \(\mathbf {x}^*\), and panels (c) and (d) show the corresponding PTC and PRC, respectively; the dashed orange line in panel (c) indicates the phase of \(I(\gamma _{0.62})\).

Figure 4 illustrates the phase reset for the FitzHugh–Nagumo model (23) after a perturbation in the direction \(\mathbf {d} = (1,0)\) of amplitude \(A = 0.25\). Panel (a) and the enlargement near the equilibrium \(\mathbf {x}^*\) in panel (b) show how the perturbed cycle \(\Gamma + A \, \mathbf {d}\) intersects the isochrons of \(\Gamma \), of which 100 are shown uniformly distributed in phase and coloured according to the colour bar in Fig. 3. In particular, one notices quite a few instances in panel (b) of quadratic tangencies between the perturbed cycle and different isochrons; one such isochron is the highlighted \(I(\gamma _{0.62})\). The green curves \(O^+\) and \(O^-\) in panels (a) and (b) are two special trajectories, along which the foliation by forward-time isochrons of \(\Gamma \) has quadratic tangencies with the foliation by backward-time isochrons (not shown) of the focus \(\mathbf {x}^*\). Tangencies between these two foliations were introduced in  [22], where we argued that such tangencies give rise to sharp turns of isochrons. We remark that the two trajectories \(O^+\) and \(O^-\) of quadratic tangencies appear at a specific value \(c^* < 2.5\) where one finds a cubic tangency between the two foliations, called a cubic isochron foliation tangency or CIFT for short; see  [22] for details. The relevance of the special trajectories \(O^+\) and \(O^-\) in the present context is that along them the isochrons of \(\Gamma \) have sharp turns as they approach \(\mathbf {x}^*\). This can clearly be seen in Fig. 4(b); as the highlighted isochron \(I(\gamma _{0.62})\) illustrates, the turns along \(O^-\) are so sharp that \(I(\gamma _{0.62})\) appears to retrace itself along certain segments. Since this happens for all isochrons of \(\Gamma \), one finds extreme phase sensitivity near the trajectory \(O^-\). Moreover, quadratic tangencies of the perturbed cycle with isochrons of \(\Gamma \) occur near both \(O^+\) and \(O^-\). Hence, the number of intersection of \(\Gamma + A \mathbf {d}\) with \(O^+\) and \(O^-\) gives an indication of how many quadratic tangencies the perturbed cycle has with different isochrons.

As we have seen in Sect. 4.2, any such quadratic tangency between \(\Gamma + A \, \mathbf {d}\) and an isochron is associated with a local maximum or minimum of the PTC, which is, therefore, not expected to be invertible. Figure 4(c) presents the PTC computed with our method as a continuous curve shown in \((\vartheta _\mathrm{old}, \vartheta _\mathrm{new})\)-coordinates on the unit torus. Clearly, its graph is quite intriguing and features six local maxima and six local minima. Observe that the local maxima correspond to quadratic tangencies near \(O^+\), while the sharper local minima correspond to quadratic tangencies near \(O^-\); in particular, the tangency with the highlighted isochron \(I(\gamma _{0.62})\) near \(O^+\) in panel (b) gives rise to a local maximum of the PTC in panel (c), where the graph has a quadratic tangency with the dashed orange line at \(\vartheta _\mathrm{new} = 0.62\). Notice that \(I(\gamma _{0.62})\) intersects the perturbed cycle \(\Gamma + A \mathbf {d}\) in panel (b), and hence, the PTC in panel (c), five more times. The associated PRC of the change in phase \(\Delta = \vartheta _\mathrm{new} - \vartheta _\mathrm{old}\) is shown in panel (d); it is also quite a complicated curve with local maxima and minima. The PTC and PRC both have six near-vertical segments at \(\vartheta _\mathrm{old} \approx 0.47\), 0.49, 0.50, 0.52, 0.54, and 0.57; such large gradients arise near the local minima because of the extreme phase sensitivity near \(O^-\).

Fig. 5.
figure 5

Phase reset along the line segment \(\gamma _{0.56} + A \, \mathbf {d}\) with \(\mathbf {d} = (1,0)\) and \(A \in \left[ 0 , 0.75 \right] \) in the FitzHugh–Nagumo model (23). Panel (a) shows the periodic orbit \(\Gamma \) (black), the line segment of perturbations (magenta) starting at point \(\gamma _{0.56} \in \Gamma \), the two trajectories \(O^+\) and \(O^-\) (green), and 100 isochrons uniformly distributed in phase; isochrons are coloured according to the colour bar in Fig. 3, and the isochron \(I(\gamma _{0.4})\) is highlighted in orange. Panel (b) is an enlargement near the equilibrium \(\mathbf {x}^*\), and panels (c) and (d) show the periodic variables \(\vartheta _\mathrm{new}\) and \(\Delta = \vartheta _\mathrm{new} - \vartheta _\mathrm{old}\), respectively, as a function of A.

Figure 5 illustrates our continuation approach for another type of resetting experiment, where phase and direction of the perturbation are fixed but its magnitude varies. Specifically, we calculate the asymptotic phase of points that are perturbed from \(\gamma _{0.56} \in \Gamma \) in the positive x-direction \(\mathbf {d} = (1,0)\) with amplitude \(A \in [0 , 0.75]\). As panels (a) and (b) show, the corresponding line segment \(\gamma _{0.56} + A \, \mathbf {d}\) passes through the phase-sensitive region of accumulating isochrons near \(\mathbf {x}^*\), where it intersects \(O^+\) and \(O^-\) several times. To compute the reset, we first rotate \(\Gamma \) and, consequently, the entire multi-segment BVP (5)–(21), such that the head point \(\mathbf {g}(0)\) of \(\Gamma \) lies at \(\gamma _{0.56}\). We then proceed as in the first continuation run in Sect. 4.1 to obtain \(\vartheta _\mathrm{new}\) as a function of A. The resulting resets \(\vartheta _\mathrm{new}\) and \(\Delta \) are shown in panels (c) and (d), respectively; note that \(\Delta \) is obtained from \(\vartheta _\mathrm{new}\) by a fixed shift of \(\vartheta _\mathrm{old} = 0.56\). The resulting reset as a function of A also shows near-vertical segments near three local minima, which are again directly associated with the three points where the line segment \(\gamma _{0.56} + A \, \mathbf {d}\) intersects the trajectory \(O^-\). Notice that the turns of the isochrons along \(O^-\) are so very sharp that one will find a quadratic tangency nearby with respect to the horizontal—or indeed practically any given direction. Along \(O^+\), on the other hand, the turns of the isochrons are more gradual and the local maxima due to intersections of the line segment of perturbations are not associated with strong phase sensitivity. Notice further that the penultimate intersection between \(\gamma _{0.56} + A \, \mathbf {d}\) and \(O^+\) does not come with a nearby quadratic tangency and, hence, does not lead to a local maximum of \(\vartheta _\mathrm{new}\).

6 Phase Resetting in a Seven-Dimensional Sinoatrial Node Model

We now illustrate how our computational approach can be applied to systems of dimension higher than two. Indeed, while the multi-segment BVP (5)–(21) now consists of higher-dimensional subsystems that represent the various orbit segments in this higher-dimensional phase space, the necessary input-output information is still given by the two parameters \(\vartheta \) and \(\nu \) that determine the relationship \(\vartheta _\mathrm{new} = P(\vartheta _\mathrm{old})\).

We compute the PTC for the seven-dimensional model from  [20] of a sinoatrial node of a rabbit, which is a type of cardiac pacemaker cell. The model is described in standard Hodgkin–Huxley formalism: the main variable is voltage V (measured in \(\mathrm{mV}\)), which depends on five ionic currents that are determined by the dynamic opening and closing of six so-called gating variables, denoted m, h, d, f, p, and q. The five currents (measured in \(\mathrm{pA}\)) are: a fast inward sodium current \(I_\mathrm{Na}\), a slow inward current \(I_\mathrm{s}\), a delayed rectifier potassium current \(I_\mathrm{K}\), a pacemaker current \(I_\mathrm{h}\), and time-independent leak current \(I_\mathrm{l}\). The system of seven equations is given by

$$\begin{aligned} \left\{ \begin{array}{rcl} \dot{V} &{}=&{} {\displaystyle - \tfrac{1}{C_m} \left[ I_{Na}(V, m, h) + I_s(V, d, f) + I_K(V, p) + I_h(V, q) + I_l(V) \right] }, \\[2mm] \dot{m} &{}=&{} {\displaystyle \alpha _m(V) \, (1 - m) - \beta _m(V) \, m}, \\[2mm] \dot{h} &{}=&{} {\displaystyle \alpha _h(V) \, (1 - h) - \beta _h(V) \, h}, \\[2mm] \dot{d} &{}=&{} {\displaystyle \alpha _d(V) \, (1 - d) - \beta _d(V) \, d}, \\[2mm] \dot{f} &{}=&{} {\displaystyle \alpha _f(V) \, (1 - f) - \beta _f(V) \, f}, \\[2mm] \dot{p} &{}=&{} {\displaystyle \alpha _p(V) \, (1 - p) - \beta _p(V) \, p}, \\[2mm] \dot{q} &{}=&{} {\displaystyle \alpha _q(V) \, (1 - q) - \beta _q(V) \, q}, \end{array} \right. \end{aligned}$$
(24)

where, \(C_m = 0.065 \, \mu \mathrm{F}\) is the capacitance. (Note the minus sign in the right-hand side of the equation for V, which was accidentally omitted in  [20].) The precise form of the ionic currents and the various functions \(\alpha _\mathrm{x}\) and \(\beta _\mathrm{x}\) with \(\mathrm{x} \in \{ m, h, d, f, p, q\}\), and associated parameter values, are given in the Appendix; see also  [20].

Fig. 6.
figure 6

The PTC of the seven-dimensional model (24), as presented in  [20, Fig. 7 (middle)] (a) and as computed with our method (b). Panel (a) is from [Krogh-Madsen, Glass, Doedel and Guevara, Apparent discontinuities in the phase-resetting response of cardiac pacemakers, J. Theor. Biol. 230(4), 499–519 (2004)] ©Elsevier; reproduced with permission.

System (24) was presented and studied in  [20], because experimental data on similar pacemaker cells suggested that the PTC was discontinuous; see already Fig. 6(a). Without a possibility to compute the PTC directly, the authors of  [20] reduced the model to a three-dimensional system and used geometric arguments to explain that the apparent discontinuities were abrupt transitions mediated by the stable manifold of a weakly unstable manifold in the model. Figure 6 shows the relevant PTC image from [20] and the PTC as computed with our method. The comparison confirms that we are able to calculate the PTC directly in the seven-dimensional model as a continuous curve on \(\mathbb {T}^2\), even though the PTC has a near-vertical segment at \(\vartheta _\mathrm{old} \approx 0.4\).

Fig. 7.
figure 7

The computed PTC of the seven-dimensional system (24). Shown is \(\vartheta _\mathrm{new}\), also over the interval \([-0.6, 0]\) (dotted line), as a function of \(\vartheta _\mathrm{old}\) in panel (a), and as a function of the arclength L of the PTC in panel (b).

Figure 7 illustrates that the PTC for system (24) is indeed continuous. Panel (a) reproduces the PTC from Fig. 6(b), but shows the computed values for \(\vartheta _\mathrm{new}\) over the wider range \([-0.6, 1]\) to illustrate that a maximum of \(\vartheta _\mathrm{new}\) is quickly followed by a minimum of \(\vartheta _\mathrm{new}\) (lowest point of dashed curve). Since it is hard to see that the PTC is indeed continuous, panel (b) shows \(\vartheta _\mathrm{new}\) over the same range \([-0.6, 1]\), but now as a function of the arclength L of the PTC in the \((\vartheta _\mathrm{old}, \vartheta _\mathrm{new})\)-plane from the point \((0,\, -3.56 \times 10^{-3})\). The near-vertical segment in the \((\vartheta _\mathrm{old}, \vartheta _\mathrm{new})\)-plane of panel (a) corresponds to the two (almost) linear segments in the \((L, \vartheta _\mathrm{new})\)-plane of panel (b). Hence, this representation resolves the near-vertical part of the PTC in a tiny \(\vartheta _\mathrm{old}\)-interval near 0.4. Panel (b) also demonstrates that the PTC is indeed a continuous closed curve on \(\mathbb {T}^2\) with exactly one maximum at \(\vartheta _\mathrm{new} \approx 0.35\), followed by one minimum at \(\vartheta _\mathrm{new} \approx 0.49\).

Instead of an instantaneous reset, the reset in  [20] is obtained by applying a current with amplitude \(I_\mathrm{app}\) for a fixed duration \(T_\mathrm{ON}\); the specific case for which a seemingly discontinuous PTC was observed is given by \(I_\mathrm{app} = -150 \, \mathrm{pA}\) and \(T_\mathrm{ON} = 0.02 \, \mathrm{s}\). Mathematically, this amounts to replacing the V-equation in system (24) by

$$\begin{aligned} \dot{V} = - \tfrac{1}{C_m} \left[ I_{Na} + I_s + I_K + I_h + I_l \right] + \tfrac{150}{C_m}, \end{aligned}$$
(25)

and switching back to the original equation after \(0.02 \, \mathrm{s}\). In our set-up, this means that we add the perturbation \(A \, \mathbf {d}\) to the right-hand side of system (24), where the direction vector \(\mathbf {d} = (1, 0, 0, 0, 0, 0, 0)\) is the unit vector pointing purely in the V-direction and the amplitude \(A = 150 / C_m = 2.31\) (\(\mathrm{mV} / \mathrm{s}\)).

We include this time-varying perturbation in the multi-segment BVP (5)–(21) in much the same way as done in  [28], that is, we replace subsystem (13) defining the orbit segment \(\mathbf {u}\), with boundary conditions (14) and (15), by two subsystems that define orbit segments \(\mathbf {u}_\mathrm{ON}\) and \(\mathbf {u}_\mathrm{OFF}\). Here, \(\mathbf {u}_\mathrm{ON}\) exists while the applied current is ‘on’ and \(\mathbf {u}_\mathrm{ON}(1)\) determines the location of the reset (21) after the first \(0.02 \, \mathrm{s}\). Hence, \(\mathbf {u}_\mathrm{ON}\) is a solution to system (24) with equation (25) for V with total integration time \(T_\mathrm{ON} = 0.02 \, \mathrm{s}\), that is,

$$\begin{aligned} \dot{\mathbf {u}}_\mathrm{ON} = T_\mathrm{ON} \, \left[ \mathbf {F}(\mathbf {u}_\mathrm{ON}) + A \, \mathbf {d} \right] . \end{aligned}$$

The second orbit segment \(\mathbf {u}_\mathrm{OFF}\) is a solution to the original system (24), with applied current ‘off’. The total integration time over both orbit segments combined should be an integer multiple of the period \(T_\Gamma \) of the periodic orbit (as before for \(\mathbf {u}\)). Hence, we define

$$\begin{aligned} \dot{\mathbf {u}}_\mathrm{OFF} = (k \, T_\Gamma - T_\mathrm{ON}) \, \mathbf {F}(\mathbf {u}_\mathrm{OFF}). \end{aligned}$$

The subsystem for \(\mathbf {u}_\mathrm{ON}\) can be viewed as an initial value problem, with initial condition

$$\begin{aligned} \mathbf {u}_\mathrm{ON}(0) = \mathbf {g_u}(0). \end{aligned}$$

Similarly, the initial point of \(\mathbf {u}_\mathrm{OFF}\) should start where \(\mathbf {u}_\mathrm{ON}\) ends, that is,

$$\begin{aligned} \mathbf {u}_\mathrm{ON}(1) = \mathbf {u}_\mathrm{OFF}(0). \end{aligned}$$

We refer to  [28] for further details.

The end point \(\mathbf {u}_\mathrm{OFF}(1)\) of the second segment \(\mathbf {u}_\mathrm{OFF}\) plays the same role as \(\mathbf {u}(1)\) in the multi-segment BVP (5)–(21). Hence, \(\mathbf {u}_\mathrm{OFF}(1)\) must satisfy boundary conditions (14) and (15). Unfortunately, this formulation requires knowledge of the Floquet bundle \(\mathbf {v_g}\) specified by subsystem (7)–(9), and specifically the vector \(\mathbf {v_g}(0)\) to measure the distance of \(\mathbf {u}_\mathrm{OFF}(1)\) to \(\Gamma \) in boundary condition (14). In the seven-dimensional phase space, this Floquet bundle is no longer unique, because \(\Gamma \) now has six non-trivial Floquet exponents. Note that the perpendicular vectors \(\mathbf {v}_0^\perp \), used in boundary conditions (12) and (20), and \(\mathbf {v_g}(0)^{\perp }\), used in boundary condition (15), are still well defined in a higher-dimensional phase space, because the isochrons are codimension-one manifolds. We get around the issue of non-uniqueness as follows. Firstly, we define subsystem (7)–(9) in terms of the adjoint Floquet bundle \(\mathbf {v_g}^\perp \), that is, the left eigenvector bundle associated with the trivial Floquet exponent 0. In other words, we solve the first variational equation

$$\begin{aligned} \dot{\mathbf {v}}_{\mathbf {g}}^\perp = T_\Gamma \, \mathrm{D}_{\mathbf {g}} \mathbf {F}^*(\mathbf {g}) \, \mathbf {v_g}^\perp , \end{aligned}$$

with the same boundary conditions (8) and (9) for \(\mathbf {v_g}^\perp \) instead, namely,

$$\begin{aligned} \left\{ \begin{array}{rcl} \mathbf {v_g}^\perp (1) - \mathbf {v_g}^\perp (0) &{}=&{} 0, \\ \mid \!\mid \! \mathbf {v_g}^\perp (0) \!\mid \!\mid &{}=&{} 1. \end{array} \right. \end{aligned}$$

Here \(\mathrm{D}_{\mathbf {g}} \mathbf {F}^*(\mathbf {g})\) is the transpose Jacobian matrix evaluated along the periodic orbit \(\mathbf {g}\). We similarly assume that \(\mathbf {v}_0^\perp \), rather than \(\mathbf {v}_0\), is stored as a known vector.

Secondly, we use the Euclidean norm to measure the distance of \(\mathbf {u}_\mathrm{OFF}\) from \(\mathbf {g}(0)\), that is, we stipulate

$$\begin{aligned} \left[ \mathbf {u}_\mathrm{OFF}(1) - \mathbf {g}(0) \right] \cdot \left[ \mathbf {u}_\mathrm{OFF}(1) - \mathbf {g}(0) \right] = \eta ^2, \end{aligned}$$
(26)

rather than imposing a signed distance. We remark that a formulation in terms of the Euclidean norm does make the continuation numerically less stable, but it still works for our set-up because \(\eta \) is a free parameter that remains positive, and boundary condition (26) effectively plays a monitoring role.

7 Conclusions

We presented an algorithm for the computation of the phase reset for a dynamical system with periodic orbit \(\Gamma \) that is subjected to an (instantaneous or time-varying) perturbation \(\Gamma _A := \Gamma + A \, \mathbf {d}\) of a given direction \(\mathbf {d}\) and amplitude A. In theory, the phase reset can be determined from the isochron foliation of the basin \(\mathcal{B}(\Gamma )\). In particular, for small enough A, it suffices to know only the linear approximation of the isochrons. Our algorithm is designed for the computation of phase resets for larger A in systems that exhibit strong nonlinearities, which is the situation in many practical applications. Our computational set-up has the distinguishing feature that it automatically tracks the necessary nonlinear phase information without computing the isochrons themselves. This approach is efficient, able to deal with extreme phase sensitivity, and suitable for use in higher-dimensional settings.

Our method is formulated in terms of a multi-segment boundary value problem that is solved by continuation and gives the new phase \(\vartheta _\mathrm{new}\) as a function of either the perturbation amplitude A or the original phase \(\vartheta _\mathrm{old}\) before the reset. The data can readily be used to produce phase transition and phase response curves. We presented the multi-segment BVP set-up in detail for a planar system, but also discussed in Sect. 6 the straightforward adaptation to higher-dimensional systems, and how to implement phase resets arising from time-varying inputs.

Our approach has the advantage that the map \(\vartheta _\mathrm{old} \mapsto \vartheta _\mathrm{new}\) is computed in a single continuation run, even in the presence of extreme phase sensitivity. If the amplitude A is such that \(\Gamma _A \subset \mathcal{B}(\Gamma )\), then the associated circle map \(P_A : [0, 1) \rightarrow [0, 1)\) is obtained in its entirety, and its graph, the phase transition curve (PTC), is a continuous closed curve on \(\mathbb {T}^2\). For A close to 0, the circle map \(P_A\) is a near-identity transformation, so that the PTC is a 1:1 torus knot. For large A it is possible that the PTC is a contractible closed curve on the torus, which corresponds to loss of surjectivity of \(P_A\). It is well known that surjectivity is lost as soon as A increases past a value for which \(\Gamma _A \not \subset \mathcal{B}(\Gamma )\)  [11, 37].

There typically exists a maximal amplitude \(A_\mathrm{max}\) such that \(\Gamma _A \subset \mathcal{B}(\Gamma )\) for \(0 \le A < A_\mathrm{max}\) . Then \(P_A\) depends smoothly on A and, hence, the PTC is a 1:1 torus knot for all \(0 \le A < A_\mathrm{max}\). Therefore, \(P_A\) is surjective for all \(0 \le A < A_\mathrm{max}\). We were particularly interested in loss of injectivity of \(P_A\) as A increases from 0. We showed that this is typically mediated by a cubic tangency between the PTC and one of the isochrons of \(\Gamma \). Further tangencies lead to very complicated PTCs, with possibly many local maxima and minima and very sudden phase changes. The associated phase sensitivity is known to occur near the boundary of \(\mathcal{B}(\Gamma )\), but our examples illustrate that milder forms of phase sensitivity inside the basin also lead to complicated PTCs.

We remark that \(P_A\) is no longer well defined for all \(\vartheta _\mathrm{old} \in [0, 1)\) when \(\Gamma _A\) intersects the boundary of the basin \({\mathcal B}(\Gamma )\). For example, when \(\Gamma _A\) crosses an equilibrium that forms a single component of the basin boundary in a planar system, there exists exactly one \(\vartheta \in [0, 1)\) such that \(P_A(\vartheta )\) is not defined, because the perturbed phase point never returns to \(\Gamma \). Entire intervals of \(\vartheta _\mathrm{old} \in [0, 1)\) must be excluded, e.g., when \(\Gamma _A\) crosses a repelling periodic orbit of a planar system, such that a closed segment of \(\Gamma _A\) lies outside \(\mathcal{B}(\Gamma )\). Changes of the PTC during the transition through different types of boundaries of \({\mathcal B}(\Gamma )\) are beyond the scope of this chapter and will be reported elsewhere.

Phase resets for higher-dimensional systems are expected to exhibit other, more complicated behaviours that lead to possibly different mechanisms of loss of injectivity and/or surjectivity of the circle map associated with the PTC. In particular, the basin \(\mathcal{B}(\Gamma )\) can be a lot more complicated, which affects the isochron foliation and, consequently, the PTC  [24]. Such higher-dimensional systems are of particular interest when resets are considered in large coupled systems. Even when the coupling is through the mean-field dynamics, such systems can exhibit rich collective dynamics that are reflected in their PTCs  [6, 33]. We believe that our approach will be useful in this context, in particular, when the perturbation is a time-dependent stimulus.