A complementarity approach for the computation of periodic oscillations in piecewise linear systems

Piecewise linear (PWL) systems can exhibit quite complex behaviours. In this paper, the complementarity framework is used for computing periodic steady-state trajectories belonging to linear time-invariant systems with PWL, possibly set-valued, feedback relations. The computation of the periodic solutions is formulated in terms of a mixed quadratic complementarity problem. Suitable anchor equations are used as problem constraints in order to determine the unknown period and to fix the phase of the steady-state oscillation. The accuracy of the complementarity problem solution is shown through numerical investigations of stable and unstable oscillations exhibited by practical PWL systems: a neural oscillator, a deadzone feedback system, a stick–slip system, a repressilator and a relay feedback system.


Introduction
Piecewise linear (PWL) models can represent a wide class of practical systems and can exhibit interesting nonlinear behaviours such as periodic steady-state oscillations.In this paper, we consider the problem of the computation of periodic solutions for linear timeinvariant dynamical systems whose inputs are related to the outputs through a static multi input-multi output PWL relation, possibly set-valued.That class of dynamical systems has attracted a considerable interest in the literature, and it allows to capture even complex behaviours arising in many practical systems.We can mention electrical circuits where the current-voltage characteristics of some devices can be considered as piecewise linear, such as nonlinear resistors [1], ideal diodes and switches [2,3], or mechanical systems with Coulomb friction [4].In those applications, the steadystate behaviour is generally depicted by a periodic motion [5,6].Since they tend to periodically oscillate also when no external excitation is applied, the period related to the periodic solution is difficult to be predicted a priori.
A considerable literature deals with the problem of computing steady-state periodic solutions and the corresponding period.The most popular time-domain technique is the so-called shooting method [7][8][9].A drawback of this method is the cost of calculating the sensitivity matrix, which is a crucial issue [10][11][12].For instance, in [13,14], in order to compute periodic stick-slip vibrations belonging to mechanical systems with discontinuous dry friction, the shooting method is applied only after the approximation of the discontinuous characteristic by a suitable smooth function.Instead, in this paper, we show that the proposed representation allows to include the discontinuity into the model.For hybrid systems that include such class, in [15] it is proposed an algorithm for the bifurcation analysis of periodic solutions.In that paper, a multi-point boundary-value problem is formulated by using the knowledge of the sequence of modes.The specific sequence is exploited also for fixing an initial guess for the periodic solution to be computed.In our paper, the periodic steady-state solution is obtained without fixing a priori the sequence of modes and without this information for choosing an initial guess.
In the frequency domain, one of the most reliable methodologies is the harmonic balance.In [16], an extension of the harmonic balance method for computing the rotary and oscillatory periodic motion of a nonlinear smooth system is proposed.Mixed timefrequency-domain approaches are presented in [17,18].In the first paper, a nonlinear oscillator is analysed by linearizing the system along the solution predicted by the harmonic balance technique and then by computing the Floquet's multipliers by using a time-domain numerical algorithm.Instead, in [18], the harmonic balance method is implemented together with the envelope following method in time domain.Such approach is used to compute the steady-state behaviour and the associated period of nonlinear circuits forced by two input signals with different oscillation frequencies.If one is interested in approximate results, the harmonic balance with a single harmonic leads to the describing function method [19,20].Such technique provides simple results about the existence of periodic solution and its parameters (the amplitude and the period), but it may fail, particularly when the system under consideration does not filter out the higher-order harmonics [21].
Complementarity models have shown to be useful for representing PWL systems [22][23][24][25][26] and for computing their steady-state solutions [27][28][29].In [27], the authors proposed the use of a linear complementarity approach for the evaluation of permanent oscillations in relay feedback systems with periodic exogenuous signals.The autonomous case for the particular class of Lur'e systems has been analysed in [28] by representing the discretized closed-loop system in a linear complementarity form.In [29], the periodicity condition was included as a constraint of the complementarity problem, but an a priori estimation of the period was still required.Instead, in [30], the period is considered as a further unknown and it is computed together with the periodic solution by constructing a suitable mixed complementarity problem.However, such approach fails if the solution does not satisfy the assumption of being sufficiently smooth.
In this paper, we propose the use of mixed quadratic complementarity problems (MQCPs) for the computation of periodic solutions exhibited by PWL systems.The analysis here proposed extends the approach presented in [30] by allowing nonsmooth solutions and by considering a more general class of PWL systems which includes those analysed in [27][28][29][30].In particular, the PWL system is characterized by a nonlinearity which is representable as a linear combination of saturations and relays characteristics.The effectiveness of the proposed technique is shown by investigating several examples whose steadystate solutions cannot be obtained by using the complementarity approaches previously presented in the literature.
The paper is organized as follows.In Sect.2, we present the autonomous PWL systems of interest and we give some preliminaries about complementarity problems and the complementarity representation of a class of PWL characteristics.Section 3 shows how to formulate a mixed quadratic complementarity problem (MQCP) for computing a periodic solution together with the period.In Sect.4, two specific cases are analysed: when the PWL system has multiple (constant and/or nonconstant) periodic solutions, and when the period of the oscillation is known.In Sect.5, we show the effectiveness of the proposed approach by considering different steady-state behaviours in several PWL systems of practical interest.In particular, we consider a stable periodic solution in a neural oscillator, an unstable periodic solution in a deadzone feedback system, a sliding periodic solution in a stick-slip system, the periodic oscillation belonging to a repressilator and a grazing-sliding bifurcation in a relay feedback system.The paper is concluded in Sect.6.

