You are on page 1of 7

European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235 www.elsevier.

com/locate/ejpb

Research paper

Handling of computational in vitro/in vivo correlation problems by Microsoft Excel: IV. Generalized matrix analysis of linear compartment systems
Frieder Langenbucher*
BioVista LLC, Riehen, Switzerland Received 21 April 2004; accepted in revised form 12 July 2004 Available online 1 September 2004

Abstract A linear system comprising n compartments is completely dened by the rate constants between any of the compartments and the initial condition in which compartment(s) the drug is present at the beginning. The generalized solution is the time proles of drug amount in each compartment, described by polyexponential equations. Based on standard matrix operations, an Excel worksheet computes the rate constants and the coefcients, nally the full time proles for a specied range of time values. q 2004 Elsevier B.V. All rights reserved.
Keywords: IVIVC; Excel; Systems analysis; Pharmacokinetics; Compartmental models

1. Introduction Continuing the discussion of IVIVC applications of Excel in previous papers [13], this last communication of the series is devoted to the analysis of linear pharmacokinetic systems with n compartments. The pharmacokinetic literature, e.g. Refs. [49], discusses a manifold of compartment models in terms of the dening microscopic rate constants, the initial conditions, and the resulting polyexponential time proles expressed in terms of macroscopic rate constants and corresponding coefcients. The claimed number n of compartments in these models is sometimes misleading, since they are dened as open, i.e. with input from and/or output to an unspecied environment. For instance, the well-known open two-compartment model species only the distribution of a drug between plasma and tissue. A systematic denition must necessarily include at least one elimination compartment; if the drug is not administered as i.v. bolus, also an administration compartment is required.
* BioVista LLC, Ruechligweg 101, CH-4125 Riehen, Switzerland. Tel.: C41-61603-3474; fax: C41-61601-2738. E-mail address: jana.mysicka@ivivc.com. 0939-6411/$ - see front matter q 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.ejpb.2004.07.003

Papers dealing with more sophisticated pharmacokinetics, e.g. [1014], prefer the denition of a system as closed, where the drug including all metabolites is present in the system from the time of administration up to the nal excretion. Such models will have considerably more than two compartments. Even in simple cases, explicit formulas are rather cumbersome, in particular since numbering of compartments and rate constants is arbitrary. The problem increases with each compartment added to the model. A generalized treatment of closed models with any number of compartments is provided by the theory of linear differential equations which, based on mathematical matrix operations, frees the user from the task to nd and remember particular solutions. Various mathematical approaches are found in relevant textbooks, e.g. Ref. [15] or [16]. The present paper presents an Excel solution based on the matrix approach of Ref. [15]. For illustration and verication it uses a simple literature case with nZ3 compartments: plasma, tissue and elimination. Expansion to any larger number of compartments is obvious. The documentation IVIVC.DOC, available together with associated EXCEL workbooks from the author upon request, provides a worksheet COMPSYST designed for nZ5. This may be used to augment the present model by an absorption site for

230

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

non-bolus input to the plasma, and/or other distribution or elimination compartments.

obtained from these conditions ab Z k31 k12 Z 0:027; a C b Z k31 C k12 C k21 Z 1:35

