[ieee 2007 mediterranean conference on control & automation - athens, greece...

6
Reachability Analysis of a Biodiesel Production System Using Stochastic Hybrid Systems Derek Riley, Xenofon Koutsoukos Kasandra Riley ISIS/EECS Vanderbilt University Mayo Foundation Nashville, TN 37209, USA Rochester, MN 55905, USA Derek.Riley, [email protected] [email protected] Abstract— Modeling and analysis of chemical reactions are critical problems because they can provide new insights into the complex interactions between systems of reactions and chemicals. One such set of chemical reactions defines the creation of biodiesel from soybean oil and methanol. Modeling and analyzing the biodiesel creation process is a challenging problem due to the highly-coupled chemical re- actions that are involved. In this paper we model a biodiesel production system as a stochastic hybrid system, and we present a probabilistic verification method for reachability analysis. Our analysis can potentially provide useful insights into the complicated dynamics of the chemicals and assist in focusing experiments and tuning the production system for efficiency. The verification method employs dynamic programming based on a discretization of the state space and therefore suffers from the curse of dimensionality. To verify the biodiesel system model we have developed a parallel dynamic programming implementation that can handle large systems. Although scalability is a limiting factor, this work demonstrates that the technique is feasible for realistic biochemical systems. I. I NTRODUCTION Modeling and analysis of chemical reactions are im- portant tasks because they can unlock insights into the complicated dynamics of systems which are difficult or expensive to test experimentally. A variety of techniques have been used to model chemical equations, but the effectiveness of the analysis techniques is often limited by tradeoffs imposed by the modeling paradigms. Sto- chastic differential equations have been used to model biochemical reactions [11], [3]; however, analysis of these models has mainly been limited to simulation. Hybrid systems have also been used [2], [10]; however, hybrid systems do not capture the probabilistic nature inherent in chemical reactions, and therefore, may not be able to correctly analyze certain systems. Stochastic Hybrid Systems (SHS) have been used to capture the stochastic nature of chemical systems but have previously only been used for simulations [22] or analysis of systems with simplified continuous dynamics [13]. In this paper we analyze the biochemical process of creating biodiesel. Biodiesel is created by transesterifica- tion of large, branched triglycerides from soybean oil into smaller, strait-chain molecules of methyl esters (biodiesel) using methanol and lye in a well-mixed, heated processor [23]. If incorrect proportions of methanol are used, the reaction will not complete and the biodiesel will not pass purity tests. Also, if too much methanol is used, the methanol must be recovered later which adds time and cost to the process. There are two main types of systems which are intended to produce biodiesel: batch and continuous. Continuous processors are generally large commercial machines which process the ingredients and produce biodiesel in a continuous flow. Batch systems are more common because they are simpler and cheaper to con- struct. The idea of a batch system is to combine all the necessary chemicals in a single vessel with a heater and mixing system and produce one batch at a time. In this work we model the batch style processor presented in [8]. Our model of the biodiesel reactions also incorporates the continuous temperature of the reacting solution and a thermostat-controlled heater. Temperature is a major factor in the rate at which chemicals react because it affects the kinetic energy of the individual molecules. As temperature of a mixture of chemicals increases, the chemicals react more often because of the increased kinetic energy. Likewise, as temperature decreases, the reduction in kinetic energy decays the reaction rates in a predictable manner. The chemical master equation accurately models the stochastic dynamics for chemical reactions, but it is impossible to solve for most practical systems [11]. The Stochastic Simulation Algorithm (SSA) is equivalent to solving the master equation based on a discrete model by simulating one reaction at a time, but if the number of molecules of any of the reactants is large, the SSA is not efficient [22]. It is computationally intractable to enumerate all possible states of the model employed by the SSA for formal verification because the reac- tion rates depend on the concentrations and the SSA models individual molecules. Therefore, our approach suggests starting with the continuous stochastic dynamics and generating discrete approximations with coarser (and variable) resolution unlike the fixed, overly-fine resolution of the SSA. The discrete approximations can then be used for verification of reachability properties [17], [18]. We model the biodiesel production equations using SHS and use a dynamic programming verification method based on a discretization of the state space. The con- tribution of the paper centers on the application of the theoretical results presented in [17], [18] to a biodiesel production system, a realistic and important biochemical process. Our results demonstrate that SHS are well- suited for modeling and verification of such biochemical processes. The proposed method suffers from the curse of dimensionality. Therefore, we have developed a parallel dynamic programming implementation of the verifica- 0HGLWHUUDQHDQ &RQIHUHQFH RQ &RQWURO DQG $XWRPDWLRQ -XO\ $WKHQV *UHHFH ; ,((( 7

Upload: kasandra

Post on 12-Dec-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Reachability Analysis of a Biodiesel Production SystemUsing Stochastic Hybrid Systems

Derek Riley, Xenofon Koutsoukos Kasandra RileyISIS/EECS Vanderbilt University Mayo Foundation

Nashville, TN 37209, USA Rochester, MN 55905, USADerek.Riley, [email protected] [email protected]

Abstract— Modeling and analysis of chemical reactionsare critical problems because they can provide new insightsinto the complex interactions between systems of reactionsand chemicals. One such set of chemical reactions definesthe creation of biodiesel from soybean oil and methanol.Modeling and analyzing the biodiesel creation process is achallenging problem due to the highly-coupled chemical re-actions that are involved. In this paper we model a biodieselproduction system as a stochastic hybrid system, and wepresent a probabilistic verification method for reachabilityanalysis. Our analysis can potentially provide useful insightsinto the complicated dynamics of the chemicals and assistin focusing experiments and tuning the production systemfor efficiency. The verification method employs dynamicprogramming based on a discretization of the state spaceand therefore suffers from the curse of dimensionality. Toverify the biodiesel system model we have developed aparallel dynamic programming implementation that canhandle large systems. Although scalability is a limitingfactor, this work demonstrates that the technique is feasiblefor realistic biochemical systems.

I. INTRODUCTION

Modeling and analysis of chemical reactions are im-portant tasks because they can unlock insights into thecomplicated dynamics of systems which are difficult orexpensive to test experimentally. A variety of techniqueshave been used to model chemical equations, but theeffectiveness of the analysis techniques is often limitedby tradeoffs imposed by the modeling paradigms. Sto-chastic differential equations have been used to modelbiochemical reactions [11], [3]; however, analysis of thesemodels has mainly been limited to simulation. Hybridsystems have also been used [2], [10]; however, hybridsystems do not capture the probabilistic nature inherentin chemical reactions, and therefore, may not be ableto correctly analyze certain systems. Stochastic HybridSystems (SHS) have been used to capture the stochasticnature of chemical systems but have previously only beenused for simulations [22] or analysis of systems withsimplified continuous dynamics [13].

In this paper we analyze the biochemical process ofcreating biodiesel. Biodiesel is created by transesterifica-tion of large, branched triglycerides from soybean oil intosmaller, strait-chain molecules of methyl esters (biodiesel)using methanol and lye in a well-mixed, heated processor[23]. If incorrect proportions of methanol are used, thereaction will not complete and the biodiesel will not passpurity tests. Also, if too much methanol is used, themethanol must be recovered later which adds time andcost to the process.

There are two main types of systems which areintended to produce biodiesel: batch and continuous.Continuous processors are generally large commercialmachines which process the ingredients and producebiodiesel in a continuous flow. Batch systems are morecommon because they are simpler and cheaper to con-struct. The idea of a batch system is to combine all thenecessary chemicals in a single vessel with a heater andmixing system and produce one batch at a time. In thiswork we model the batch style processor presented in [8].

Our model of the biodiesel reactions also incorporatesthe continuous temperature of the reacting solution anda thermostat-controlled heater. Temperature is a majorfactor in the rate at which chemicals react because itaffects the kinetic energy of the individual molecules.As temperature of a mixture of chemicals increases, thechemicals react more often because of the increasedkinetic energy. Likewise, as temperature decreases, thereduction in kinetic energy decays the reaction rates in apredictable manner.

The chemical master equation accurately models thestochastic dynamics for chemical reactions, but it isimpossible to solve for most practical systems [11]. TheStochastic Simulation Algorithm (SSA) is equivalent tosolving the master equation based on a discrete modelby simulating one reaction at a time, but if the numberof molecules of any of the reactants is large, the SSAis not efficient [22]. It is computationally intractable toenumerate all possible states of the model employedby the SSA for formal verification because the reac-tion rates depend on the concentrations and the SSAmodels individual molecules. Therefore, our approachsuggests starting with the continuous stochastic dynamicsand generating discrete approximations with coarser (andvariable) resolution unlike the fixed, overly-fine resolutionof the SSA. The discrete approximations can then be usedfor verification of reachability properties [17], [18].

We model the biodiesel production equations usingSHS and use a dynamic programming verification methodbased on a discretization of the state space. The con-tribution of the paper centers on the application of thetheoretical results presented in [17], [18] to a biodieselproduction system, a realistic and important biochemicalprocess. Our results demonstrate that SHS are well-suited for modeling and verification of such biochemicalprocesses. The proposed method suffers from the curse ofdimensionality. Therefore, we have developed a paralleldynamic programming implementation of the verifica-

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

1-4244-1282-X/07/$25.00 ©2007 IEEE

T14-004

tion algorithm that can handle large systems. This workdemonstrates that the technique is feasible for realisticsystems of chemical equations even though scalability isa limiting factor.

The organization for the rest of the paper is as follows:Section 2 describes the related work, Section 3 describesSHS modeling of systems of chemical equations forbiodiesel, Section 4 describes the probabilistic verificationmethod, Section 5 presents our experimental results, andSection 6 concludes the work.

II. RELATED WORK

Biodiesel reactions have been previously modeled usingdifferential equations under constant temperature con-ditions [8], [20]. A kinetic-based modeling techniquefor the biodiesel reactions is presented in [1]. Differentbiodiesel processor designs and processing techniquesare compared in [24]. Since biodiesel processors involveswitches, pumps, and variable temperatures, hybrid mod-eling techniques can be used to accurately model the realprocessors.

Hybrid systems have been used for modelingbiological-based systems in order to capture the compli-cated dynamics using well-defined abstractions. Biologi-cal protein regulatory networks have been modeled withhybrid systems using linear differential equations to de-scribe the changes in protein concentrations and discreteswitches to activate or deactivate the continuous dynamicsbased on protein thresholds [10]. Stochastic hybrid sys-tems further improve on the benefits of hybrid systemsby providing a probabilistic framework for realisticallymodeling chemical reactions. A modeling technique thatuses SHS to construct models for chemical reactionsinvolving a single reactant specie is presented in [13].A genetic regulatory network was modeled with a SHSmodel and compared to a deterministic model in [15].SHS models of biochemical systems have been developedand simulated using hybrid simulation algorithms in [12],[22].

This paper adopts a SHS model that is a special caseof the general model presented in [6] and employs areachability analysis method based on discrete approxi-mations. Discrete approximation methods based on finitedifferences have been studied extensively in [19]. Basedon discrete approximations, the reachability problem canbe solved using algorithms for discrete processes [21].The approach has been applied for optimal control of SHSgiven a discounted cost criterion in [16]. For verification,the discount term cannot be used and convergence ofthe value function can be ensured only for appropriateinitial conditions. A related grid based method for safetyanalysis of stochastic systems with applications to airtraffic management has been presented in [14]. Our ap-proach is similar but using viscosity solutions we showthe convergence of the discrete approximation methods.

Reachability analysis for SHS can also be performedusing Monte Carlo methods [5]. Multiple stochastic simu-lations are used to determine the reachability probabilityfor an initial state of a SHS. Confidence intervals and

accuracy probabilities can be selected by adjusting thenumber of simulations.

III. MODELING CHEMICAL REACTIONS USING SHS

A. Dynamics of Chemical Reactions

A chemical reaction specifies all chemical specieswhich react (reactants) and are produced (products). Akinetic constant k, associated with each reaction, numeri-cally describes the affinity for the reactants to produce theproducts in constant temperature conditions. Experimentalanalysis is used to physically measure the variation inindividual concentrations of the chemical species in a bio-chemical system. However, understanding the dynamicalbehavior of biochemical systems requires running manyexperiments that can be time consuming, tedious, unsafe,or costly. Developing and analyzing dynamical modelsfor capturing the evolution of individual chemical speciesconcentrations can reduce the number of experimentsneeded.

Chemical reactions are inherently probabilistic becauseof the unpredictability of molecular motion [9], so theirdynamics can be accurately described by stochastic mod-els. Discrete stochastic models of reactions can be createdby describing a reaction j as firing at a rate aj [7].When the reaction fires, the concentrations of the reactantsand products are reset to the appropriate updated values.Table I shows the rates and resets for several examplesof different types of reactions. For example, when thereaction X → Z occurs, a molecule of X is consumedand a molecule of Z is produced denoted by x− = 1 andz+ = 1 respectively where x and z are the quantities ofmolecules of chemical species X and Z, and ki is thekinetic constant for reaction i.

Reaction aj ResetX → Z k1x x− = 1;

z+ = 1;X + Y → 2Z k2xy x− = 1;

y− = 1;z+ = 2;

2X → Z 1/2 ∗ k3x(x − 1) x− = 2;z+ = 1;

2X + Y → 2Z 1/2 ∗ k4x(x − 1)y x− = 2;y− = 1;z+ = 2;

3X → Z 1/6 ∗ k5x(x − 1)(x − 2) x− = 3;z+ = 1;

TABLE I

EXAMPLE REACTION RATES AND RESETS

Discrete modeling is ideal for small systems withlow concentrations, but systems with a large number ofmolecules quickly become inefficient to analyze. The dy-namics of these large systems can, however, be describedusing stochastic differential equations assuming that thereactions happen in a well mixed solution.

Continuous modeling of chemical reactions can beaccomplished using the following technique. Supposethat we have a system of M chemical reactions and N

chemical species. We define xi as the concentration of

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

T14-004

the ith chemical species in micro-Molarity (µM), Mf asthe number of reactions, aj as the reaction propensity ofthe jth reaction, and W as an Mf -dimensional Wienerprocess. Reaction propensities are calculated using thekinetic constants and concentrations of the reactants foreach chemical reaction. The stoichiometric matrix v is a(Mf X N ) matrix whose values represent the concentra-tion of chemical species lost or gained in each reaction(0, +1, -1, +2, etc.). Equation (1) describes the continuousdynamics for each of the i chemical species [22].

dxi =

Mf∑

j=1

vjiaj(x(t))dt+

Mf∑

j=1

vji

aj(x(t))dWj (1)

All chemical reaction rates are effected by the temper-ature at which they occur. The higher the temperature,the more likely that the individual molecules will interactand eventually react. The chemical reaction rate k is mostoften defined for a single temperature and pressure, butmost chemical reactions are exothermic or endothermicand therefore inherently change the temperature.

Furthermore, it is advantageous to control the reactionrates by applying or removing heat to ensure that thesystem behaves correctly. The effect of temperature onthe reaction rate, k, is given by k = Ae

−EaRT where A is

a constant for each reaction, Ea is the activation energyfor each reaction, R is the gas constant (1.9872), andT is the temperature in Kelvin (for example see [8]).Using this equation we can determine the reaction ratesfor each reaction at any temperature and therefore modelthe fluctuating reaction speeds.

A heating or cooling apparatus generally applies heat orcool in a binary manner (on or off), so a discrete model ofheating control is necessary. Stochastic hybrid systems areideal for modeling systems of chemical reactions becausethey are able to model continuous and discrete dynamicsin a stochastic framework. Temperature can easily beincluded in a stochastic model as another continuous state.The temperature can then be used to help calculate thereaction rates for the individual reactions.

B. Biodiesel Production

Biodiesel can be produced by combining soybean oil,methanol, and lye under the correct conditions [20]. Thelye is used to neutralize free fatty acids, and is a fairlysimple component of the biodiesel process, so we assumethat the system has no free fatty acids so we can focuson the more complicated reactions.

Once the free fatty acids have been neutralized, thesoybean oil is comprised mainly of triglycerides (TG).The TG can be mixed with methanol (M) and turnedinto biodiesel in a process called transesterification. Thechemicals involved in the transesterification process aredescribed in Table II and the reactions are described inTable III. The TGs are turned into diglycerides (DGs)which are turned into monoglycerides (MGs) which areturned into esters (E) also known as biodiesel. The onlybyproduct of the reaction is glycerol (Gl) which can beused as a hand soap. We model the concentration of each

of these six chemical species as a continuous variable inour model. Each of the six reactions are modeled usingthe SDE (1). The kinetic values are determined by theequations in Table III [20].

Reactant Variable [Min, Max] (Moles) ResolutionTG x1 [0.00001, 4.00001] 0.2DG x2 [0.00001, 4.00001] 0.4MG x3 [0.00001, 4.00001] 0.4E x4 [0.00001, 4.00001] 0.4M x5 [0.00001, 1.00001] 0.05Gl x6 [0.00001, 1.00001] 0.1T x7 [20,70] 10

TABLE II

CONTINUOUS VARIABLES

Reaction Kinetic Rate

TG + M → DG + E k1 = 3.92 × 107e−13145

1.987T

DG + E → TG + M k2 = 5.58 × 105e−9932

1.987T

DG + M → MG + E k3 = 5.89 × 1013e−19860

1.987T

MG + E → DG + M k4 = 9.87 × 109e−14369

1.987T

MG + M → GL + E k5 = 5350e−6421

1.987T

GL + E → MG + M k6 = 21500e−9588

1.987T

TABLE III

BIODIESEL REACTIONS AND KINETIC EQUATIONS

The chemical reactions involved in the biodiesel pro-duction process are affected greatly by temperature, butprevious models of the biodiesel reactions have assumeda constant temperature. Since more heat added to thesystem will increase the reaction rates (k), the warmerthe reacting chemicals can be, the faster biodiesel will beproduced. However, the energy required to heat the systemis a major cost of producing biodiesel, so it is importantto know if a heating control system will produce biodieselsuccessfully under realistic conditions.

The model we have developed uses temperature (T )as another continuous state of the system. We use thetemperature to calculate the kinetic constants (k) for eachreaction as seen in Table III. The biodiesel reactions createa negligible amount of heat, so we assume that the onlyheat added to the system comes from a heating element.We also assume that when the heating element is not on,the system loses heat at a constant rate.

x7 =

{

.02(−x7)dt+ .01dW cooling.05(100 − x7)dt+ .01dW heating

(2)

We model the change in heating using two discretestates, one for heating and one for cooling. The continu-ous dynamics of the two states are determined by combin-ing the equations (1) describing the rate of concentrationchange with the equations in Table III describing the ef-fect of temperature on the kinetic constants. Furthermore,the temperature is described as another continuous stateof the system where the continuous dynamics for x7 are

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

T14-004

described by Equation 2. The system can switch betweenthe states depending on the temperature of the reactants.In this model, if the temperature is above 30 degrees, theheater is turned off, and if the temperature is below 30degrees the heater is turned on.

Methanol (M) is an expensive chemical necessary forproducing biodiesel from soybean oil, and recovery ofmethanol from the resulting biodiesel can be costly, soconservation of the chemical is necessary. However, hav-ing too little methanol in the mix can leave unconvertedTGs, DGs, or MGs which will cause the biodiesel to failquality testing. Therefore, ideally we would like to useour model to test whether all of the TGs, DGs, MGs, andmethanol are used up at the same time to ensure qualityand efficiency.

C. SHS Model of Biodiesel Production

dx=b(q1,x)dt+σ(q1,x)dW

x7>30/x7:=x7+0.1

x7<30/x7:=x7-0.1

dx=b(q2,x)dt+σ(q2,x)dW

Fig. 1. SHS model of biodiesel production system

The SHS model for biodiesel production is shownin Figure 1. Between transitions, the continuous stateevolves according to the corresponding SDE where thesolution is understood using the Ito stochastic integral.Upon occurrence of a transition, the continuous state xis reset according to the reset map. A guarded transitionfires the instant when the guard becomes true and is resetaccording to the reset map. We include a reset on thetransition to ensure that Zeno behavior is avoided by themodel [18].

The functions b(q, x) and σ(q, x) shown in Figure 1come from Equations 1,2 and are bounded and Lipschitzcontinuous in x ∈ X and thus the SDE has a uniquesolution. As described in Table II, the concentrationsof the biodiesel production system are assumed to bebounded. Given these assumptions, the SHS for thebiodiesel production system is a special case of the SHSmodel described in [17]. In particular, this model has twodiscrete states and two guarded discrete transitions.

Our goal of the analysis of the biodiesel modelis to determine the probability that the reaction willfully complete with a small excess of methanol.To determine this, we define the set of reachablestates as the set of all concentrations that satisfyT =

{

x ∈ R7 : x5 < .1 ∧ x1 < 1 ∧ x2 < 1 ∧ x3 < 1

}

.Since we don’t want the system to run out of TGs,DGs, or MGs before it runs out of methanol, we de-fine the unsafe states as those which satisfy U ={

x ∈ R7 : x5 < .1 ∧ (x1 > 1 ∨ x2 > 1 ∨ x3 > 1)

}

. Ourproblem is to determine what is the probability that theSHS will enter the reachable set without entering theunsafe set.

IV. PROBABILISTIC VERIFICATION

A. Reachability Analysis

Given a target set and an unsafe set of states, theobjective of the reachability problem is to compute theprobability that the system execution from an arbitraryinitial state will reach the target set while avoiding theunsafe set. We denote Xq the state space for modeq and S = ∪qX

q the state space of the system. LetT = ∪q∈QT

{q} × T q and U = ∪q∈QU{q} × Uq the set

of target and unsafe states respectively. We assume thatT q and Uq are proper open subsets of Xq for each q,i.e. ∂T q ∩ ∂Xq = ∂Uq ∩ ∂Xq = ∅ and the boundaries∂T q and ∂Uq are sufficiently smooth. We define Γq =Xq \ (T q ∪ Uq) and Γ = ∪q∈Q{q}×Γq. The initial state(which, in general, is a probability distribution) must lieoutside the sets T and U . The reset map is defined asa transition measure R(s,A) that defines the probabilitydistribution of the state after the jump and is assumed tobe defined so that the system cannot jump directly to Uor T [18].

Consider the stopping time τ = inf{t ≥ 0 : s(t) ∈∂T ∪ ∂U} corresponding to the first hitting time of theboundary of the target or unsafe set. Let s be an initialstate in Γ, then we define the function V : Γ → R+ by

V (s) =

Es[I(s(τ−)∈∂T )], s ∈ Γ1, s ∈ ∂T

0, s ∈ ∂U

where Es denotes the expectation of functionals giventhat the initial condition is s and I denotes the indicatorfunction. The function V (s) can be interpreted as theprobability that a trajectory starting at s will reach theset T while avoiding the set U .

The value function V can be described as the viscositysolution of a system of coupled Hamilton-Jacobi-Bellman(HJB) equations [17], [18]. This function is similar tothe value function for the exit problem of a standardstochastic diffusion, but the running and terminal costsdepend on the function itself. The coupling between theequations arises because the value function in a particularmode depends on the value function in the adjacent modesand is formally captured by the dependency of the runningand terminal costs on the value function V.

Proposition We define a bounded function c : S → R+

continuous in x such that

c(q, x) =

{

1, if x ∈ ∂T q

0, if x ∈ ∂Uq ∪ ∂Xq

and denote ψV (q, x) = c(q, x) +∫

ΓV (y)R((q, x), dy)

and a(q, x) = σT(q, x)σ(q, x). Then, V is the uniqueviscosity solution of the system of equations

b(q, x)DxV +1

2tr(a(q, x)D2

xV ) = 0

in Γq with boundary conditions V (q, x) = ψV (q, x) on∂Γq.

The proof is a straightforward application of the resultspresented in [17], [18] to the SHS of the sugar cataractdevelopment of the biodiesel production system.

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

T14-004

B. Numerical Methods Based on Dynamic Programming

One of the advantages of characterizing reachabilityproperties using viscosity solutions is that for compu-tational purposes we can employ numerical algorithmsbased on discrete approximations. We employ the finitedifference method presented in [19] to compute locallyconsistent Markov chains (MCs). We consider a dis-cretization of the state space denoted by Sh = ∪q∈Q{q}×Sh

q where Shq is a set of discrete points approximating

Bq and h > 0 is an approximation parameter char-acterizing the distance between neighboring points. Bythe boundness assumption, the approximating MC willhave finitely many states which are denoted by sh

n =(qh

n, ξhn), n = 1, 2, . . . , N . The transition probabilities

ph((q, x), (q′, x′)) of the Markov chain are computed toapproximate the SHS while preserving local mean andvariance [17], [18].

The value function V of the SHS can be approximatedby

V h(s) = Es

[

νh∑

n=0

c(qhn, ξ

hn)I(n=ni)

]

.

where νh is the time the state will enter the target set Tor the unsafe set U and ni are the times of the discretejumps. The function V h can be computed using a valueiteration algorithm. The results in [17], [18] show that thealgorithm converges for appropriate initial conditions, andfurther, the solution based on the discrete approximationsconverges to the one for the original stochastic hybridsystem as the discretization becomes finer (h → 0).Regarding the efficiency of the computational methods,the iterative algorithm is polynomial in the number ofstates of the discrete approximation process. Althoughscalability is a limiting factor, using parallel methods theapproach is feasible for realistic systems as biodiesel pro-duction system, a seven-dimensional biochemical systemfor which the approximating process has approximately500 million states.

V. EXPERIMENTAL RESULTS

In this section we present the results of the reachabilityprobability for the SHS biodiesel production model pre-sented in Section 3. The chemical concentration rangesand resolutions used are presented in Table II. We chosethe resolution parameters to be similar to the resolutionthat measurement equipment can achieve in actual exper-iments.

The resolution parameters for the biodiesel productionsystem result in an MDP with approximately 500 millionstates. Storing the values at each state alone requiresseveral gigabytes of memory, so we developed a parallelvalue iteration implementation to improve the perfor-mance of the algorithm. The value iteration algorithm isstill guaranteed to converge in a parallel implementationas long as updated values are used periodically [4]. Paral-lel dynamic programming algorithms are well-defined andeasy to implement [4]. Our MDP has a regular structurewhich improves the efficiency of the value iteration algo-

rithm and allows us to implement a fairly straitforwardpartitioning technique for the parallel implementation.

To partition the problem for multiple processors weselect five of the seven dimensions of the MDP to dividein half. Each processor only analyzes half of the totalrange for each of five divided ranges and the entire rangefor the other two dimensions. The two range divisions infive dimensions create 25 or 32 range combinations thatmust be considered. The processors are each specificallyassigned a combination of the ranges to ensure that theentire range for each dimension is computed, and allrange values are arranged to minimize communication.Processors with neighboring range values regularly updatetheir neighbors to ensure the value iteration converges.

Fig. 2. Projection of the value function (MG,DG) for the temperature-controlled reachability results

Fig. 3. Projection of the value function (MG,TG) for the temperature-controlled reachability results

To visualize our results we plot projections of the datafor different concentrations of the chemicals involved. Theprojection in Figure 2 shows the reachability probabilityfor selected ranges of diglycerides (DG) and monoglyc-erides (MG) (x2, x3) where x1 = 0.00001, x4 = 0.00001,

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

T14-004

x5 = 1.00001, x6 = 0.5, and x7 = 50.0. The projec-tion in Figure 3 shows the reachability probability forselected ranges of triglycerides (TG) and monoglycerides(MG) (x1, x3) where x2 = 0.00001, x4 = 0.00001,x5 = 1.00001, x6 = 1.0, and x7 = 50.0. Lightercolors represent states which have a higher probability oftransitioning to the target set without reaching the unsafestates which are located around the boundary of the statespace.

These results indicate that the modeled temperaturecontroller will probably not work effectively for thissystem because the probability of success for many of thestates is fairly low. Further experiments can be performedto determine the ideal temperature to use the heater tomaximize efficiency and minimize the use of the heater.

The Advanced Computing Center for Research andEducation (ACCRE) at Vanderbilt University providesthe parallel computing resources for our experiments(www.accre.vanderbilt.edu). The computers form a clusterof 348 JS20 IBM PowerPC nodes running at 2.2 GHzwith 1.4 Gigabytes of RAM per machine. We use C++as the implementation language because ACCRE supportsMessage Passing Interface (MPI) compilers for C++. Weuse the MPI standard for communication between proces-sors because it provides an efficient protocol for messagepassing middleware for distributed memory parallel com-puters. The sugar cataract experiment took approximately2 hours on the 32 processors. Currently, the bottlenecksof this approach are the memory size and speed.

VI. CONCLUSIONS

Biochemical system modeling and analysis are impor-tant but challenging tasks which hold promise to unlocksecrets of complicated biochemical systems. SHS are anideal modeling paradigm for biochemical systems be-cause they incorporate probabilistic dynamics into hybridsystems to capture the inherent stochastic nature of thebiochemical systems. The biodiesel production system isexcellent example of a system of chemical equations thatcan be modeled effectively using the presented modelingmethods. Our dynamic programming analysis techniqueprovides verification results for realistic systems usingparallel computing techniques to lessen the effect of thecurse of dimensionality. This technique can be used todesign and test controllers of complicated, real-worldsystems in order to help optimize designs using theproposed verification technique.Acknowledgements Research is partially supported bythe National Science Foundation CAREER grant CNS-0347440.

REFERENCES

[1] S. Al-Zuhair, The effect of substrate concentrations on the produc-tion of biodiesel by lipase-catalysed transesterification of vegetableoils, J. Chem. Tech. and Biotech., vol 81, pp. 299-305, 2006.

[2] R. Alur, C. Belta, F. Ivanicic, V. Kumar, M. Mintz, G. Pappas, H.Rubin, J. Schug, Hybrid Modeling and Simulation of BiomolecularNetworks, Hybrid Systems: Computation and Control, LNCS2034, pp. 19-33, 2001.

[3] R. Barbuti, S. Cataudella, A. Maggiolo-Schettini, P. Milazzo, A.Triona, A Probabilistic Model For Molecular Systems, Funda-menta Informaticae XX, IOS Press, 1-15, 2005.

[4] D. Bertsekas, J. Tsitsiklis, Parallel and Distributed Computation:Numerical Methods, Prentice-Hall, 1989.

[5] H. Blom, J. Lygeros, M. Everdij, S. Loizou, K. Kyriakopoulos, Sto-chastic Hybrid Systems: Theory and Safety Critical Applications,Lecture Notes in Control and Informations Sciences, Springer,vol.337, 2006.

[6] M. Bujorianu, J. Lygeros, Theoretical Foundations of GeneralStochastic Hybrid Systems: Modeling and Optimal Control, InProc. of 43rd IEEE Conf. on Decision and Control, 2004.

[7] Y. Cao, H. Li, L. Petzold, Efficient formulation of the stochasticsimulation algorithm for chemically reacting systems, J. Chem.Phys., 121, 4059, 2004.

[8] D. Darnoko, M. Cheryan, Kinetics of Palm Oil Transesterificationin a Batch Reactor, JAOCS, Vol 77, no. 12, pp. 1263-1267,2000.

[9] M. Elowitz, A. Levine, E Siggia, P. Swain, Stochastic GeneExpression in a Single Cell, Science 297, 1183, 2002.

[10] R. Ghosh, C. Tomlin, Symbolic Reachable Set Computation ofPiecewise Affine Hybrid Automata and its Application to Biolog-ical Modeling: Delta-Notch Protein Signalling, Systems Biology,1:170-183, 2004.

[11] D. Gillespie, A General Method for Numerically Simulating theStochastic Time Evolution of Coupled Chemical Reactions. JComp. Phys., 22:403-434, 1976.

[12] E. Haseltine, J. Rawlings, Approximate simulation of coupled fastand slow reactions for stochastic chemical kinetics, J Chem. Phys.,117, 6959, 2002.

[13] J. Hespanha, A. Singh. Stochastic Models for Chemically ReactingSystems Using Polynomial Stochastic Hybrid Systems, Int. J.on Robust Control, Special Issue on Control at Small Scales,15:669689, 2005.

[14] J. Hu, M. Prandini, and S. Sastry, Probabilistic Safety Analysis inThree Dimensional Aircraft Flight, Proc. of 42nd IEEE Conf. onDecision and Control, pp. 5335-5340, 2003.

[15] J. Hu, W. Wu, and S. Sastry, Modeling Subtilin Production inBacillus subtilis Using Stochastic Hybrid Systems, Hybrid Sys-tems: Computation and Control 2004, LNCS, vol. 2993, pp. 417-431, 2004.

[16] X. Koutsoukos, Optimal Control of Stochastic Hybrid SystemsBased on Locally Consistent Markov Decision Processes, Int. J.of Hybrid Systems, 4, 301-318, 2004.

[17] X. Koutsoukos and D. Riley, Computational Methods for Reach-ability Analysis of Stochastic Hybrid Systems, Hybrid Systems:Computation and Control 2006 LNCS 3927, pp. 377-391, 2006.

[18] X. Koutsoukos and D. Riley, Computational Methods for Verifica-tion of Stochastic Hybrid Systems, IEEE Transactions on Systems,Man, and Cybernetics - Part A. To appear.

[19] H. Kushner, P. Dupuis, Numerical Methods for Stochastic ControlProblems in Continuous Time, Springer, 2001.

[20] H. Noureddini, D. Zhu, Kinetics of Transesterification of SoybeanOil, JAOCS, vol 74, no. 11, pp. 1457-1463, 1997.

[21] M. Puterman, Markov Decision Processes-Discrete Stochastic Dy-namic Programming, Wiley: Hoboken, New Jersey, 2005.

[22] H. Salis and Y. Kaznessis, Accurate hybrid stochastic simulation ofa system of coupled chemical or biochemical reactions, J. Chem.Phys., v122, pp. 54-103, 2005.

[23] R. Sridharan, I. Mathai, Transesterification Reactions, J. Sri. Ind.Res. Vol. 33, pp 178-187, 1974.

[24] Y. Zhang, M. Dube, D. McLean, M. Kates, Biodiesel Productionfrom Waste Cooking Oil: 1 Process Design and TechnologicalAssessment, Bioresource Technology, vol. 89, pp. 1-16, 2003.

2007 Mediterranean Conference on Control andAutomation, July 27 - 29, 2007, Athens - Greece

T14-004