Medicine & Health ★★ Intermediate

🛡️ Immune Response

When a pathogen invades, the innate immune system responds first — neutrophils and macrophages engulf invaders within minutes. If the infection persists, adaptive immunity kicks in: T-cells and B-cell-derived antibodies mount a targeted, lasting response. Adjust virulence, immune strength, and vaccination level to see whether the infection is cleared, becomes chronic, or overwhelms the host.

Pathogens:
Neutrophils:
T-cells:
Status:
dP/dt = r·P·(1 − P/K) − k_innate·N·P − k_adaptive·T·P·V  │  Lotka-Volterra style

Phases of the Immune Response

0–4 h (immediate): Complement proteins and mast cells release inflammatory signals. Neutrophils (blue) are first responders — they engulf and destroy bacteria by phagocytosis and release of toxic granules.

4–96 h (innate): Macrophages (green) arrive, engulfing pathogens and presenting antigens to T-cells. Natural killer cells destroy infected host cells.

3–14 days (adaptive): T-cells (orange) expand clonally and directly kill infected cells. B-cells differentiate and secrete antibodies (yellow) that neutralise pathogens. Memory cells formed here provide long-term immunity. Vaccination pre-arms the adaptive system — reducing pathogen peak dramatically.

About Immune Response Simulator

The immune response is the body's coordinated defence against pathogens — bacteria, viruses, fungi, and parasites — as well as against damaged or cancerous cells. It operates through two interconnected arms: the innate immune system, which provides rapid, non-specific responses within minutes to hours, and the adaptive immune system, which develops targeted responses over days to weeks but retains immunological memory for future exposures.

The innate response involves physical barriers (skin, mucous membranes), phagocytic cells (neutrophils, macrophages), natural killer cells, and the complement system. Pattern recognition receptors such as Toll-like receptors detect conserved molecular patterns shared by pathogens. This triggers inflammation — vasodilation, increased vascular permeability, and recruitment of immune cells to the infection site.

The adaptive response involves B lymphocytes (which mature into plasma cells producing antibodies) and T lymphocytes (cytotoxic T cells that kill infected cells, and helper T cells that coordinate the response). Clonal selection amplifies only the lymphocytes whose receptors match the pathogen's antigens. After clearance, long-lived memory cells persist, enabling rapid recall responses that protect against reinfection — the basis of vaccine-induced immunity.

Frequently Asked Questions

What is the difference between innate and adaptive immunity?

Innate immunity responds within minutes using pre-programmed pattern recognition that detects broad classes of pathogens. Adaptive immunity takes days to weeks but is highly specific, generates antibodies and T cells tailored to a particular pathogen, and creates immunological memory. The two systems communicate through cytokines and antigen presentation.

How do vaccines train the immune system?

Vaccines introduce antigens (inactivated pathogens, protein subunits, or mRNA encoding viral proteins) without causing disease. The adaptive immune system mounts a response, generating memory B and T cells. On future exposure to the real pathogen, these memory cells enable a much faster and stronger response that clears infection before disease develops.

What are cytokines and what role do they play?

Cytokines are signalling proteins secreted by immune cells to coordinate the immune response. Interleukins, interferons, and tumour necrosis factors (TNF) recruit and activate specific cell types, promote inflammation, trigger fever, and regulate the transition between innate and adaptive phases. A cytokine storm — excessive, uncontrolled cytokine release — can cause severe tissue damage.

What is an antigen and how is it recognised?

An antigen is any molecule (typically a protein or polysaccharide on a pathogen's surface) that can be specifically recognised by immune receptors. B cell receptors and antibodies bind three-dimensional surface epitopes; T cell receptors recognise peptide fragments presented by MHC molecules on the surface of cells.

How does the body prevent the immune system from attacking itself?

Central tolerance eliminates self-reactive lymphocytes during development in the thymus (T cells) and bone marrow (B cells) through a process of clonal deletion. Peripheral tolerance mechanisms — regulatory T cells, anergy induction, and inhibitory checkpoints — suppress any self-reactive cells that escape. Failures in these mechanisms lead to autoimmune diseases like lupus, rheumatoid arthritis, and type 1 diabetes.

About this simulation

This is an agent-based model of an infection: individual coloured dots — pathogens, neutrophils, macrophages, T-cells and antibodies — move, multiply and interact under simple local rules rather than a single global equation. The underlying dynamic follows a Lotka-Volterra-style predator-prey relationship (dP/dt = r·P·(1−P/K) − k_innate·N·P − k_adaptive·T·P·V), but you watch it unfold cell by cell rather than as an abstract curve. Three phases run in sequence: an immediate response in the first few hours, a slower innate phase over several days, and a delayed adaptive phase that can take over a week to ramp up — unless vaccination has already primed it.

🔬 What it shows

Red pathogen dots reproduce logistically up to a virulence-dependent ceiling while blue neutrophils, green macrophages, orange T-cells and yellow antibodies hunt them down at different speeds and kill rates. Neutrophils and macrophages recruit within the first hours; T-cells only begin appearing after roughly 180 simulated ticks, and antibodies after 240 ticks — or after just 60 ticks if vaccination is high enough.

🎮 How to use

Choose a preset — Bacterial, Viral, Vaccinated or Immunocompromised — or drag the Pathogen virulence, Immune strength and Vaccination sliders yourself, then hit Reset to restart with the new settings. Watch the fact-bar counts and the population-history graph to see whether the infection is cleared, contained, or overwhelms the host.

💡 Did you know?

Neutrophils make up roughly 50-70% of circulating white blood cells and are usually the first immune cells to reach a site of infection, often within minutes. Vaccination works by pre-training this same adaptive machinery: memory T-cells and B-cells can persist for decades, which is why a high Vaccination value here spawns T-cells almost immediately instead of waiting for day three.

Frequently asked questions

What do the coloured dots in the simulation represent?

Each dot is an individual agent: red dots are pathogens, blue are neutrophils, green are macrophages, orange are T-cells, and yellow are antibodies. They move around the field, and immune cells actively steer toward the nearest pathogen once it is within detection range, then have a chance to eliminate it on contact.

What does the Pathogen virulence slider actually change?

Virulence sets both the starting number of pathogens and the population ceiling they can reproduce up to (5 plus up to 95 more at maximum virulence), as well as their maximum movement speed. Higher virulence means the infection starts bigger, grows faster, and is harder for the immune system to keep contained.

How does the Vaccination slider change the simulation's timing?

At high vaccination levels the model pre-spawns T-cells at the very start (tick 10) instead of waiting until the adaptive phase begins around tick 180, and lets antibodies appear from tick 60 rather than tick 240. This mirrors how vaccines create memory cells in advance, so a real infection is met by a fast, targeted adaptive response instead of starting from zero.

Why do T-cells and antibodies appear later than neutrophils and macrophages?

The simulation reproduces the real timeline of an immune response: neutrophils are pre-existing and mobilise within hours, macrophages follow over the next few days, but T-cells and antibody-producing B-cells need time to be selected and expanded from the small pool of cells that recognise the specific pathogen — typically three to fourteen days in a real infection, represented here as several hundred simulated ticks.

What is the difference between the Bacterial, Viral and Immunocompromised presets?

The Bacterial preset uses moderate virulence and strong immune strength, resembling a typical bacterial infection cleared mainly by neutrophils and macrophages. The Viral preset raises virulence and lowers immune strength slightly, reflecting how viruses can replicate faster. The Immunocompromised preset keeps virulence moderate but cuts immune strength and vaccination sharply, so pathogens face far fewer, slower-arriving defenders and can more easily overwhelm the host.