Preliminaries
Let us introduce first some notation and preliminary definitions.Let vec(•) indicate the vectorization operator, 1 R N + is the set of nonnegative N -dimensional real vectors, I N denotes the N × N identity matrix and 1 N , ∞ N are the N -dimensional vectors whose components are ones and infinity, respectively.The symbol ⊗ indicates the Kronecker product.The following block circulant matrix notation is adopted where B 1 and B 2 are square matrices of the same dimension and N is the number of times that B 1 is repeated on the main diagonal.
The mixed quadratic complementarity problem (MQCP) is another important ingredient of this paper.It is defined as follows.Given a function ϕ(z) : R r → R r , a square matrix M ∈ R r ×r , a vector q ∈ R r , and lower and upper bounds , where ϕ(z) is a vector of quadratic forms in z and the inequalities are meant componentwise.If and u are finite, the continuity of F(z) = ϕ(z) + Mz + q ensures the existence of solutions.More results about the existence of solutions for complementarity problems and variational inequality (VI) can be found in [31].Recall 1 vec{A} denotes the column vector obtained by stacking in one column all the columns of the matrix A. By vec(c 1 , c 2 , . . ., c n ) we will denote the column obtained by stacking all the c i columns, even when they have a different number of components.
that every (nonlinear) complementarity problem as in ( 2) is a variational inequality (VI).When the term ϕ(z) does not appear in (2a), the MQCP becomes a mixed linear complementarity problem (MLCP) [32].Moreover, if the upper bound u has all infinity components and = 0, one gets v = 0 and the problem reduces to the classical linear complementarity problem with w and z being the usual complementarity variables [33].
The class of systems of interest can be represented by the block scheme in Fig. 1, where the dynamical system is described by Each block R i consists of a scalar saturationlike characteristic as in Fig. 2. Such characteristic with finite β R i , i , u i ∈ R, i < u i and μ i 0 can be represented in the following mixed linear complementarity form with w 0 and v 0. If μ i > 0, for any given y i ∈ R the MLCP (4) has a unique solution λ i [34].Therefore, in order to show that the MLCP (4) corresponds to the relation in Fig. 2, it is enough to verify that the feasible values of λ i correspond to values of y i belonging to the saturation characteristic.In particular, if λ i = i from (4b) it follows v = 0 and, since w 0, one obtains y i μ i i + β R i , that corresponds to the lower constant saturated piece of the characteristic.If i < λ i < u i from the second and third constraints in (4b) it follows w = v = 0, and from (4a) one obtains y i = μ i λ i + β R i that corresponds to the linear interval of the saturation characteristic.Finally, if λ i = u i , one obtains w = 0 and y i μ i u i +β R i , which corresponds to the upper saturation of the characteristic.If μ i = 0 the model (4) represents set-valued characteristics.Indeed, it is easy to verify that for μ i = 0 the model (4) represents a set-valued step function.
Fig. 2 PWL saturation-like characteristic with μ i > 0 By collecting (4) and by defining R = vec(R 1 , R 2 , . . ., R m ), one can write the relation between y and λ as follows with The model ( 5) includes the representation of many typical PWL functions such as minimum, maximum, relay, deadzone and PWL characteristics obtained by linear combinations of these ones.
We now obtain a compact representation for the closed-loop system in Fig. 2. By substituting (3c) in (3a) and (3b), and (3b) in (3d) and by taking we obtain the following dynamical system with R = vec(R 1 , R 2 , . . ., R m ) given by ( 5) and The class of systems (7) is the one considered in this paper where (A, B, C) is a minimal state space real- and f ∈ R m all being constant and the time derivative is meant almost everywhere.It is assumed that for every initial condition x(t 0 ) the system (7) has an absolutely continuous solution x(t) : [t 0 , +∞) → R n that satisfies (7) for almost every t t 0 .A solution x(t) of the system ( 7) is periodic if there exists a positive real number T such that x(t + T ) = x(t) for any t 0. The stability concepts and definitions typically used for systems and equilibria can be also applied to periodic solutions which can be stable, asymptotically stable and unstable [35].
In the next section, it is shown how the combination of (5) with the discretized version of (7a)-(7b) allows to construct a MQCP for the computation of periodic solutions of (7).

