numerical solution of discontinuous differential systems...

24
Numerical Solution of Discontinuous Differential Systems: Approaching the Discontinuity Surface from One Side Luca Dieci a , Luciano Lopez b a School of Mathematics, Georgia Tech Institute, Atlanta, GA 30332-0160, USA b Dipartimento di Matematica, Universit´ a degli Studi di Bari ”Aldo Moro”, Via E. Orabona 4, I-70125, Bari, Italy Abstract We consider the numerical integration of discontinuous differential systems of ODEs of the type: x = f 1 (x) when h(x) < 0 and x = f 2 (x) when h(x) > 0, and with f 1 = f 2 for x Σ, where Σ := {x : h(x)=0} is a smooth co-dimension one discontinuity surface. Often, f 1 and f 2 are defined on the whole space, but there are applications where f 1 is not defined above Σ and f 2 is not defined below Σ. For this reason, we consider explicit Runge-Kutta methods which do not evaluate f 1 above Σ (respectively, f 2 below Σ). We exemplify our approach with subdiagonal explicit Runge-Kutta methods of order up to 4. We restrict attention only to integration up to the point where a trajectory reaches Σ. Key words: Discontinuous ODEs, Filippov convexification, Runge-Kutta methods. 2000 MSC: 65L05 1. Introduction We study a differential system in R n with discontinuous right hand side in the form: x (t)= f (x)= f 1 (x(t)) when x R 1 f 2 (x(t)) when x R 2 , (1) Email addresses: [email protected] (Luca Dieci), [email protected] (Luciano Lopez) Preprint submitted to Applied Numerical Mathematics March 2, 2011

Upload: others

Post on 29-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

Numerical Solution of Discontinuous Differential

Systems: Approaching the Discontinuity Surface from

One Side

Luca Diecia, Luciano Lopezb

aSchool of Mathematics, Georgia Tech Institute, Atlanta, GA 30332-0160, USAbDipartimento di Matematica, Universita degli Studi di Bari ”Aldo Moro”, Via E.

Orabona 4, I-70125, Bari, Italy

Abstract

We consider the numerical integration of discontinuous differential systems ofODEs of the type: x′ = f1(x) when h(x) < 0 and x′ = f2(x) when h(x) > 0,and with f1 6= f2 for x ∈ Σ, where Σ := {x : h(x) = 0} is a smoothco-dimension one discontinuity surface. Often, f1 and f2 are defined on thewhole space, but there are applications where f1 is not defined above Σ andf2 is not defined below Σ. For this reason, we consider explicit Runge-Kuttamethods which do not evaluate f1 above Σ (respectively, f2 below Σ). Weexemplify our approach with subdiagonal explicit Runge-Kutta methods oforder up to 4. We restrict attention only to integration up to the point wherea trajectory reaches Σ.

Key words: Discontinuous ODEs, Filippov convexification, Runge-Kuttamethods.2000 MSC: 65L05

1. Introduction

We study a differential system in Rn with discontinuous right hand side

in the form:

x′(t) = f(x) =

