Constraint Satisfaction Differential Problems - CiteSeerX

2 downloads 0 Views 202KB Size Report
ber of decision making problems, such as those arising in the biomedical ... ematical tool to model system dynamics (e.g. biomedical systems) are not ac-.
Constraint Satisfaction Differential Problems Jorge Cruz and Pedro Barahona Centro de Inteligˆencia Artificial, DI/FCT/UNL, 2829-516 Caparica, Portugal, {jc,pb}@di.fct.unl.pt

Abstract. System dynamics is often modeled by means of parametric differential equations. Despite their expressive power, they are difficult to reason about and make safe decisions, given their non-linearity and the important effects that the uncertainty on data may cause. Either by traditional numerical simulation or relying on constraint based methods, it is difficult to express a number of constraints on the solution functions (for which there are usually no analytical solutions) and these constraints may only be handled passively, with generate and test techniques. In contrast, the framework we propose not only extends the declarativeness of the constraint based approach but also makes an active use of constraints on the solution functions, which makes it particularly suited for a number of decision making problems, such as those arising in the biomedical applications presented in the paper.

1

Introduction

Many real world problems can be modeled as Continuous Constraint Satisfaction Problems (CCSPs) where variable domains are continuous real intervals and constraints are equalities and inequalities [7]. Constraint reasoning handles the uncertainty of model parameters, by modeling them as numerical variables ranging over given bounds (e.g. intervals of real numbers) and propagates such knowledge through a network of constraints on these variables, in order to decrease the underlying uncertainty (i.e. width of the intervals). However, parametric differential equations, a general and expressive mathematical tool to model system dynamics (e.g. biomedical systems) are not accommodated in the usual CCSP framework. This is not a major problem only if such systems have analytical solutions, where an explicit representation of the solution functions can be expressed by means of constraints on the parameters, making it possible to take full advantage of constraint reasoning. The handling of differential equations in the constraint setting has already been addressed [6, 8], but only in the limited setting of Initial Value Problems (IVP), which aim at computing, from a set of differential equations and some initial values, the trajectory of the corresponding solution functions. In contrast with classical numerical approaches that compute numerical approximations of the solutions but do not provide any guarantees on their accuracy, interval methods [11, 14, 13], also known as validated methods, do verify the existence of unique solutions and produce guaranteed error bounds for the solution trajectory along the whole interval of time T .

For such constraints, often required in decision support problems, the validated methods require additional generate and test procedures, where such constraints are used passively. Certain intervals on the parameters are used to generate trajectories, which are subsequently tested, so as to accept or reject such intervals. In this paper we present a new kind of constraint, a Constraint Satisfaction Differential Problem (CSDP), which represents a differential equation together with additional related information, and we include it in the general CCSP framework extending its expressive power. Appropriate narrowing functions are defined and used for the propagation of such constraints. Although not discussed in the paper, it is worth mentioning that the effectiveness of the whole approach depends significantly on the type of propagation used in the general CCSP framework. Some examples show the usefulness of imposing global-hull consistency [2–4]), a higher-level consistency criterion built on top of the usual basic criteria (e.g. box-consistency [1] or 2Bconsistency [9]). The paper is organised as follows. After a brief overview of the relevant concepts related with differential equations and their solving procedures, section 2 presents differential equations as CSDPs and their integration in an extended CCSP framework. Section 3 presents a procedure for solving CSDPs. Sections 4 and 5 present two examples in the biomedical area, which show the potential of the formalism developed. The paper ends with a summary of the main conclusions.

2 2.1

Constraint Satisfaction Differential Problems Ordinary Differential Equations

The behaviour of many systems is naturally modelled by a system of first order Ordinary Differential Equations (ODEs), often parametric. ODEs are equations that involve derivatives w.r.t. a single independent variable, t, usually representing time. An ODE system S, represented in vector notation as dy = f (y, t) dt determines, for an instantiation of y and t, the evolution of y for an increment of t, and may be regarded as a restriction on the sequence of values that y can take over t. A solution of the above ODE system, for a time interval T , is a function s such that: ds ∀t ∈ T : = f (s(t), t) dt Since S does not fully determine the sequence of values of y (but rather a family of such sequences, that is, a family of solutions of S), initial / boundary conditions are usually provided with a complete / partial specification of y at some time point t.

