[Math] Analytic solution to the one-compartment model

ordinary differential equations

I have the following linear system of ordinary differential equations:

$$\frac {dA} {dt} = -k_a \cdot A$$
$$\frac {dC} {dt} = k_a \cdot A – k_0 \cdot C$$

$$A(0) = A_0$$
$$C(0) = 0$$

Some people may recognize this as the one-compartment model of pharmacokinetics, which describes the amount of a drug in the gut $A(t)$ and blood $C(t)$ over time when a pill with an amount of drug $A_0$ is taken, which is then absorbed from the gut into the blood with rate constant $k_a$ and eliminated from blood with rate constant $k_0$. But understanding the biology is not necessary for solving the problem.

When I consult Wolfram Alpha or pharmacology texts, they give this analytic solution to the problem:

$$A(t) = A_0 \cdot e^{-k_a \cdot t}$$
$$C(t) = \frac{A_0 \cdot k_a \cdot (e^{-k_a \cdot t}-e^{-k_0 \cdot t})}{k_0-k_a}$$

The problem is that this solution for $C(t)$ is undefined when $k_a$ is equal to $k_0$, though there obviously exists a solution to the differential equations when this is the case. I could solve for the special case of equality, but that still leaves the equation numerically unstable when the two parameters are close.

The following plot illustrates the hole. If we set $t=1$ and plot $C(t)$ versus $k0$ and $ka$, then we see the line at $k0=ka$ where the function is not defined:

Plot of k0 and ka versus C when t1=0

Is there a solution to this system of equations that avoids the singularity?

Best Answer

Firstly, you can solve the first equation:

$$\frac {dA} {dt} = -k_a \cdot A \Rightarrow A(t) = A_0e^{-k_at},$$

having posed that $A(0) = k_0$. Then, solve the second equation imposing $k_0 = k_a$:

$$\frac {dC} {dt} = - k_a \cdot C + k_a A_0e^{-k_at}.$$

The general solution is $C_g(t) = Me^{-k_at}$, for some $M$. The particular solution should normally be in the form $C_p(t) = Ne^{-k_at}$, too. But since the general solution is similar, then

$$C_p(t) = Nte^{-k_at},$$

and

$$C(t) = Me^{-k_at} + Nte^{-k_at}.$$

Then:

$$C(0) = M = 0,$$

and $$\frac {dC} {dt} = Ne^{-k_at}-Ntk_ae^{-k_at} = -Ntk_ae^{-k_at} + k_aA_0e^{-k_at}.$$

Hence, $N=k_a A_0$ and your unique solution is $C(t) = k_a A_0 te^{-k_at}$

Another way...

Consider the following:

$$\lim_{k_a \to k_0}\frac{A_0 \cdot k_a \cdot (e^{-k_a \cdot t}-e^{-k_0 \cdot t})}{k_a-k_0} = \lim_{k_a \to k_0}\frac{A_0 \cdot k_a \cdot e^{-k_a \cdot t} (1-e^{(k_a-k_0) \cdot t})}{k_a-k_0} =\\= A_0 k_0 t e^{-k_a \cdot t} ,$$

since

$$\lim_{x \to 0} \frac{1 - e^{-xt}}{x} = t$$

Related Question