UC SCI 111, vM+.
Notebook 11

\(Needs["Graphics`Colors`"]; 
<< Graphics`Arrow`\)\(Off[General::spell1]; 
Off[General::spell]; \)

Solving the two compartment model.

The model.

In pharmacology the human body is sometimes depicted as having two parts: the blood and the tissue. Medicine injected into the blood will  over time diffuse into the tissue. So at any time we can consider the concentration of medicine in the blood and the concentration of medicine in the tissue. What can happen with the medicine over time? It can:

	(Subscript[k, 12])	 flow from the blood into the tissue
	(Subscript[k, 21])	 flow from the tissue into the blood
	(Subscript[k, 13])	 flow into the toilet or end up in a smelly T-shirt
		
In general, (Subscript[k, ij]) is the volume that per unit of time is transported from compartment i to compartment j, while being replaced by an equal volume, so that the total volume of each compartment stays constant. The situation is sketched in the figure.

In this context one has to start thinking about one's volume instead of one's weight. Indeed for a concentration you need a volume. As at the time of writing, we do not yet know the reader's volume, we will say that the reader's blood volume is (Subscript[V, 1]), and the tissue volume (Subscript[V, 2]), for instance (Subscript[V, 1]) is 5 liters and (Subscript[V, 2]) is 20 liters.

If there is 10 gram of medicine in the readers' blood we have a concentration of medicine in the blood of 2 grams per liter.  The concentration of medicine in the blood will be called (Subscript[x, 1]) and in this particular example we have (Subscript[x, 1])=2 in appropriate units. Similarly the concentration of medicine in the tissue is called (Subscript[x, 2]).  Now the medicine can flow from the blood to the tissue and reversely, so (Subscript[x, 1]) and (Subscript[x, 2]) vary over time.

Now suppose that (Subscript[x, 1])satisfies a differential equation. We would have that
	
	((d (Subscript[x, 1]))/dt)

depends on t, that is time, alone. This is not very probable, because  (Subscript[x, 1]) also depends on the amount of initially swallowed aspirin. It is also likely that (Subscript[x, 1]) and (Subscript[x, 2]) are interrelated. There is a mathematical way of saying this: the vector valued function 

	X(t)=((Subscript[x, 1])(t), (Subscript[x, 2])(t))
	
satisfies a differential equation, in this case:
	
	(dX/dt) = AX		(1.1)

Here A is a matrix with two rows and two columns

	A=(({{(Subscript[A, 11]), (Subscript[A, 12])}, {(Subscript[A, 21]), (Subscript[A, 22])}}))

To see how the relation between (Subscript[x, 1]) and (Subscript[x, 2]) pops up here we write out our differential equation. 

	((d (Subscript[x, 1]))/dt) = (Subscript[A, 11]) (Subscript[x, 1])(t) + (Subscript[A, 12]) (Subscript[x, 2])(t)
							(1.2)
	((d (Subscript[x, 2]))/dt) = (Subscript[A, 21]) (Subscript[x, 1])(t) + (Subscript[A, 22]) (Subscript[x, 2])(t)

Although we have not yet determined the coefficients (Subscript[A, 11]), (Subscript[A, 12]), (Subscript[A, 21]) and (Subscript[A, 22]), we have written down a model for what happens after swallowing an aspirin. We see that swallowing an aspirin is a complicated matter, but our model is quite general: it also applies to a junkie injecting heroin. Of course we did not derive it. We only introduced the mathematics behind it.

Exercise 3.
Express the coefficients (Subscript[A, 11]), (Subscript[A, 12]), (Subscript[A, 21]) and (Subscript[A, 22]) in terms of the transmission coefficients. For example,

		(Subscript[A, 22]) = - ((Subscript[k, 21])/(Subscript[V, 2]))

Two different questions.

There are (at least) two ways of approaching the two compartment model. One way is that you know all parameters, that is, you know the transmission coefficients and the initial concentrations of medicine in the blood an tissue. In this case the question is.

	1) How does X(t) changes when time proceeds?
	
The question of an experimenter would be different. She would measure the concentration of,  for example, a poison in the blood and tissue in the morning and would like to predict how these concentrations will develop during the day. Her question is:

	2) What are the parameters of A?
	
In this notebook we will consider question 1. The inverse problem, that is, question 2, will be addressed in the next notebook.

An example.

Let's consider a concrete example before we tackle the general problem.  Suppose that the volume of the blood equals 5 liters and the volume of the tissue 20 liters. Somebody sniffs up 50 mg of pure cocaine, of which we will assume that it ends up directly in the blood. The transition coefficients are as follows

	(Subscript[k, 12]) = .25
	(Subscript[k, 21]) = .05
	(Subscript[k, 13]) = .001

Exercise 4.
a) What is in this case the initial condition of the system (1.1)?
b) Use Mathematica in order to solve the system (1.1) with respect to the initial condition you have found in a).  That is, find equations for (Subscript[x, 1])(t) and (Subscript[x, 2])(t).  
c) Plot in one picture the solutions (Subscript[x, 1])(t) and (Subscript[x, 2])(t) for t=0..100.
d) At what moment is the concentration of cocaine in the blood and in the tissue the same?

General solutions.

After we gained some intuition about our system we will look in this paragraph for the general solution of our differential equation. 

	((d X)/dt)= A X		(1.1)

We could calculate the eigensystem of A and obtain two eigenvectors (u, v) with corresponding  eigenvalues ((Subscript[λ, 1]), (Subscript[λ, 2])). One solution would be

	X(t) = (e^((Subscript[λ, 1]) t))u

Exercise 5.
a) Verify that

		X(t) = (e^( (Subscript[λ, 1]) t)) u
		
gives indeed a solution  of Equation (1.1).
b) Write down another solution.

Suppose that γ(t) and δ(t) are two arbitrary solutions of Equation (1.1). 

c) Show that  γ(t) + δ(t)  gives a solution of Equation (1.1) as well.
d) Is a linear combination of γ(t) and δ(t) again a solution?

We conclude that the general solution is of the form

	X(t) = (Subscript[c, 1]) (e^((Subscript[λ, 1]) t)) u + (Subscript[c, 2])  (e^((Subscript[λ, 2]) t)) v

where  (Subscript[λ, 1]), (Subscript[λ, 2]) and u, v denote the eigenvalues and eigenvectors.

The maximum concentration in the tissue.

Suppose that a known quantity q of medicine is injected in the blood at t=0.  Write the eigenvectors as u=((Subscript[u, 1]), (Subscript[u, 2])) and v=((Subscript[v, 1]), (Subscript[v, 2])). It is important to know when the doses of medicine is maximal in the tissue. The doses should be high enough in order to sort out some effect, but when it is getting too high it might turn out dangerous.

Exercise 6.
a) Go back to the example and compute when a maximum in  (Subscript[x, 2])(t)  occurs in this example.
b) Write down the general initial condition for system (1.1).
c) Show that

	(Subscript[u, 1])+(Subscript[v, 1]) = (q/(Subscript[V, 1]))
	
	(Subscript[u, 2])+(Subscript[v, 2]) = 0
		
d) When in general  is (Subscript[x, 2])(t) maximal for the first time?	
e) Compute the eigenvalues in the example and show that your answer in a) matches your formula in d).