An Initial Value Problem (IVP) is characterised by an ODE system S together with the initial condition y(t0 ) = y0 . A solution of the IVP w.r.t. an interval of time T (t0 ∈ T ) is a solution s of S (during T ) that satisfies s(t0 ) = y0 . Classical numerical approaches for solving IVPs [16] compute numerical approximations of the solutions and do not provide guarantees on their accuracy. A sequence of discrete points t0 , t1 , . . . , ti is considered within the interval of time T and for each new point ti+1 , the solution s(ti+1 ) is approximated by a value si+1 computed from the approximated values at the previous points. In contrast, interval methods [11, 14, 13] do verify the existence of unique solutions and produce guaranteed error bounds for the solution trajectory along the whole interval of time T . They use interval arithmetic to calculate each approximation step, explicitly keeping the error term within safe interval bounds. In most interval approaches, each step between two consecutive points ti and ti+1 generally consists of two phases. The first validates the existence of a unique solution and calculates an a priori enclosure of it between the two points. In the second phase, a tighter enclosure of the solution function at point ti+1 is obtained through interval arithmetic over a numerical approximation step, with the error term bounded as a result of the enclosure of the previous phase. Interval Taylor Series (ITS) methods [11, 13] are often used due to its simple error term form. The enclosure for the set of solutions between points ti and ti+1 may be achieved through the application of the Picard-Lindelf operator [14] or an alternative higher order method [13]. The tighter enclosure of the solution function at point ti+1 is obtained through an interval extension of the Taylor Series expansion around ti . The recent application of constraint techniques for solving IVPs seems to provide competitive results either in the precision of the trajectory enclosure bounds or in the efficiency of the computations [6, 8]. The novelty of the approach is the subdivision of the second phase into a predictor process, for computing an initial enclosure, and a corrector process, for narrowing this enclosure, both based on constraint techniques. However, the goal of these methods is not the integration of differential integration in constraint reasoning. They rather use constraint propagation techniques for improving the traditional methods for solving IVPs. 2.2

Representing ODE Problems with CSDPs

All the information traditionally associated with an ODE problem may be represented as a CSDP. Moreover, the framework allows the specification of additional useful information that cannot be easily handled by classical approaches. A CSDP is a Constraint Satisfaction Problem (CSP) with a special variable, a special constraint and additional constraints and variables for representing additional restrictions. The special variable (xODE ), whose domain is a set of functions, is associated with an ODE system S for every t within the interval T through the ODE constraint, ODES,T (xODE ). Variable xODE , denoted solution variable, represents those functions that are solutions of S (during T ) and satisfy all the additional restrictions.

Definition 1. (ODE Constraint). Let S be an n-ary ODE system defined as dy n dt = f (y, t), T a real interval, and FT the set of all functions from T to R . The ODE constraint, denoted ODES,T (xODE ), is defined by means of: 1. a unary constraint scope: the solution variable xODE ; 2. a constraint relation ρ = {hsi|s ∈ FT ∧ ∀t ∈ T : ds dt = f (s(t), t)}. The other variables of the CSDP, denoted restriction variables, are all real valued variables used to model a number of constraints of interest in many applications. These constraints, generally denoted as ODE restrictions, associate some restriction variable with the value of some property of the ODE solutions. Such a property is specified through a function from the set of functions FT to R. Definition 2. (ODE Restriction). Let S be an n-ary ODE system defined as dy n dt = f (y, t), T a real interval, FT the set of all functions from T to R , and r a function from FT to R. An ODE restriction w.r.t. r is defined by means of: 1. a binary constraint scope: the solution variable xODE and a real variable x; 2. a constraint relation ρ = {hs, vi|s ∈ FT ∧ v ∈ R ∧ v = r(s)}. With the above definitions, a CSDP may be formalized as a special CSP. Definition 3. (CSDP). Let S be an n-ary ODE system dy dt = f (y, t), T a real interval, and FT the set of all functions from T to Rn . A CSDP is a CSP where: 1. the set of variables includes the solution variable xODE and m restriction variables x1 ,. . . ,xm ; 2. the initial domain of the solution variable DxODE is FT and the initial domains of the restriction variables Dx1 ,. . . ,Dxm are real intervals; 3. the set of constraints is composed of the ODE constraint ODES,T (xODE ) and a set of ODE restrictions with scope hxODE , xi i(1 ≤ i ≤ m). In a CSDP, initial and boundary conditions are represented by an appropriate set of constraints denoted Value restrictions. A Value restriction V aluej,t (x) associates a variable x with the value of a trajectory component j at a particular time t. Definition 4. (Value Restriction). Let S be an n-ary ODE system defined as dy dt = f (y, t), T a real interval, tp ∈ T and 1 ≤ j ≤ n. Let FT be the set of functions from T to Rn , r a function from FT to R, s ∈ FT and sj the j th component of s. A Value restriction V aluej,tp (x) is an ODE restriction w.r.t. r defined as: r(s) = sj (tp ). Besides initial and boundary conditions, and regarding an ODE solution as a continuous vector function (and each of its components as a continuous real function), several other conditions of interest may be imposed. Important properties of a continuous function are its maximum and minimum values. Maximum restriction M aximumj,τ (x) associates x with the maximum value of a trajectory component j within a time interval τ (Minimum restrictions are similar).

