hybrid simulation of continuous...

3

Click here to load reader

Upload: dinhkien

Post on 22-Apr-2018

216 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: HYBRID SIMULATION OF CONTINUOUS …lppd.bioe.uic.edu/preview/2000/Escape10_HybridSimulation_preview.pdfHYBRID SIMULATION OF CONTINUOUS-DISCRETE SYSTEMS ... and gProms (Barton and Pantelides,

1

HYBRID SIMULATION OF CONTINUOUS-DISCRETESYSTEMS

Vishal Bahl and Andreas A. LinningerLaboratory for Product and Process Design

Department of Chemical Engineering, University of Illinois at Chicagoe-mail: {vbahl,linninge}@uic.edu

Abstract

Many processes in the chemical industry have some discrete phenomena superimposed on the continuous systemdynamics. While the continuous behavior arises from phenomena such as mass, energy and momentum conversion,discrete behavior may occur due to physico-chemical discontinuities or discrete controller actions. Such systems whichinvolve interaction between the continuous system dynamics and logical control functions are classified as HybridSystems. For such systems modeling in terms of the continuous variables alone is not sufficient. Simulation of suchsystems is necessary since discrete actions can trigger a qualitative change in the process model. Dynamic simulationbecomes mandatory for the synthesis and validation of safety operating conditions in chemical processes or start-up andshut-down procedures. This paper presents a new hybrid simulation environment for modeling and simulation of hybridsystems. It offers a high-level design language for the automatic or semi-automatic generation of the process models.Examples of practical relevance as well as an outline for treating the logical consistency of multi-event network aregiven. The application of the simulation language is illustrated by means of a continuous-discrete implementation of aDynamic Matrix Control strategy.

Keywords Modeling, simulation, discrete events, modeling language, digital controllers

1. Introduction

Models of industrial process often contain discretephenomena superimposed upon the continuous systembehavior. Examples include the dynamics of the reactingsystem together with its safety device and systems withdiscrete controller actions. The discrete behavior is due tooperation interference or the controller action e.g. digitalregulatory control. The strong interaction of these twofacets of the process behavior demands the developmentof analytical techniques and special simulationalgorithms that can address continuous and discretebehavior appropriately. Gear (Gear, 1980) has shown thatif a system with ODE's is modeled without anyconsideration for the discontinuities it will result in grossinefficiencies when using a multi step integrationmethodology. Preston (Preston et al., 1989) hasillustrated the need for special handling of discontinuitiesin dynamic simulations. Simulation environments likeSpeedUp (Perkins and Sargent, 1982), Batches (Joglekarand Reklaitis, 1984) and gProms (Barton and Pantelides,1994) offer symbolic elements for modeling ofdiscontinuities in a physical system. We have developed anew hybrid simulation language for the efficientmodeling of continuous-discrete systems. The language isembedded in TechTool, which offers a genericmathematical language based on object inheritance andits symbolic interpretation through the dynamiccompilation. This proposal outlines two important aspectsof the hybrid simulation environment in TechTool (a) the

algorithm for modeling of systems with discontinuitiesand (b) the semantics aspect and the logical consistency.Section 2 of this paper illustrates the detailedcategorization of events in a physical process system.Section 3 discusses the proposed event-handlingalgorithm for detecting and locating discontinuities in asystem. Section 4 deals with a discussion of Consecutiveand Synchronous events in a physical system. Section 5deals with the proposed language constructs for Hybridsimulations in TechTool. The application of themethodology has been discussed with a case study insection 6.

2. Events Categorization in a Physical System

A combined continuous-discrete simulation isadvanced by a solution of a sequence of initial valueproblem. Mathematically, the continuous dynamics ofhybrid system are governed by a set of ordinarydifferential or algebraic equations. In this discussion wewill focus only on the ODE problems.

)),(),(()(0 ttutxgty = (1)In the above equation unknowns x are differentialvariables, u are known systems inputs and t is theindependent time variable. The combined simulationproblem is defined as,

0),,,,( )()()( .)()( =tuyyyf kkkkk

PREVIEW

Page 2: HYBRID SIMULATION OF CONTINUOUS …lppd.bioe.uic.edu/preview/2000/Escape10_HybridSimulation_preview.pdfHYBRID SIMULATION OF CONTINUOUS-DISCRETE SYSTEMS ... and gProms (Barton and Pantelides,

2

],[

),()()1(

)()(

kk

kk

tttwhere

tuu−∈

=(2)

The termination of each initial value problem is markedby the occurrence of an event. 0),( ≤tyZ (3)Equation 3 expresses a conditional that constitutes adiscontinuity. Typically, when a system experiences adiscontinuity it traverses to another state described byqualitatively different equations or parameters. As anexample consider the filling of a liquid on a tray in aseparator. The change of the filling on the tray can bedescribed by the ODE

overflowin qqdtdh

A −= (4)

An event condition may occur if the liquid level reachesthe overflow weir and the liquid overflows from the trayfor the first time. This conditional weirhh ≥ is of the formas given by equation (3) and after normalization the Z-function can be represented as

0)( ≤−= thhZ weir (5)The model for the state change may include actions suchas:• discontinuous changes of state variables• qualitative changes to underlying system equations• or combination of the aboveDepending upon the mathematical form of theconditionals and the semantics of the situations, we cancategorize the events into four classes as shown in Table1.

Table 1: Events Categorization

3. Event Handling Algorithm and Logical Consistency

To model a system with discontinuities it isnecessary to first detect and then locate thediscontinuities in the physical system. Event detectioninvolves finding whether an event has taken in a physicalsystem while event location involves finding the time

when an event occurs. Several algorithms have beenproposed for consistent event detection and location.Most of the approaches involve setting up an eventfunction based on the event conditionals and locating thestate event time in an integration interval tk, tk+1.

Pantelides (Pantelides, 1988) has proposed bisectionalgorithm while Barton (Barton and Pantelides, 1992)has proposed interval arithmetic techniques for accuratedetermination of state events. In the next section, we willpresent a simple algorithm for event detection andlocation by using the popular Runge-Kutta method. Ouralgorithm not only accurately locates the discontinuitiesin a physical system, it also offers the advantage of lessercomputational time as compared to previousmethodologies. Despite previous work pertaining to themathematical aspects of hybrid systems, logicalconsistency and the semantics content of continuous-discrete process models needs further discussion. Recentresults and the case studies of multi-event network will bepresented in section 6.

3.1 Event Detection

To detect whether an event has taken place in aphysical system, an event function, Z is set up as given byequation (3). The original system of differential equationsspecifying the continuous system dynamics, is augmentedby the event function, Z.

)(

0)( .

yGdtdZ

yZtS

=

≤ (6)

The solution of the initial value problem is thenproceeded by integrating of the augmented system ofdifferential equations. Note that a DAE approach asproposed by Park and Barton (Park and Barton, 1994)can circumvent the required differentiation of the Z-function described here. During the integration intervalthe system of equations are "locked" even if one or moreevent conditions have been satisfied (Pantelides, 1988).After one successful integration step, the event function ischecked for a zero crossing (Barton, 1992) as given byequation (7).

0*0 ≤eZZ (7)If no event has been detected the integration is continuedwith the same step size. If there is a sign change of the Z-function an event has been detected and the algorithmshould proceed to accurately locate it.

3.2 Event Location

Next the exact time at which the event functionassumes a value of the zero has to be found. This requiresinterpolation of the solution trajectory. For simplicity andefficiency reasons we have implemented a quadraticinterpolation formula pivoted between the twointermediate estimators of the zerocrossing. The situationis depicted in Figure 1. The roots of the quadratic

Event Categorization Type of Event Example

Time explicit events Periodic explicitevents

Sampling usingdigital PID controller

Reversible implicitevents

Operation of pressurerelief valveTime implicit events

Irreversible timeimplicit events

Operation of apressure burst disc

Consecutive eventsConsecutive eventsin digital cascadecontrol scheme

Consecutive events ina distillation columnto control bottomstemperature.

Combination ofimplicit and explicitevents

Charging of feed in avessel

Charging of fuel in afurnace.PREVIE

W

Page 3: HYBRID SIMULATION OF CONTINUOUS …lppd.bioe.uic.edu/preview/2000/Escape10_HybridSimulation_preview.pdfHYBRID SIMULATION OF CONTINUOUS-DISCRETE SYSTEMS ... and gProms (Barton and Pantelides,

3

equation representing the polynomial gives the time t*

when an event occurs. Our assumption is based on thefact that within a very small time interval any higherorder polynomial can be represented as second orderpolynomial. In figure 1 the event has been detected ininterval k4 and k5. If the polynomial is represented byquadratic equation of form AX2+MX+C=0,

AACM

AMt

24

2

2* −±−= (8)

= )(bsqrta ±− (9)

c

dkdtaWhere

2 , = (10)

c

kab 1 2 −= (11)

)12(

)*)12()45((,

2hhdkdthhkk

cWhere−

−−−=(12)

polynomial for the slope dkdt detected is

event in which estimators teintermedia k5 and k4 size step h1-h2

0 h1)-(h2 .

=

==>tS

If c<0.001 the polynomial can be represented as astraight line and the time for event occurrence is givenas,

)45()12(

*41*

kkhh

kht−−−= (13)

k5Time

zk2

k3k4

zo

zek5 Time

z

t*

k4

t o+hQuadratic approximation

t1 t2

True Solution

to

Fig. 1 Event location using quadratic approximation

3.3 Step Completion

The entire system is then re-integrated from to to to+h*min to obtain consistent values of all the statevariables before the event. Then, the corresponding entryin the state vector is incorporated to reflect the systemsnew state after the event. Continued integration will nowlock into a new set of equations or parameters asspecified in the action part of the hybrid languageelement (Pantelides, 1998). Alternative approaches suchas implicit integration step, based on Eulers method andSemi-implicit Runge-Kutta method for the direct solutionof event time t* are currently under investigation (Bahland Linninger, 1999)

4 Consecutive Events and Synchronous Events

A situation often omitted in the discussion of hybridsystems pertains to the description of Consecutive Events.Step completion triggers actions that may also effectuatediscontinuous changes to the values of the state variables.In consequence another conditional distinct from the firstone may also be triggered. Consecutive Events are thoseevents whose conditionals are triggered by the actions ofa principal event. Fig. 2 sketches this situation. Theprincipal event is triggered by event Zi as indicated by the

PREVIEW