Power-law tumour growth
A tumour whose proliferating part scales as a power of its size.
- Class:
PowerLawGrowthSystem - Import:
from skcomplex.systems.biology.oncology import PowerLawGrowthSystem - Field:
biology/oncology - Topics:
tumour growth,ode,power law - References:
- Padmanabhan, Meskin, and Al Moustafa 2021
- Benzekry et al. 2014
Use this system
The block imports the class and simulates the system with its default parameters and its tuned run settings.
from skcomplex.systems.biology.oncology import PowerLawGrowthSystem
trajectory = PowerLawGrowthSystem().prepare().simulate()
Parameters
The model parameters take these defaults, and set_params changes them.
| Parameter | Default |
|---|---|
n |
10.0 |
r |
1.32 |
p |
0.58 |
solver |
'auto' |
backend |
'auto' |
Tags
The system with its default parameters has these capability tags, which solvers and analyses check.
| Tag | Values |
|---|---|
| Time | continuous |
| Space | none |
| Laws | rate |
| Randomness | deterministic |
| Domains | real |
| Structure | fixed |
Class
The source of the class shows how it builds its components from its model parameters.
class PowerLawGrowthSystem(BaseSystem):
"""A tumour whose proliferating part scales as a power of its size.
The growth is `dn/dt = r n^p`.
For `p < 1` the volume follows `(n0^(1-p) + (1-p) r t)^(1/(1-p))`, a growth slower than exponential. The defaults
are the fit to breast cancer volumes in mm³ and days. The system has the volume `tumour.x`.
Args:
n:
The initial volume.
r:
The growth rate.
p:
The exponent.
label:
The label of the system, which names it when it is nested in another one.
solver:
The solver of the problem, or `'auto'` for the one the system chooses.
backend:
The backend that evaluates the compiled functions, or `'auto'` for the one the system chooses.
Examples:
>>> from skcomplex.systems.biology.oncology import PowerLawGrowthSystem
>>> PowerLawGrowthSystem(p=2 / 3).prepare().system_.interactions[0].p
0.6666666666666666
"""
field = 'biology/oncology'
topics = ('tumour growth', 'ode', 'power law')
references = GROWTH_REFERENCES
until = 40.0
dt = 0.2
def __init__(
self,
n: float = 10.0,
*,
r: float = 1.32,
p: float = 0.58,
label: str = 'system',
solver: BaseSolver | str = 'auto',
backend: BaseBackend | str = 'auto',
) -> None:
super().__init__(label, solver=solver, backend=backend)
self.n = n
self.r = r
self.p = p
def _prepare(self, context: Sequence[Observable] | None = None) -> None:
"""Set the system of a tumour whose proliferating part scales as a power of its size.
The growth is `dn/dt = r n^p`.
Args:
context:
The observables to compile with the problem, or `None` for none.
"""
super()._prepare(context)
self.system_ = System(
self.label,
elements=[PopulationElement('tumour', x=self.n)],
interactions=[PowerLawGrowthInteraction('growth', target='tumour', r=self.r, p=self.p)],
)
Components
The system uses these element and interaction classes, each with its nearest class of the core.
Elements:
PopulationElement, fromElement, through the shared recipeNonnegativeElement
Interactions:
PowerLawGrowthInteraction, fromInteraction
class PopulationElement(CompartmentElement):
"""Population of one species, a compartment whose state `x` holds its size.
Args:
label:
The label of the population.
x:
The initial size.
Examples:
>>> from skcomplex.systems.biology.common.populations import PopulationElement
>>> PopulationElement('rabbits', x=40).x
40
"""
def __init__(
self,
label: str,
*,
x: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
) -> None:
super().__init__(label, x=x)
class PowerLawGrowthInteraction(GrowthInteraction):
"""Growth that scales as a power of the size, `dx/dt = r x ** p`, without harvest.
Args:
label:
The label of the interaction.
target:
The path of the element or group whose population grows.
r:
The growth rate.
p:
The exponent, `2/3` for a growing rim and 1 for exponential growth.
state:
The name of the state of the target that holds the population.
Examples:
>>> from skcomplex.systems.biology.common.kinetics import CompartmentElement
>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.biology.oncology import PowerLawGrowthInteraction
>>> system = System(
... elements=[CompartmentElement('tumour', x=1.0)],
... interactions=[PowerLawGrowthInteraction('growth', target='tumour', r=1.0, p=0.5)],
... )
>>> trajectory = system.prepare().simulate(until=2.0, dt=0.01)
>>> round(float(trajectory.get_values('tumour.x')[-1]), 3)
4.0
"""
def __init__(
self,
label: str,
*,
target: Role,
r: Annotated[float, RealSet.open(0, oo)] = 1.32,
p: Annotated[float, RealSet.open(0, oo)] = 0.58,
state: str = 'x',
) -> None:
super().__init__(label, target=target, r=r, p=p, form='power', state=state)
def _get_rate(self, namespace: SimpleNamespace) -> Expression:
"""Return the power-law growth, with no harvest.
Args:
namespace:
The namespace of the symbols the rate can use, with the namespace of the target.
Returns:
rate:
The rate of the population.
"""
return self._get_growth(namespace)
Equations
The equations are those that symbolic returns for the system with its default parameters.
tumour.x: diff(x_tumour(t), t) == r_growth*x_tumour(t)^p_growth