Definition 5. (Maximum Restriction). Let S be an n-ary ODE system defined as dy dt = f (y, t), τ ⊆ T real intervals and 1 ≤ j ≤ n. Let FT be the set of functions from T to Rn , r a function from FT to R, s ∈ FT and sj the j th component of s. A Maximum restriction M aximumj,τ (x) is an ODE restriction w.r.t. r defined as: r(s) = sj (tp ) with tp ∈ τ and ∀t∈τ sj (t) ≤ sj (tp ). Other important ODE restrictions provided in the CSDP framework are Time, Area, First and Last restrictions. A Time restriction T imej,τ,≥θ (x) associates x with the time within time period τ in which the value of a trajectory component j exceeds a threshold θ. Similarly, the Area restriction Areaj,τ,≥θ (x) associates x with the area of a trajectory component j, within time period τ , above threshold θ. The First restriction F irstV aluej,τ,≥θ (x) associates x with the first time within τ in which the value of a trajectory component j exceeds θ. Restrictions F irstM aximumj,τ (x) and F irstM inimumj,τ (x) associate x with the first time within τ in which the value of a trajectory component j is respectively a maximum or a minimum. Last restrictions LastV aluej,τ,≥θ (x), LastM aximumj,τ (x) and LastM inimumj,τ (x) are similar. Representing an ODE problem as a CSDP. Consider the ODE system S: dy1 (t) = −0.7y1 (t) dt

dy2 (t) ln(2) = 0.7y1 (t) − y2 (t) dt 5

(1)

with a boundary condition y1 (0) = 1.25 and an additional restriction requiring the maximum value of y2 between t = 1 and t = 3 to lie within interval [1.1..1.3], for which we are interested in the value of y2 at t = 6. Such ODE problem is represented as a CSDP with the following constraints: 1. an ODE constraint ODES,[0..6] (xODE ) associating the solution variable xODE with the ODE system S for every t within the time interval [0..6]; 2. a Value restriction V alue1,0 (x1 ) associating variable x1 with y1 (0); 3. a Maximum restriction M aximum2,[1..3] (x2 ) associating variable x2 with the maximum value of y2 within time interval [1..3]; 4. a Value restriction V alue2,6 (x3 ) associating variable x3 with y2 (6); The initial domains of restriction variables x1 and x2 are, respectively, Dx1 =1.25 for enforcing the initial condition and Dx2 =[1.1..1.3] for imposing the maximum value requirement. Since x3 represents an output variable, its initial domain is unbounded. The initial domain of the solution variable xODE is the set F[0..6] of all functions from [0..6] to R2 . Figure 1 illustrates the problem, showing the CSDP solutions (grey area) and the respective restriction variable domains. 2.3

Integrating CSDP Constraints into Extended CCSPs

The full integration of a CSDP within an extended CCSP is accomplished by sharing the restriction variables of the CSDP. The CSDP is a constraint restraining the possible values of such variables. The CSDP solving procedure is used as a safe narrowing procedure to reduce the domains of the restriction variables.

