SMOOTH TO DISCONTINUOUS SYSTEMS: A GEOMETRIC AND NUMERICAL METHOD FOR SLOW-FAST DYNAMICS

. We consider a smooth planar system having slow-fast motion, where the slow motion takes place near a curve γ . We explore the idea of replacing the original smooth system with a system with discontinuous right-hand side (DRHS system for short), whereby the DRHS system coincides with the smooth one away from a neighborhood of γ . After this reformulation, in the region of phase-space where γ is attracting for the DRHS system, we will obtain sliding motion on γ and numerical methods apt at integrating for sliding motion can be applied. Moreover, we further bypass resolving the sliding motion and monitor entries (transversal) and exits (tangential) on the curve γ , a fact that can be done independently of resolving for the motion itself. The end result is a method free from the need to adopt stiﬀ integrators or to worry about resolving sliding motion for the DRHS system. We illustrate the performance of our method on a few problems, highlighting the feasibility of using simple explicit Runge-Kutta schemes, and that we obtain much the same orbits of the original smooth system.


1.
Introduction.In spite of many years of work on the subject, problems with different time scales still present considerable difficulty for numerical methods.In numerical analysis terminology, these problems are often stiff and/or possibly highly oscillatory.It is widely acknowledged that classical explicit methods (say, explicit Runge-Kutta schemes) are inefficient for numerical integration of stiff systems, and in fact implicit schemes are routinely advocated for integrating these systems.But, of course, implicit schemes come with some inherent drawbacks, notably the need to use (in a form or another) the system Jacobian, and the fact that they tend to damp solution components, which can be undesirable when trying to resolve (highly) oscillatory behavior.
1.1.A prototypical model.In this work, we focus on planar slow-fast systems of relaxation-oscillation type.The prototype of these systems is the well known van der Pol equation: ẍ + β(x 2 − 1) ẋ + x = 0 , ( where the notation ẋ stands for dx dt , and β is a positive parameter, the case of interest being β ≫ 1.
In order to maintain some freedom on the friction term, and to obtain different types of solution behavior, let us consider a broader class of problems similar to (1.1), namely oscillators in the form ẍ + βg x (x) ẋ + U x (x) = 0 , ( where g(•) is a smooth function of the position x, and U (•) is a smooth potential 1 .Since d dt (g(x)) = g x (x) ẋ, for these problems we perform the standard reduction to Liénard form, followed by a change of time variable.That is, letting ẋ = β(y − g(x)) −→ ẋ = β(y − g(x)) ẏ = − 1 β U x , and then changing time variable: t = βτ , but still using ẋ for dx dτ , and finally letting ǫ = 1 β 2 , (1.2) is rewritten as the system Clearly, in (1.3), x is the fast variable and y is the slow variable.The slow manifold is just the curve y = g(x); for later reference, let us call γ := {(x, y) : y = g(x)}.We remark that in the formulation (1.3) the slow manifold is independent of β.
Performing the above reductions on (1.1), one obtains the familiar singularly perturbed form of the van der Pol oscillator: with 0 < ǫ ≪ 1.It is well known (e.g., see [3]) that -aside from the originsolutions of (1.4), hence of (1.1), approach an asymptotically stable periodic orbit with asymptotic phase.Indeed, by rewriting the system as in (1.4), the periodic orbit closely follows (it is O(ǫ)-close) the two outer branches of the cubic y = x 3 /3 − x, the slow motion phase, and there is fast motion along the connecting arcs, where x changes rapidly.Again, this is very well known, see [3].
From the numerical point of view, for ǫ ≪ 1 the van der Pol system (1.4) is very stiff, and even sophisticated explicit integrators, say those of Matlab, cannot satisfactorily/efficiently resolve the solution profile, the difficulty arising during the slow motion phase of the integration 2 .
Example 1.1.Using the Matlab non-stiff integrator ode45 (based on explicit Runge Kutta, RK, schemes) and the Matlab recommended integrator for stiff problems, ode15s (based on the Numerical Differentiation formulas), we obtain the following outcome.For β = 50, with initial condition ( √ 3, 0), on the time interval [0, 1.8] (roughly, this is over one period), and with relative and absolute error tolerances of 10 −6 , ode45 takes 10497 steps, while ode15s takes 443 steps and 25% of the computing time.For β = 100, ode45 takes nearly 40000 steps, while ode15s requires 485 steps, and 10% of the computing time. 1 Of course, for β = 0, one has conservation of energy d dt 1 2 ( ẋ) 2 + U (x) = 0. 2 Indeed, the van der Pol oscillator is the standard example provided in the Matlab documentation to exemplify stiffness.

Replacing the cubic with piecewise linear
Using the same Matlab integrators as above, for (1.4) with this modified pwl reformulation, now gives us these results.For β = 50, initial condition at (3/2, 0), on the interval [0, 1.9] (there is a slight increase in the period), and relative and absolute error tolerances of 10 −6 , ode45 takes 7945 steps, while ode15s takes 388 steps and 66% of the computing time.For β = 100, ode45 takes nearly 30000 steps, while ode15s requires 387 steps, and 8% of the computing time.For β = 100, the two solution profiles, with the original formulation and the modified one, are on the right.

Cubic vs. piecewise linear limit cycles
The key feature of the reformulation of the van der Pol system described in Example 1.1 is that an a-priori replacement is made, based upon the shape of the curve γ.Of course, one obtains a different model, one whose dynamics can (or not) be faithful to the dynamics of the original van der Pol problem.[For example, see [9] for a situation where this reformulation gives misleading results].Regardless, apparently the reformulation did not produce dramatic computational savings insofar as numerical integration is concerned, nor it alleviated the concerns of stiffness or the inappropriateness of using explicit schemes.
In this work, for (1.4), and more generally for (1.3) and related problems, we propose a rather different modification of the system, for ǫ ≪ 1, one which will allow us to: use explicit RK schemes, obtain a meaningful saving in computing time, and recover a faithful solution profile and dynamical behavior for several different systems, stiff and highly oscillatory.
1.2.Our basic idea.Considering the van der Pol oscillator as a guiding example, an important consideration is that the approach to the slow manifold is asymptotic; that is, solution trajectories approach the periodic orbit tangentially (with asymptotic phase).However, if we consider a sufficiently large cylinder-like region enclosing the curve γ, then solution trajectories will enter this cylindrical region transversally.This simple consideration prompted us to exploit the following idea.
• Consider a "cylindrical" neighborhood of γ of "radius" ρ, call it C(ρ), and define a modified vector field as follows.
(i) Maintain the original vector field at points outside C(ρ), and on ∂C(ρ).
(ii) Define the vector field at a point P inside C(ρ) to be equal to the vector field at the closest point to P on ∂C (see below).(iii) Noting that, for ρ > 0, the new system has the curve γ as a discontinuity manifold, rephrase the modified problem as a systems with DRHS in the sense of Filippov.In this work, we considered two possibilities to define C(ρ) and the associated concept of distance3 of a point P inside C(ρ) from ∂C: (a) Tubular neighborhood, and (b) Shift neighborhood.
(In the figures below, we illustrate these constructions relative to the van der Pol problem.)Let γ = {(x, y) ∈ R 2 : y = g(x)}.Let ρ > 0 be a given positive value, and define C(ρ) = {P ≡ (x, y) ∈ R 2 : d(P, γ) ≤ ρ}, where d(P, γ) is the "distance" of the point P from the curve γ.(a) Tubular neighborhood .This is the classical concept adopted in dynamical systems studies (e.g., see [3]).Here, d(P, γ) is the true Euclidean distance of the point P from the curve γ; that is, C(ρ) is obtained by considering points within ±ρ along the unit normal directions at points on γ.This defines the tubular neighborhood of γ.See Figure 1, where ρ = 1/10 , C(ρ) is the cylinderlike region between the two blue curves, and γ is traced in black inside C(ρ).
Of course, C(ρ) will shrink onto γ as ρ goes to 0. (b) Shift neighborhood .Here the distance is measured only along the y-axis.In other words, for a given point P = (x, y), then we use d(P, γ) = |y − g(x)|.Thus, C(ρ) is obtained by shifting, up to ±ρ, the y-values on γ.Again, see Figure 1.
Remark 1.2.From the geometrical point of view, the classical tubular neighborhood is probably more appealing than the "Shift"-neighborhood.The latter choice has been adopted in singular perturbation studies (e.g., see [10, Section 39, p.255], where it is called µ-tube) as well as in regularization studies for discontinuous systems (e.g., see [8]); in any case, it is considerably simpler to build the shift-neighborhood than the tubular neighborhood.We will see below some other computational advantages/disadvantages of these two choices.
Once we have C(ρ), the vector field for the modified system is uniquely defined, except on γ itself, since points on γ are at "distance" ρ from two points on ∂C.In other words, we have created a DRHS system, where γ is the discontinuity curve.
Regardless of having adopted the tubular or shift neighborhood construction, the DRHS system we have is built as follows.As usual, let γ = {(x, y) : y = g(x)} (e.g., g(x) = x 3 /3 − x, for van der Pol), let P = (x, y) be a given point, and let d(P, γ) be defined according to the tubular or shift neighborhood constructions above.Moreover, let h(x, y) = y − g(x).
If d(P, γ) ≥ ρ, then the vector field at P is the same as the original vector field (say, the van der Pol vector field).When 0 < d(P, γ) < ρ, the vector field at P is the vector field at the point on ∂C(ρ) "closest" to P .Again, the meaning of closest depends on the choice of neighborhood.
(a) Tubular.Then, the closest point on ∂C(ρ) to P , is the point on ∂C(ρ) at minimal Euclidean distance from P , along the normal direction taken at the projection of P on γ.Note that this simple construction keeps the vector field constant at points inside C(ρ) along the normal directions to the curve γ, by retaining the values one has at points at distance ±ρ from γ along the unit normal to γ. See Figure 2. In principle, one may also use a smoother transition at ∂C(ρ), but we have not attempted a more refined implementation.(b) Shift.Since h(x, y) = 0, then the closest point on ∂C(ρ) to P is simply the point of coordinates (x, g(x) + ρ sign(h(x, y)).Again, see Figure 2 for elucidation.Next, suppose ρ > 0. At any point P = (x, y), let F − and F + be the two vector fields associated to the two cases h < 0 and h > 0, respectively (that is, below and above γ).We stress that these two vector fields coincide with the original vector field, except when d(P, γ) < ρ, where they are defined according to the above construction.
Example 1.3.To clarify, suppose we have chosen the shift neighborhood for the system and that we are selecting ρ = ǫ (this is the choice we do in practice).Then, our problem gets written as Regardless of how we choose the neighborhood of γ, we have the DRHS system: When h(x, y) = 0 (on γ), the problem is not defined in a classical sense, and we resort to Filippov theory to define a solution ( [2]).In particular, let ∇h = −g x 1 denote the normal direction at points on (and in a neighborhood of) γ, and consider the quantities w 1 = ∇h T F − and w 2 = ∇h T F + .
(1.8)Then, if at points (x, y) ∈ γ, w 1 > 0 and w 2 < 0, and are bounded away from 0, we have that γ is attractive and it will be reached in finite time from nearby initial conditions; in this case, upon reaching γ, solution trajectories will be forced to remain on it with (sliding) vector field given by (1.9) If, instead, a solution trajectory reaches a point on γ where w 1 w 2 > 0, then the trajectory will cross γ with vector field F + if w 1 , w 2 > 0, or vector field F − if w 1 , w 2 < 0. Finally, points on γ where one of w 1 or w 2 is equal to 0 are potential tangential exit points from γ: we should expect a trajectory reaching such a point to leave γ with vector field F − if w 1 = 0 and F + if w 2 = 0.

Remark 1.4.
There is a substantial difference between our reformulation and that obtained by replacing γ with a different functional form (as in the reformulation of Example 1.1).We sought a reformulation which would not sacrifice the accuracy of the solution profile in the phase plane, while at the same time replacing the asymptotic approach to (parts of) γ with finite time approach.Coupled with sliding mode theory, we can thus obtain transversal entries on the relevant portions of γ and tangential exits when sliding motion ceases to be attractive.
In Section 2, we give an overview of two different ways to implement the above idea.Then, in Section 3 we present results of our numerical simulation on several problems: the van der Pol oscillator, a oscillatory problem of type (1.3), and the FitzHugh-Nagumo problem.
Remark 1.5.We stress that we are transforming a smooth system into one with discontinuous right-hand side, and this may appear a bit odd.Indeed, in the literature on systems with DRHS, the opposite operation is much more commonly adopted: regularization, or smoothing, whereby one modifies a system with DRHS into a smooth one.For example, suppose we have a system like (here, x ∈ R n and h : R n → R) Then, a standard process of regularization consists in replacing this system with the globally defined system and where α η (x) interpolates between 0 and 1 in the interval [−η, η], with a desired degree of smoothness, and η defines a small interval near 0.
For example, suppose we use the following C 0 -interpolant: (1.11) Curiously, when we replace the DRHS system (1.6) with its regularized version as above (using (1.10) and (1.11) and η = ǫ), then, a simple computation tells us that we will obtain the original system (1.5) everywhere.

2.
The overall numerical method: Overview.We consider the DRHS system (1.7), and look at two possible ways of proceeding in order to approximate the solution.We will assume that trajectories of (1.7) enter γ transversally and exit γ tangentially, according to the well defined 1st order theory of Filippov.
2.1.Method 1: Sliding on γ, Entry and Exit.This method is nothing but just solving the DRHS system.We can do that by considering an event-driven technique, whereby a numerical technique identifies where we are with respect to γ and decides on what is the correct vector field to consider: F − , F + , or F s .We locate accurately intersection points with γ and decide on whether we should cross γ or slide on it by looking at the w i 's in (1.8).During sliding motion, we use a projected RK integrator, and monitor/locate tangential exit points, otherwise we just use a standard 4th order RK integrator.All integrations can be done with adaptive or constant time stepping.Overall, the implementation of this method is standard, see [1].The most time consuming part is the integration during sliding motion, since projected schemes have to be used in order to avoid (numerical) chattering phenomena.Because of the ue of projected schemes, with an underlying explicit time stepping scheme, when using this approach the end behavior is similar to that of the explicit scheme for the unmodified problem.
2.2.Method 2: Entry and Exit without sliding.In this method we bypass integration during sliding motion.It is easy to describe it assuming that we have computed (a-priori) the tangential exit points, that is the points satisfying w 1 = 0 and/or w 2 = 0, while coming from sliding motion.Then, upon reaching a point on γ where sliding motion should take place (a transversal entry), we directly trace the curve from the entry to the relevant exit point, after which we will continue with the appropriate exit vector field (i.e., F − if w 1 = 0 or F + if w 2 = 0) and a 4th order RK integrator.By construction, the integrator is used only in the fast motion part of the dynamics, and hence an explicit integrator is completely adequate.
There are a few important observations to make for these methods.
(i) For our discretization, and with both Methods 1 and 2, we always get perfect limit cycles.This is because we always trigger the integrator from the same exit point(s), hence -for any mode of integration, with constant or variable stepsizes-the method will render the same solution profile.(Of course, different values of ρ and/or of the time-step and/or of the error tolerances, will give (slightly) different orbits; but, once these values are fixed, the numerically computed periodic orbits will all be identical).(ii) With Method 2, since there is no integration for the sliding motion (i.e., for the slow motion), there is no numerical difficulty associated to resolving it (cfr.with 2.1).(iii) With Method 2, since there is no time integration for the sliding motion, the concept of time, specifically that of period of the solution, is somewhat lost.This reflects the fact that we are really recovering the orbit in phase space, and not computing a trajectory from which we then approximate the orbit.
In our case, the orbits are periodic, and what we can recover is the length of the orbit, but not the period in the original time variable.
Observation 2.1.Ideally, we would like to enter in the cylindrical neighborhood of γ precisely when the exact solution of the (unmodified) problem does, and abandon the neighborhood also when the solution does.Since -during slow motion-the exact solution is O(ǫ)-close to γ, then, in order for our method to be advantageous, we must have ρ = O(ǫ).Although the constant in the O term depends on the problem, in our computations we chose precisely ρ = ǫ, which worked rather well.
We are ready to summarize the key characteristics of our approach, and its advantages and disadvantages.We do this regardless of whether we chose the tubular or shift neighborhood, but of course only think of the truly advantageous ways to implement our approach, that is as Method 2: Entry and Exit without sliding.
• The asymptotic approach to the limit cycle has been replaced by a finite time approach to the curve γ (the slow manifold).• In the DRHS reformulation, there is no need to resolve the slow motion.
• Once we have chosen ǫ, and ρ, our reformulation gives an inherent error in the vector field, which is O(ǫ) close to the original.In terms of the stepsize of a numerical scheme, we can only expect convergence with respect to the reformulated problem, not the original one.See Figure 8 for elucidation of the inherent O(ǫ) error.

3.
Examples.Here we present results of simulations with our approach, highlighting benefits and shortcomings, on several problems of fast-slow motion.In Example 3.1, we consider both possibilities to build the neighborhood of γ: tubular and shift neighborhood.For the other Examples, we consider only the tubular neighborhood construction.
In Figure 3 we show the well known limit cycle, and superimpose on it the curve γ = {(x, y) : y = x 3 /3 − x} with enlargement of the right corner, when the limit cycle departs from closely following γ.In Figure 4 we show the construction of the modified vector fields, relative to the (a) tubular and (b) shift neighborhoods of γ, of radius ρ = 1/100.It is plainly obvious that (portion of) the left and right branches of the cubic are attracting for the modified DRHS system, regardless of the choice of cylindrical neighborhood.Instead, the choice of cylindrical neighborhood C(ρ) has an important impact on the dynamics of the DRHS system, since exit points in the two cases are rather different.In this specific case, the exit points from sliding motion using the tubular neighborhood are at (1.4142..., −0.4714...) (exit vector field is F − ) and at (−1.4142..., 0.4714...) (exit vector field is F + ); the exit values remain close (but not identical) to these for all ǫ, for as long as ρ = ǫ.Instead, using the shift-neighborhood, the exit points from sliding motion occur when x = ±(1 + √ 5)/2 ≈ ±1.618 and of course y = g(x) ≈ ∓0.206 (these values can be easily computed exactly, imposing w 1 = 0 or w 2 = 0).We also observe that, as long as ρ = ǫ (which is our default choice), the exit points for the case of the shift neighborhood will remain the same for all ǫ; this fact may be undesirable since it implies that we will not be fully bypassing the slow-motion integration (we will be leaving the sliding regime too soon).In Figures 5 and 6 we show the results obtained with Methods 2.1 and 2.2, relative to the tubular neighborhood C(ρ).The value of the radius of the tubular neighborhood is ρ = 0.01. Figure 5 show the results obtained with Method 2.1: sliding on γ, and we also show an enlargement around the right exit point.Figures 6 and 7 refer to Method 2.2: no sliding motion integration, we move the trajectory from entry-to-exit point(s).Again we show an enlargement near the right exit point.Quite clearly, there is no slow-motion integration, nor need to project during sliding motion.In this case, we use about 1/10-th as many integration points as for Method 2.1.Figure 6 refers to the tubular neighborhood, and Figure 7 to the Shift neighborhood.In the first case, for the given value of τ = 10 −2 , 56 integration steps are needed for the periodic trajectory, in the second case 93 steps are required, confirming that by the time we left γ we had not bypassed the slow motion.Finally, Figure 8 shows an enlargement near the "left entry point" for Method 2.2 with the tubular neighborhood for C(ρ), and compare that trajectory (shown also in Figure 6) with the solution of the unmodified problem.The fact that we used a piecewise constant vector field chosen for our modified approach (inside C(ρ)) is clearly appreciated, and as a consequence the fact the we have to remain O(ǫ) close to the exact solution.Computations were performed with a 4th order Runge-Kutta schemes (the 3/8-th rule) with constant stepsize of 10 −4 .
Example 3.2 (Oscillatory).This is a "corrugated van der Pol" oscillator, used as illustration of a problem with high frequency oscillations along the limit cycle.We only consider the tubular neighborhood construction.
In the reformulation (1.3) the system is where ǫ = 1/β 2 .The case of interest to us being 1 ≪ β, so that there are small amplitude, high frequency, oscillations around the limit cycle.In Figure 9 we show the limit cycle, and superimpose on it the curve γ with enlargement of the upper left part, when the limit cycle departs from closely following γ.For our reformulation, this is a harder problem than Example 3.1, in large part because the value of ρ impacts to a great extent the entry and exit points on the curve γ.To exemplify, in Figure 10 we show the modified vector fields for the DRHS reformulation, in the case of β = 20 and ρ = 0.01 and ρ = 0.001, respectively.The key difference in the two cases of ρ = 0.01 and ρ = 0.001 is when γ loses attractivity for the DRHS reformulation.Namely, for ρ = 0.001, the curve γ ceases to be attractive at x ≈ ±1.7, whereas for ρ = 0.01, there are repeated tangential exit points at x ≈ ±1.235 and x ≈ ±0.965; see figure on the right.We note that if we abandon the slow manifold at x ≈ ±1.7, then we end up having to integrate the system during its slow motion phase, and have a very stiff problem.Again, this confirms that the choice ρ = O(ǫ) is convenient.Exit points, case of ρ = 0.01.
Finally, in Figure 11, we show the results of Method 2.2, that is when we adopt the DRHS reformulation but no sliding motion, for the case of ρ = 0.01.The original problem with slow motion around an oscillating curve is easily solved.
where a describes an external stimulus and ǫ = 1/β 2 .We observe that this system is not in the form (1.3).
We fix the value a = 0.5, for which the system exhibits relaxation-oscillations, and β = 10.The figure on the right shows the solution profile.Motion is counterclockwise.Clearly, the solution follows closely the two branches of the cubic y = x − x 3 /3 + a. Limit cycle of (3.2), and slow manifold.
Again, we only consider the tubular neighborhood reformulation.Our method on this problem behaves quite similarly to Example 3.1, and we simply show the vector fields resulting from the DRHS reformulation with ρ = 0.01, in Figure 12, and the results obtained with Method 2.2, in Figure 13.

Conclusions.
We have presented a method in which a smooth system with relaxation-oscillation behavior is replaced by a system with DRHS, in a way which allowed us to adopt sliding mode techniques on a curve γ in R 2 .A key ingredient of our idea consisted in exploiting the replacement of asymptotic approach to γ with a finite time approach.We further bypassed resolving for the sliding motion, and simply instantaneously moved along the curve γ from a transversal entry to a tangential exit point; so doing, the slow motion portion of the dynamics is bypassed, with obvious simplifications in the numerical integration.We gave numerical evidence that our results accurately recover the phase space solution profile.The above said, our work must be considered a preliminary exploratory attempt, and more work will be needed in order to understand the reach of applicability of the approach.For example, we have exploited having a curve γ in R 2 along which there is slow motion.Also, a detailed analysis of the interaction between system's parameters and the radius ρ of the tubular neighborhood would be surely desirable.