29
State Event Location in Differential- Algebraic Models TAESHIN PARK and PAUL I. BARTON Massachusetts Institute of Technology, Cambridge, Massachusetts An efficient discontinuity handling algorithm for initial value problems in differential-algebraic equations is presented. The algorithm supports flexible representation of state conditions in propositional logic, and guarantees the location of all state events in strict time order. The algorithm consists of two phases: (1) event detection and (2) consistent event location. In the event detection phase, the entire integration step is searched for the state event by solving the interpolation polynomials for the discontinuity functions generated by the BDF method. An efficient hierarchical polynomial root-finding procedure based upon interval arithmetic guaran- tees detection of the state event even if multiple state condition transitions exist in an integration step, in which case many existing algorithms may fail. As a second phase of the algorithm, a consistent event location calculation is developed that accurately locates the state event detected earlier while completely eliminating incorrect reactivation of the same state event immediately after the consistent initialization calculation that may follow. This numerical phenomenon has not been explained before and is termed discontinuity sticking. Results from various test problems are presented to demonstrate the correctness and efficiency of the algorithm. Categories and Subject Descriptors: I.6.8 [Simulation and Modeling]: Types of Simulation–com- bined; G.1.7 [Numerical Analysis]: Ordinary Differential Equations–initial value problems; multi- step methods; G.1.0 [Numerical Analysis]: General–numerical algorithms; G.1.5 [Numerical Anal- ysis]: Roots of Nonlinear Equations–methods for polynomials; G.1.1 [Numerical Analysis]: Interpolation–interpolation formulas; I.6.2 [Simulation and Modeling]: Simulation Languages General Terms: Algorithms Additional Key Words and Phrases: Combined discrete/continuous simulation, differential algebraic equation, discontinuities, interval arithmetic, state event 1. INTRODUCTION Mathematical models of certain physical systems under transient condi- tions are naturally described by systems of differential-algebraic equations An earlier version of this paper was presented at a session of the Special Topical Conference on Industrial Chemical Technology, AIChE Annual Meeting, St. Louis, MO, 1993. The work of these authors was supported by the Leaders for Manufacturing Program at Massachusetts Institute of Technology and by the National Science Foundation (NSF) under grant CTS 93-21863. Authors’ address: Department of Chemical Engineering, Massachusetts Institute of Technol- ogy, Cambridge, MA 02139. Please direct all correspondence to P. I. Barton. Permission to make digital / hard copy of part or all of this work for personal or classroom use is granted without fee provided that the copies are not made or distributed for profit or commercial advantage, the copyright notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. © 1996 ACM 1049-3301/96/0400 –0137 $03.50 ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996, Pages 137–165.

Event Location in Differential Equations

  • Upload
    lhomssi

  • View
    12

  • Download
    0

Embed Size (px)

DESCRIPTION

Treat the non-smooth behavior when integrating ODEs

Citation preview

Page 1: Event Location in Differential Equations

State Event Location in Differential-Algebraic ModelsTAESHIN PARK and PAUL I. BARTONMassachusetts Institute of Technology, Cambridge, Massachusetts

An efficient discontinuity handling algorithm for initial value problems in differential-algebraicequations is presented. The algorithm supports flexible representation of state conditions inpropositional logic, and guarantees the location of all state events in strict time order. Thealgorithm consists of two phases: (1) event detection and (2) consistent event location. In the eventdetection phase, the entire integration step is searched for the state event by solving theinterpolation polynomials for the discontinuity functions generated by the BDF method. Anefficient hierarchical polynomial root-finding procedure based upon interval arithmetic guaran-tees detection of the state event even if multiple state condition transitions exist in an integrationstep, in which case many existing algorithms may fail. As a second phase of the algorithm, aconsistent event location calculation is developed that accurately locates the state event detectedearlier while completely eliminating incorrect reactivation of the same state event immediatelyafter the consistent initialization calculation that may follow. This numerical phenomenon has notbeen explained before and is termed discontinuity sticking. Results from various test problems arepresented to demonstrate the correctness and efficiency of the algorithm.

Categories and Subject Descriptors: I.6.8 [Simulation and Modeling]: Types of Simulation–com-bined; G.1.7 [Numerical Analysis]: Ordinary Differential Equations–initial value problems; multi-step methods; G.1.0 [Numerical Analysis]: General–numerical algorithms; G.1.5 [Numerical Anal-ysis]: Roots of Nonlinear Equations–methods for polynomials; G.1.1 [Numerical Analysis]:Interpolation–interpolation formulas; I.6.2 [Simulation and Modeling]: Simulation Languages

General Terms: Algorithms

Additional Key Words and Phrases: Combined discrete/continuous simulation, differentialalgebraic equation, discontinuities, interval arithmetic, state event

1. INTRODUCTION

Mathematical models of certain physical systems under transient condi-tions are naturally described by systems of differential-algebraic equations

An earlier version of this paper was presented at a session of the Special Topical Conferenceon Industrial Chemical Technology, AIChE Annual Meeting, St. Louis, MO, 1993.The work of these authors was supported by the Leaders for Manufacturing Program atMassachusetts Institute of Technology and by the National Science Foundation (NSF) under grantCTS 93-21863.Authors’ address: Department of Chemical Engineering, Massachusetts Institute of Technol-ogy, Cambridge, MA 02139. Please direct all correspondence to P. I. Barton.Permission to make digital /hard copy of part or all of this work for personal or classroom useis granted without fee provided that the copies are not made or distributed for profit orcommercial advantage, the copyright notice, the title of the publication, and its date appear,and notice is given that copying is by permission of the ACM, Inc. To copy otherwise, torepublish, to post on servers, or to redistribute to lists, requires prior specific permissionand / or a fee.© 1996 ACM 1049-3301/96/0400–0137 $03.50

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996, Pages 137–165.

Page 2: Event Location in Differential Equations

(DAEs). The advantages of working directly with DAEs and the need tosupport DAEs in modeling environments have been recognized for severalyears [Pantelides et al. 1988; Brenan et al. 1989; Mattsson 1989; Cellierand Elmqvist 1993]. Simulation of these models is complicated by thepresence of discontinuities, which occur in the form of discrete changes tothe functional form of the system of equations.Solution of initial value problems in DAE models containing discontinui-

ties can be formulated as a combined discrete/continuous simulation prob-lem [Cellier 1979; Barton and Pantelides 1994]. Barton and Pantelides[1994] define the mathematical formulation for this problem as a sequenceof initial value problems interspersed by the occurrence of discontinuities(known as events) that may cause some form of discrete change to theinitial value problem currently being solved. As a consequence, the timeinterval of interest [t(0), t( f )) is partitioned into NCD continuous subinter-vals [t(k21), t(k)) k 5 1PNCD. The combined simulation problem cantherefore be defined as:

