💉 Drug Diffusion & Pharmacokinetics

Two-compartment model · IV bolus & oral dosing · Cmax, AUC, half-life

Plasma (central)
Tissue (peripheral)
Gut (oral only)
Therapeutic range

Drug Preset

Route

Dosing

PK Parameters

Results

Cmax (mg/L)
Tmax (h)
AUC (mg·h/L)
t½ (h)

💊 Drug Diffusion & Pharmacokinetics

A two-compartment pharmacokinetics model simulating drug absorption, distribution and elimination. Compare IV bolus versus oral dosing, visualise plasma and tissue concentration curves, and calculate key PK parameters.

🔬 What It Demonstrates

Drug movement between plasma (central) and tissue (peripheral) compartments follows first-order kinetics. Key parameters — Cmax, Tmax, AUC and half-life — determine dosing regimens. Oral absorption adds a lag phase modelled by ka.

🎮 How to Use

Switch between IV and oral modes. Adjust dose, absorption rate and clearance. Watch concentration-time curves update live. A stats panel shows Cmax, Tmax, AUC and elimination half-life.

💡 Did You Know?

The therapeutic window — between the minimum effective concentration and the toxic level — is often surprisingly narrow. Digoxin, for example, has a therapeutic index of only 2, meaning double the normal dose can be lethal.

About Drug Diffusion & Pharmacokinetics

This simulation models how a drug moves through the body using a two-compartment pharmacokinetic model. The central compartment represents plasma and well-perfused tissue, while the peripheral compartment represents slower-equilibrating tissue. Concentrations are advanced numerically with a small fixed time step (0.005 h) by integrating coupled first-order differential equations governing distribution between compartments and elimination from the central compartment.

The controls let you choose a drug preset, switch between IV bolus, oral and infusion routes, and set dose, number of doses, dosing interval and infusion duration. Sliders for clearance (CL), volumes V1 and V2, intercompartmental clearance Q, absorption rate ka and body weight reshape the curves, while live readouts report Cmax, Tmax, AUC and apparent half-life. This is exactly how clinicians reason about dosing regimens and the therapeutic window.

Frequently Asked Questions

What is a two-compartment pharmacokinetic model?

It is a way of describing how a drug distributes in the body using two linked pools: a central compartment (plasma and well-perfused organs) and a peripheral compartment (more slowly equilibrating tissue). The drug moves reversibly between them and is eliminated from the central compartment, producing the characteristic biphasic concentration-time curve you see plotted in red and blue.

What do Cmax, Tmax, AUC and half-life mean?

Cmax is the peak plasma concentration reached, and Tmax is the time at which it occurs. AUC is the area under the concentration-time curve, a measure of total drug exposure, here in mg·h/L. Half-life is the time for the concentration to fall by half during the elimination phase. The simulation computes all four from the plasma curve.

How do IV, oral and infusion routes differ here?

An IV bolus places the full dose into the central compartment instantly, so the plasma curve starts at its peak. An oral dose enters a gut compartment first and is absorbed with rate constant ka, creating a delayed, rounded peak. An infusion delivers the dose steadily over the chosen duration, smoothing the rise to Cmax.

What equations does the simulation actually solve?

It integrates dC1/dt = -(CL/V1)·C1 - (Q/V1)·C1 + (Q/V2)·C2 + input/V1 for the central compartment and dC2/dt = (Q/V1)·C1 - (Q/V2)·C2 for the peripheral one. For oral dosing a gut term dGut/dt = -ka·Gut feeds absorption into the central input. These are advanced with simple forward-Euler steps of 0.005 h.

What do the PK parameter sliders control?

CL is clearance (volume cleared of drug per hour per kg), and increasing it speeds elimination. V1 and V2 are the central and peripheral volumes of distribution per kg. Q is intercompartmental clearance, governing how fast drug shuttles between compartments. ka sets oral absorption speed, and body weight scales the volumes and clearances from per-kg values to absolute litres and L/h.

Why does the plasma curve fall in two phases?

Immediately after an IV dose, the steep early decline reflects distribution of drug from plasma into peripheral tissue alongside elimination. Once the two compartments approach equilibrium, the slower terminal phase is dominated by elimination alone. This biphasic shape is the signature of two-compartment kinetics and is why a single exponential often misfits real plasma data.

Is the half-life value exact?

The displayed half-life uses a single-compartment approximation, 0.693·V1/CL, which gives the apparent elimination half-life rather than the true terminal half-life of the full two-compartment system. It is a useful, fast estimate, but for a multi-compartment drug the genuine terminal half-life derived from the slower eigenvalue can be longer.

What is the therapeutic range shown on the chart?

The shaded amber band marks an illustrative therapeutic window for the selected drug preset, between a minimum effective concentration and an upper limit. Effective dosing aims to keep the plasma curve within this band. The window can be narrow, which is why parameters like clearance and dosing interval matter so much for safety.

How does multiple dosing reach steady state?

Set more than one dose and choose an interval, and each dose adds to whatever drug remains from earlier ones. If doses are given faster than the drug is eliminated, concentrations accumulate and approach a steady-state plateau after roughly four to five half-lives. The simulation shows the sawtooth rise and the eventual fluctuating plateau directly.

How is this used in real medicine and drug development?

Two-compartment models underpin dose selection, infusion regimens and therapeutic drug monitoring for medicines such as antibiotics, anticoagulants and anaesthetics. Pharmacologists fit these parameters to measured blood samples to individualise dosing, predict accumulation, and keep concentrations within the therapeutic window while avoiding toxicity, exactly the trade-off this simulation lets you explore.