NACoM-2003 Extended Abstracts 1 – 4 Constraint Reasoning with Differential Equations Jorge Cruz∗1 and Pedro Barahona∗∗1 1 Centro de Inteligência Artificial, Departamento de Informática, Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa, 2829-516 Caparica, Portugal Received 14 March 2003 System dynamics is naturally expressed by means of differential equations. Despite their expressive power, they are difficult to reason about and make decisions, given their non-linearity and the important effects that the uncertainty on data may cause. In contrast with traditional numerical simulations that may only provide a likelihood of the results obtained, we propose a constraint reasoning framework to enable safe decision support despite data uncertainty and illustrate the approach in the tuning of drug design. 1 Introduction Parametric differential equations are general and expressive mathematical means to model system dynamics. Notwithstanding its expressive power, reasoning with such models may be quite difficult, given their complexity. Analytical solutions are available only for the simplest models. Alternative numerical simulations require precise numerical values for the parameters involved, often impossible to gather given the uncertainty on available data. To overcome this limitation (given non-linearity, small differences on input values may cause important differences on the output produced), Monte Carlo methods rely on a large number of simulations to estimate the likelihood of the options under study. However, they cannot provide safe conclusions, given the various sources of errors accumulated in the simulations (both input and round-of errors). In contrast, constraint reasoning models the uncertainty of numerical variables within intervals of real numbers and propagates them through a network of constraints on these variables, to decrease the underlying uncertainty (i.e. width of the intervals). To be effective, these methods rely on advanced methods to constrain uncertainty sufficiently as to make safe decisions possible. Interval analysis techniques (e.g. the interval Newton [8]) provide efficient and safe methods for solving Continuous Constraint Satisfaction Problems [6] (CCSPs) where real variables are constrained by equalities and inequalities. These methods prune the variables domains to impose local consistency [1], guaranteedly loosing no solutions (value combinations satisfying all constraints). The results obtained may be further improved with search techniques for imposing stronger consistency requirements such as global hull consistency [3, 4]. In the context of differential equations, validated [9] and constraint based [7] approaches provide safe methods for solving initial value problems which verify the existence of unique solutions and produce guaranteed bounds for the true trajectory. We developed an approach [2, 5] that uses a validated method, Interval Taylor Series (ITS), to include Ordinary Differential Equations (ODEs) in the CCSP framework. An ODE system y 0 = f (y, t) is considered a restriction on the sequence of values that y can take over t. Since it does not fully determine the sequence of values of y (but rather a family of such sequences), further information is usually provided commonly in the form of initial or boundary conditions. An ODE system together with related information is denoted a Constraint Satisfaction Differential Problem (CSDP). ∗ ∗∗ Corresponding author: e-mail: jc@di.fct.unl.pt, Phone: +00 351 212 948 536, Fax: +00 351 212 948 541 Second author: e-mail: pb@di.fct.unl.pt, Phone: +00 351 212 948 536, Fax: +00 351 212 948 541 c 2003 WILEY-VCH Verlag GmbH & Co. KGaA, Weinheim ° 2 J. Cruz and P. Barahona: Constraint Reasoning with Differential Equations A brief introduction in section 2 shows the expressive power of the framework developed, and stresses the active use of less common constraints on upper and lower values of the functions involved, and on the time or the area under curve in which they exceed a certain threshold. The expressive power of the approach is illustrated in the tuning of drug design, presented in section 3. We show how the active use of constraints of the types above is sufficient to make safe decisions regarding the intended goals. The paper ends with a summary of the main conclusions. 2 Constraint Satisfaction Differential Problems In a CSDP a special variable (xODE ) is associated to an ODE system S for every t within the interval T through a special constraint, ODES,T (xODE ). Variable xODE represents all functions that are solutions of S (during T ) and satisfy all the additional restrictions. The other real valued variables of the CSDP, denoted restriction variables, are used to model a number of constraints of interest in many applications. Restriction V aluej,t (x), associates variable x with the value of a trajectory component j at a particular time t, and can be used to model initial and boundary conditions. Restriction maximumV aluej,T (x) associates x with the maximum value of a trajectory component j within a time interval T (minimum restrictions are similar). Restriction T imej,T,≥θ (x) constrains x to the time within T when trajectory component j exceeds a threshold θ. Similarly, restriction Areaj,T,≥θ (x) associates x with the area of a trajectory component j, within time period T , above threshold θ. The solving procedure for CSDPs that we developed maintains a safe enclosure for the set of possible solutions based on an ITS method for initial value problems. The improvement of such enclosure is combined with the enforcement of the ODE restrictions through constraint propagation on a set of narrowing functions associated with the CSDP. Some reduce the domain of a restriction variable given the current trajectory enclosure. The safety of such pruning is guaranteed by identifying functions within the current enclosure that maximise and minimise the restriction variable. For example, the area restriction variable is maximised by a function that for every value of t associates the maximum possible trajectory value within the current enclosure. Consequently, the upper bound of such restriction variable cannot exceed the area computed for such extreme function. Other narrowing functions safely reduce the uncertainty of the trajectory according to the domain of a restriction variable. For example, the trajectory enclosure cannot exceed the upper bound of a maximum restriction variable. Other narrowing functions reduce the uncertainty of the trajectory by successive application of the ITS method between consecutive time points. The full integration of a CSDP within an extended CCSP is accomplished by sharing the restriction variables of the CSDP. The CSDP solving procedure is used as a safe narrowing procedure for reducing the domains of the restriction variables. 3 A Differential Model for Drug Design The gastro-intestinal absorption process subsequent to the oral administration of a therapeutic drug is usually modeled by the following two-compartment model [10]: dx(t) = −p1 x(t) + D(t) dt dy(t) = p1 x(t) − p2 y(t) dt (1) x is the concentration of the drug in the gastro-intestinal tract; y is the concentration of the drug in the blood stream; D is the drug intake regimen; p1 and p2 are positive parameters. The effect of the intake regimen D(t) on the concentrations of the drug in the blood stream during the administration period is determined by the absorption and metabolic parameters, p1 and p2 . We assume that the drug is taken in a periodic basis (every six hours), providing a unit dosage that is uniformly dissolved into the gastro-intestinal tract during the first half hour. Maintaining such intake regimen, the solution where NACoM-2003 Extended Abstracts 3 of the ODE system asymptotically converges to a six hours periodic trajectory, the limit cycle, shown in Figure 1 for specific values of the ODE parameters. 1 1.5 y(t) x(t) 0.5 1 0 0.5 0 1 2 3 4 5 6 0 t 1 2 3 4 5 6 t Fig. 1 The periodic limit cycle with p1 = 1.2 and p2 = ln(2)/5. In designing a drug, it is necessary to adjust the ODE parameters to guarantee that the drug concentrations are effective, but causing no side effects. In general, it is sufficient to guarantee some constraints on the drug blood concentrations during the limit cycle, namely, to impose bounds on its values, on the area under the curve and on the total time it remains above some threshold. We show below how the extended CCSP framework can be used for supporting the drug design process. We will focus on the absorption parameter, p1 , which may be adjusted by appropriate time release mechanisms (the metabolic parameter p2 , tends to be characteristic of the drug itself and cannot be easily modified). The tuning of p1 should satisfy the following requirements during the limit cycle: (i) the concentration in the blood bounded between 0.8 and 1.5; (ii) its area under the curve (and above 1.0) bounded between 1.2 and 1.3; (iii) it cannot exceed 1.1 for more than 4 hours. 3.1 Using the Extended CCSP for Parameter Tuning The limit cycle and the different requirements may be represented in the extended CCSP framework. Due to the intake regimen definition D(t), the ODE system has a discontinuity at time t = 0.5, and is represented by two CSDP constraints in sequence. The first, PS1 , ranges from the beginning of the limit cycle (t = 0.0) to time t = 0.5, and the second PS2 , is associated to the remaining trajectory of the limit cycle (until t = 6.0). Both CSDP constraints include Value, Maximum Value, Minimum Value, Area and Time restrictions for associating variables with different trajectory properties. Besides variables representing the ODE parameters, the initial trajectory values and the final trajectory values, there are variables representing the maximum and minimum drug concentration values and respective area above 1.0 and time above 1.1 during the segment of time associated with each constraint. The extended CCSP P , shown below, connects in sequence the two ODE segments by assigning the same variables to both the final values of PS1 and the initial values of PS2 (parameters p1 and p2 are shared by both constraints). Moreover, the 6 hours period is guaranteed by the assignment of the same variables to both the initial values of PS1 and the final values of PS2 . In addition to the restriction variables of each ODE segment, new variables for the whole trajectory sum up the values in each segment. CCSP P = (X, D, C) where: X = < x0 , y0 , p1 , p2 , x05 , y05 , ymax1 , ymax2 , ymin1 , ymin2 , ya1 , ya2 , yarea , yt1 , yt2 , ytime > D = <Dx0 ,Dy0 ,Dp1 ,Dp2 ,Dx05 ,Dy05 ,Dymax1 ,Dymax2 ,Dymin1 ,Dymin2 ,Dya1 ,Dya2 ,Dyarea ,Dyt1 ,Dyt2 ,Dytime > C = { PS1 (x0 , y0 , p1 , p2 , x05 , y05 , ymax1 , ymin1 , ya1 , yt1 ), yarea = ya1 + ya2 , PS2 (x05 , y05 , p1 , p2 , x0 , y0 , ymax2 , ymin2 , ya2 , yt2 ), ytime = yt1 + yt2 , } The tuning of drug design may be supported by solving P with the appropriate set of initial domains for its variables. We will assume p2 to be fixed to a five-hour half live (Dp2 = [ln(2)/5]) and p1 to be adjustable up to about ten-minutes half live (Dp1 = [0..4]). The initial value x0 , always very small, 4 J. Cruz and P. Barahona: Constraint Reasoning with Differential Equations is safely bounded in interval Dx0 = [0.0..0.5]. Additionally, the following bounds are imposed by the previous drug requirements: Dymin1 = [0.8..1.5], Dymax1 = [0.8..1.5], Dyarea = [1.2..1.3], Dymin2 = [0.8..1.5], Dymax2 = [0.8..1.5], Dytime = [0.0..4.0] Solving the extended CCSP P (enforcing global hull consistency), with a precision of 0.001, narrows the original p1 interval to [1.191..1.543] in less than 3 minutes (the tests were executed in a Pentium 4 computer at 1.5 GHz with 128 Mbytes memory). Hence, for p1 outside this interval the set of requirements cannot be satisfied. This may help to adjust p1 but offers no guarantees on specific choices within the obtained interval. However, guaranteed results may be obtained for particular choices of the p1 values. Solving P with initial domains Dx0 = [0.0..0.5], Dy0 = [0.8..1.5], Dp1 = [1.3..1.4] and Dp2 = [ln(2)/5] narrows the remaining unbounded domains to: ymin1 ∈ [0.881..0.891], ymax1 ∈ [1.090..1.102], yarea ∈ [1.282..1.300], ymin2 ∈ [0.884..0.894], ymax2 ∈ [1.447..1.462], ytime ∈ [3.908..3.967] Notwithstanding the uncertainty, these results do prove that with p1 within [1.3..1.4] (an acceptable uncertainty in the manufacturing process), all limit cycle requirements are safely guaranteed. Moreover, they offer some insight on the requirements showing, for instance, the area to be the most critical constraint. 4 Conclusion This paper presents a framework to make decisions with models expressed by differential equations, with a constraint reasoning approach. In contrast to Monte Carlo and other stochastic techniques that can only assign likelihoods to the different decision options, and despite the data uncertainty and approximation errors during calculations, the enhanced propagation techniques developed (enforcing global hull consistency) allow safe decisions to be made. Whereas the traditional use of complex differential models for which there are no analytical solutions is currently unsafe, the constraint reasoning framework extends the possibility of practical introduction of this type of models in decision making, specially when safe decisions are required. References [1] Collavizza, H., Delobel, F., Rueher, M.: A Note on Partial Consistencies over Continuous Domains. Principles and Practice of Constraint Programming. Springer (1998) 147-161. [2] Cruz, J., Barahona, P.: Handling Differential Equations with Constraints for Decision Support. Frontiers of Combining Systems, Springer (2000) 105-120. [3] Cruz J., Barahona, P.: Global Hull Consistency with Local Search for Continuous Constraint Solving. 10th Portuguese Conference on AI. Springer (2001) 349-362. [4] Cruz J., Barahona, P.: Maintaining Global Hull Consistency with Local Search for Continuous CSPs. 1st Int. Workshop on Global Constrained Optimization and Constraint Satisfaction, Sophia-Antipolis, France (2002). [5] Cruz J.: Constraint Reasoning for Differential Equations. PhD thesis, submitted (2003). [6] Sam-Haroud, D., Faltings, B.V.: Consistency Techniques for Continuous Constraints. Constraints 1(1,2) (1996) 85-118. [7] Janssen, M., Van Hentenryck, P., Deville, Y.: Optimal Pruning in Parametric Differential Equations. Principles and Practice of Constraint Programming. Springer (2001). [8] Moore R.E.: Interval Analysis. Prentice-Hall, Englewood Cliffs, NJ (1966). [9] Nedialkov, N.S.: Computing Rigorous Bounds on the Solution of an Initial Value Problem for an Ordinary Differential Equation. PhD thesis, Univ. of Toronto, Canada (1999). [10] Spitznagel, E.: Two-Compartment Pharmacokinetic Models. C-ODE-E. Harvey Mudd College, Claremont, CA (1992).