Computation of periodic oscillations
Let x(t) be a nonconstant periodic solution of (7) with unknown period, say T .The dynamical model ( 7) can be normalized with respect to the unknown period by using the time scaling t = T τ , where τ is a dimensionless time variable.Then (7) can be rewritten as where x is the derivative with respect to τ .Any periodic solution of (7) with period T will correspond to a periodic solution of ( 8) with period 1.Note that the right-hand side of (8a) is quadratic with respect to the unknowns T, x and λ.By using ( 5) and ( 8), the problem of computing the periodic solution is to where the constraints (9b)-(9d) must hold for any τ ∈ The phase of a periodic solution of an autonomous system is not fixed.Then any time translation of a periodic solution provides another 'different' periodic solution.In other words, if the PWL system admits a periodic solution, it admits an infinite number of periodic solutions each one differing from the others by a translation in time.In order to fix the initial phase of the periodic solution, one more equation is required, which is usually called anchor equation [36][37][38].A possible anchor equation is the phase condition proposed in [38]: where x j is a generic j-th component of the state at an arbitrarily chosen time instant τ ∈ [0, 1] and c j ∈ R n is a vector with all elements equal to zero except for the j-th element equal to 1.Note that the index j can be chosen arbitrarily for sufficiently smooth solutions.Indeed, in case of periodic solutions x(t) of class C 1 , the time derivative of each state variable must be zero at least at one time instant τ ∈ [0, 1].
In order to solve ( 9)- (10), one can discretize (9b) and reformulate the problem in terms of a discretetime complementarity problem.By using the (θ, γ ) discretization technique [39] with a sampling period 1/N , N being an integer, and by using the subscript k for indicating the k-th sample of a variable, from (9b) one obtains where θ ∈ [0, 1] and γ ∈ [0, 1].The constraints (9c)-(9d) can be written for each sampling time instant: with w k 0, v k 0 and k = 1, . . ., N .Moreover, (9e) can be rewritten as Finally, one can assume that τ in ( 10) is a sampling time instant.Therefore, by defining k = τ N , the anchor equation ( 10) can be written as or, equivalently, By collecting ( 11)-( 13) for k = 1, . . ., N in a matrix form we are now able to formulate the problem of computing the periodic solution (and its period) as a MQCP.In particular, the unknown vector z for the MQCP is given by the samples λ k and x k for k = 1, . . ., N and the period T : The lower and upper bounds for T and for each x k with k = 1, . . ., N are set as −∞ and +∞: Given the discretization parameters (θ, γ ) and the number of discrete samples per period N , by considering ( 16)-( 17), by collecting ( 11)-( 12) for k = 1, . . ., N together with (13) and by considering ( 14), the MQCP can be represented in the form (2) with where φ k (z) : R N n+N m+1 → R n are given by for k = 1, . . ., N together with (13), and h λ ∈ R N m is a vector with all zero elements, h x ∈ R N n is a vector with all zero entries but two elements −1 and +1 corresponding to the j-th component of x k−1 and x k , representing the anchor equation ( 15), and δ q = 0.The described formulation is used to compute a stable periodic oscillation in a neural oscillator and an unstable periodic solution in a deadzone feedback system in Sects.5.1 and 5.2, respectively.Indeed, in such examples the feedback characteristic is Lipschitz continuous, then a solution of class C 1 is expected.If x(t) is of class C 0 , as in the case of a relay feedback system, we have to pay attention to the fact that the time derivative can jump, so a different phase constraint should be derived.In particular, we assume that there exists a component of the system output, say c j y, which is equal to a value α j at a time instant τ ∈ [0, 1]: The constant α j should be selected by exploiting the system structure.In particular, since we use the phase condition (21) because the trajectory x(t) is only C 0 , the discontinuity of the time derivative ẋ(t) allows to say that there exist some j and τ ∈ [0, 1] such that (21) holds with α j being a discontinuity point of the relation R j .
As in the previous case, we write (21) in discrete time as follows with k = τ N .The anchor equation ( 22) can be included in the form (18) by setting h λ and h x with all zero entries except for the components corresponding to k which are equal to −c j D and c j C, respectively, and δ q = c j f − α j .In Sects.5.3, 5.4 and 5.5, the anchor equation ( 22) is used to compute periodic nonsmooth oscillations in a stick-slip system, in a repressilator and in a relay feedback system.
The continuous PWL interpolation of the sequence x k obtained by solving the MQCP derived above is expected to approximate better and better the continuous-time periodic solution x(t) of ( 7) as the number of samples per period N increases.Such convergence property of the discrete-time solution is also called 'consistency' [40].A formal proof of consistency of the solution of time-stepping methods used for solving boundary-value differential variational inequalities can be found in [41].However, the nonsingularity condition of matrices involved in the boundary-value constraint is not valid in the case of periodic solutions.

