Each tumor cell carries a continuous CD19 antigen-expression level a ∈ [0,1] — the receptor CAR-T cells are engineered to recognise. Every simulated day, each living cell faces an independent kill probability set by the CAR-T attack rate and its own antigen level:
P(kill) = k · a
k = CAR-T kill efficacy × (CAR-T count / 40)
Surviving cells divide with logistic growth capped at carrying capacity K, and each daughter's antigen level drifts from its parent by a random mutation step:
P(divide) = r₀ · (1 − N / K)
a_daughter = clamp(a_parent + 𝒩(0, σ), 0, 1)
Because P(kill) scales with antigen level, CD19-high cells are removed far faster than CD19-low ones — the population isn't shrinking uniformly, it's being selected. Each generation's survivors skew lower in mean antigen, and low-antigen mutants that would have been irrelevant under no treatment now have a survival edge. Over enough days a CD19-negative subclone — invisible to the CAR-T cells — expands to dominate the population: clinically, this is antigen-loss relapse, the dominant resistance mechanism behind CD19-negative relapse after CAR-T therapy for B-cell leukemia and lymphoma.
Verified numerically (standalone Node script, not shipped): with the mutation rate set to 0%, the same escape still emerges from standing heterogeneity alone — the pre-existing initial CD19⁻ fraction gets selectively enriched even with no new mutants, since P(kill) for a near-zero-antigen cell is close to zero every single day while high-antigen cells keep dying. New mutation only speeds the process up; it isn't required for it. The 3D source model was ported unmodified — its birth-death rules are internally consistent.
- Kill efficacy — how aggressively CAR-T cells eliminate antigen-bearing cells (higher = stronger short-term response, but also stronger selection for escape).
- CAR-T cell count — scales overall attack pressure and the number of green cells patrolling the tumor mass.
- Mutation rate — how much antigen expression drifts per division; higher rates seed escape variants faster.
- Initial CD19⁻ fraction — pre-existing low-antigen cells at day 0, modelling tumor heterogeneity already present before treatment starts.
Left panel: a 2D phyllotaxis-packed view of the tumor mass (drag to pan, scroll/pinch to zoom) with CAR-T cells patrolling in orbit. Right panel, top to bottom: population over time, mean-antigen / escape-fraction over time, and a live histogram of antigen expression across the population — watch the histogram's single high peak split and slide toward zero as selection does its work.