# How do you calculate the time until the steady-state of a drug?

I encountered a mathematically intriguing conundrum, in that it's related to medicine but is centered around mathematics.

Suppose drug A has a half-life in the body of 30 hours. The patient takes 40mg once per day. How long is it then until the patient then reaches steady-state dosage in the body (within some tolerance interval)?

The answer should be about one week, but I'm trying to understand the math behind "why".

Here's a short simulation that show the process. You can find more about how to simulate a half decay process here

You can notice that the first dose of 40 mg should decay to 20 mg in 30 hours, but the process is cut by the new dose.

The daily oscillation reaches a steady state around the seventh day (you can find small changes in the data, but not appreciable at the naked eye)

import matplotlib.pylab as plt
import numpy as np

ndays = 12
ttot = 24*ndays
dt = 0.25

time = np.arange(0, ttot, dt)
Concentration = np.zeros(len(time))

conc = 0
tau = 30./np.log(2)  ## exponential decay time constant from half-life value
dosis = 40

for k, t in enumerate(time):
if t%24 == 0:   ## If the time is multiple of 24 hours, the dosis is given
conc += dosis
Concentration[k] = conc
### update concentration decay
conc = conc*(1 - dt/tau)

ax = plt.subplot(111)
ax.plot(time, Concentration)
ax.set_xticks(np.arange(0, ndays * 24, 24 ))
ax.set_xticklabels(['%d'%d for d in np.arange(ndays)])
ax.set_xlabel('Days')
ax.set_ylabel('Dosis remaining (AU)')

• Can you explain where the 0.693 in the calculation of tau comes from? Oct 11, 2022 at 9:13
• 0.693 = ln 2. Assumed exponential kinetics for half-life Oct 11, 2022 at 9:20
• you could use np.log(2) to make that clearer ... Oct 11, 2022 at 13:49
• Thanks for the nice plot. Is there a way you could simulate what the effect would be if the daily dosage was instead an "average" over a 24 hour period? That should give you a nice differential equation you can solve explicitly. Oct 12, 2022 at 16:02
• Glad you like it. The differential equation you propose is the one in #thegreatemu answer. In that case D = dose/24 (mg/hour). If you simulate it, the dynamic is the same he found analytically. The Euler step can go like this "conc = conc*(1 - dt/tau) + dt*dosis/24" Oct 13, 2022 at 14:21

heracho's answer does a good job showing the realistic timing. However you can do a pretty good approximation with a simple differential equation, where you approximate the daily dose as a continuous input. If $$C(t)$$ is the concentration of the drug at time $$t$$, then

$$\frac{dC}{dt} = D - \frac{\ln{2}}{t_{1/s}} C$$ where $$D$$ is the dose rate, 40 mg/day. The steady-state condition is reached when $$\frac{dC}{dt} \to 0$$, which tells you that the (average) steady state concentration is $$C_{ss} = D\frac{t_{1/2}}{\ln{2}} \approx 72.13\mathrm{mg}$$ which agrees pretty well with heracho's plot.

The full solution to the differential equation, assuming $$C(0)=0$$ is $$C(t) = C_{ss}\cdot(1-\mathrm{e}^{-t\ln{2}/t_{1/2}})$$

From here you can see clearly the answer to the "when do we reach steady state?" question is driven by the exponential term, which is negligible by ~5 half-lives.

Having stolen @heracho's plotting script and added the following lines:

conc_ss = dosis*(tau/24)
concavg = conc_ss*(1-np.exp(-time/tau))
...
ax.plot(time, concavg, label='continuous dose approximation')


you can see that this approximation follows the mean of the true concentration pretty well after just a few half-lives.

• Very nice, I appreciate the simpler differential equation that matches closely, it's a bit easier to analyze than something that oscillates up and down so much. Oct 12, 2022 at 16:04