{

f1(x(t)) when x ∈ R1

f2(x(t)) when x ∈ R2, (1)

Email addresses: [email protected] (Luca Dieci), [email protected](Luciano Lopez)

Preprint submitted to Applied Numerical Mathematics March 2, 2011

Page 2: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

ΣΣ

n(x)

x

1

2

n(x)2

T Txx

x

1

R

R

R

R

Figure 1: The surface, tangent plane and normal vector in 1D and 2D.

(see [1], [2], [3]). The state space Rn is split (locally) into two subspaces R1

and R2 by a hypersurface Σ such that Rn = R1 ∪ Σ ∪ R2. The hypersurface

is defined by a scalar event function h : Rn → R, so that the subspaces R1

and R2, and Σ, are implicitly characterized as

Σ = {x ∈ Rn| h(x) = 0} , R1 = {x ∈ R

n| h(x) < 0} , R2 = {x ∈ Rn| h(x) > 0} .

(2)We will assume that h ∈ Ck, k ≥ 2, and that ∇h(x) 6= 0 for all x ∈ Σ, so

that the unit normal n to Σ is well defined1.In the differential system (1), the right-hand side f(x) can be assumed to

be smooth in R1 and R2 separately, but it is usually discontinuous across Σ,that is f1(x) 6= f2(x), x ∈ Σ.

Remark 1.1. Although in the literature it is often assumed (e.g. see [2, 4,3]) that f1 and f2 are defined smoothly everywhere in an open neighborhood ofΣ, this may be a strong restriction from both theoretical (see [2]) and practicalpoints of view. Therefore, we wish to study numerical methods which avoidthis assumption.

As we just noticed, in (1) f(x) is not defined if x is on Σ. A way to definethe vector field on Σ is to consider the set valued extension F (x) below:

x′(t) ∈ F (x(t)) =

f1(x(t)), x ∈ R1

co {f1(x(t), f2(x(t)} , x ∈ Σf2(x(t)), x ∈ R2

, (3)

1In many practical applications, the function h is actually linear (Σ is a plane).

2

Page 3: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

where co(A) denotes the smallest closed convex set containing A. In ourparticular case:

co {f1, f2} = {fF

: x ∈ Rn → R

n : fF

= (1 − α)f1 + αf2, α ∈ [0, 1]} . (4)

The extension of a discontinuous system (1) into a convex differential inclu-sion (3) is known as Filippov convexification. Existence of solutions of (3) canbe guaranteed with the notion of upper semi-continuity of set-valued func-tions ([1], [2]). A solution in the sense of Filippov (see [2]) is an absolutelycontinuous function x : [0, τ ] → R

n such that x′(t) ∈ F (x(t)) for almost allt ∈ [0, τ ], where F (x(t)) is the closed convex hull defined in (4).

Now, consider a trajectory of (1), and suppose that x0 /∈ Σ, and thus,without loss of generality, we can think that x0 ∈ R1, that is h(x0) < 0. Theinteresting case is when, starting with x0, the trajectory of the differentialsystem x′ = f1(x) is directed towards Σ and reaches it in a finite time. Atthis point, one must decide what happens next. Loosely speaking, there aretwo possibilities: (a) we leave Σ and enter into R2 (or, less likely, we re-enterin R1); (b) we remain in Σ with a yet to be defined vector field. Filippovdeviced a very powerful first order theory which helps to decide what to do inthis situation, and how to define the vector field in case (b). We summarizeit below.

Let x ∈ Σ and let n(x) be the normal to Σ at x. Let nT (x)f1(x) andnT (x)f2(x) be the projections of f1(x) and f2(x) onto the normal direction.

Transversal Intersection. In case in which, at x ∈ Σ, we have

[nT (x)f1(x)] · [nT (x)f2(x)] > 0 , (5)

then we will leave Σ. We will enter R1, when nT (x)f1(x) < 0, and will enterR2, when nT (x)f1(x) > 0. In the former case we will have (1) with f = f1,in the latter case with f = f2. Any solution of (1) with initial condition notin Σ, reaching Σ at a time t1, and having a transversal intersection there,exists and is unique.

Sliding Mode. In case in which, at x ∈ Σ, we have

[nT (x)f1(x)] · [nT (x)f2(x)] < 0 , (6)

then we have a so-called sliding mode through x.An attracting Sliding Mode occurs if

[nT (x)f1(x)] > 0 and [nT (x)f2(x)] < 0, x ∈ Σ , (7)

3

Page 4: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

where the inequality signs depend of course on the definition of R1,2 in (2).When we have (7) satisfied at x0 ∈ Σ, a solution trajectory which reachesx0 does not leave Σ, and will therefore have to move along Σ: sliding mo-tion. During the sliding motion the solution will continue along Σ with timederivative f

Fgiven by:

fF(x) = (1 − α(x))f1(x) + α(x)f2(x) . (8)

Here, α(x) is the value for which fF(x) lies in the tangent plane Tx of h(x)

at x, that is the value for which nT (x)fF(x) = 0. This gives

α(x) =nT (x)f1(x)

nT (x)(f1(x) − f2(x)). (9)

Observe that a solution having an attracting sliding mode exists and isunique, in forward time.

We have a repulsive sliding mode when

[nT (x)f1(x)] < 0 and [nT (x)f2(x)] > 0, x ∈ Σ . (10)

Repulsive sliding modes do not lead to uniqueness (at any instant of time onemay leave with f1 or f2), and we will not further consider repulsive slidingmotion in this work.

Summarizing, we consider solutions of (1) which will exhibit either transver-sal intersection or attractive sliding mode on Σ. These will generally becontinuous, but not differentiable, functions. Moreover, we will henceforthfocus on the case in which we reach Σ coming from R1 and we will restrictto the case in which f1 reaches Σ not tangentially. To be precise, we willcharacterize the attractivity of Σ from R1 by the following assumption:

There exists a strictly positive constant δ, such that for all x ∈ R1 ∪ Σ,

and sufficiently close to Σ, we have

hTx (x)f1(x) ≥ δ > 0 . (11)

Observe that, since (for a trajectory in R1)

d

dth(x(t)) = hT

x (x(t)x′(t) = hTx (x(t)f1(x(t)) ,

then (11) implies that the function h monotonically increases along a solutiontrajectory in R1 (and close to Σ), until eventually the trajectory hits Σ non-tangentially. A “discrete analog” of this property is the key to producingappropriate numerical schemes.

4

Page 5: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

2. One-sided numerical methods

In some instances, the vector field f1 (respectively, f2) cannot be extendedsmoothly outside R1∪Σ (respectively, R2∪Σ), or, even if it may be extended,the physical features of the model may prohibit evaluation of f1 above (re-spectively, f2 below) Σ. The following dynamical system exemplifies thissituation:

x′ =

{

x(1 − t)(2k+1)/2, k = 0, 1, 2, . . . , when t ≤ 10 , when t > 1

. (12)

Note that the vector field in (12) has k continuous derivatives at t = 1;the example is an extension of one considered in [5, 6] where the authorsconsidered the case of k = 0.

For the above reasons, we are not willing to consider numerical methods(unlike, say, [7, 8, 9]) that require that f1 extends smoothly outside R1 ∪ Σ,but we consider one-sided numerical procedures in which we do not needto compute the vector field f1 outside R1 ∪ Σ. In particular, we will studynumerical procedures in which the discontinuity surface is approached fromone side. These procedures compute the event or discontinuity points, andtherefore they belong to the class of event driven methods (see [10]) andmake sense only if on the time interval of interest there are finitely manyevent points.

We will study the class of general explicit Runge–Kutta (ERK) schemesand give conditions under which these methods approach the discontinutysurface from one side. As illustration of this general result, we will give suf-ficient conditions for a subclass of “sub-diagonal” ERK methods2 in orderto satisfy these conditions. This specific class of subdiagonal ERK schemesallows for recursive arguments of proof, as well as modularity in the imple-mentation of the schemes.

Remark 2.1. It should be said that several numerical methods have been de-vised for detecting event points when solving systems of ODEs. For example,the methods of [8] and [9] are in this class. Even the popular ODESUITE ofMatlab codes provides “event detection” as an option. What distinguishedour present construction from these other methods is that we approach the

2In the Butcher’s tableau, only the entries in the first sub-diagonal are nonzero.

5

Page 6: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

event point from one side only, and do not resort to any interpolation proce-dure.

We emphasize that in this work we restrict attention only to being able tolocate (accurately) the point where we “hit” Σ. What to do afterwards hasbeen treated elsewhere by a number of authors; e.g., see [11] and referencesthere.

2.1. General Explicit Runge Kutta methods

Let us consider the general explicit Runge–Kutta (ERK) scheme definedby the Butcher’s tableau

0 0 0 0 . . . 0c2 a21 0 0 . . . 0c3 a31 a32 0 . . . 0. . . . . . . . . . . . . . . . . .cs as1 as2 . . . as,s−1 0

b1 b2 . . . . . . bs

.

Suppose we start with x0 in the region R1. One step of the ERK method,with time step τ > 0, reads

x1(τ) = x0 + τs

i=1

bif1(yi(τ)) , (13)

with

y1 = x0 , yi(τ) = x0 + τ

i−1∑

j=1

ai,jf1(yj(τ)) , j = 2, . . . , s . (14)

The main idea is to make sure that f1 can be evaluated at all internal stagesy2, . . . , ys, so that the numerical solution x1(τ) may be computed.

Clearly, as long as all stage values yj’s and x1 are in R1, the numericalintegration can proceed. Otherwise, we need to consider several differentcases.

Case 1. Let us suppose (see Figure 2):

(1.a) h(yi(σ)) ≤ 0 for 0 ≤ σ ≤ τ and i = 2, . . . , s;

6

Page 7: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

y

y

y

y

x

1

2

3

ys−1

s

1

Σ

Figure 2: Case 1: General Explicit RK method.

(1.b) h(x1(τ)) > 0.

In this case, the numerical solution with stepsize τ , x1(τ), is above Σ, whileall internal stage values (for all σ ∈ [0, τ ]) are below Σ. This is the simplestcase. Letting x1(σ) = x0 + σ

∑si=1 bif1(yi(σ)), σ ∈ [0, τ ], one can use a root

finding routine (say, bisection or the secant method) to compute a value ηsuch that the scalar function H(σ) = h(x1(σ)) vanishes, that is x1(η) on Σ.

Remark In a different context, a similar approach for finding the step sizesuch that the numerical solution lies on the discontinuity surface has beenused in [12]. However, in [12] the authors use implicit RK schemes, and needto solve a nonlinear system (the stage values are parts of the unknowns); itis not clear to us that the iterative solution of the system will give approx-imations in the region R1. On the other hand, for us, the hypothesis (1.a)guarantees that f1 may be evaluated at the internal stages (14) for all σ in[0, τ ] and this implies that the iterations of the root finding routine of thescalar values function h(x1(σ)) are well defined.

Finally, we notice that the value η ∈ [0, τ ] which gives h(x1(η)) = 0 isunique if

d

dσh(x1(σ)) > 0, ∀σ ∈ [0, τ ] , (15)

and we recognize this formula as the numerical realization of (11).

Case 2. Let us suppose (see Figure 3):

7

Page 8: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

y

y

y

1

2

3

Σ

ys

ys−1

Figure 3: Case 2: General Explicit RK method.

(2.a) h(yi(σ)) ≤ 0 for 0 ≤ σ ≤ τ and i = 2, . . . , s − 1;

(2.b) h(ys(τ)) > 0.

In other words, we have that the last stage value ys((τ) is above Σ, while allthe previous stage values are below Σ for all σ ∈ [0, τ ]. Let us now assumethat

d

dσh(ys(σ)) = hT

x (ys(σ))y′

s(σ) > 0, ∀σ ∈ [0, τ ] ,

which we again recognize as a monotonicity condition on the stage valuefunction ys (see (11)). Then, there exists a unique η ∈ (0, τ) such thath(ys(η)) = 0 and further h(ys(σ)) < 0, for all σ ∈ [0, η). With this value ofη, we compute x1(η) = x0 + η

∑si=1 bif1(yi(η)) and we need to distinguish

between two subcases:

(2.c) if h(x1(η)) > 0, we are back to the situation treated in Case 1;

(2.d) if h(x1(η)) ≤ 0, then we either continue the integration with vectorfield f1 (if h(x1(η)) < 0), or stop since we have found the sough pointon Σ.

The analysis of the other possibilities proceed along similar lines.Case 3. Suppose that:

(3.a) h(yi(σ)) ≤ 0 for 0 ≤ σ ≤ τ and i = 2, . . . , s − 2;

8

Page 9: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

(3.b) h(ys−1(τ)) > 0.

Assume that (again a monotonicity condition for the stage function ys−1):

d

dσh(ys−1(σ)) = hT

x (ys−1(σ))y′

s−1(σ) > 0, ∀σ ∈ [0, τ ] .

Then, there exists a unique η ∈ (0, τ) such that h(ys−1(η)) = 0. Similarly tobefore, we have to distinguish between two subcases:

(3.c) if h(ys(η)) ≤ 0, then we can form x1(η)); if h(x1(η)) > 0, we willassume that3 h(ys(σ)) ≤ 0 for σ ∈ (0, η) in order to compute η suchthat h(x1(η)) vanishes;

(3.d) if h(ys(η)) > 0, then we go back to case 2.

All other cases, until the situation where y2(τ) is above Σ, and y1(τ) (thatis, x0) is below Σ may be treated in much the same way. Details are clearand therefore omitted.

We stress that, as long as appropriate monotonicity assumptions hold forthe stage value functions, any explicit Runge-Kutta method can approachthe discontinuity surface from one side.

Next, we exemplify what properties are needed of the vector field, in orderto make sure that these monotonicity properties hold. We do this, for a classof subdiagonal explicit Runge Kutta schemes of order 1 through 4.

2.2. Subdiagonal Runge Kutta Methods of Order 1 through 4

Explicit Euler method. Consider the explicit Euler method, ERK1, de-fined by the following tableau:

0 01

.

In the region R1, one step of ERK1 with stepsize τ reads

x1 = x0 + τf1(x0) . (16)

If x1 is in R1 we continue to integrate, otherwise we are above Σ. Considerthe function x1(σ) = x0 + σf1(x0), 0 ≤ σ ≤ τ . Trivially, this is a monotone

3which, again, can be guaranteed by the monotonicity assumption d

dσh(ys(σ)) > 0

9

Page 10: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

function. It is a simple observation that the function h(x1(σ)) changes signin [0, τ ], and therefore there must be a value η ∈ [0, τ ] where this functionhas a zero. If we want to make sure that this is the only root of h(x1(σ))for σ ∈ [0, τ ], then we need that the straight line segment x1(σ) intersect Σjust once4; this requires a control on the curvature of Σ with respect to thestepsize and the attractivity rate δ of (11). This is the content of the nextresult.

Theorem 2.2. Let x0 ∈ R1 and close to Σ. Let τ > 0 be the stepsize ofthe method and let x1(σ) = x0 + σf1(x0), 0 ≤ σ ≤ τ (so that x1(τ) = x1).Let τ be sufficiently small, and assume that there exist two strictly positiveconstant δ and ρ such that

(S1) hTx (x0)f1(x0) ≥ δ;

(S2) [f1(x0)]T hxx(x1(σ))f1(x0) ≥ −ρ, for all σ ∈ [0, τ ] ;

(S3) δ − ρτ > 0.

Then, the function h(x1(σ)) is strictly increasing for σ ∈ [0, τ ]. In particular:

(i) if h(x1) ≤ 0, then h(x1(σ)) ≤ 0 for all σ ∈ [0, τ ];

(ii) if h(x1) > 0, then there exists a unique η ∈ (0, τ) on Σ.

Proof We observe that

d

dσh(x1(σ)) = hT

x (x1(σ))x′

1(σ) = hTx (x1(σ))f1(x0)

and therefore we have

d

dσh(x1(σ)) = hT

x (x0)f1(x0)+

∫ 1

0

[f1(x0)]T hxx(x0+s(x1(σ)−x0))(x1(σ)−x0)ds ,

and so ddσ

h(x1(σ)) ≥ δ − ρτ > 0. �

4This is not strictly required; since the method has 1st order accuracy, and (11) holds,any root of h(x1(σ)) will do

10

Page 11: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

Explicit midpoint method. The explicit midpoint method, ERK2, isdefined by the following tableau

0 0 012

12

00 1

.

In the region R1, one step of ERK2 with stepsize τ reads

x1 = x0 + τf1(y2) , with y2 = x0 +τ

2f1(x0) , (17)

and notice that y2 is one step of Euler method (16) with stepsize τ/2.Now, suppose we have x0 ∈ R1, close to Σ. If h(x0 + τ

2f1(x0)) ≤ 0 and

also h(x1) ≤ 0, we continue integrating this system. Otherwise, we will haveto distinguish between the following two cases:

(a) h(y2) ≤ 0 but h(x0 + τf1(y2)) > 0 ,

(b) h(y2) > 0.

Case (a). Define y2(σ) = x0 + σ2f1(x0), for σ ∈ [0, τ ], and assume that

y2(σ) ∈ R1, for all σ ∈ [0, τ ]; this can be guaranteed under conditions muchlike those of Theorem 2.2, namely: hT

x (x0)f1(x0) ≥ δ, [f1(x0)]T hxx(y2(σ))f1(x0) ≥

−ρ and δ − ρτ/2 > 0. In this case, take the function H(σ) = h(x1(σ)),σ ∈ [0, τ ], where x1(σ) = x0 + σf1(y2(σ)). Observe that H(σ) is a smoothfunction, taking values of opposite sign at the endpoints of the interval [0, τ ].As a consequence, there must be a (first) value, call it η, where H(η) = 0.If we want that this is the unique value in [0, τ ] where H vanishes5, we cangive sufficient conditions to guarantee that the function H(σ) is monotonefor σ ∈ [0, τ ]. The theorem below is such a result.

Theorem 2.3. Consider case (a), and assume that h(y2(σ)) ≤ 0, for allσ ∈ [0, τ ]. Further, assume that there are constants δ2 > 0 and ρ2 > 0 andlet τ > 0 be sufficiently small such that the following conditions hold:

(S1) hTx (x1(σ))f1(y2(σ)) ≥ δ2, for all σ ∈ [0, τ ] ;

(S2) hTx (x1(σ))Df1(y2(σ))f1(x0) ≥ −ρ2, for all σ ∈ [0, τ ] ;

5Again, in this case it is not strictly necessary that there be a unique root of H(σ)

11

Page 12: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

(S3) δ2 −τ2ρ2 > 0.

Then, the function h(x1(σ)) is strictly increasing for σ ∈ [0, τ ]. In particular,there exists a unique η ∈ (0, τ) such that h(x1(η)) = 0.

Proof For σ ∈ [0, τ ], we have:

d

dσh(x1(σ)) = hT

x (x1(σ))x′

1(σ) .

Sincex′

1(σ) = f1(y2(σ)) +σ

2Df1(y2(σ))f1(x0) ,

we get

hTx (x1(σ))x′

1(σ) = hTx (x1(σ))f1(y2(σ)) +

σ

2hT

x (x1(σ))Df1(y2(σ))f1(x0)

and so, using (S1)-(S3) we obtain ddσ

h(x1(σ)) ≥ δ2 −σ2ρ2 ≥ δ2 −

τ2ρ2 > 0 �

Therefore, in case (a), and under the assumptions of Theorem 2.3, thescalar function H(σ) = h(x1(σ)) has a unique zero which can be found bystandard techniques.

Case (b). Next, consider case (b). Now, the stage value y2 is already onthe other side of Σ, and thus we cannot properly form x1. So, we first seeka value η ∈ (0, τ) such that y2(η) ∈ Σ. Then, if x1(η) = x0 + ηf1(y2(η)) isabove Σ, we are back to case (a) relatively to the stepsize η, and therefore thefact that there will exist a (unique) value η ∈ [0, η] for which h(x1(η)) = 0can rest on Theorem 2.3 (the details are omitted). On the other hand, ifx1(η) is below Σ, we continue integrating.

Heun method. This explicit Runge Kutta method of order 3, ERK3, isdefined by the following tableau:

0 0 0 013

13

0 023

0 23

014

0 34

.

In the region R1, with stepsize τ , one step of ERK3 reads

x1 = x0 + τ [1

4f1(x0) +

3

4f1(x0 +

2

3τf1(x0 +

1

3τf1(x0)))] , (18)

12

Page 13: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

x

y

x00

yy

x0

x1

Σ Σ Σ

Case (a). Case (c).Case (b).

2

23

y2

y3

Figure 4: ERK3: Different cases for ERK3.

that isx1 = x0 + τ [1

4f1(x0) + 3

4f1(y3)] ,

y3 = x0 + 2 τ3f1(y2) ,

y2 = x0 + τ3f1(x0) .

Notice that y3 can be rewritten as

y3 = x0 + 2τ

3f1(y2) = x0 + 2

τ

3f1(x0 +

τ

3f1(x0)) ,

and therefore the stage value y2 corresponds to one step of (16) with stepsizeτ/3, and y3 corresponds to one step of (17) with stepsize 2τ

3, instead of τ .

Now, suppose we are integrating x′(t) = f1(x(t)), starting with x0 belowthe surface Σ, that is h(x0) < 0, but close to it. If h(y2) ≤ 0, h(y3) ≤ 0 andh(x1) ≤ 0, we continue integrating this system. Otherwise, we will have todistinguish between the three cases (see Figure 4):

(a) h(y2) ≤ 0, h(y3) ≤ 0 but h(x1) > 0,

(b) h(y2) ≤ 0 but h(y3) > 0,

(c) h(y2) > 0.

Case (a). Define y2(σ) = x0 + σ3f1(x0), for σ ∈ [0, τ ], and assume that

y2(σ) ∈ R1, for all σ ∈ [0, τ ], that is h(y2(σ)) ≤ 0. This can be guaranteedby conditions like those in Theorem 2.2, with the only change there beingδ − ρτ/3 > 0. In this case, the function y3(σ) = x0 + 2

3σf1(y2(σ)), for all

σ ∈ [0, τ ], is well defined. Further, assume that h(y3(σ)) ≤ 0, ∀σ ∈ [0, τ); this

13

Page 14: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

can be guaranteed by conditions similar to those in Theorem 2.3, namely: forall σ ∈ [0, τ ], we have hT

x (y3(σ))f1(y2(σ)) ≥ δ2, hTx (y3(σ))Df1(y2(σ))f1(x0) ≥

−ρ2, and δ2 −τ3ρ2 > 0. In this case, for all σ ∈ [0, τ ], the function H(σ) =

h(x1(σ)) is well defined, where

x1(σ) = x0 + σ[1

4f1(x0) +

3

4f1(y3(σ))] .

Since H(·) is a smooth function and takes values of opposite sign at theendpoints of the interval [0, τ ], there must be a (first) value, call it η, whereH(η) = 0. We now give sufficient conditions guaranteeing that this is theunique value in [0, τ ] where H vanishes6.

Theorem 2.4. Consider case (a), and assume that h(y2(σ)) ≤ 0 and h(y3(σ)) ≤0, for all σ ∈ [0, τ ]. Further, let there be constants δ3 > 0, ρ3 > 0 and η3 > 0,and let τ > 0 be sufficiently small so that the following conditions hold:

(S1) hTx (x1(σ))[f1(x0) + 3f1(y3(σ))]/4 ≥ δ3 , for all σ ∈ [0, τ ] ;

(S2) hTx (x1(σ))Df1(y3(σ))f1(y2(σ)) ≥ −ρ3 , for all σ ∈ [0, τ ] ;

(S3) hTx (x1(σ))Df1(y3(σ))Df1(y2(σ))f1(x0) ≥ −η3 , for all σ ∈ [0, τ ] ;

(S4) δ3 −τ2ρ3 −

τ2

6η3 > 0 .

Then, the function h(x1(σ)) is strictly increasing for σ ∈ [0, τ ]. In particular,there exists a unique η ∈ (0, τ) such that h(x1(η)) = 0.

Proof The proof amounts to a straightforward differentiation. For σ ∈ [0, τ ],we have:

d

dσh(x1(σ)) = hT

x (x1(σ))x′

1(σ) ,

x′

1(σ) =1

4(f1(x0) + 3f1(y3(σ))) +

4Df1(y3(σ))y′

3(σ) ,

and

y′

3(σ) =2

3f1(y2(σ)) +

9Df1(y2(σ))f1(x0) .

6Again, in this case it is not strictly necessary that there be a unique root of this H(σ)

14

Page 15: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

So, using (S1)-(S4), we obtain

d

dσh(x1(σ)) ≥ δ3 −

σ

2ρ3 −

σ2

6η3 > 0

Case (b). Now h(y3) > 0. Assume that y2(σ) ∈ R1 (that is, h(y2(σ)) ≤0), for all σ ∈ [0, τ ]; this can be guaranteed by conditions like those inTheorem 2.2. At this point, we look for the unique value η ∈ (0, τ) suchthat h(y3(η)) = 0, and form x1(η) = x0 + η[1

4f1(x0) + 3

4f1(y3(η))]. The

existence and uniqueness of this value η can be guaranteed by a result justlike Theorem 2.3. If h(x1(η)) > 0, we are back to consider a situation like incase (a), relatively to the interval [0, η], otherwise we continue to integrate.

Case (c). In this case, y2 is on the other side of Σ: h(y2) > 0. In thissituation we can use Theorem 2.2 to guarantee that h(y2(σ)) is an increasingfunction for σ ∈ [0, τ ], and so there exists a unique η ∈ [0, τ ] such thath(y2(η)) = 0 where y2(η) = x0+

23ηf1(y1(η)). If h(y3(η)) > 0, relatively to the

stepsize η (instead of τ), we are back to case (b); otherwise, if h(y3(η)) ≤ 0,we are back to case (a).

Classical Runge Kutta Method. The last one-sided integration schemewe propose is based on the classical explicit Runge Kutta method of order4, ERK4, defined by the following tableau:

0 0 0 0 012

12

0 0 012

0 12

0 01 0 0 1 0

16

13

13

16

.

In R1, one step of length τ of ERK4 is

x1(τ) = x0 + τ [1

6f1(x0) +

1

3f1(y2) +

1

3f1(y3) +

1

6f1(y4)] (19)

where

y2 = x0 + τ2f1(x0) ,

y3 = x0 + τ2f1(y2) = x0 + τ

2f1(x0 + τ

2f1(x0)) ,

y4 = x0 + τf1(y3) = x0 + τf1(x0 + τ2f1(x0 + τ

2f1(x0))) .

15

Page 16: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

Σ

ΣΣ

Case (a). Case (b).

Σ

x1

y

y

y

x0

y

y

x0

y

y

y

x0

y

x0

Case (c).Case (d).

2

3

44

2

3

2

32

4

4

Figure 5: Different cases for ERK4

Observe that the stage value y2 corresponds to (16), and y3 to (17), withstepsizes τ

2instead of τ .

Now, suppose we are integrating x′(t) = f1(x(t)), starting with x0 ∈ R1,but close to Σ. If h(y2) ≤ 0, h(y3) ≤ 0, h(y4) ≤ 0 and also h(x1) ≤ 0,we continue integrating this system. Otherwise, we will have to distinguishbetween the four cases:

(a) h(y2) ≤ 0, h(y3) ≤ 0, h(y4) ≤ 0 but h(x1) > 0,

(b) h(y2) ≤ 0, h(y3) ≤ 0, but h(y4) > 0,

(c) h(y2) ≤ 0 but h(y3) > 0,

(d) h(y2) > 0.

16

Page 17: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

Case (a). Assume that for all σ ∈ [0, τ), we have h(y2(σ)) ≤ 0, h(y3(σ)) ≤ 0,and h(y4(σ)) ≤ 0, where

y2(σ) = x0 + σ2f1(x0) ,

y3(σ) = x0 + σ2f1(y2(σ)) ,

y4(σ) = x0 + σf1(y3(σ)) .

Observe that sufficient conditions to guarantee that h(y2(σ)) ≤ 0 and h(y3(σ)) ≤0 can be obtained much like in Theorems 2.2 and 2.3. To guarantee thath(y4(σ)) ≤ 0, we need a result similar to Theorem 2.4, which we state with-out proof.

Theorem 2.5. Consider case (a), and assume that h(y2(σ)) ≤ 0 and h(y3(σ)) ≤0, for all σ ∈ [0, τ ]. Let there be constants δ4 > 0, ρ4 > 0 and η4 > 0, andlet τ > 0 be sufficiently small so that the following conditions hold:

(S1) hTx (y4(σ))f1(y3(σ)) ≥ δ4 , for all σ ∈ [0, τ ] ;

(S2) hTx (y4(σ))Df1(y3(σ))f1(y2(σ)) ≥ −ρ4 , for all σ ∈ [0, τ ] ;

(S3) hTx (y4(σ))Df1(y3(σ))Df1(y3(σ))f1(x0) ≥ −η4 , for all σ ∈ [0, τ ] ;

(S4) δ4 −τ2ρ4 −

τ2

8η4 > 0 .

Then, the function h(y4(σ)) is strictly increasing for σ ∈ [0, τ ].

Under the conditions of Theorem 2.5, y2(σ), y3(σ) and y4(σ) are belowΣ for all σ ∈ [0, τ ] and so the function H(σ) = h(x1(σ)), σ ∈ [0, τ ] is welldefined, where

x1(σ) = x0 + σ[1

6f1(x0) +

1

3f1(y2(σ)) +

1

3f1(y3(σ)) +

1

6f1(y4(σ))] .

Since H(·) is smooth and takes values of opposite signs at 0 and τ , thereis a (first) value, call it η such that h(x1(η)) = 0. Sufficient conditionsguaranteeing that this is the only root of H(·) in [0, τ ] can of course begiven, but it is not strictly necessary that H(·) vanishes at only one point,any zero will do.

Case (b). Assuming that, for all σ ∈ [0, τ ], h(y2(σ)) ≤ 0 and h(y3(σ)) ≤ 0,which we can guarantee much like in Theorems 2.2 and 2.3, then the functiony4(σ) is well defined for all σ ∈ [0, τ ]. Thus, we will look for the unique value

17

Page 18: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

η for which h(y4(η)) = 0. Existence and uniqueness of η can be guaranteedby Theorem 2.5. At this point, we consider the scheme (19) with η replacingτ there. If h(x1(η)) > 0, we are back to case (a), relatively to the interval[0, η] and can thus find a value η ∈ [0, η] such that h(x1(η)) = 0; otherwise ifh(x1(η)) ≤ 0, we continue integrating.

Case (c). Now we need to assume that, for all σ ∈ [0, τ ], h(y2(σ)) ≤ 0,which we can guarantee like in Theorem 2.2. Then, the function y3(σ) is welldefined for all σ ∈ [0, τ ] and we look for the unique value τ1 < τ for whichh(y3(τ1)) = 0, which we can guarantee as in Theorem 2.3. Now, on [0, τ1],also the function y4(σ) is well defined. If h(y4(τ1)) > 0, we are back to case(b), relatively to the stepsize τ1 instead of τ ; otherwise we are back to case(a).

Case (d). Here, we first have to take the step τ1 < τ for which h(y2(τ1)) = 0,which we can do as in Theorem 2.2. So, y3(σ) is well defined for all σ ∈ [0, τ1]and h(y3(τ1)) > 0. Thus we are back to Case (c), relatively to the stepsizeτ1 instead of τ .

Remark 2.6. When implementing the method (19), in fact any of the gen-eral ERK methods, we need to check the position of the stage values and thefinal approximation with respect to the discontinuity surface Σ. Of course,we must always start with the first stage value and proceed (by possibly pro-gressively decreasing the stepsize) to the next stage values and then the finalapproximation.

Remark 2.7. Finally, we observe that in case the discontinuous differentialsystem is stiff, then one sided ERK methods will require a small step size, forstability reasons. On the other hand, an implicit method will require solutionof a nonlinear (algebraic) system, and thus f1 will need to be evaluated atthe iterates arising during solution of such system; in general, these may bevalues above Σ.

3. Numerical Tests

In this section we will apply our scheme to two different examples. Thefirst example is one where f1 extends smoothly from R1 into R2, and usethis example to check accuracy of the computed event point. Our secondexample, instead, is effectively (12) rewritten in autonomous form; in thiscase, the vector field f has only limited smoothness and we will see that thisleads to unavoidable loss of order.

18

Page 19: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

−0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 1.2−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

0.3

x1

x2

Figure 6: Solution with ICs (−0.4,−0.5).

3.1. Example 1.

Consider the discontinuous system from [13], with vector fields

f1(x) =

(

x2

−x1 + 11.2−x2

)

, f2(x) =

(

x2

−x1 −1

0.8+x2

)

.

The discontinuity surface Σ is the line h(x1, x2) = x2−0.2 = 0. A plot of thesolution on the time interval [0, 10] and initial conditions (ICs) (x1(0), x2(0)) =(−0.4,−0.5) is shown in the Figure 6. Another plot of the solution up to Σ,for ICs (x1(0), x2(0)) = (0.4,−0.5), is in Figure 7.

For the two different ICs, we computed (at very high accuracy) the inter-section points and they are

ICs (−0.4,−0.5) → x1 = −0.49889048306999, x2 = 0.2 ,

ICs (0.4,−0.5) → x1 = 0.10921295035161, x2 = 0.2 .

We have used the four one-sided subdiagonal ERK methods considered pre-viously, with step size τ = 0.01, to compute the point where the numericaltrajectory hits Σ. In Tables 1 and 2, we report on the numerical solution atthis event point, for the two different sets of ICs, for these four methods.

The column “Final Time” denotes the time value at which the corre-sponding numerical solution hits the discontinuity surface.

19

Page 20: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

x1

x2

Figure 7: Solution with ICs (0.4,−0.5).

Table 1: ICs (−0.4,−0.5)

Method

x1 x2 Error Ratio Error Final Time

Euler -0.50268467261891 0.2 3.7942E-3 0.5815ERK2 -0.49889786523447 0.2 7.3823E-6 5.14E+2 0.5805ERK3 -0.49889047489584 0.2 8.1742E-9 9.03E+2 0.5803ERK4 -0.49889048306839 0.2 1.5999E-12 5.01E+3 0.5803

Table 2: ICs (0.4,−0.5)

Method

x1 x2 Error Ratio Error Final Time

Euler 0.10440596383147 0.2 4.807E-3 1.3095ERK2 0.10920429334411 0.2 8.657E-6 5.55E+2 1.3074ERK3 0.10921297100861 0.2 2.066E-8 4.19E+2 1.3074ERK4 0.10921295040386 0.2 5.225E-11 3.95E+2 1.3074

20

Page 21: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

The column denoted by “Ratio Error” gives the ratio between the globalerror of the method and the one of the method of previous smaller order.¿From these, we can see that the methods behave consistently with theirexpected order, in that there is a gain of O(τ) accuracy as we increase theorder.

3.2. Example 2.

Now we consider the discontinuous system in (12), rewritten in the formof (1), with f being a Ck function. More precisely, we have

f1(x1, x2) =

(

x1(1 − x2)2k+1

2

1

)

, f2(x1, x2) =

(

01

)

, (20)

and consider initial conditions x1(0) = 0.5 and x2(0) = 0. The discontinuitysurface Σ is now the line h(x1, x2) = x2 − 1 = 0, separating the two regionsR1 = {x : x2 < 1} and R2 = {x : x2 > 1}. The exact solution of thedifferential system at x2 = 1 is given by x1(1) = x1(0) exp( 2

2k+3). Table

3 shows the numerical solution, for k = 0, by means of ERK1 and ERK2methods at the discontinuity point. Here we show the global errors for thesetwo methods (GEERK1 and GEERK2, respectively) obtained by using halvedstepsize. We started with τ = 0.014, in order to avoid to arrive on t = 1by an integer multiple of τ , so that a root finding routine is required. Inthe columns RFERK1 and RFERK2 we show the reduction factors of the twomethods (that is the ratio between the global error obtained by using τ andthe one obtained by using τ/2). Such a behaviour seems to indicate thatERK1 has order 1, while ERK2 does not have order 2. A reduction of theerror similar to the one observed for ERK2 occurs for ERK3 and ERK4. [It isa simple explicit verification to show that the error is behaving as it should,given the form of the exact solution of this problem.]

Next, consider the case k = 3 in (20). In Table 4 we show the globalerrors of the four subdiagonal RK methods considered in this work, at thediscontinuity point t = 1. Quite clearly, all methods display the expectedorder of accuracy.

References

[1] J.-P. Aubin, A. Cellina, Differential Inclusions, Springer-Verlag, Berlin,1984.

21

Page 22: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

Table 3: ERK1 and ERK2 Methods: k = 0 in (20)

τ GEERK1 RFERK1 GEERK2 RFERK2

0.014 2.9235E-3 7.2817E-50.014/2 1.5635E-3 1.87 3.2566E-5 2.230.014/4 7.9718E-4 1.96 1.0172E-5 3.200.014/8 4.0491E-4 1.97 3.0312E-6 3.35

Table 4: ERK1, ERK2, ERK3, ERK4 Methods: k = 3 in (20)

τ GEERK1 RFERK1 GEERK2 RFERK2

0.014 3.800E-3 4.299E-60.014/2 1.900E-3 2.00 1.078E-6 3.990.014/4 9.574E-4 1.98 2.698E-7 3.990.014/8 4.784E-4 2.00 6.750E-8 3.99

τ GEERK3 RFERK3 GEERK4 RFERK4

0.014 5.488E-09 8.207E-110.014/2 7.017E-10 7.82 5.585E-12 14.690.014/4 8.877E-11 7.90 3.598e-13 15.520.014/8 1.116E-11 7.95 2.409E-14 14.93

22

Page 23: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

[2] A. Filippov, Differential Equations with Discontinuous Right-HandSides, Mathematics and Its Applications, Kluwer Academic, Dordrecht,1988.

[3] V. Utkin, Sliding Modes and Their Application in Variable StructureSystems, MIR Publisher, Moskow, 1978.

[4] R. Leine, D. van Campen, B. van de Vrande, Bifurcations in nonlineardiscontinuous systems, Nonlinear Dynamics 23 (2000) 105–164.

[5] M. Najaf, A. Azil, R. Nikoukhah, Implementation of continuous-timedynamics in Scicos, in: V. H. Alexander Verbraeck (Ed.), Proceedings15th European Simulation Symposium, SCS European Council / SCSEurope BVBA, 2003.

[6] M. Najaf, R. Nikoukhah, Modeling and simulation of differential equa-tions in Scicos, Modelica, The Modelica Association September (2006)177–185.

[7] E. Eich-Soellner, C. Fuhrer, Numerical Methods in Multibody Dynam-ics, B.G. Teubner Stuttgart, Germany, 1998.

[8] R. Mannshardt, One-step methods of any order for ordinary differentialequations with discontinuous right-hand sides, Numer. Math. 31 (1978)131–152.

[9] L. Shampine, S. Thompson, Event location for ordinary differentialequations, Computer and Mathematics with Applications 39 (2000) 43–54.

[10] V. Acary, B. Brogliato, Numerical Methods for Nonsmooth DynamicalSystems. Applications in Mechanics and Electronics, Lecture Notes inApplied and Computational Mechanics. Springer-Verlag, Berlin, 2008.

[11] L. Dieci, L. Lopez, Sliding motion in Filippov differential systems: The-oretical results and a computational approach., SIAM J. Numer. Anal.47 (2009) 2023–2051.

[12] N. Guglielmi, E. Hairer, Computing breaking points in implicit delay dif-ferential equations, Advances in Computational Mathematics 29 (2008)229–247.

23

Page 24: Numerical Solution of Discontinuous Differential Systems ...people.math.gatech.edu/~dieci/preps/DieciLopez-Fili4.pdfNumerical Solution of Discontinuous Differential Systems: Approaching

[13] R. Leine, Bifurcations in Discontinuous Mechanical Systems of Fil-ippov’s type, phD thesis, Techn. Univ. Eindhoven, The Netherlands(2000).

24