2. Conventional analysis (illustration example) Following closely the presentation in chap. 14 of Welling [4], the further discussion uses an illustration example shown in Fig. 1, which is conventionally known as open two-compartment model with plasma (#1) and tissue (#2) only. The double-bordered circle indicates that all drug is present in #1 at time zero. If dened as closed system, elimination is dened as a distinct compartment (#3), hence the actual number of compartments is nZ3. Microscopic rate constants are positive values, specied in consistent units, e.g. [1/h]. According to matrix notation, kij denotes transfer to i from j, which differs from pharmacokinetic convention where it denotes transfer from i to j. Even for this simple model, notation differs considerably in the literature, e.g. numbering of compartments varies with the actual context; rate constants are dened ambiguously as kC or kK. The problem increases when including further compartments. If input into the plasma compartment is by an absorption step rather than i.v. bolus, an additional input compartment (#4) has to be added to the c11 Z 0 c21 Z 0 c31 Z 1

which gives aZ1.330 and bZ0.020 as solution of the quadratic equation  q a Z k31 Ck12 Ck21 G k31 Ck12 Ck21 2 K4k31 k12 2 b Since all kij have positive values by denition, also a and b are positive numbers, with the property that aOb, i.e a is the faster of both. Time proles in the relevant compartments (plasma, tissue, elimination) are described by three polyexponential functions: Y1 t Z c11 eK0t C c12 eKat C c13 eKbt ; Y2 t Z c21 eK0t C c22 eKat C c23 eKbt ; Y3 t Z c31 eK0t C c32 eKat C c33 eKbt Although the analysis uses only two parameters a and b, the systematic treatment suggests inclusion of a third term with rate constant 0. Coefcients cij are then dened as follows:

k12 K a k Kb Z C0:901 c13 Z C 12 Z C0:099 a Kb a Kb k k c23 Z C 21 Z C0:779 c22 Z K 21 Z K0:779 a Kb a Kb k K ak31 k K bk31 Z K0:122 c33 Z K 12 Z K0:878 c32 Z C 12 a K ba a K bb c12 Z K By substituting the original conditions, the above literature denitions of c32 and c33 may be altered to (aKb) as common denominator for all coefcients: c32 Z c33 Z k12 K ak31 =a b K k31 k C k21 K a Z ; Z 12 a Kb a Kb a Kb k12 K bk31 =b a K k31 k C k21 K b Z Z 12 a Kb a Kb a Kb

model (note that (#0) is not suitable as subscript for matrix analysis). If elimination is modeled by parallel pathways, e.g. urinary excretion and metabolism, this would require the addition of another compartment. These modest expansions would require new model denitions with differing compartment numbering and a completely new and complicated denition of formulas. Returning to the illustration case with nZ3, two macroscopic rate constants, usually denoted a and b, are

The rst form is an obvious rearrangement, the second is most convenient for actual computation, the third indicates that c32ZK(c12Cc22) and c33ZK(c13Cc23) are the negative sums of the corresponding coefcients of Y1 and Y2. In summary, the model is described by these functions: Y1 is a Bateman function with two positive terms. Y2 is a Bateman function with two identical coefcients with opposite sign. Y3Z1K(Y1CY2) is dened according to mass balance.
Fig. 1. Illustration example according to digoxin data [9]. Compartments are numbered according to general conventions, rate constants kij as to i from j.

All coefcients are based on the condition that a dose DZ1 is administered to the plasma compartment at time zero. A distribution volume VP, converting amounts into

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

231

concentrations for the plasma, is disregarded in the equations above, but may be added in subsequent steps.

0 y1 Z a11 y1 C a12 y2 C a13 y3 C/ 0 y2 Z a21 y1 C a22 y2 C a23 y3 C/ 0 y3 Z a31 y1 C a32 y2 C a33 y3 C/

3. Generalized matrix analysis Assume a linear system with n compartments, where the numbering (iZ1,2,3,.,n) is free choice. The system is dened as dense, in that it permits to specify all possible n! (nK1) rst-order rate constants kij between any two of the compartments, to i from j (non-existing connections are specied as 0). In addition, the system is dened as closed, without input from or output to the environment. Hence, all information for the further analysis is specied in two matrices: 2 Kk21 C k31 k12 Kk12 C k32 k32 0 0 3 (1) 7 05 k31 K1:20 0:15 6 Z 4 1:02 K0:15 0:18 2 0 2 k13 k23 Kk13 C k23 3 7 5 6 A Z 4 k21

The general solution of Eq. (3) is a matrix function which computes the vector y for a given time value t as matrix product of a square (n!n) matrix QZeAt and the vector m y Z eAt m Z Qm (4)

3 2 3 0:252 m1 6 7 6 7 m Z 4 m2 5 Z 4 0 5 m3 0

(2)

As discussed in detail in the following sections, the explicit solution for time proles in the n compartments is a set of n polyexponential equations y1 t Z c11 el1 t C c12 el2 t C c13 el3 t C/ y2 t Z c21 el1 t C c22 el2 t C c23 el3 t C/ y3 t Z c31 el1 t C c32 el2 t C c33 el3 t C/ where each equation has n terms exp(lit) according to the eigenvalues li of matrix A. The n!n matrix C contains the polyexponential coefcients, where cij represents the eigenvalue j in equation (compartment) i. Note that matrix expressions such as exp(lit) with negative eigenvalues are equivalent to the pharmacokinetic convention of exp(Kat) with positive macroscopic rate constants. 3.2. Rate constants (eigenvalues) For a square n!n matrix A, exactly n eigenvalues li and eigenvectors x of size (n!1) are dened which meet this particular condition Ax Z lx (6) (5)

The (n!n) square matrix A contains the rate constants kij as off-diagonal elements; diagonal elements represent the sum of all other constants in the same column with negative sign. In general, each row of A represents a compartment with its positive inow and negative outow. For the example case with nZ3, only three of possible six constants are non-zero; the last empty column signals that #3 is a terminal compartment without any backow to the rest of the system. The (n!1) column vector m species the initial conditions, i.e. which amount of drug is present in the compartments at tZ0. In the example, the entire dose of 0.252 mg is initially in the plasma compartment (#1), and all others are empty. 3.1. Differential equations and their solution Transport in a linear compartment system is described by a set of differential equations, where column vectors y and y 0 denote the amount and the rate of change in all compartments involved (for convenience, the relationship is presented below as matrix equation, the set of explicit equations, and the corresponding Falk scheme): y 0 Z Ay (3)

This states that for each eigenvector xi, multiplication by the scalar li gives the same result as matrix multiplication by A. In other words, the matrix products Axi are multiples

232

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

Fig. 2. Eigenvalues l and eigenvectors x of a square matrix A, illustrated by the digoxin example.

Depending on n, the curve is a straight line, a parabola with one extreme, a third-order parabola with one maximum and one minimum, etc. Since l is negative; the negative wing asymptotes positive ordinate values; the positive wing is positive for even and negative for odd n. The polynomial has exactly n roots, where D(l)Z0; these represent the eigenvalues of A. According to the actual nature of A, all roots are negative real numbers; the absolute size of the largest eigenvalue is estimated as the square root of the sum of all squared elements of A v uX X u n n 2 (9) ajk jlmax j% t
jZ1 kZ1

of the original vectors xi. These relationships are illustrated in Fig. 2 for the example case. In statistical applications, matrices are symmetric and their eigenvalues are obtained by standard programs, e.g. the functions EIGVAL or EIGEN of SAS/IML [17]. In the present application, macroscopic (hybrid) rate constants of the relevant time proles are computed as the eigenvalues li of matrix A. Since A is non-symmetric in general, standard tools are not applicable and a more generalized procedure is used instead [15], which is illustrated in Fig. 3 for the illustration example with nZ3. Regarding l as a continuous independent variable, the following function is computed for each value of l Dl Z detA K El (7)

where AKEl represents matrix A with 1 subtracted on the main diagonal. The determinant is always a scalar quantity, evaluated as the sum of products involving all diagonal elements, where main-diagonal elements are counted as positive, those according to the secondary diagonal as negative. Eq. (7) is represented by a polynomial of degree n, according to the size of A Dl Z c0 C c1 l C c2 l2 C c3 l3 C/ (8)

For large values of l, the value reduces to the product of the main diagonal, i.e. ln. In any case, the positive wing approaches KN. The negative asymptote depends on n; odd values approach CN, even values to KN. In the illustration example, D(l) is a cubic equation with three roots. According to Eq. (9), the Excel formula LMAXZSQRT(SUMSQ(A)) estimates lmaxZK1.6 as absolute maximum, and all roots are located between this limit and 0. Fig. 3 is computed from a table with equidistant data points LAM, by means of DETZMDETERM (AKE3*LAM) where E3Z{1,0,0;0,1,0;0,0,1} is the unit matrix of size 3. The abscissa range may be deliberately altered to give a general survey or details of a particular range. The general survey, shown in Fig. 3, reveals a unique root l3zK1.35, which is obviously the largest-size root. The other two roots are expected in the vicinity of the origin. Closer inspection of this range reveals these roots as l2zK0.02 and l1z0. When the Solver is used to optimize the initial estimates, exact eigenvalues are found as 2 0 3 (10) 6 7 l Z 4 K0:02031 5 K1:32969

3.3. Matrix exponentials The same way the exponential of a number x is dened by an innite series, the exponential of a square matrix A may be dened as a series ex Z 1 C x=1! C x2 =2! C x3 =3! C/; (11) eA Z E C A=1! C A2 =2! C A3 =3! C/ where E is the identity matrix of the same size. Matrix A2 is obtained by multiplication of A by itself; the operation may be repeated to give a power An, e.g. A3ZA2A. All matrices are square, with the same size as A. Actual calculation of Eq. (11) is best achieved by means of the Lagrange interpolation formula

Fig. 3. Prole of D(l) according to Eq. (8) and eigenvalues of matrix A as roots of the polynomial.

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

233

yx Z

x K x2 x K x3 /x K xn y x1 K x2 x1 K x3 /x1 K xn 1 C x K x1 x K x3 /x K xn y C/ x2 K x1 x2 K x3 /x2 K xn 2 x K x1 x K x2 /x K xnK1 y xn K x1 xn K x2 /xn K xnK1 n

which is the well-known interpolation formula, where a set of n data points (xi, yi) denes a polynomial equation y(x) of degree nK1, from which other values can be interpolated. Note that the formula also applies to derived functions: y may be replaced by any function f(y), such as exp(y). When applied to matrices, the Lagrange formula is modied by replacing denominator terms (xiKxj) by (liKlj), and numerator terms (xKxi) by (AKliE) f A Z A K l2 EA K l3 E /A K ln E f l1 l1 K l2 l1 K l3 /l1 K ln C A K l1 EA K l3 E /A K ln E f l2 l2 K l1 l2 K l3 /l2 K ln

arranged in three main columns according to the three eigenvalues shown in block (a). Block (b) computes three matrices AKliE by subtracting the value of li from all diagonal elements of A; this is achieved by means of the unit matrix E of size (n!n). Block (c) computes the numerator terms of the Lagrange formula, each of which is a matrix product of nK1 matrices, corresponding with all eigenvalues except the one dening the term, as illustrated below for N1:

C/ C A K l1 EA K l2 E /A K lnK1 E f ln ln K l1 ln K l2 /ln K lnK1 (12)

Block (d) computes the corresponding denominator terms Di, where each term is a product of nK1 scalar factors of the form (liKlj), with i denoting the eigenvalue in question and j any eigenvalues other than li. Further blocks of Fig. 4 illustrate the computation of four matrix functions f(A) according to Eq. (12). The matrix function is computed in the rightmost column as sum of n terms corresponding with the n eigenvalues of A, with Pi according to block (e): f A Z P1 f1 C P2 f2 C/C Pn fn (13)

Fig. 4 illustrates the matrix setup for the example case with nZ3 (extension to nO3 is obvious). Terms are

Fig. 4. Numerical values of the factors involved in the Lagrange interpolation formula, for the illustration example with nZ3.

234

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

The desired function is specied by the corresponding scalar factor f(li):


f(li) (e) (f) (g) (h) 1 li exp(li) exp(lit) f(A) E A eA eAt Identity matrix Original matrix Matrix exponential Exponential term for given t

While blocks (e) and (f) serve only for illustration and control, block (g) computes the matrix exponential. Block (h) computes the function eAt, where the matrix A is multiplied by a scalar time value t, similar to eat for a single compartment; in the example, tZ2 is assumed as an arbitrary time value. 3.4. Polyexponential time proles According to Eq. (4), the response vector y for all compartments and for any specied time value t, is computed as matrix product of the function QZeAt and the vector m of initial amounts. Obviously, the functions Q are computed in blocks of Fig. 4: For tZ0, QZe0 is the unit matrix according to block (e); hence yZe0 mZm. For tZ1, QZeA is the matrix exponential of A according to block (g); hence yZeA m. For general values of t, QZeAt according to block (h). For actual worksheet computation, only the last general block is required. The two special cases are covered by the latter and serve only as illustration and verication. To compute entire time proles in a worksheet, it is useful to make some further arrangements of the involved matrices. As illustrated in Fig. 5, all relevant polyexponential coefcients cij according to Eq. (5) are computed in three vectors ci, as matrix products of the polynomial matrices Pi and the vector m c i Z Pi m (14)

Fig. 6. Matrix arrangement computing time proles for all compartments involved, and for a vector t of time values.

Fig. 6 shows the nal worksheet arrangement of matrices, for a column vector t of time values covering the desired range with reasonable intervals. The time proles in the compartments are obtained as the matrix product Y Z ZC (15)

Matrix Z computes the values of exp(lt), according to the time vector and the n eigenvalues. Matrix C represents the coefcients according to eigenvalues and compartments. In the worksheet it is directly computed from the vectors ci according to Eq. (14), by placing the transposed formulas in the appropriate rows.

4. Notation Matrices are denoted by capitalized bold-face letters; vectors are distinguished by non-capitalized bold letters A (n!n) C (n!n) E (n!n) m (n!1) P (n!n) Q (n!n) augmented rate constants aij polyexponential coefcients cij unit matrix of dimension n initial amounts mi in compartments Lagrange terms pij matrix exponential function (ZeAt)

Fig. 5. Computation of the coefcients as matrix products according to Eq. (14).

F. Langenbucher / European Journal of Pharmaceutics and Biopharmaceutics 59 (2005) 229235

235

t (1!k) Y (k!n) Z (k!n) l (n!1)

vector of equidistant time points tk response values yki exponential time functions (Ze lt) eigenvalues li (macroscopic rate constants)

References
[1] F. Langenbucher, Handling of computational IVIVC problems by Microsoft Excel: I. Principles and some general algorithms, Eur. J. Pharm. Biopharm. 53 (2002) 17. [2] F. Langenbucher, Handling of computational IVIVC problems by Microsoft Excel: II. Distribution functions and moments, Eur. J. Pharm. Biopharm. 55 (2003) 7784. [3] F. Langenbucher, Handling of computational IVIVC problems by Microsoft Excel: III. Convolution and deconvolution, Eur. J. Pharm. Biopharm. 56 (2003) 429437. [4] P.G. Welling, Pharmacokinetics, American Chemical Society, Washington, DC, 1986. [5] M. Gibaldi, D. Perrier, Pharmacokinetics, Marcel Dekker, New York, 1982. [6] P.I.D. Lee, G.L. Amidon, Pharmacokinetic Analysis; A Practical Approach, Technomic, Lancaster, PA, 1996. [7] J.T. Carstensen, Modeling and Data Treatment in the Pharmaceutical Sciences, Technomic, Lancaster, PA, 1996. [8] J. Gabrielsson, D. Weiner, Pharmacokinetic and Pharmacodynamic Data Analysis: Concepts and Applications, Swedish Pharmaceutical Press, Stockholm, 1997. [9] L. Shargel, A.B.C. Yu, Applied Biopharmaceutics and Pharmacokinetics, Appleton & Lange, Stamford, CT, 1999. [10] A. Rescigno, G. Segre, Drug and Tracer Kinetics, Blaisdell, Waltham, MA, 1966. [11] G. Bozler, G. Heinzel, F.W. Koss, M. Wolf, Modellentwicklung in der Pharmakokinetik, Arzneimittelforschung/Drug Res. 27 (1977) 897 931. [12] D.P. Vaughan, M. Dennis, Mathematical basis and generalization of the Loo-Riegelman method for the determination of in vivo drug absorption, J. Pharmacokinet. Biopharm. 8 (1980) 8398. [13] R. Suverkrup, Segmentally continuous input functions in linear multicompartment systems, J. Pharm. Sci. 74 (1985) 136141. [14] P.V. Pedersen, General treatment of linear pharmacokinetics, J. Pharm. Sci. 67 (1978) 187191. [15] G. Dietrich, H. Stahl, Matrizen und Determinanten und ihre Anwendungen in Technik und Oekonomie, Verlag Harri Deutsch, Thun, 1978. [16] H.G. Zachmann, Mathematik fur Chemiker, Verlag Chemie, Weinheim, 1981. [17] SAS Institute Inc., SAS/IML Users Guide for Personal Computers, SAS Institute Inc., Cary, NC, 1985.

Indices i and j indicate the serial number of compartments. In matrix A they distinguish the direction to i from j, otherwise this distinction is disregarded. The total size of system-relevant matrices (compartments, eigenvalues, coefcients, etc.) is indicated by n. The number of points for the computation of time proles is indicated by k. Excel computations in the worksheet COMPSYST are performed as described in Refs. [13]. In particular: Data input is exclusively in vector m and the off-diagonal elements of matrix A, where non-existing values are specied as 0. The evaluation of eigenvalues is interactive since the Solver tool must be invoked. The unit matrix E, containing 1 on the main diagonal and 0 otherwise, is specied by the array formula {1,0,0;0,1,0;0,0,1}. Transposed matrices YZZ 0 are computed by the formula YZMTRANSPOSE(Z). Matrix products such as YZ XZ are evaluated by the formula YZMMULT(X;Z), in accordance with the Falk scheme, but not necessarily arranged in the worksheet accordingly. The product of transposed matrices may be written as Y 0 ZZ 0 X 0 , where all three matrices are transposed and the order of multiplication is reversed. Matrix elds are identied by Excel names such as A, COEF, EXPLT. These names are dened locally in the worksheet, and are used as reference in Excel formulas. Note that several steps discussed in the present paper for sake of illustration, are not computed in the worksheet since not necessary for the nal result.

You might also like