morphogen.coupling.diffusion¶
Transient diffusion in voxel images: moisture, oxygen, solvents.
The activity u of the mobile species (relative humidity, oxygen pressure over its
value outside) is continuous across interfaces; each phase holds the concentration
c = S u (S its solubility, the concentration at equilibrium with the outside)
and lets it through with the permeability P = D S (D its diffusivity):
S du/dt = div(P grad u) - k S u
(k an optional first-order consumption). Finite volumes on the voxels: the flux
between two neighbours goes through the harmonic mean of their permeabilities (exact
for layers in series), the exposed faces hold u (a value or a function of time)
half a voxel from the centres of their voxels, the other faces are impermeable or, in
periodic images, periodic; implicit Euler steps. The analytic solutions of a slab
(Crank 1975, eq. 4.17 and 4.18) check it.
- morphogen.coupling.diffusion.DIRECT_LIMIT = 4096¶
Voxels up to which the steps are solved by sparse LU (one factorization per time step length); preconditioned conjugate gradients beyond.
- class morphogen.coupling.diffusion.DiffusionResult(times: ndarray, fields: list[ndarray], uptake: ndarray, saturation: float)[source]¶
Bases:
objectConcentrations
c = S uat the requestedtimesand the uptake: the mean concentration over the image at each time, and at equilibrium (saturation).- property relative_uptake: ndarray¶
M(t) / M_inf.
- morphogen.coupling.diffusion.transient_diffusion(image, diffusivity, times, *, solubility=None, exposed=('x-', 'x+'), boundary: float | Callable[[float], float] = 1.0, initial: float = 0.0, consumption=None, steps: int = 40, periodic=None) DiffusionResult[source]¶
Diffusion of a species into the phases of
imagefrom itsexposedfaces, held at the activityboundary(a number or a function of time), from a uniform initial activityinitial.diffusivity,solubility(default 1) andconsumption(first-order rate, default 0): one number, or a mapping phase -> value.times: the output times, each interval split intostepsimplicit Euler steps (the first one into steps growing geometrically, for the sqrt(t) start). Axes without exposed faces are periodic in periodic images, impermeable otherwise.