### Mathematical definition

A torus bifurcation of limit cycles (Neimark-Sacker, NS) generically corresponds to a bifurcation to an invariant torus, on which the flow contains periodic or quasi-periodic motion. It can be characterized by adding an extra constraint to (47) where is the torus test function which has four components from which two are selected. The complete BVP defining a NS point using a minimally extended system is

|  |  | (75)

where

is defined by requiring

| (76)

Here and are functions and and are scalars and

| (77)

where the bordering functions , vectors and are chosen so that is nonsingular [15]. We note that an additional variable is introduced in (75). This method (using system (76) and (77)) is implemented in the curve definition file `neimarksacker.m`. The discretization is done using orthogonal collocation over the interval . The additional variable is introduced as the last continuation variable of `neimarksacker.m`, after the state variables, the period and the two active system parameters.