Let's take a moment to think about what it means for a drug dosed multiple times to reach "steady-state": "steady-state" would mean that it doesn't matter much if you've been taking the drug for N or N-1 days, if you've reached "steady-state" the concentration of drug is steady from day to day (of course, with a 30-hour half-life, it's not going to be particularly stable within a day, assuming relatively rapid uptake).

It's also important to recognize that simple exponential decay is a scenario that occurs when the fates of particles are independent of each other. Therefore, one way we can think about comparing day N to day N-1 would be to consider how much drug is still around on day N from the first dose, because that's the only difference in the history of doses.

For a drug with a 30-hour half-life, after 7 days you could say 7 days * 24 hours/day * 1 half-life/30 hours = 5.6 half-lives have passed.

After 5.6 half-lives, you could say 0.5^5.6 = about 0.02 or 2% of a drug is remaining relative to the original concentration.

Another way to say that is that the difference at the end of the 7th day between having had the drug for 7 days vs. having had it for 6 days would be that 2% remaining from day 1. That seems roughly reasonable to consider a "steady-state".

This is all assuming simple exponential kinetics, other assumptions will change the nature of the problem. It's also important to recognize that for a drug with a 30-hour half-life given once daily, the concentration will never really be "steady" but will still have a clear oscillation after each dosage, depending on the kinetics of release/uptake.

• This seems like a good start, but it could be more clearly framed in terms of build-up of concentration over time. The time scales are the same for loss from steady-state vs. build-up of a monomolecular/saturating curve starting from zero (basic dynamics are $1-\exp(-kt)$), so a half-life describes the time taken to decrease the distance from the current concentration to the steady-state concentration (i.e. after 5.6 half-lives we are within 2% of the steady state). Oct 10, 2022 at 19:45
• @BenBolker I was trying to go from a simpler intuitive approach to exponential decay, which is to recognize that every molecule is independent of the others. That means that on the 7th day you can know how much of the first dose is still present, which tells you whether you should care that you're on the 6th versus 7th versus 8th day of dosing. Once it doesn't matter, you can effectively consider that "steady-state", though of course there is still some accumulation forever, we just have to decide at what point we don't care anymore. Oct 10, 2022 at 20:15
• This is a very clever approach. To just check how much of the first dose is still in the body at day N, and compare the difference of having taking it or not (N v/s N-1 days). Oct 11, 2022 at 13:49
• The first two paragraphs had me thinking this answer had missed the point of multiple dosing, but now I see it's a very elegant solution to the problem (avoiding the work of simulating an ODE with a series of impulses). Oct 11, 2022 at 20:53
• @electronpusher I think I probably could have done a better job of setting up the conceptual approach. I'll try to improve it. Oct 11, 2022 at 20:55

I like @thegreatmu's answer, but I think we can get closer to the original problem. During the day, the concentration decays according to $$\frac{\partial C}{\partial t} = - \frac{\log(2)}{t_{1/2}} C$$ pretty much like @thegreatmu's equation, but without the term $$D$$, because during the day, no medicine is added.

At a fixed point during every day, say at breakfast, the medicine is ingested, and the concentration instantly increases by the dose $$D$$. At such moments, whe have both the low concentration $$C_-$$ and the high concentration $$C_+ = C_- + D$$.

Let us measure time in days (the half-time is 1.25 days), and let us take breakfast-time to be the moments $$t=0$$, $$t=1$$, $$t=2$$, etcetera.

The concentration at any time $$n-1\leq t < n$$ in the $$n$$-th day is given by $$C(t) = \exp\left(- \frac{\log(2) }{t_{1/2}} (t-n+1)\right) C_+(n),$$ so just before taking the medicine again, we have the low concentration $$C_-(n+1) = \exp\left(- \frac{\log(2) }{t_{1/2}} \right) C_+(n).$$ and the high concentration is given by $$C_+(n+1) = D + \exp\left(- \frac{\log(2) }{t_{1/2}} \right) C_+(n).$$ From here it is pssible to calculate the high concentration for any day $$n$$: $$\begin{eqnarray} C_+(0) = D &,& C_+(1) = D\left(1 + \exp\left(- \frac{\log(2) }{t_{1/2}} \right)\right), \cdots \nonumber \end{eqnarray}$$ leading to $$\begin{eqnarray} C_+(n) &=& D\sum_{j=0}^{n} \exp\left(- \frac{\log(2) }{t_{1/2}} \right)^j = D\frac{1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n+1}} {1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)} \nonumber \end{eqnarray}$$ and at $$n-1\leq t < n$$, any moment in the $$n$$-th day, the concentration is given by $$\begin{eqnarray} C(t) &=& D\frac{1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n}} {1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)} \exp\left(- \frac{\log(2) }{t_{1/2}} (t-n+1)\right) \nonumber \end{eqnarray}$$ we can compare the current concentration $$C(t)$$ to the concentration $$C(t+m)$$, the same time of day, but $$m$$ days later: $$\begin{eqnarray} C(t) = \frac{1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n}} {1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n+m}} C(t+m) = \left(1-\exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n}\right)C(t+\infty), \nonumber \end{eqnarray}$$ where $$C(t+\infty)$$ means 'at this time of day, in steady state'.

Therefore, we can say that the concentration is in steady state when $$\begin{eqnarray} \exp\left(- \frac{\log(2) }{t_{1/2}} \right)^{n} < \epsilon, \nonumber \end{eqnarray}$$ where $$\epsilon$$ is small, for instance $$\epsilon = 0.01$$ when you consider 'in steady state' to mean 'less that one percent away from steady state'. This will be after $$n$$ days, where $$n$$ is given by $$\begin{eqnarray} n > {}^2\log(1/\epsilon)~t_{1/2}. \nonumber \end{eqnarray}$$ In the case where the half-time is $$1.25$$ days, and $$\epsilon=0.01$$, we get $$n > 8.3$$: just over a week. After 7 days, steady stage is approached up to 2%.