Observed since 20 Oct, 18:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A non-isothermal Allen-Cahn tumor growth simulator using JAX and exponax
A reproducible, high–performance simulator for the non‑isothermal Allen–Cahn tumour growth model. This package
implements a three‑variable partial differential equation system coupling tumour cell concentration, temperature and
nutrient dynamics. The continuous model is derived in Gatti et. al. and
describes the interplay of tumour proliferation, apoptosis, nutrient consumption and heat conduction. The equations are
implemented in JAX and solved with either the exponax pseudo‑spectral framework (if available) or a fallback
finite–difference scheme.
To illustrate the dynamical behaviour of the non-isothermal Allen–Cahn tumour model, we present simulation snapshots at three different time horizons:
These correspond to increasing physical time and reveal how the coupled fields ($\varphi$) (tumour), ($\theta$) ( temperature), and ($\sigma$) (nutrient) co-evolve.
At early times, the tumour is still close to its initial condition (typically a small localized region).
$$ \Delta \varphi - F'(\varphi) $$
Interpretation: This regime is dominated by interface relaxation and initial proliferation. The system has not yet developed strong nonlinear feedback.
At intermediate times, nonlinear coupling becomes significant.
Interpretation: This stage reflects active tumour growth under resource constraints. The coupling term
$$ (P\sigma - A)h(\varphi) $$
starts to regulate growth: regions with lower nutrient slow down or stabilize.
At long times, the system approaches a steady or metastable configuration.
$$ -C\sigma h(\varphi) + B(\sigma_B - \sigma) \approx 0 $$
Interpretation: The system reaches a dynamic equilibrium where:
This corresponds to a homeostatic tumour state in the model.
You can reproduce similar trajectories using:
python examples/basic_3d_simulation.py
The simulator solves the simplified non-dimensional system of coupled PDEs (equations(3.3) in the reference). Under homogeneous Neumann boundary conditions, the model reads
φ_t = Δφ − F′(φ) + θ + (P σ − A) h(φ),
θ_t = ∇·(κ(θ)∇θ) + (φ_t)^2 − θ φ_t,
σ_t = Δσ − C σ h(φ) + B (σ_B − σ),
where φ is the tumour cell concentration, θ the absolute temperature, and σ the nutrient concentration. The terms
on the right–hand side correspond to diffusion, a double-well potential (F), thermal coupling and reaction/source
mechanisms. The governing equations come from the derivation in the reference; in particular the authors show that,
after non-dimensionalisation and setting (c_V=β=ε=1), the model reduces to the above system.
The simulator uses the following constitutive relations, taken directly from the physical model:
h: The tumour regulates proliferation and apoptosis through a bounded, monotonic increasing
function h. Biologically, one expects (h(0)=0) and (|h(r)|+|h′(r)|≤C); in practice we implement a smooth ramp
that approximates (\max(0,φ)). These properties ensure that the source terms remain bounded and reflect the
underlying biology.q=2 but this can be changed via the parameter
dataclass.The positive constants P, A, C, B and σ_B respectively denote the tumour proliferation rate, the apoptosis
rate, the nutrient consumption rate, the blood–tissue transfer rate and the nutrient concentration in the
vasculature. When (P σ − A) > 0 the tumour grows; otherwise it decays. The nutrient equation combines consumption
C σ h(φ) with supply B(σ_B−σ). Homogeneous Neumann boundary conditions (zero normal fluxes) are imposed for all
fields.
The repository is organised as follows:
src/acthermal_tumor/core.py – constitutive functions, discrete differential operators and the right‑hand side of
the PDE system.src/acthermal_tumor/solver.py – a high‑level ThermalTumorSimulator class that builds the computational grid,
initializes state variables and advances the solution using a fourth–order Runge–Kutta scheme. The solver uses
exponax to build spectral Laplacians when the library is available; otherwise it falls back to a finite–difference
implementation of the Laplacian and divergence operators with Neumann boundary conditions.src/acthermal_tumor/parameters.py – a dataclass encapsulating all physical parameters and numerical settings.src/acthermal_tumor/utils.py – helper routines for generating initial conditions and plotting simulation output.tests/ – a small pytest suite that checks basic stability (e.g. no NaN values after a few time steps).docs/ – introductory documentation and usage examples.The package uses PEP517 build isolation via hatchling. To install the development version locally, clone this repository and run:
pip install .[dev]
This will install the simulator along with its optional test dependencies. You can then run the test suite with
pytest.
The following example sets up a two‑dimensional grid, initializes a small circular tumour and runs the simulator for a
few time steps. See docs/index.md for a detailed tutorial.
import jax.numpy as jnp
from acthermal_tumor.parameters import Parameters
from acthermal_tumor.solver import ThermalTumorSimulator
from acthermal_tumor.utils import generate_initial_conditions, plot_state
# Define domain and parameters
shape = (64, 64) # 2D grid
params = Parameters(
P=2.0,
A=1.0,
C=1.0,
B=0.5,
sigma_B=1.0,
q=2,
dt=1e-3,
dx=1.0 / 64
)
# Generate initial conditions: tumour in the centre, uniform temperature and nutrient
phi0, theta0, sigma0 = generate_initial_conditions(shape, radius_fraction=0.1)
# Create and run simulator
sim = ThermalTumorSimulator(shape=shape, params=params)
state = sim.initialize_state(phi0, theta0, sigma0)
for _ in range(100):
state = sim.step(state)
# Plot the final state
plot_state(state)
Contributions that improve accuracy, extend functionality or add additional time steppers are welcome. Please open an issue or pull request on the project repository.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.4.0 | 1 May 2026 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e8b4a5562ef078f55f10f8005b32c324e9385ed61db7d57dd71ddb3dade7de87