Multiple solutions and known period
In this section, the MQCP formulated above is specified under two interesting conditions, i.e. when more periodic solutions coexist and when the period of the oscillation is known.

Elimination of a given periodic solution
Depending on the relation (y, λ) ∈ R, the corresponding PWL system can present multiple periodic solutions as well as constant solutions.For instance, when e and f are zero and (0, 0) ∈ R, the origin is also a solution (an equilibrium) of the system.Once a periodic (constant or nonconstant) solution is computed, say x, one may be interested in finding another periodic trajectory.To this aim, one can formulate an analogous MQCP by adding a further constraint which excludes the solution x from its feasibility set.In particular, the following condition can be used: for some chosen î, where x (•, î) ∈ R N is the vector obtained by collecting all samples of the î-th component of the state vector.The condition (23) can be included in the MQCP by using the following complementarity representation: where is a small positive parameter, with ρ = 0 and u ρ equal to +∞ (so that v ρ = 0).Indeed, from the nonnegativity of the variable w ρ , the constraints (24b) ) must be strictly positive; i.e. there exists at least a sample of x (•, î) which is different from a sample of the computed current solution x (•, î) .

MLCP for known period
A particular case of MQCP occurs when the period T of the periodic solution is known.In this case, the periodic solution computation can be formulated in terms of a MLCP.Since T is known, Eqs. ( 11) are linear with respect to the unknowns λ k and x k .By collecting (11) and (12a) for k = 1, . . ., N , by defining and u as in (17) without the last element and by using the periodicity condition (13), one obtains and e, M R , C and f defined as in (20b)-(20e), respectively.
Since T is known, the anchor equation ( 10) is not required anymore.In this case, we can define z = col(λ, x) and formulate the above problem as a MLCP, that is (2) without ϕ(z), with the following matrices In the particular case of a nonsingular A, one can solve (25a) for the vector x thus obtaining By substituting (28) in (25b) one obtains which is in the form (2b) without ϕ(z) and with z = λ, The solution λ of the corresponding MLCP can be used for the computation of the periodic solution x by using (28).
Note that for T /N → 0, the determinant of A tends to zero.Then we can state that when a high accuracy is required, i.e. a small step size T /N , the formulation in ( 25) is preferable to (29).
In the case that the PWL system presents constant solutions, the complementarity problem can be reformulated so that the new problem has no constant solutions.Since the use of ( 24) makes the problem nonlinear, in order to preserve the linearity we can use an alternative approach.
As an example, let us assume that the PWL system has the origin as an equilibrium point, as discussed at the beginning of Sect.4.1.In order to find only nonzero solutions, one can impose (without loss of generality) x k to be greater than some positive value ε for some chosen k.In particular, the constraint x k ε can be written in the complementarity form by modifying the constraints on some samples of the vector x.For instance, one can set x k,1 = ε and u x k,1 = +∞, where x k,1 , u x k,1 are the lower bound and the upper bound of the first component of x at the time k.Note that the approach presented above is not required in the case of an unknown period; indeed, such further constraint affects the phase condition of the solution which is already determined by the anchor equation.

Examples
In this section, the effectiveness of the proposed technique for computing period and waveform of oscillations is shown by considering PWL systems with different steady-state behaviours.We present a neural oscillator and a deadzone feedback system, which have solutions belonging to class C 1 .The second group of examples, including a stick-slip system, a repressilator and a relay feedback system, present oscillations of class C 0 .The computation of the periodic solution and the corresponding period is obtained by solving a MQCP with the matrices given in (18).
For all the following examples, we have computed the 'exact' steady-state solution of the discretized system by constructing the nonlinear closed-loop map.The idea for obtaining such map is to consider the solutions of the differential state equations, which model the 'modes' of the system, and to cascade them in order to link a sampled state to the next sample.It is important to highlight that the exact solution can be analytically obtained only if the sequence of modes is known, while the proposed approach is formulated without considering any hypothesis of such sequence.We numerically show that by varying the number of samples per period, i.e. by improving the resolution of the discretization, the error between the solution obtained with the MQCP and the exact one decreases.The maximum number of samples is chosen for a reasonable computational effort to perform the MATLAB code on a Intel Core i7 clocked at 2.40 GHz.The complementarity problems have been solved by using the PATH solver [32], that is a particular version of the Newton method for nonsmooth problems.The solver requires an initial guess, which by default is set to zero.Since PATH provides only a local convergence, it is clear that if the initial point is close to an existing solution, one has more chances that it converges to that particular solution; e.g. one can choose as initial guess for the period the one predicted by the describing function.In the following examples, we report the initial point used in the PATH solver, whose value is chosen from a set of trivial vectors and is not related to neither to the searched solution nor to the corresponding sequence of modes.The numerical results are also compared by varying the discretization parameters.