f ~k!~x ~k!, x ~k!, y ~k!, u ~k!, t! 5 0u ~k! 5 u ~k!~t! J t [ @t ~k21!, t ~k!! k 5 1PNCD (1)

where

f ~k!:Rn~k!

3 Rn~k!

3 Rm~k!

3 R l~k!

3 R ° Rn~k!1m~k!

,

and

x ~k! [ Rn~k!

, x ~k! [ Rn~k!

, y ~k! [ Rm~k!

, u ~k! [ R l~k!

.

The unknowns x and y are usually referred to as the differential andalgebraic variables respectively, and u are the known system inputs. Thefollowing condition is assumed for the purposes of this paper:

Rank@fx~k!~k! fy~k!

~k! # 5 n ~k! 1 m ~k!, t [ @t ~k21!, t ~k!! k 5 1PNCD (2)

This is a sufficient condition for Eq. (1) to have an index [Brenan et al.1989] equal to or less than unity. The initial time t (0) is given, and the endof each sub-interval is marked by the occurrence of an event explicitly (timeor determined events) or implicitly (state or contingent events) during thecourse of a simulation [Nance 1981]. The exact time of occurrence of timeevents is known in advance, so solution of sub-intervals can proceed in astraightforward manner to these events [Ellison 1981]. However, the timeof occurrence of state events is never known in advance because it isdetermined by conditions (known as state conditions) whose value cannotbe known in advance. Instead, the numerical solution of each initial valueproblem must be advanced speculatively until the state condition becomessatisfied. The detection and subsequent location of state events is one of thesubproblems in the solution of the combined simulation problem. Accurate

138 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 3: Event Location in Differential Equations

simulation requires state events to be located precisely and processed instrict time order because the discontinuities resulting from the occurrenceof a state event can radically change the future evolution of the overallsystem behavior.This paper presents a new algorithm for detecting and locating state

events tailored to the needs of simulation with DAE models. The newalgorithm is implemented in conjunction with the BDF (Backward Differ-ence Formula) method [Gear 1971] because it is the most widely usedapproach for the solution of DAEs [Brenan et al. 1989]. However, the basicidea applies to any linear multistep integration method. The next sectiondiscusses the desired properties of a state event location algorithm em-ployed by a general-purpose simulation package. This is followed by areview of existing algorithms, a description of the algorithm, and the paperconcludes with results and discussion.

2. QUALIFICATIONS FOR STATE EVENT LOCATION ALGORITHMS

2.1. Correct Event Detection and Location

A fundamental requirement for state event location algorithms is to guar-antee detection and location of all state events in strict time order. A stateevent is defined as the earliest transition of a state condition in anintegration step. If multiple state condition transitions exist in an integra-tion step, the earliest transition must be detected and its time of occurrencemust be located accurately.

2.2. Representation of State Conditions

Even though simple relational expressions are commonly used to expressstate conditions, a more general form of state conditions is preferred formore flexible problem formulation and wider application. For example,consider the rectifier circuit in Carver [1978]. Depending on the values ofvoltage and current, diode D1, diode D2, or both are conductive. Thecondition for both D1 and D2 to be conductive requires the logical proposi-tion:

~~i1 . 0! ~ ~v1 . v3!! ` ~~i2 . 0! ~ ~v2 . v3!!. (3)

Consider also the steam trap shown in Figure 1 employed to allow only aliquid phase to flow. The steam trap valve is only open if the liquid level His greater than the minimum level HMIN and there is a positive pressuredifference across the valve, which can be expressed as:

~H $ HMIN! ` ~DP $ 0!. (4)

Finally, consider the temperature-composition diagram for a binary systemof partially miscible liquids at constant pressure as shown in Figure 2. Thesystem can exist as a single phase, two phases, or even three phases

State Event Location in Differential-Algebraic Models • 139

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 4: Event Location in Differential Equations

depending upon the temperature and/or total composition. The conditionfor the system to exist as a single vapor phase can be expressed as:

~~T $ TL1Vdew~ZA!! ` ~ZA # Z*A!! ~ ~~T $ TL2V

dew~ZA!! ` ~ZA $ Z*A!!, (5)

where TL1Vdew(ZA), TL2V

dew(ZA) are dew point temperatures for systems L1Vand L2V respectively, ZA is the total mole fraction of a species A, and Z*A isthe total mole fraction of a species A at the eutectic point.The three examples clearly illustrate the need for a more general

formulation of state conditions. Classical propositional logic is well suitedfor the representation of state conditions because it can represent conjunc-tions and/or disjunctions of relational expressions effectively. Note that ingeneral, the function on either side of a relational operator may benonlinear (e.g., the dew point temperatures).

2.3. Discontinuity Locking

The location of state events that lead to discontinuities is equivalent tointegration over discontinuities. If an integration step is attempted across adiscontinuity, this normally results in repeated step failures and a signifi-cant reduction of the integration step [Cellier 1979; Hay and Griffin 1979].One way to avoid this problem is to lock the system of equations for eachsubinterval. During the step, the system of equations cannot change even ifone or more state conditions are satisfied. Instead, the state conditions areexamined at the end of each step, and if any of them are satisfied, the exacttime of occurrence is then located. This approach has been demonstrated tobe both efficient and correct [Cellier 1979], provided that the system ofequations employed before the state event is mathematically well behavedin a small interval following the state event (even if the solution is notphysically meaningful). The main advantage of this approach is that thesolution trajectories are C1 functions over the whole step. This eliminatesthe difficulties of integration over discontinuities, and also provides themeans for efficient interpolation procedures for location of the state event.Discontinuity locking has already been implemented in many algorithms[Carver 1978; Birta et al. 1985; Joglekar and Reklaitis 1985; Pantelides1988].

Fig. 1. Steam trap.

140 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 5: Event Location in Differential Equations

2.4. Discontinuity Sticking and Consistent Event Location

State event location requires the evaluation of state conditions over theentire integration interval. This is typically done by interpolating theunknowns (differential and algebraic variables) required to evaluate stateconditions. After location of the state event, a consistent initializationcalculation is required to restart the integration in the new subinterval.This calculation is usually based on the assumption of continuity of thedifferential variables [Barton and Pantelides 1994]. Given values for thedifferential variables, the new system of DAEs is solved to find consistentinitial values for the algebraic variables and the time derivatives of thedifferential variables. If the state event does not occur at mesh points andit has been located by interpolation, the converged initialization calculationmay indicate that the state event detected has actually not quite beentriggered. This situation occurs because the BDF method [Gear 1971]provides no guarantees for the consistency of differential and algebraicvariables between mesh points although it ensures that the values of thealgebraic variables, differential variables, and their time derivatives areconsistent at mesh points (within the convergence tolerance of the correctoriteration).Figure 3 illustrates this numerical phenomenon. The state event result-

ing from a state condition:

g~x, y, t! . 0 (6)

is detected in the integration step [tk, tk11]. The state event time, t*, can

Fig. 2. VLLE diagram of binary partially miscible system.

State Event Location in Differential-Algebraic Models • 141

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 6: Event Location in Differential Equations

be determined by solving:

g~xp~t*!, yp~t*!, t*! 5 a, (7)

where xp(t), yp(t) are interpolation formulae (usually polynomials in t) fordifferential and algebraic variables respectively provided by the BDFmethod. The small positive constant a is an error band employed to ensurethat g(xp(t*), yp(t*), t*) . 0 at t* found by a root-finding procedure [Hayand Griffin 1979; Birta et al. 1985]. A consistent initialization calculationwith the assumption of x(t*) 5 xp(t*) is then performed at t* to findconsistent values for algebraic variables y(t*) which are different fromy p(t*) if t* is not a mesh point:

yp~t*! Þ y~t*! if t* Þ tk , tk11 . (8)

Consequently, at the computed state event time, t*:

g~xp~t*!, yp~t*!, t*! Þ g~xp~t*!, y~t*!, t*!. (9)

Contrary to what one might expect, the value of the state condition can beless than zero after the initialization calculation ( g(x(t*), y(t*), t*) , 0)as shown in Figure 3. If this is the case, then the same state event isdetected again immediately in the new subinterval. We term this numericalphenomenon discontinuity sticking. Our experience with several DAE-based simulators indicates that discontinuity sticking is not a rare phenom-enon; it frequently causes computational inefficiency and sometimes unnec-essary simulation failures. However, this problem and its causes have notbeen recognized in the design of existing algorithms. The algorithm de-scribed in this paper eliminates discontinuity sticking completely.

Fig. 3. Illustration of discontinuity sticking.

142 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 7: Event Location in Differential Equations

Discontinuity sticking is an inherent problem in the simulation of DAE-based models. However, the same phenomenon may occur during thesolution of initial value problems in ordinary differential equations (ODEs)even though it is not observed in general because a consistent initializationcalculation is unnecessary after the location of a discontinuity in thesimulation of ODE-based models. For example, consider the solution of theODEs (Eq. (10a)) with a state condition (Eq. (10b)):

x 5 f~x, t!, x~0! 5 x0 (10a)

g~x, t! . 0 (10b)

The interpolation formula for g(x, t) is required to detect and locate thestate event. One approach to construct this interpolation formula using anODE solver is to integrate the following system of augmented ODEs[Carver 1978]:

x 5 f~x, t!, x~0! 5 x0

(10)

z 5 g~x, x, t!, z0 5 g~x0 , 0!,

where z is an additional differentiable variable introduced for g(x, t).Suppose that the state condition is satisfied in the integration step [tk,tk11], then the state event time t* can be found by solving:

zp~t*! 5 a, (11)

where zp(t) is an interpolation formula for g(x, t) provided by the integra-tion routine. An appropriate set of initial conditions for x and z to restartintegration following the state event is {x p(t*), g(x p(t*), t*)} rather than{x p(t*), zp(t*)}. However, zp(t*) Þ g(x p(t*), t*) even though z(0) 5g(x(0), 0). Therefore, simulation of Eq. (11) can lead to discontinuitysticking problems.

3. REVIEW OF EXISTING ALGORITHMS

Most modern approaches to state event location employ the discontinuitylocking mechanism and discontinuity functions. The system of discontinu-ity functions (or variables) z(t) 5 g(x, x, y, u, t) is constructed from therelational expressions in the pending state conditions (expressed in generalas logical propositions) so that one of their zeros correspond to the stateevent time. A major difference amongst the various algorithms reported inthe literature is the manner in which the interpolation formulae fordiscontinuity functions zp(t) are generated and the state event time islocated in the integration interval [tk, tk11].

State Event Location in Differential-Algebraic Models • 143

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 8: Event Location in Differential Equations

Carver [1978] constructs zp(t) from an auxiliary system of differentialequations (obtained from differentiation of the discontinuity functions withrespect to time) appended to the original system of ODEs, and integratingthe augmented system of ODEs. The signs of zp(tk), zp(tk11), zp(tk),zp(tk11) are employed to detect state events and, if detected, the stateevent time is located by solving one of the zp(t) 5 0 detected to cross zero.Hay and Griffin [1979], Ellison [1981], Joglekar and Reklaitis [1984], and

Preston and Berzins [1991] detect the state event by checking the signs ofz(tk) and z(tk11). Hay and Griffin [1979] locate the state event time bysuccessive integration with reduced step size combined with linear andquadratic interpolation. Ellison [1981] proposes a location algorithm basedon Hermite interpolation. Joglekar and Reklaitis [1984] restrict themselvesto linear discontinuity functions, construct zp(t) from x p(t) and y p(t), andlocate the state event time by solving one of zp(t) 5 0 using a Newtoniteration scheme. Preston and Berzins [1991] propose a location algorithmspecific to a particular class of problems, which basically marches up to thediscontinuity with successive integration combined with several interpola-tion formulas.Birta et al. [1985] approximate z(t) by cubic polynomials, tabulate the

various possible configurations of a cubic polynomial to detect a stateevent, and locate the state event by Regula-Falsi and Newton iterationschemes.Shampine et al. [1987] also consider linear discontinuity functions of the

form, g 5 x(t) 1 b or x(t), where b is a constant, and construct zp(t)algebraically from xp(t). A Sturm sequence is generated to determine thenumber of zeroes for zp(t) 5 0, and the state event time is located using abisection algorithm and the Sturm sequence.Rather than employing discontinuity functions, Pantelides [1988] uses

the state conditions directly. The state event is detected by comparing thelogical values of state conditions at tk and tk11, and if detected, the time ofoccurrence is located by a bisection algorithm with interpolation formulasx p(t) and y p(t).Although the use of discontinuity functions has been the most common

method for handling state events, Gear and Østerby [1984] deal with theproblem in a direct manner by examining the behavior of the local trunca-tion error and its estimate in the region of the discontinuity.None of the existing algorithms satisfy all the requirements for a state

event location algorithm outlined in the previous section. First, onlyShampine et al. [1987] can guarantee the location of the earliest statecondition transition when there are multiple state condition transitionscaused by the multiple zero crossings of a discontinuity function in anintegration step. Second, state conditions in classical propositional logic arenot supported in most algorithms except Pantelides [1988]. Finally, thereare no provisions for the discontinuity sticking problem in DAE-basedalgorithms [Joglekar and Reklaitis 1984; Pantelides 1988; Preston andBerzins 1991].

144 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 9: Event Location in Differential Equations

4. STATE EVENT LOCATION ALGORITHM

A new algorithm for the detection and location of state events in simulationof DAE models is presented. The algorithm supports flexible representationof state conditions in classical propositional logic, and all state events areguaranteed to be detected and processed in strict time order. The algorithmconsists of two phases: (1) event detection, and (2) consistent event loca-tion. These are presented in the subsections.

4.1. Representation of State Conditions

As discussed in Section 2.2, state conditions are represented by logicalpropositions that contain members of a complete set of connectives (e.g.,{NOT, AND, OR}) and a set of atomic propositions (relational expressions),which can be expressed in Backus Normal Form as:

^Rel Exp&<5^Exp&^Rel Op&^Exp&, (13)

where a valid ^Rel Op& is one out of {., ,, $, #} and ^Exp& is any valid realexpression. Therefore, the state condition can be represented as:

L~t! 5 P~r~x, x, y, y, u, t!!, (14)

where P is a logical proposition between a set of relational expressions r,and L is the corresponding Boolean function. A set of relational expressionscan also be rearranged as:

g~x, x, y, y, u, t! $ 0 (15a)

z~t! 5 g~x, x, y, y, u, t!, (15b)

where g is a set of discontinuity functions and z are the correspondingdiscontinuity variables.

4.2. Event Detection Phase

The event detection phase determines whether or not any Boolean statecondition Li, i 5 1PNSC changes its value within the current integrationinterval [tk, tk11] and, if it does, finds the limiting state condition L* thatchanges its value first, and therefore triggers the state event. The limitingstate condition L* is defined along with the state event time t*d as follows:

L* 5 $Li:g~Li , t*d! 5 1, 1 # i # NSC% (16a)

t*d 5 mint

$t:g~Li , t! 5 1, 1 # i # NSC, tk # t # tk11% (16b)

(17)

where g [ {0, 1} is a function defined for a Boolean function L as:

g~L, t! 5 H1 if L changes its value at t0 otherwise.

State Event Location in Differential-Algebraic Models • 145

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 10: Event Location in Differential Equations

The transition of a state condition L can be determined by monitoringvalues of its constituent relational expressions. Each relational expressionchanges its value whenever its corresponding discontinuity function crosseszero. Therefore, an event detection algorithm requires finding zero cross-ings of the discontinuity functions, and determination of t*d and L* at thesezero crossings. Figure 4 shows the event detection algorithm. The limitingdiscontinuity function g* is one of the discontinuity functions in L*, andone of its zero crossings actually determines t*d and L*. Note that the stateevent time t*d found in this phase is only an initial guess for the consistentevent location phase, in which the consistent state event time t*l will becalculated. The detection algorithm can be made more efficient by firstfinding the earliest zero crossing of each discontinuity function and check-ing whether the state condition changes at these zero crossings. However,it is very rare for a discontinuity function to have multiple zero crossings inan integration interval.In general, there can be more than one L* and g* in an integration step.

However, it is assumed that they will be isolated relative to machineaccuracy. Furthermore, the root-finding procedure based on interval arith-metic is able to separate multiple instances of L* and g* to within machineaccuracy.

Fig. 4. Event detection algorithm.

146 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 11: Event Location in Differential Equations

The performance of the event detection algorithm depends on findingzero crossings of the discontinuity functions, which is based on the interpo-lation formulae for the discontinuity functions zp(t). Therefore, the degreeof approximation of zp(t) to z(t) is critical for the performance of the eventdetection algorithm (as will be demonstrated later). Construction of zp(t)will be discussed next followed by a rigorous and efficient algorithm to findzero crossings of zp(t).

4.2.1. Interpolation Formulas for Discontinuity Functions

The BDF method provides interpolation polynomials xp(t) and yp(t) fordifferential and algebraic variables respectively for each integration inter-val [tk, tk11]. Errors in xp(t) and yp(t) are controlled even though xp(t)and yp(t) do not automatically satisfy algebraic relations of the DAEsbetween mesh points. Interpolation polynomials zp(t) for the discontinuityfunctions should be constructed that are as accurate as xp(t) and yp(t).Also, this should be computationally efficient because the construction ofzp(t) is required at every integration step. This can be achieved byappending a set of discontinuity functions (Eq. (15b)) to the original set ofDAEs (Eq. (1)) and integrating an augmented system of equations of theform:

f~x, x, y, u, t! 5 0u 5 u~t!

z~t! 5 g~x, x, y, y, u, t!(18)

Note that it is not necessary to differentiate the discontinuity functions[Carver 1978]. Then, the BDF method automatically provides zp(t) that areas accurate as xp(t) and yp(t) at each integration step because the meshpoints are chosen considering all the equations including the discontinuityfunctions. This approach increases the system of equations to be integratedby the number of discontinuity functions. However, the dominant cost ofintegrating a system of DAEs is that of computing and factoring aniteration matrix [Brenan et al. 1989]. Figure 5 shows the incidence form ofthe iteration matrix for the augmented system of equations, and clearly thesize of the matrix that should be factored does not change by adding theadditional equations because z(t) only appear in z(t) 5 g(x, x, y, y, u, t).Therefore, the computational cost increase per integration step related toappending the discontinuity functions is insignificant. However, integra-tion of the augmented system (Eq. (18)) may require more integration stepsthan that of the original system (Eq. (1)) because the functional properties

Fig. 5. Iteration matrix of the augmented system of equations.

State Event Location in Differential-Algebraic Models • 147

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 12: Event Location in Differential Equations

of the discontinuity functions (Eq. (15b)) may limit the step size of theaugmented system.If the discontinuity functions involve the time derivatives of the algebraic

variables y, the index of the augmented system is raised to 2. Hence, in thiscase, the augmented system should be integrated by an algorithm appropri-ate for an index 2 problem in the semi-explicit form [Gritsis et al. 1988;Brenan et al. 1989].

4.2.2. Zero Crossings of Discontinuity Functions

Zero crossings of each discontinuity function can be found by solving aninterpolation polynomial zp(t) in [tk, tk11]. The interpolation polynomialprovided by the BDF method takes the form:

zijp~t! 5 O

n50

q hnextn zij

~n!~tk11!

n! S t 2 tk11

hnextD n

, (19)

where hnext is the next suggested step length and q is the current order ofintegration. The introduction of scaled time s bounded by 0 and 1 in thecurrent integration interval [tk, tk11] simplifies the numerical computationinvolved with the root-finding procedure. The polynomial (Eq. (19)) rescaledby the current step length h is:

zijp~s! 5 O

n50

q ~21!nhnzij~n!~tk11!

n!sn 5 O

n50

q

Cnsn, (20)

where s 5 (tk11 2 t)/h. Thus, we need to find roots of zijp (s) 5 0 in [0, 1].

Interval arithmetic [Neumaier 1990] is applied for rigorous root-finding.The root-finding procedure consists of two steps: (1) a root exclusion test,and (2) Newton’s method with recursive interval bisection [Moore 1979].The exclusion test identifies most of the polynomials that have no roots in[0, 1]. The exclusion test is based on the enclosure of zi j

p (s), which containsthe range of values of zij

p (s) in [0, 1]. There are no roots of zijp (s) 5 0 in [0, 1]

if zero is not contained in this enclosure. Even though there are a variety ofways to evaluate an enclosure of a real function with interval arithmetic,depending on the quality of the enclosure and computational costs [Neu-maier 1990], we employed the most efficient way to evaluate an enclosureof a polynomial as shown in Eq. (21):

z ijp~@0,1#! :5On50

q

Cn@0, 1#n 5 On50

q

Cn@0, 1#, (21)

where zijp ([0, 1]) is an enclosure of a polynomial zij

p (s) in the range of [0, 1].Note that the evaluation of zij

p ([0, 1]) requires only q additions. Further-more, as will be demonstrated later, the exclusion test is extremely

148 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 13: Event Location in Differential Equations

successful because it can identify most of the polynomials that have noroots in [0, 1]. The use of this exclusion test greatly enhances the overallefficiency of the root-finding procedure because it is expected that therewill be no roots at all in most integration steps.Due to the nature of the exclusion test, a polynomial not eliminated by

this test may or may not have roots in [0, 1]. Newton’s method withrecursive interval bisection determines whether or not this polynomial hasroots in [0, 1], and finds its roots if it does. The intervals that enclose theroots are searched by existence and nonexistence tests with recursiveinterval bisection. Once this interval is found, the root can be determinedby Newton iteration method. Existence and nonexistence tests are based onthe Krawcyk operator [Moore 1977]:

K~s! :5m~s! 2zijp~m~s!!

m~z ijp~s!!1 S1 2

z ijp~s!

m~z ijp~s!!D ~s 2 m~s!!, (22)

where s is an interval of scaled time s, zijp(s) is an interval extension of zij

p(s),and m( ) is a midpoint operator to an interval. If K(s) ù s 5 B, then zij

p(s)contains no zero in s (nonexistence test). On the other hand, if K(s) # int(s),then zij

p(s) contains a unique zero in s (existence test), which can be found by asimplified Newton method (Eq. (23)) from any initial guess in s:

s ~k11! :5s ~k! 2 zij

p~s ~k!!

m~z ijp~s!!. (23)

If K(s) ù s Þ B and K(s) ÷ int(s) where int(s) is interior of an interval s,then the interval s is bisected and the existence and nonexistence tests areapplied to the bisected intervals recursively. Note that the Krawcyk opera-tor and the Hansen operator [Hansen et al. 1981] give the same existenceand nonexistence tests for a single equation.While the nonexistence test excludes an interval that has no zeros, the

existence test identifies an interval enclosing a unique zero. There is a case inwhich the existence test fails. The existence test cannot identify an intervalenclosing a zero of multiplicity greater than one because an interval extensionof the Jacobian of the polynomial is not regular [Neumaier 1990]. In otherwords, the root-finding procedure can only find simple zeros of the polynomial.However, this limitation does not cause problems in this particular applicationbecause it is extremely rare that the polynomial produced by the BDF methodhas a zero of multiplicity greater than one.

4.3. Consistent Event Location Phase

The second phase of the algorithm is consistent event location, whichdetermines the consistent state event time t*l at which consistency betweenthe differential and algebraic variables is retained, and consequentlyeliminates discontinuity sticking problems. The consistent event location

State Event Location in Differential-Algebraic Models • 149

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 14: Event Location in Differential Equations

problem can be formulated as a system of nonlinear equations:

f~x, x, y, u, t*l ! 5 0 (24a)

u 5 u~t*l ! (24b)

x 5 xp~t*l ! (24c)

g*~x, x, y, u, t*l ! 5 6«g , (24d)

where «g (which will be called the discontinuity tolerance) is a smallpositive tolerance. The sign on «g is determined by the direction of the zerocrossing of g*. An extra equation (24d) is introduced to determine theadditional unknown t*l. Note that the discontinuity function g* does notinvolve the time derivative of the algebraic variables y in this formulation.A Newton iteration requires only from zero to two iterations to solve thissystem of equations because extremely good initial guesses for the un-knowns are available from the detection phase. An alternative formulationof the consistent event location problem is:

f~x, x, y, u, t*l! 5 0 (25a)

u 5 u~t*l! (25b)

x 5a0x

~t*l 2 tk!1 O

i51

qa ix~tk112i!

~t*l 2 tk!(25c)

y 5a0y

~t*l 2 tk!1 O

i51

qa iy~tk112i!

~t*l 2 tk!(25d)

g*~x, x, y, y, u, t*l! 5 6«g , (25e)

where ai, i 5 0Pq, are coefficients of the BDF method. Equation (25) iseffectively a corrector iteration of the BDF method with an unknown stepsize t*l 2 tk. The step size or the consistent event time t*l is simultaneouslydetermined with other unknowns. Equations (25b), (25c), and (25d) can beused to eliminate u, x, and y from Eqs. (25a) and (25e), and the augmentedJacobian matrix of the reduced system of equations is:

J 5 3­f

­x1

­f

­x

­x

­x

­f

­y

­f

­t1

­f

­x

­x

­t1

­f

­u

­u

­t

­g

­x1

­g*

­x

­x

­x

­g*

­y1

­g*

­y

­y

­y

­g*

­t1

­g*

­x

­x

­t1

­g*

­y

­y

­t1

­g*

­u

­u

­t4. (26)

150 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 15: Event Location in Differential Equations

It is unnecessary to evaluate and factor the whole Jacobian matrix J. Theleading principal submatrix Jn1m of order n 1 m of J is equivalent to theJacobian matrix Jc of the corrector iteration of the BDF method, andJn1m(t), t [ [tk, tk11], can be approximated effectively by Jc(tk11), theJacobian matrix used in the corrector iteration at tk11, which is alreadyavailable in a factored form. We only need to evaluate the last column androw of J and to perform elimination operations on the last column and rowof J in order to factor the Jacobian matrix J. Therefore, solution of Eq. (25)requires less computational effort compared to Eq. (24).This additional calculation should determine the consistent state event

time t*l as close as possible to the true event time t*a, at which the zerocrossing actually occurs, while eliminating discontinuity sticking problems.This objective can be accomplished by selecting the discontinuity tolerance«g correctly as shown in Figure 6. The discontinuity tolerance is deter-mined from state event tolerance d and the slope of the discontinuityfunction g* as follows:

«g :51

2u g* ud

(27)«g [ @«g

min, «gmax#.

The discontinuity function g* is assumed to be linear in the small interval[t*a, t*a 1 d]. Note that the discontinuity tolerance is bounded by «g

min and «gmax.

While the upper bound «gmax is necessary to prevent the value of g* at t*l from

being too far from zero, the lower bound «gmin is necessary to prevent the

discontinuity sticking problem. Even though «gmax can be assigned by the user,

Fig. 6. Selection of discontinuity tolerance «g.

State Event Location in Differential-Algebraic Models • 151

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 16: Event Location in Differential Equations

«gmin is determined as follows:

«gmin :52«, (28)

where « is the numerical tolerance of the equation solver employed in theconsistent event location calculation and initialization calculation. Thisrelationship is necessary because the consistent state event time t*l can beconverged to any value in the interval shown in Figure 6 and the initializa-tion calculation is performed at this converged event time. In summary,consistent event location determines the consistent state event time t*l,which is guaranteed to be within the bound specified in Eq. (29) whileeliminating the discontinuity sticking problem completely with minimalcomputational cost.

t*l [ @t*a , t*a 1 d# if1

2u g* u d $ «g

min

(29)

t*l [ @t*a , t*a 1 D# if1

2u g* u d # «g

min where D $ d

After the consistent event location phase, it is necessary to checkwhether there exists any other state condition L** such that g(L**, t*l) 51, where L** Þ L*. This can be done efficiently using the convergedresults from the consistent event location calculation (basically repetitionof the event detection phase). If there exists such L**, then the consistentevent location problem (Eq. (25)) is solved again using a new limitingdiscontinuity function g**, which is one of discontinuity functions in L**.A finite number of state conditions ensures termination of this algorithm infinite time. However, this phenomenon is very rare, as will be demon-strated later.

5. RESULTS AND DISCUSSION

The proposed algorithm has been implemented in the combined discrete/continuous modeling environment ABACUSS1 and is applied to a series oftest problems from the literature [Carver 1978; Birta et al. 1985] and somechemical engineering problems to demonstrate its correctness and effi-ciency. We have also implemented and tested the bisection algorithm[Pantelides 1988]. The latter algorithm is valuable by way of comparisonbecause it is currently employed by widely used DAE-based simulators(e.g., SpeedUp [AspenTech 1993] and gPROMS [Barton and Pantelides1993]), and, if events are located correctly, represents the minimal compu-tational cost associated with state event handling.

1ABACUSS (Advanced Batch and Continuous Unsteady-State Simulator) process modelingsoftware, a derivative work of gPROMS software, © 1992 by Imperial College of Science,Technology, and Medicine.

152 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 17: Event Location in Differential Equations

Table VI shows an overview of the problems tested with respect toproblem size and computational measures. Regarding representation ofstate conditions, one literature problem (Example 3 of Carver [1978]) andall the chemical engineering problems require state conditions expressed interms of logical propositions rather than simple relational expressions.

5.1. Event Detection

Some of the earlier algorithms frequently fail to detect and locate the stateevent when there are multiple state condition transitions in an integrationstep. There can be two situations in which the state condition experiencesmultiple transitions. The first case is when one of its constituent discontinuityfunctions has multiple zero crossings in the integration step. For example, thestate condition in Eq. (4) will change its value two times if H 2 HMIN 5 0 hastwo roots and DP $ 0 in the integration interval. It is critical to find the firstroot of H 2 HMIN 5 0 in this case. Even though this potential problem hasbeen recognized [Carver 1978; Birta et al. 1985; Shampine et al. 1987], onlythe Sturm sequence algorithm of Shampine et al. [1987] and our algorithmguarantee the detection of the state event in such a case. However, although itis possible to create simple example problems that have multiple zero cross-ings in an integration step, in our experience this phenomenon is extremelyrare in the large-scale problems typically encountered in engineering applica-tions. This is because it is extremely unlikely for a linear multi-step integra-tion method to generate an integration step with a stationary point in itsinterpolation polynomials.On the other hand, a state condition expressed as a logical proposition

containing a conjunction can frequently experience multiple transitions inan integration step even if its constituent discontinuity functions cross zeroonly once [Angulo and Torkzadeh 1988]. The bisection algorithm fails todetect and locate the earliest transition in this case. For example, considerthe circuit example [Carver 1993; Birta et al. 1985]. Figures 7 and 8 showsolution profiles produced by the bisection algorithm and our algorithmrespectively. There are 10 state events in this problem [Birta et al. 1985] ascan be seen in Figure 8. However, the bisection algorithm detected only thefirst state event, which results in completely incorrect solution profiles ascan be seen in Figure 7. The bisection algorithm failed to detect nine stateevents because it detects a state event by checking the transition of a statecondition only at mesh points. For example, consider the failure to detectthe second state event. The state condition that triggers the second stateevent is:

~~i2 $ 0! ~ ~v2 $ v3!! ` ~~i1 5 0! ~ ~v1 # v3!! (30)

and the discontinuity function that actually triggers the state event is i1 502 [Birta et al. 1985]. Table I shows integration steps taken by the bisection

2Note that i1 5 0 is formulated as ABS(i1) # Tol in ABACUSS, where Tol is a smallnumerical tolerance.

State Event Location in Differential-Algebraic Models • 153

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 18: Event Location in Differential Equations

algorithm around the second state event. It is clear that the state conditionof Eq. (30) is satisfied in the interval [0.0066444, 0.0066974] even though itis not at the mesh points. In this case, the time period in which the statecondition is satisfied is completely enclosed by the integration step, and thebisection algorithm failed to detect the event because the state condition

Fig. 7. Solution of Example 3 [Carver 1978] by the bisection algorithm.

154 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 19: Event Location in Differential Equations

does not change its value at the mesh points. The bisection algorithm failedto detect the remaining eight state events for the same reason. The sameerror has also been observed in the Weir simulation problem.In general, any algorithm that detects a state event by monitoring the

transition of the state condition only at mesh points fails to detect andlocate the state event when the state condition experiences multiple

Fig. 8. Solution of Example 3 [Carver 1978] by the new algorithm.

State Event Location in Differential-Algebraic Models • 155

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 20: Event Location in Differential Equations

transitions in the integration step. To be more specific, it fails to detect thestate event when the state condition changes its value an even number oftimes, and it does not guarantee location of the earliest transition when thestate condition changes its value an odd (greater than one) number oftimes.Unlike the bisection algorithm, our detection algorithm detected and

located all the state events correctly. In fact, our algorithm guarantees thedetection and location of the state event even if the state conditionexperiences multiple transitions in the integration step because our algo-rithm rigorously searches for the state event in the whole integration stepusing interval arithmetic.

5.2. Interpolation Formulas for Discontinuity Functions

The detection and location phases of most algorithms rely on the interpola-tion formulas for the discontinuity functions zp(t). However, the impor-tance of the accuracy of zp(t) has often been overlooked. In fact, interpola-tion formula zp(t) that are accurate over the entire integration step areessential to detect and locate the state event correctly [Shampine 1987].For example, consider Example 1 of Carver [1978], consisting of onedifferential equation:

x 5 H x2,0, sin~4pt! . 0sin~4pt! # 0

x~0! 5 0.1, t [ @0, 0.9#. (31)

There are three state events, which occur at t 5 0.25, 0.5, 0.75 accordingto the analytical solution. Figures 9 and 10 show the solutions obtained bythe bisection algorithm and our algorithm respectively. Table II shows theintegration steps taken by the bisection algorithm. Clearly, the bisectionalgorithm skips over the last two events, whose time of occurrences arecompletely enclosed in the last integration step. This happens because theintegration steps taken by the bisection algorithm are far from beingappropriate to provide accurate approximation for the discontinuity func-tion sin(4pt) by linear interpolation. In general, any algorithm will fail todetect the state events if it takes integration steps inappropriate for thediscontinuity function sin(4pt) and constructs the interpolation formulausing the data of sin(4pt) at mesh points.

Table I. Integration steps taken by the bisection algorithm for Example 3 [Carver 1978].

156 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 21: Event Location in Differential Equations

This example illustrates that interpolation formulas zp(t) that are accu-rate over the entire integration step are critical to detect and locate thestate event correctly. Our algorithm guarantees the construction of zp(t) asaccurate as xp(t) and yp(t) by forcing the BDF method to select theintegration step sizes appropriate to z(t), x(t), and y(t).

Fig. 10. Solution of Example 1 [Carver 1978] by the new algorithm.

Fig. 9. Solution of Example 1 [Carver 1978] by the bisection algorithm.

State Event Location in Differential-Algebraic Models • 157

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 22: Event Location in Differential Equations

5.3. Discontinuity Sticking Problem

Table III shows the number of discontinuity stickings for three of the testproblems. Note that the bisection algorithm suffers from a number ofdiscontinuity stickings. Figure 11 is a portion of the ABACUSS outputscript for the PilotPlant simulation problem, which shows one instance ofdiscontinuity sticking. On the other hand, the consistent event locationcalculation completely eliminates discontinuity stickings. Table IV listssatisfactory values of numerical tolerances used in the consistent eventlocation calculation.Regarding the activation of a different state condition after the consis-

tent event location, it does not occur in any of the problems tested.

5.4. Computational Efficiency

Computational efficiency of the algorithm can be evaluated by consideringthe computational costs associated with three calculations: root-finding,consistent event location, and integration of the augmented system ofDAEs. Each subject will be discussed.As shown in Table V, it is necessary to solve a large number of

polynomials during the simulation experiment. Note that the polynomialshave no roots at all in most cases (99.85%). Therefore, it is important toexclude those polynomials as efficiently as possible. Table V shows perfor-mance of the exclusion test we employed, and it excluded 99.96% ofpolynomials that have no roots.Recursive interval bisection with existence and nonexistence tests re-

quires a series of evaluations of the Krawcyk operator. Even thoughinterval arithmetic generally requires more computational effort than realarithmetic, evaluation of the Krawcyk operator requires only one intervalextension of the Jacobian of a polynomial and one polynomial evaluation,which are efficiently computed by the Horner scheme. Regardless of thecomputational cost related with evaluating the Krawcyk operator, theoverall efficiency of the root-finding procedure is dominated by the effi-ciency of the exclusion test because most polynomials have no roots at all.Comparing our root-finding algorithm with the Sturm sequence algo-

rithm of Shampine et al. [1987] that can be used as an exact exclusion test,

Table II. Integration steps taken by the bisection algorithm for Example 1 [Carver 1978].

158 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 23: Event Location in Differential Equations

both algorithms guarantee that all roots in an integration interval will befound. However, the latter is computationally expensive. In order to per-form an exclusion test by Sturm sequence for a qth order polynomial, it isnecessary to construct a Sturm sequence, which requires (q 1 1)(q 2 2)/ 2multiplications, and to evaluate 2q polynomials, while our exclusion testrequires only q additions.Additional computational effort required for the consistent event location

calculation is insignificant because it converges within zero to two itera-tions due to extremely good initial guesses for the unknowns, and it isunnecessary to evaluate and factor the whole Jacobian matrix for thiscalculation. Furthermore, consistent event location completely eliminatesdiscontinuity stickings that cause computational inefficiency primarily dueto additional Jacobian factorizations in the unnecessary consistent initial-ization calculations and unnecessary restarts of the numerical integration.

Fig. 11. ABACUSS output script of PilotPlant simulation problem solved by the bisectionalgorithm.

Table III. Number of discontinuity stickings.

Table IV. Numerical tolerances for consistent event location.

State Event Location in Differential-Algebraic Models • 159

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 24: Event Location in Differential Equations

Table VI shows the effect on computational cost of appending thediscontinuity functions to the system of DAEs and integrating the aug-mented system. Compared with the bisection algorithm, our algorithmrequired more integration steps for the problems tested except the Batch-Distillation problem. Note that our algorithm required less integrationsteps for the BatchDistillation problem, which has numerous discontinuitystickings, because it eliminated the unnecessary integration restarts com-pletely. However, the issue of computational efficiency is irrelevant becausethe bisection algorithm fails, as demonstrated earlier, whereas our algo-rithm detected and located all the state events correctly. For the purposesof experimentation, we tested our algorithm without inserting the disconti-nuity functions in the error control mechanism. Therefore, the accuracy ofthe interpolation polynomials for the discontinuity functions is not guaran-teed. Table VI shows the result. In terms of computational cost, thisapproach compares very favorably with the bisection algorithm. However,it also fails for the same reason on two problems. Hence, it is notrecommended.

6. CONCLUSIONS

Mathematical models of physical systems frequently contain discontinui-ties [Grossman et al. 1993] and accurate simulation of these modelsrequires exact location of these discontinuities or state events. An inte-grated state event location algorithm for initial value problems in differen-tial-algebraic equations has been presented. The algorithm is designed tobe used in modern general-purpose simulation tools, it supports flexible

Table V. Performance of exclusion test.

160 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 25: Event Location in Differential Equations

TableVI.

Com

parisonofcompu

tational

cost

associated

withintegration.

State Event Location in Differential-Algebraic Models • 161

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 26: Event Location in Differential Equations

representation of state conditions using propositional logic, and guaranteesthe efficient location of all state events in strict time order.The state event location algorithm consists of two phases: (1) event

detection, and (2) consistent event location. The event detection identifiesthe state condition and its constituent discontinuity function that triggersthe state event. Interpolation polynomials for the discontinuity functionsare solved directly to find the earliest transition of the state condition inthe integration interval. The polynomials are solved by a hierarchicalroot-finding procedure based on interval arithmetic, which consists of anexclusion test and Newton’s method with recursive interval bisection.Interpolation polynomials as accurate as those of model variables aregenerated automatically by the BDF method. A consistent event locationcalculation is developed to locate the time occurrence of the state eventdetected earlier accurately while completely eliminating discontinuitysticking, which is a term coined to describe the numerical phenomenon ofincorrect reactivation of the same state event immediately after the initial-ization calculation that will follow.Results from various test problems have been presented to demonstrate the

guaranteed performance of the algorithm. The event detection phase detectedall state events correctly even if the state condition experiences multipletransitions in an integration step. The overall efficiency of the event detectionphase is enhanced by the extremely efficient exclusion test employed to fullyexploit the fact that there are no roots at all in most integration steps.Consistent event location determines the state event time accurately andeliminates all discontinuity sticking with minimal computational cost.

NOMENCLATURE

Cn coefficient of nth order term in a scaled polynomialf (k) vector of differential-algebraic equations for kth subintervalg vector of discontinuity functionsg* limiting discontinuity function that triggers the state eventgij jth discontinuity function in ith state conditionh current step length

hnext next suggested step lengthH liquid level in a steam trap

HMIN minimum liquid level for a liquid phase to flow in a steamtrap

J Jacobian matrix for the consistent event location calculationJc Jacobian matrix for the corrector iteration of the BDF

methodJn1m leading principal submatrix of order n1m of JK(s) Krawcyk operator for an interval Sl (k) dimension of a vector u(k)

L Boolean function representing a state conditionL* limiting state condition that triggers the state eventLi ith state condition in the current subinterval

162 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 27: Event Location in Differential Equations

m( ) midpoint operator for an intervalm (k) dimension of a vector y(k)

n (k) dimension of a vector x(k)

Ni number of discontinuity functions in ith state conditionNsc number of state conditions in the current subinterval

NCD number of continuous subintervalsP logical proposition representing a state conditionq current order of integrationr vector of relational expressionsS scaled timeS interval of St timet* state event timet*a true state event timet*d state event time determined at the event detection phaset*l consistent state event time determined at the consistent

event location phaset (k) beginning and/or end of subintervals

tk, tk11 integration mesh pointsT temperature

TLiVdew dew point temperature for systems LiVu(k) vector of input variables for kth subintervalx(k) vector of differential variables for kth subintervalx(k) vector of first time derivatives of differential variables for

kth subintervalxp vector of interpolation formulas for differential variablesy(k) vector of algebraic variables for kth subintervalyp vector of interpolation formulas for algebraic variablesZ vector of discontinuity variables

zij(n) nth time derivative of zij

p

zp interpolation formula for a discontinuity functionzp vector of interpolation formulas for discontinuity functionszp vector of first time derivatives of interpolation formulas for

discontinuity functionszijp interpolation formula for jth discontinuity function in ith

state conditionzijp (s) scaled interpolation formula for zij

p

zijp ([0, 1]) enclosure of zij

p (s) in [0, 1]z ijp (s) first derivative of zij

p (s) with respect to szijp (s) interval extension of z ij

p (s)ZA total mole fraction of a species AZ*A total mole fraction of a species A at the eutectic point

Greek Symbols

a small positive constantb constant

State Event Location in Differential-Algebraic Models • 163

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 28: Event Location in Differential Equations

d state event toleranceD state event tolerance if 1/ 2 g*d # «g

min

« numerical tolerance of an equation solver«g discontinuity tolerance

«gmax upper bound on «g

«gmin lower bound on «g

g absolute time derivative function of a Boolean function LDP pressure difference across the value in a steam trap

REFERENCES

ANGULO, I., AND TORKZADEH, G. 1988. State event in combined simulation. In Proceedings ofthe 1988 Winter Simulation Conference (San Diego, Calif.). pp. 389–393.

ASPENTECH. 1993. SpeedUp User Manual Issue 5.4, Aspen Technology.BARTON, P. I., AND PANTELIDES, C. C. 1993. gPROMS–A combined discrete/continuous mod-eling environment for chemical processing systems. Sim. Ser. 25, 3, 25–34.

BARTON, P. I., AND PANTELIDES, C. C. 1994. Modeling of combined discrete/continuousprocesses. AIChE J., 40, 6, 966–979.

BIRTA, L. G., OREN, T. I., AND KETTENIS, D. L. 1985. A robust procedure for discontinuityhandling in continuous system simulation. Trans. Soc. Comput. Sim. 2, 3, 189–205.

BRENAN, K. E., CAMPBELL, S. L., AND PETZOLD, L. R. 1989. Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations. North-Holland, New York.

CARVER, M. B. 1978. Efficient integration over discontinuities in ordinary differentialequation simulations. Math. Comput. Sim. XX, 190–196.

CELLIER, F. E. 1979. Combined Continuous/Discrete System Simulation by Use of DigitalComputers. Ph.D. dissertation. Swiss Federal Institute of Technology. ETH, Zurich.

CELLIER, F. E., AND ELMQVIST, H. 1993. Automated formula manipulation supports object-oriented continuous-system modeling. IEEE Cont. Syst. (Apr.), 28–38.

ELLISON, D. 1981. Efficient automatic integration of ordinary differential equations withdiscontinuities. Math. Comput. Sim. XXIII, 12–20.

GEAR, C. W. 1971. Simultaneous numerical solution of differential-algebraic equations.IEEE Trans. Circ. Theory CT-18, 89–95.

GEAR, C. W., AND ØSTERBY, O. 1984. Solving ordinary differential equations with disconti-nuities. ACM Trans. Math. Softw. 10, 1 (Mar.), 23–44.

GRITSIS, D., PANTELIDES, C. C., AND SARGENT, R. W. H. 1988. The dynamic simulation oftransient systems described by index two differential-algebraic equations. In Proceedings of3rd International Symposium on Process Systems Engineering (Sydney, Australia).

GROSSMAN, R. L., NERODE, A., RAVN, A. P., AND RISCHEL, H. 1993. Hybrid Systems. LectureNotes in Computer Science. Vol. 736. Springer-Verlag, New York.

HANSEN, E., AND SENGUPTA, S. 1981. Bounding solutions of systems of equations usinginterval analysis. BIT, 21, 203–211.

HAY, J. L., AND GRIFFIN, A. W. J. 1979. Simulation of discontinuous dynamical systems. InProceedings of the 9th IMACS Conference on Simulation of Systems (Sorrento, Italy). 79–87.

JOGLEKAR, G. S., AND REKLAITIS, G. V. 1984. A simulator for batch and semi-continuousprocesses. Comput. Chem. Eng. 8, 6, 315–327.

MATTSSON, S. E. 1989. On modeling and differential/algebraic systems. Simulation, (Jan.),24–32.

MOORE, R. E. 1977. A test for existence of solution to nonlinear systems. SIAM J. Num.Anal. 14, 611–615.

MOORE, R. E. 1979. Methods and Applications of Interval Analysis. SIAM, Philadelphia, PA.NANCE, R. E. 1981. The time and state relationships in simulation modeling. Commun.ACM 24, 4 (Apr.), 173–179.

NEUMAIER, A. 1990. Interval Methods for Systems of Equations. Cambridge UniversityPress, Cambridge, England.

164 • T. Park and P. I. Barton

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.

Page 29: Event Location in Differential Equations

PANTELIDES, C. C. 1988. SpeedUp–Recent advances in process simulation. Comput. Chem.Eng. 12, 7, 745–755.

PANTELIDES, C. C., GRITSIS, D., MORISON, K. R., AND SARGENT, R. W. H. 1988. The mathemat-ical modeling of transient systems using differential-algebraic equations. Comput. Chem.Eng. 12, 5, 449–454.

PRESTON, A. J., AND BERZINS, M. 1991. Algorithms for the location of discontinuities indynamic simulation problems. Comput. Chem. Eng. 15, 10, 701–713.

SHAMPINE, L. F., GLADWELL, I., AND BRANKIN, R. W. 1987. Reliable solution of special eventlocation problems for ODEs. Numerical Analysis Report 138. Dept. of Mathematics, Univer-sity of Manchester, Manchester, England.

Received March 1995; revised November 1995; accepted January 1996

State Event Location in Differential-Algebraic Models • 165

ACM Transactions on Modeling and Computer Simulation, Vol. 6, No. 2, April 1996.