1.5

1.5 x1

x2 x3

s2(t)

s1(t)

0.0

0.0 0

1

2

3

4

5

6

0

1

2

3

4

5

6

Fig. 1. The CSDP representation of an ODE problem. Its solutions and variables

Definition 6. (CSDP constraint). A CSDP constraint is a constraint defined as a CSDP where: 1. the constraint scope is the set of the CSDP restriction variables; 2. the constraint relation is the set of the possible combination values of the restriction variables from the whole set of solutions of the CSDP. Definition 7. (Extended CCSP). An extended CCSP is a CSP where each variable domain is a real interval and each constraint is either an equality constraint, an inequality constraint or a CSDP constraint.

3

Solving a CSDP

This section presents a procedure to handle a CSDP aiming at pruning the domains of its restriction variables. This is implemented as a function solveCSDP which, from a real box representing the domains of the restriction variables, returns a smaller real box discarding some value combinations that can be proved to be inconsistent with the CSDP. As long as the solveCSDP function is correct, not eliminating any possible CSDP solution, and contracting, returning a smaller real box, it may be used by the extended CCSP as a correct narrowing function for the CSDP constraint. The additional narrowing functions associated with the CSDP constraints, together with the usual narrowing functions associated with the numerical constraints, completely characterize the set of narrowing functions of an extended CCSP. This set may be used by a constraint propagation algorithm to prune the domains of the extended CCSP variables. The solving procedure for CSDPs that we developed maintains a safe enclosure for the set of possible ODE solutions based on validated methods for solving IVPs. This enclosure is used for the representation of the domain of the solution variable and is denoted the ODE trajectory. The quality 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. The next subsection presents the ODE trajectory enclosure. Subsection 3.2 illustrates some of the narrowing functions associated with the CSDP. Subsection 3.3 describes how these narrowing functions are integrated in the constraint propagation algorithm for narrowing the domains of the CSDP variables.

3.1

The ODE Trajectory

An ODE trajectory T R is implemented as a pair of ordered lists T R=hT P, T Gi. List T P defines a sequence of k trajectory time points tp along the interval of time T (associated with the CSDP) together with corresponding n-ary boxes representing enclosures for the ODE solution values at these points. The first and last time points of such list are the lower and upper bounds of T respectively. List T G defines the sequence of k − 1 trajectory time gaps (between each pair of consecutive time points, tpi and tpi+1 , of the previous list) and the associated n-ary boxes representing enclosures for the ODE solution values between those points. The boxes associated with the elements of these lists are represented as T P (tp ) and T G([tpi ..tpi+1 ]) and the intervals associated with their j th component (1 ≤ j ≤ n) as T Pj (tp ) and T Gj ([tpi ..tpi+1 ]). Figure 2 shows an ODE trajectory representing a safe enclosure for the set of possible ODE solutions of the CSDP presented in 2.2 (see figure 1). The ODE trajectory is defined through a sequence of seven time points and the time gaps in between. For each component, the intervals associated to each time point and time gap are represented, respectively, as a vertical line and a dashed rectangle.

1.5

1.5

s2(t)

s1(t)

0.0

0.0 0

1

2

3

4

5

6

0

1

2

3

4

5

6

Fig. 2. An ODE trajectory enclosing the ODE solutions of a CSDP

The ODE trajectory of figure 2 represents the set of all functions from [0..6] to R2 whose components are continuous functions enclosed by the rectangles and crossing the vertical lines. This includes any possible ODE solution and so this ODE trajectory is a safe enclosure for the set of ODE solutions of the CSDP. During the solving process, the ODE trajectory is modified by the narrowing functions associated with the constraints of the CSDP. Each change of the trajectory is either the narrowing of some box (associated with a time point or gap) or the addition of a new time point (and reformulation of the ordered lists). 3.2

CSDP Narrowing Functions

In any constraint propagation algorithm based on a set of narrowing functions, each such function is a mapping between subsets of the variable domains where the new element is obtained from the original by eliminating some value combinations incompatible with a particular CSP constraint. Thus, applying a narrowing