Stable periodic solution in a neural oscillator
The dynamical model of a neural network consisting of η mutually inhibiting neurons with adaptation can be represented in the following form [42]: with i = 1, . . ., η.Here, χ i is the membrane potential of the i-th neuron, v i represents the degree of adaptation, e c is the total input from outside the network that is assumed positive and constant with the time, τ 1 is a time constant, τ 2 and κ are the parameters that specify the time course of the adaptation, and ν indicates the strength of the inhibitory connection between the neurons.In [42], it is shown that for certain values of model parameters, the neural network has no stable equilibrium points and produces sustained oscillations.In the following, we consider a neural network with two neurons; i.e. η = 2, see Fig. 3.For neuron 1 and neuron 2, let us denote by x 1 and x 3 the state variables that represent the membrane potential, respectively, and by x 2 and x 4 the state variables for the degree of selfinhibition, respectively.Then the neural oscillator can be represented in the form (3) with the following matrices: The relation R = vec(R 1 , R 2 ) represents the inhibitory connection between the two neurons, with R i that corresponds to λ i = max{0, y i }, i = 1, 2, so as indicated by (30c).Each R i can be modelled as in (4) with μ i = 1, β R i = 0, i = 0 and u i = +∞, and they can be 'linked' to the system by choosing H u = −I 2 and H y = I 2 , in (3c) and (3d), respectively.By using ( 6), the neural model network is recast in form (7a) and (7b) and the feedback relation is In [43], it is shown that by considering the parameters τ 1 = 0.1 s, τ 2 = 0.2 s, κ = 2, ν = 2 and e c = 1, the system has a locally stable periodic oscillation.Figure 4 shows the solution computed by solving the corresponding MQCP with N = 600, θ = 0.5 and γ = 0.5 that yields a value of the period T = 0.8973 s.The neural system has also a constant unstable solution in [0.2, 0.2, 0.2, 0.2] that was eliminated by following the procedure presented in Sect.4.1.The initial guess for the solver has been set as z 0 = [x 0 ; T 0 ; λ 0 ; z 0 ρ ], where x 0 = [1, . . ., 1, −1, . . ., −1], λ 0 = [1, . . ., 1, 0, . . ., 0, 1, . . ., 1], T 0 = 0.897 s, and z 0 ρ = 0. Let us consider the error between the exact solution and the solution computed with the complementarity approach by varying the number of samples per period and the parameters θ and γ .Since the relation R is a Lipschitz continuous function of x, the solution is expected to belong to the class C 1 .As suggested in [3], in the case of solutions of class C 1 , it is possible to compute the solution of the discretized system by varying both θ and γ in order to obtain the pair which provides the best accuracy for the solution.Figure 5 shows the evolution of the maximum error in the computation of the x 2 trajectory, while in Fig. 6 it reported the error for the period computation.
As one could expect, the error decreases when the number of samples increases.For θ = 0.5 and γ assuming values between 0.5 and 1, the accuracy is improved, but we do not achieve order 2 when γ = 0.5.This in Fig. 6 Neural system.Error in the period computation obtained with different discretization techniques and with N ∈ [50,600] mainly due to the lack of regularity of the computed solution.This phenomenon is generally observed when higher-order methods are used for a solution with limited smoothness; see [4, §9.1].

