# Scientific model and equations

## Scope
The family models motile bacteria in a two-dimensional rectangular chamber. A static attractant field is prescribed. Cells swim at constant speed during runs. Tumble events occur as a Poisson process whose instantaneous hazard depends on the temporal change in logarithmic concentration experienced along the current heading. This idealized model isolates temporal sensing and biased run duration; it is not a full receptor-signalling or hydrodynamic model.

## Chemical concentration field
A Gaussian attractant source is placed at `(xs, ys)` over a uniform background:

\[C(x,y)=C_0+A\exp\left[-\frac{(x-x_s)^2+(y-y_s)^2}{2\sigma^2}\right].\]

Here C0 is background concentration, A is peak increment, and sigma is source width. The gradient of log concentration is calculated analytically, with \(\nabla\ln C=\nabla C/C\). For example:

\[\frac{\partial\ln C}{\partial x}=-\frac{A e^{-r^2/(2\sigma^2)}(x-x_s)}{\sigma^2 C(x,y)}.\]

## Temporal sensing
A cell swims with velocity \(\mathbf v=v\mathbf u\), where \(\mathbf u=(\cos\theta,\sin\theta)\). The instantaneous temporal signal is:

\[q=\frac{d\ln C}{dt}=\mathbf v\cdot\nabla\ln C=v\mathbf u\cdot\nabla\ln C.\]

Positive q means motion toward increasing attractant; negative q means motion toward decreasing attractant.

## Tumble hazard
\[\lambda(q)=\operatorname{clip}\left[\lambda_0\exp(-\alpha\tau q),\;0.15\lambda_0,\;3\lambda_0\right].\]

Lambda0 is baseline tumble rate, alpha is dimensionless chemosensory gain and tau is a sensing-memory time scale. Positive q lowers tumble hazard and lengthens favourable runs; negative q raises it. For a time step delta-t:

\[P(\mathrm{tumble})=1-\exp[-\lambda(q)\Delta t].\]

A tumble reorients heading isotropically in 2D. Between tumbles, cells move at constant speed.

## Numerical method
- Explicit fixed time step, default 0.05 s.
- Each cell is advanced independently.
- Tumble events use the exact Poisson event probability for the current step.
- New headings are uniform on [0, 2pi).
- Reflecting boundaries contain cells inside the chamber.
- Mulberry32 seeded pseudo-random numbers make runs reproducible for the same seed, population and parameter set.

## Population observables
Mean concentration at cell positions; mean distance to source; mean instantaneous heading alignment with local log-concentration gradient; fraction within 0.25 sigma of source; cumulative tumbles per cell per simulated second.

## Assumptions and limitations
1. Static, isotropic Gaussian attractant field; no diffusion, degradation, uptake or cell-mediated depletion.
2. No cell-cell interactions, collisions, growth, division or death.
3. Constant swimming speed, independent of concentration.
4. Isotropic tumble reorientation; no species-specific angular persistence.
5. Phenomenological temporal sensing; receptor occupancy, adaptation networks and biochemical noise are not resolved.
6. Two-dimensional chamber with reflecting boundaries.
7. Hazard is clipped to 15%–300% of baseline.
8. Educational conceptual model, not calibrated species-specific prediction.

Chemotaxis emerges because cells moving up the gradient experience lower tumble rates and maintain favourable runs longer. No direct force or steering toward the source is applied.