function, the new element cannot be larger (w.r.t. set inclusion) than the original element (boxes are contracted into smaller boxes) and the discarded elements cannot contain solutions of the CSP (the procedure is correct). In the case of the CSDP narrowing functions, the contracting property is generally attained by preventing the enlargement of any interval domain, either from a restriction variable or from a component of any box of the ODE trajectory. Additionally, the correctness property must be guaranteed for each constraint relation used by the narrowing function for pruning the variable domains. Associated with the constraint relation of each ODE restriction a pair of narrowing functions is defined: one responsible for reducing the current domain I of the restriction variable given the current ODE trajectory enclosure T R and the other responsible for reducing the uncertainty of T R according to I. In the first case, the correctness property may be achieved by identifying, within T R, the functions that maximise and minimise the values of the restriction variable and guaranteeing that its new domain includes those values. In the second case, this reduction is achieved through the narrowing of one or more boxes of T R and correctness is guaranteed if, considering in isolation each narrowed interval, there are no discarded functions with a value (of the restriction variable) in I. The following definitions associate narrowing functions with Value and Maximum restrictions (similar ones exist for the other types of ODE restrictions). Definition 8. (Value Narrowing Functions). Let T R=hT P, T Gi be the trajectory enclosure representing the domain of xODE and I the domain of x. Let T R0 be the trajectory enclosure obtained from T R by changing T Pj (tp ) to T Pj (tp )∩I. The restriction V aluej,tp (x) has associated the narrowing functions: 1. N F1 (hT R, . . . , I, . . .i) = hT R, . . . , T Pj (tp ) ∩ I, . . .i 2. N F2 (hT R, . . . , I, . . .i) = hT R0 , . . . , I, . . .i Definition 9. (Maximum Narrowing Functions). Let T R=hT P, T Gi be the trajectory enclosure representing the domain of xODE and I=[i1 ..i2 ] the domain of x. Let a be the maximum of the lower bounds of T Pj (tp ) for any trajectory time point tp within τ . Let b be the maximum of the upper bounds of T Gj ([tpi ..tpi+1 ]) for any trajectory time gap [tpi ..tpi+1 ] within τ . Let T R0 be the enclosure obtained from T R by changing T Pj (tp ) into T Pj (tp ) ∩ [−∞..i2 ] and T Gj ([tpi ..tpi+1 ]) into T Gj ([tpi ..tpi+1 ]) ∩ [−∞..i2 ] for every time point tp and gap [tpi ..tpi+1 ] within τ . The restriction M aximumj,τ (x) has associated the narrowing functions: 1. N F1 (hT R, . . . , I, . . .i) = hT R, . . . , [a..b] ∩ I, . . .i 2. N F2 (hT R, . . . , I, . . .i) = hT R0 , . . . , I, . . .i Figure 3 illustrates the narrowing functions for the M aximum2,[1..3] (x2 ) restriction of the CSDP presented in 2.2 for the enclosure represented in Figure 2. All the remaining narrowing functions of a CSDP are associated with the ODE constraint relation and are responsible for reducing the uncertainty of the trajectory enclosure by the successive application of an Interval Taylor Series (ITS) method between consecutive time points. The narrowing function N Flink uses the ITS method to validate (link) some time gap for which the method was never applied in either direction. As a consequence, besides the safe elimination from the ODE trajectory of some functions

b 1.5

[a..b]

i2

a



s2(t)

−∞

0.0 0

1

2

3

4

5

6

Fig. 3. Narrowing functions associated with a Maximum restriction

incompatible with the ODE constraint, the time gap may become completely or partially validated (in this case, a new time point is inserted and the link narrowing function must be reapplied to completely validate the gap). The propagate narrowing function N Fpropagate prunes the ODE trajectory through the reapplication of the ITS method over some time gap, which is chosen to contain the time point with the largest enclosure reduction since the previous application of the ITS method. This heuristics assumes that, when an enclosure for the ODE solutions at some time point is reduced by some narrowing function, the reapplication of the ITS method over the adjacent time gaps may further prune these gaps. Moreover, the repeated application of the interval step method triggered by the reduction of the enclosures propagates this pruning along the ODE trajectory gaps, previously validated with larger starting enclosures. Additionally, for each ODE restriction, a narrowing function N Fimprove may also be associated with the ODE constraint to improve the ODE trajectory, thus reducing the restriction variable domain. In general, the narrowing functions responsible for reducing the domain of the restriction variable (except the Value narrowing functions) depend on the time gap enclosures of the ODE trajectory. Therefore, by reducing such time gap enclosures, the restriction variable domain may eventually be narrowed. This is the goal of an improve narrowing function, that is, to reduce some time gap enclosure that later may trigger some other narrowing function associated with an ODE restriction and reduce the domain of a restriction variable. The reduction of the time gap enclosure is achieved through the insertion of a new time point within the gap and the subsequent application of the ITS method linking this point with its adjacent neighbours. 3.3