Unstable periodic solution in a deadzone feedback system
The deadzone behaviour is typical in many real actuator systems, including mechanical connections, hydraulic y λ 1 -1 Fig. 7 Deadzone characteristic servo valves, piezoelectric translators and electronic circuits.A graphical representation is given in Fig. 7, and an analytical description is presented below In this section, we analyse the steady-state periodic behaviour of the dynamical system in form (3) with the following matrices: and whose feedback characteristic is the deadzone in Fig. 7.Note that A is not Hurwitz, then self-induced oscillation is possible [44].
The dynamical system is a low-pass filter and the polar diagram intersects the negative real axis, so the closed-loop system is a good candidate for the application of the describing function technique [45].The value of the approximated period is computed by considering the oscillation frequency ω * corresponding to the point in which the polar diagram of G( jω) (continuous line in Fig. 8) intersects the negative reciprocal of the describing function graph (dashed line in Fig. 8).We obtain ω * = 1.723 rad/s, then the corresponding period T * = 3.627 s.Moreover, the orientation of the two curves predicts that the periodic oscillation is unstable.The following numerical results show that the proposed complementarity approach is able to get the periodic behaviour together with the period also in the case of unstable solutions.The deadzone characteristic can be expressed as the difference of two saturation-like characteristics, R 1 and R 2 .In particular, R 1 corresponds to λ 1 = y 1 , while R 2 is λ 2 = sat(y 2 ), that is the unitary saturation function.These two relations can be modelled as in (4) by choosing for R 1 , μ 1 = 0, β R 1 = 0, 1 = −∞ and u 1 = +∞, while for R 2 , μ 2 = 1, β R 2 = 0, 2 = −1 and u 2 = +1.Then we choose H u = 1, −1 and H y = vec(1, 1) in (3c) and (3d), respectively.By using (6), the dynamical system can be recast in form (7a) and (7b), together with the complementarity representation of feedback relation discussed above.
Figure 9 shows the periodic solution computed through the proposed technique, by solving a MQCP with matrices in (18) and, with N = 5400, θ = 0.5 and γ = 0.5, which yields to a value of the period T = 3.6620 s.The initial guess for the solver has been set as z 0 = [x 0 ; T 0 ; λ 0 ; z 0 ρ ], where ], T 0 = 3.6 s, and z 0 ρ = 0.The dotted line graph corresponds to the numerical result obtained by implementing a time-stepping simulation of the initial value problem [3,46], with an initial condition sufficiently close to the periodic solution (x 0 = [1.3, −7.848, 4]).Of course the standard time-stepping simulation is not able to show the unstable orbit: the proposed approach is particularly advantageous in such cases.
The error between the exact solution and the one computed with the complementarity approach has been analysed by varying the number of samples per period between 100 and 5400 and by considering values of the parameters θ and γ in the interval [0.5, 1]; see Figs. 10  and 11.It is possible to prove that the trivial solution is also a solution of the system considered in this example, so the constraint (24) was added to the problem (18) to directly get the periodic solution.Qualitatively, the same comments presented for the previous example about the accuracy of the error can be repeated; see Figs. 5 and 6.

Sliding periodic solution in a stick-slip system
Let us consider a mass m connected to a spring with elastic constant K , which is pulled at a constant speed e s .Let x 1 be the elongation of the spring, and x 2 the mass velocity.Such system can be represented in the form (3) with and R being the friction characteristic represented in Fig. 12, where F c and F s are the Coulomb friction and the stiction force, respectively.As in the previous example, such characteristic can be obtained as the combination of two saturation-like characteristics, say R 1 and R 2 .In this case, R 1 represents λ 1 = relay(y 1 ), where relay(•) is the unitary relay characteristic, and , where sat m R (•) is the unitary saturation function where the nonzero slope of the characteristic is 1/m R .The two relations can be modelled as in (4) by choosing for Fig. 12 Coulomb friction characteristic with Stribeck effect with null viscous friction: y is the mass velocity and λ is the friction force Then we choose , respectively, and we write the dynamical system in form (7) with the matrices given by (6).
Let us select m = 1 kg, K = 2 N/m, F c = 2.94 N, F s = 5.88 N, m R = 1/12, and e s = 2 m/s.In [47], it is shown that this system can exhibit complex behaviours and that, depending on the selected integration technique, it is possible that sticking phases of the mass can be missed by the numerical simulation.Due to the discontinuity of the PWL relation at y = 0, a solution belonging to C 0 is expected.For such reason, the computation of the periodic solution and the corresponding period was obtained by solving the MQCP with matrices given in (18), using the anchor equation with the one in (22).Figure 13 shows that the complementarity approach is able to get the steady-state periodic behaviour of the system, in which it is possible to recognize the stick and the slip modes.When the trajectory is in the stick mode, the friction force increases rapidly and stops the motion.The system remains in the stick mode as long as the spring force is smaller than the stiction force.After that, the system enters in the slip mode and the mass accelerates subject to the Coulomb friction.The spring is then compressed and the motion of the mass stops again and the spring force needs to win again the stiction force.Such solu- The initial guess for the solver has been set as z 0 = [x 0 ; T 0 ; λ 0 ; z 0 ρ ], where x 0 = [5, . . ., 5, 0, . . ., 0], λ 0 = [(F s − F c ), . . ., (F s − F c ), 0, . . ., 0], T 0 = 4.91 s, and z 0 ρ = 0. Since the smoothness of the solution is one degree lower with respect to the previous examples, according to the discretization scheme in [4], we have fixed γ = 1 and we have varied only θ.The evolution of the error shown in Figs. 14 and 15 confirms the effectiveness of the proposed approach.

