UC SCI 111, vM+.
Notebook 12

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

Finding parameters for the two compartment model.

The model revisited.

In this notebook we continue our analysis of the two compartment model. Remember that we can describe this model by a system

	(dX/dt) = AX		(1.1)
	
where A is the matrix that describes the flows from and to the blood and tissue. The flows were as follows:

	(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
		
The situation is, again,  sketched in the figure. The volumes of the blood and the tissue are denoted by (Subscript[V, 1]) and (Subscript[V, 2]).

The general solution of system (1.1) can be written as 
	
	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=((Subscript[u, 1]),(Subscript[u, 2])) and  v=((Subscript[v, 1]),(Subscript[v, 2])) denote the eigenvalues and eigenvectors of the matrix A. But as eigenvectors are determined up to multiples. we might as well forget about the (Subscript[c, 1])and the (Subscript[c, 2]), that is we set (Subscript[c, 1])=1 and (Subscript[c, 2])=1. Resuming, we can write (Subscript[x, 1])(t) as
	
	(Subscript[x, 1])(t) = (e^((Subscript[λ, 1]) t))(Subscript[u, 1]) + (e^((Subscript[λ, 2]) t)) (Subscript[v, 1])
	
The aim in this notebook is as follows. Suppose that we inject a known quantity q of a certain medicin in the blood at t=0. We want to determine the eigenvalues and eigenvectors and as much of the flow coefficients as possible from the data provided to us by measurements. 

An experimenter injected 60 milligram of medicin at t=0. The concentration of the medicin in the blood was measured every two minutes. This gave the following data.

data
       = {{0, 12}, {2, 10.42}, {4, 9.06}, {6, 7.80}, {8, 6.89}, {10, 6.03}, {
          12, 5.29}, {14, 4.65}, {16, 4.11}, {18, 3.64}, {20, 3.24}, {22, 
          2.89}, {24, 2.59}, {26, 2.34}, {28, 2.12}, {30, 1.93}, {32, 1.77}, {
          34, 1.63}, {36, 1.51}, {38, 1.40}, {40, 1.32}, {42, 1.24}, {44, 
          1.18}, {46, 1.12}, {48, 1.072}, {50, 1.030}, {52, 0.990}, {54, 
          0.964}, {56, 0.933}, {58, 0.894}, {60, 0.896}};

These data are plotted in the following graph.

ListPlot[data];

Exercise 2.
Determine (Subscript[V, 1]) from the initial condition.

A dominant eigenvalue.

As you can verify, the two eigenvalues will only be equal in very unlikely situations.  So, from now on we assume that (Subscript[λ, 1]) > (Subscript[λ, 2]).

Exercise 3.
a) Prove that after a substantial period of time the only term that matters is the one containing (e^((Subscript[λ, 1]) t)), because this term will be about as big as the whole solution. Make your statement precise using the term little o.
Hint:  (Subscript[λ, 2]) < (Subscript[λ, 1]) < 0.
b) Plot ln( (Subscript[x, 1])(t) )  and print the plot.
c) Determine (Subscript[λ, 1]) and (Subscript[u, 1])from this plot.
d) Find also a way for determining  (Subscript[λ, 2])and (Subscript[v, 1]).

Determining the matrix.

By now we have computed the eigenvalues and know something about the eigenvector. In this paragraph we want to determine as many of the coefficients of the matrix A as possible. As we already know the initial condition, this would give us control over the system (1.1). For this purpose we need some algebraic manipulations. Recall that
	
	Tr(A)   = (Subscript[λ, 1]) + (Subscript[λ, 2])
	Det(A) = (Subscript[λ, 1]) . (Subscript[λ, 2])
		
and that we wrote

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

Exercise 4.
a) Prove that

	((Subscript[λ, 1]) - (Subscript[A, 11])) (Subscript[u, 1]) = (Subscript[A, 12]) 
          (Subscript[u, 2])	((Subscript[λ, 2]) - (Subscript[A, 11])) (Subscript[v, 1]) = (Subscript[A, 12]) 
          (Subscript[v, 2])
	
	((Subscript[λ, 1]) - (Subscript[A, 22])) (Subscript[u, 2]) = (Subscript[A, 21]) 
          (Subscript[u, 1])	((Subscript[λ, 2]) - (Subscript[A, 22])) (Subscript[v, 2]) = (Subscript[A, 21]) 
          (Subscript[v, 1])
	
b) Recall that 

	(Subscript[u, 1]) + (Subscript[v, 1])=(q/(Subscript[V, 1])).	
	
	(Subscript[u, 2]) + (Subscript[v, 2])=0

This was only the preliminary work. Now we can start harvesting!

Exercise 5.
a) Prove that

	(Subscript[A, 11]) = (((Subscript[λ, 1]) (Subscript[u, 1])  + (Subscript[λ, 2]) (Subscript[v, 1]))/((Subscript[u, 1]) + (Subscript[v, 1])))
	
b) Prove that

	(Subscript[A, 22]) = (((Subscript[λ, 1]) (Subscript[v, 1])  + (Subscript[λ, 2]) (Subscript[u, 1]))/((Subscript[u, 1]) + (Subscript[v, 1])))
	
c) (Easy!) What is (Subscript[A, 12])(Subscript[A, 21])?

We can even get back some of the flow coefficients.

Exercise 6.
Show that we can determine  (Subscript[k, 12]), (Subscript[k, 13]) and (((Subscript[k, 21]))/( (Subscript[V, 2]))).