CSDP Constraint Propagation Algorithm

The constraint propagation algorithm for pruning the domains of the CSDP variables is derived from the propagation algorithm AC3 [10]. The only difference is the imposition of an ordering on the application of the narrowing functions. Since there are no guarantees of monotonicity for the narrowing functions associated with the CSDP constraints, the order of their application may be crucial, not only for the efficiency of the propagation but also for the pruning achieved. The strategy followed by the algorithm is to propagate as soon as possible any information related with the restriction variables and delay as much as pos-

sible the application of the narrowing functions for reducing the ODE trajectory uncertainty. The reason is that whereas the former are easy to deal with and may provide fast domain pruning, the latter may be computationally more expensive as they require the application of the ITS method. Among the narrowing functions for reducing the ODE trajectory uncertainty, the selection criterion favours the propagate narrowing function that spread as much as possible any domain reduction achieved by any other narrowing function. Moreover, since it does not make sense to try to improve an ODE trajectory that is not completely validated, the link narrowing function is always preferred to any of the improve narrowing functions. Lack of space prevents us to present at greater detail the algorithm that was developed. These details may be found in [Cru03], together with the proof that the algorithm is correct and terminates.

4

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 two-compartment model [17]: dx(t) = −p1 x(t) + D(t) dt

dy(t) = p1 x(t) − p2 y(t) dt

(2)

where

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 on 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 of the ODE system asymptotically converges to a six hours periodic trajectory called the limit cycle, shown in Figure 4 for specific values of the ODE parameters. 1

1,5

0,5

x(t)

y(t)

1

0

0,5 0

1

2

3

t

4

5

6

0

1

2

3

4

t

Fig. 4. The periodic limit cycle with p1=1.2 and p2=ln(2)/5

5

6

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, by imposing bounds on its values, on the area under the curve and on the total time it remains above some threshold. Figure 5 shows maximum, minimum, area (≥ 1.0) and time (≥ 1.1) values for the limit cycle of figure 4.

maximum area (≥1) minimum

y(t)

1 t time (≥1.1)

Fig. 5. Maximum, minimum, area and time values at the limit cycle

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. 4.1

Using the Extended CCSP for Parameter Tuning

The limit cycle and all the requirements may be represented as an extended CCSP. 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 (≥1.0) and time (≥1.1) during the time associated with each constraint. The extended CCSP P 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 . Besides considering all the restriction variables of each ODE segment, new variables for the whole trajectory sum 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 fivehour 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, 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 10−3 , narrows the original p1 interval to [1.191, 1.543] in less than 3 minutes (the tests were executed in a Pentium 4 at 1.5 GHz with 128 Mb memory). Hence, for p1 outside this interval the set of requirements cannot be satisfied. Note the importance of imposing global hull consistency as mentioned above. With a local consistency criteria (either box- or 2B-consistency), no pruning of the above parameter domains is achieved. Enforcing bound-consistency [15] does not achieve the same level of pruning (only prunes the parameter domain to [1.156..1.580] - an increase of 20% in the domain width) in a comparable time. 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.

5

The SIR Model of Epidemics

The SIR model [12] is a well-known model of epidemics which divides a population into three classes of individuals and is based of the ODE system: dS(t) = −rS(t)I(t) dt

dI(t) = rS(t)I(t) − aI(t) dt

dR(t) = aI(t) dt

(3)