Nonsmooth stable periodic solution in a repressilator
Let us now consider the model of a repressilator, which is a synthetic genetic regulatory network that uses a cyclic repression structure.In the literature (see, e.g., [48] and the reference therein), it is shown the existence of oscillations for a three-dimensional system in which sigmoidal regulation functions that deter- mine the interaction between network elements are replaced by step functions.The resulting PWL systems have been proposed as a modelling framework in biology allowing efficient simulations, as confirmed in [49] where the complementarity approach is used to compute the behaviour of a repressilator in the bacterium Escherichia coli.Such a repressilator consists of three genes, and it can be modelled by considering the evolution of three variables which represent concentrations of the proteins Lacl, TetR and Cl.Such a repressilator model can be easily put in the form (3) with and where and i = 1, 2, 3.Each relation R i can be modelled as the MLCP (4) with μ i = 0, β R i = −1, i = 0 and u i = 1.Then we choose H u = I 3 and H y = −I 3 in (3c) and (3d), respectively, and we write the dynamical system in form (7) with the matrices given by ( 6).As showed in [49], the system has an unstable equilibrium point in (1, 1, 1) and a stable nonsmooth periodic solution.In order to compute such solution and the associated period, we solve a MQCP with matrices in (18) replacing the anchor equation with the one in (22).The initial guess for the solver has been set as z 0 = [x 0 ; T 0 ; λ 0 ; z 0 ρ ], where x 0 = [3, . . ., 3, 0, . . ., 0], λ 0 = [0, 1, 0, 0, 1, 0, . . ., 0, 1, 0], T 0 = 14.1959 s, and z 0 ρ = 0. Figure 16 shows the time evolution of the periodic steady state for the state variables, obtained with the proposed approach.The error results in Figs. 17 and 18 show that, for this particular example, the solution is not much sensitive to the discretization parameters.

Grazing-sliding bifurcation and multiple periodic solutions in relay feedback systems
A relay feedback system may present a great variety of behaviours at steady state.In this section, we analyse two examples.In the first one, the system undergoes a grazing-sliding bifurcation, while the second example presents multiple periodic solutions; in particular, one solution is stable and another is unstable.
Let us consider the third-order system described by the following matrices  The relay characteristic can be modelled as the MLCP (4) with M R = 0, β R = 0, = −1 and u = 1.
We choose H u = 1 and H y = 1 in (3c) and (3d), respectively, and we write the dynamical system in form (7) with the matrices given by (6).In [50], it is shown that such system undergoes different type of bifurcations by varying the system parameters.We consider the grazing-sliding bifurcation that occurs when the parameter ζ varies between 0.082 and 0.098 with all the other parameters fixed at the values ω = 10.84,−σ = α = ρ = κ = 1.In Fig. 19, we report the periodic steady-state evolutions of the system output x 1 and of the corresponding relay output λ obtained with three different values of the parameter ζ .The grazing-sliding bifurcation is clearly visible.For ζ = 0.082, there is a stable, symmetric trajectory with 6 pieces of sliding, which is shown in Fig. 19a.The evolution of the relay output is presented in Fig. 19b and, as expected, the value of λ is between −1 and 1 during the six time intervals corresponding to the six sliding pieces.The trajectory undergoes a grazing-sliding bifurcation and becomes a trajectory with 4 pieces of sliding for ζ = 0.098 as shown in Fig. 19e, f. Figure 19c shows that for ζ = 0.091 the trajectory grazes the switching surface at time instants 0.3475 and 3.243 s.Indeed, at the same time instants, the corresponding value of λ is between −1 and 1, as shown in Fig. 19d.The initial point for the solver PATH is set as z 0 = [x 0 ; T 0 ; λ 0 ; z 0 ρ ], where T 0 = 8.642 s, and z 0 ρ = 0. Let us consider the relay feedback system with the following matrices As in Sect.5.2, let us use the describing function technique for predicting the existence of periodic solutions.Figure 20 shows the Nyquist diagram of system (38) together with the negative reciprocal of the relay describing function, which corresponds to the negative real axis.The Nyquist diagram intersects the negative real axis in two points in which ω assumes the values 1.65 and 4 rad/s.This means that the closed-loop system has two periodic solutions with different period.In particular, the system has an unstable periodic solution of period T = 1.570 s and a stable periodic solution of period T = 3.808 s.By using the complementarity representation for the relay characteristic given above, we can write the dynamical system in form (7) with the matrices given by (6).
The unstable solution in Fig. 21 and the corresponding period are computed by solving the MQCP in (18) and by setting N = 400, γ = 1 and θ = 1.The computed value of the period is 1.8030 s.The initial point for the solver PATH is set as z 0 = [x 0 ; T 0 ; λ 0 ], where x 0 = [0, . . ., 0, 1, . . ., 1], λ 0 = [1, . . ., 1, 0, . . ., 0], and T 0 = 2 s.For the dynamical system under consideration, the constant trivial solution is also a solution.By using the arguments in Sect.4, suitable constraints were added to the MQCP in order to eliminate both the computed periodic unstable solution and the trivial one.Then the periodic stable steady-state solution in Fig. 22 was obtained, whose period is 3.5645 s.We use the same initial point, except that we added the initial value for the variables z ρ 1 and z ρ 2 , which was set to zero.