where S are the susceptibles, individuals who can catch the disease; I are the infectives, individuals who have the disease and can transmit it; R are the removed, individuals who had the disease and are immune/dead; r and a are positive parameters. The model assumes that the total population is constant N =S(t)+I(t)+R(t) and the incubation period is negligible. Parameter r accounts for the efficiency of the disease transmission (proportional to the frequency of contacts between susceptibles and infectives) and a measures the recovery rate from the infection. Important questions in epidemic situations are: whether the infection will spread or not; what will be the maximum number of infectives; when will it start to decline; when will it ends; and how many people will catch the disease. In the following study we will use the extended CCSP framework to answer each of the above questions. We use the data reported in the British Medical Journal (4th March 1978) from an influenza epidemic that occurred in an English boarding school (taken from [12]): a single boy (from a total population of 763) initiated the epidemic and the evolution of the number of infectives is available daily, from day 3 to the end of the epidemic (day 14). The goal of our study is to predict what would happen if a similar disease occurs in a different place, say a small town with a population of about 10000 individuals. Moreover, if there is a vaccine to that disease, what would be the vaccination rate necessary to guarantee that the maximum number of infectives never exceeds some predefined threshold, for example, half of the total population. 5.1

Using an Extended CCSP for Predicting Epidemic Behaviour

The first step for solving the above problem is to characterize an epidemic disease which is similar to the one reported in the boarding school. The classical approach would be to perform a numerical best fit approximation to compute the parameter values r0 and a0 that minimize the resid¢2 Pm ¡ ual: j=1 I(tj ) − Itj where It1 , . . . , Itm are the infectives observed at times t1 , . . . , tm , and I(t1 ), . . . , I(tm ) their respective values predicted by the SIR model (3) with r = r0 and a = a0 . In [12] this method is used to compute r = 0.00218 and a = 0.44036 with a residual of 4221. An alternative approach, possible in a constraints framework, is to relax the imposition of the ”best” fit and merely impose a ”good” fit, requiring, for example, that the residual does not exceed 4800. Such problem can be represented as an extended CCSP P with a CSDP constraint and a numerical constraint. The CSDP constraint PS , represents the evolution of the susceptibles and infectives (the 1st and 2nd components of the model) during the first 14 days (in the equations the r parameter is multiplied by 0.01 re-scaling it to the interval [0..1]; the best fit value is thus re-scaled to r=0.218). This CSDP contains several Value restrictions for associating variables with: the initial values of the susceptible (s0 ) and infective (i0 ); the parameter values (r and a); and the values of the infective at times 3, . . . , 14 (i3 , . . . , i14 ). The numerical constraint defines the residual (R) from the above variables (i3 , . . . , i14 ) and the observed values (constants k3 , . . . , k14 ).

CCSP P = (X, D, C) where: X =< s0 , i0 , r, a, i3 , . . . , i14 , R > D =< Ds0 , Di0 , Dr, Da, Di3 , . . . , Di14 > P, DR 14 2 C = { PS (s0 , i0 , r, a, i3 , . . . , i14 ), R = j=3 (ij − kj ) } Assuming very wide initial parameter ranges (Dr=Da=[0..1]), the ”good” fit requirement can be enforced by solving P with the residual initial domain DR=[0..4800] (the values of the susceptible and infective are initialized accordingly to the report: Ds0 =762, Di0 =1). Solving P (enforcing global hull consistency) with precision 10−6 , the parameter ranges are narrowed from [0..1] to: r ∈ [0.213..0.224], a ∈ [0.423..0.468] Once obtained the parameter ranges that may be considered acceptable to characterize epidemic diseases similar to the one observed, the next step is to use them for making predictions in the context of a population of 10000 individuals. In this case a single CSDP constraint represents the first two components of the model together with ODE restrictions associating variables with the predicted values (besides the Value restrictions to associate variables with the parameter values r and a and the initial values s0 and i0 ). A Maximum restriction represents the infectives maximum value imax and a First restriction represents the time of such maximum tmax . A Last restriction represents the duration tend of the epidemics as the last time that the number of infectives exceeds 1. Finally a Value restriction represents the number of people s25 that are still susceptible at a time (25) safely after the end of the epidemics. Solving such problem with the parameters ranging within the previously obtained intervals Dr=[0.213..0.224] and Da=[0.423..0.468], the initial value domains Ds0 =9999 and Di0 =1, and all the other variable domains unbounded, the results obtained for these domains indicated that: imax ∈ [8939..9064] clearly suggesting the spread of a severe epidemics; tmax ∈ [0.584..0.666] and tend ∈ [20.099, 22.405] predicting that the maximum will occur during the first 14 to 16 hours, starting then to decline and ending before the 10th hour of day 22; s25 ∈ [0..0.001] showing that everyone will eventually catch the disease. If the administration of a vaccine is considered at a rate λ proportional to the number of infectives then, the differential model must be modified into: dS(t) dI(t) dR(t) = −rS(t)I(t) − λS(t) = rS(t)I(t) − aI(t) = aI(t) + λS(t) dt dt dt The requirement that the maximum of infectives cannot exceed half of the population is represented by adding the constraint imax ≤ 5000. Solving this CCSP with the λ initial domain [0, 1.5], its lower bound is raised up to 0.985 indicating that at least such vaccination rate is necessary to satisfy the requirement.