Conclusions
The mixed quadratic complementarity approach has been proposed for the computation of periodic solu- Fig. 21 Unstable periodic steady-state solution of the relay feedback system in (38).The solution is obtained by fixing N = 400, θ = 1 and γ = 1.The corresponding value of the period is 1.8030 s tions in a class of piecewise linear (PWL) systems, which consists of linear time-invariant systems with PWL feedback relations representable as linear combinations of saturation-like or step characteristics.For many practical systems belonging to this class, the period and the shape of the oscillation are difficult to be predicted, then phase conditions acting as anchor equations for the periodic solution have been added to the complementarity problem.It has been showed how to build a mixed quadratic complementarity problem (MQCP) which models the discretized closed-loop system together with the periodicity constraint and the Fig. 22 Stable periodic steady-state solution of the relay feedback system in (38).The solution is obtained by fixing N = 400, θ = 1 and γ = 1.The corresponding value of the period is 3.5645 s phase condition.The solution of such MQCP gives, as outcome, the periodic solution and the corresponding period.The effectiveness of the proposed approach has been tested by considering several practical PWL systems with different steady-state periodic behaviours: a stable periodic solution in a neural oscillator, an unstable oscillation for a deadzone feedback system, a sliding orbit in a stick-slip system, a periodic solution belonging to a repressilator, a grazing-sliding bifurcation in a relay feedback system and coexisting periodic solutions in a relay feedback system.The simulations, implemented by using different discretization schemes and sampling frequencies, showed the good accuracy of the proposed approach with respect to the analytical solution, computed by assuming the a priori knowledge of the modes sequence.Future work will investigate the use of the proposed tool for the computation of periodic solutions in a continuation framework.

3 Fig. 4
Fig.4 Stable periodic steady-state oscillation of the neural oscillator projected into the (x 1 , x 3 ) plane

5 Fig. 5
Fig. 5 Neural system.Error in the steady-state solution computation obtained with different discretization techniques and with N ∈ [50, 600]: maximum error in the x 2 trajectory

Fig. 8
Fig. 8 Nyquist diagram of the transfer function of the dynamical system (continuous line) together with the representation of the negative reciprocal of the deadzone describing function (dashed line)

3 Fig. 9 5 Fig. 10
Fig.9 Unstable periodic oscillation for the deadzone feedback system: steady-state solution computed by using the MQCP approach (continuous line) and diverging time-stepping simulation (dotted line)

5 Fig. 11
Fig. 11 Deadzone feedback system.Error in the period computation obtained with different discretization techniques and with N ∈ [100, 5400]

Fig. 13
Fig.13 Periodic steady-state solution of the stick-slip system.The graphs show the elongation of the spring, x 1 , the velocity of the mass, x 2 , and the friction force, λ.The solution is obtained by fixing N = 1000, θ = 0.5 and γ = 1.The corresponding value of the period is 4.9355 s

Fig. 14 Fig. 15
Fig. 14 Stick-slip system.Error in the steady-state solution computed with different discretization techniques and with N ∈ [90, 1080]: maximum error in the x 1 trajectory

Fig. 16 Fig. 17
Fig.16 Periodic steady-state solution of a repressilator network consisting of three genes.The graph shows the evolution of the variables x 1 , x 2 and x 3 which represent the concentration of proteins Lacl, Tetr and Cl, respectively.The solution is obtained by fixing N = 1080, θ = 0.5 and γ = 1.The corresponding value of the period is T = 15.1116s

Fig. 18
Fig.18 Repressilator network.Error in the steady-state period computation obtained with different discretization techniques and with N ∈[30, 1080]

Fig. 19 −Fig. 20
Fig.19 Relay feedback system: effect of a grazing-sliding bifurcation.Periodic steady-state trajectory of the variable x 1 : a for ζ = 0.082 it shows six pieces of sliding, c and for ζ = 0.091 the trajectory grazes the switching surface at time instants 0.3475