6

Conclusion

This paper extends the Continuous Constraint framework enabling the declarative expression of system dynamics, traditionally modelled by means of parametric differential equations. This is particularly important for decision support

applications where one is interested in finding the range of parameters for which some constraints on the solutions of such differential equations are met. Previous approaches rely on the generation of numerical solutions (either by traditional or constraint based numerical methods) that have to be subsequently tested for the satisfaction of constraints. Given the non-linearity nature of these constraints, a potentially very large number of values (or intervals) for the problem parameters have to be tested passively (possibly with Monte Carlo techniques that only provide probabilistic measures of satisfaction). The constraint approach proposed in this paper makes an active use of complex constraints, making it more expressive and fully declarative. Although the paper focuses on these features, we intend to assess its efficiency in the future, and explore alternative algorithms to solve CSDPs, namely those that have been proposed to obtain tighter ODE enclosures [6, 8]. Acknowledgements This work was partly supported by Project Protein (POSI /33794/SRI/2000), funded by the Portuguese Foundation for Sc. and Tech.

References 1. Benhamou, F., McAllester, D., Van Hentenryck, P.: CLP(Intervals) revisited. Logic Programming Symposium, MIT Press (1994) 124-131. 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 CCSPs. Global Constrained Optimization Constraint Satisfaction, France (2002). 5. Cruz, J.: Constraint Reasoning for Differential Equations. PhD thesis, Univ. Nova Lisboa, Portugal, submitted (2003). 6. Deville, Y., Janssen, M., Van Hentenryck, P.: Consistency Techniques in ODEs. Principles and Practice of Constraint Programming. 162-176, Springer, (1998). 7. Sam-Haroud, D., Faltings, B.V.: Consistency Techniques for Continuous Constraints. Constraints 1(1,2) (1996) 85-118. 8. Janssen, M., Van Hentenryck, P., Deville, Y.: Optimal Pruning in Parametric Differential Equations. Principles Practice of Constraint Programming. Springer (2001). 9. L’homme, O.: Consistency Techniques for Numeric CSPs. IJCAI, (1993) 232-238. 10. Montanari, U.: Networks of Constraints: Fundamental Properties and Applications to Picture Processing. Information Science 7(2) (1974) 95-132. 11. Moore R.E.: Interval Analysis. Prentice-Hall, Englewood Cliffs, NJ (1966). 12. Murray, J. D.: Mathematical Biology, 2nd Edition, Springer (1991) 13. Nedialkov, N.S.: Computing Rigorous Bounds on the Solution of an IVP for an Ordinary Differential Equation. PhD thesis, Univ. of Toronto, Canada (1999). 14. Lohner, R. J.: Einschliebung der Lsung gewhnlicher Anfangs- und Randwertaufgaben und Anwendungen, PhD thesis, Universitt Karlsruhe, 1988. 15. J-F. Puget and P. Van Hentenryck. A Constraint Satisfaction Approach to a Circuit Design Problem. Journal of Global Optimization, MIT Press (1997). 16. Shampine, L.F.: Numerical Solution of ODEs. NY, Chapman and Hall (1994). 17. Spitznagel, E.: Two-Compartment Pharmacokinetic Models. C-ODE-E. Harvey Mudd College, Claremont, CA (1992).