Expand description
Excitable media shared by dicty_aggregation and heart_fibrillation (SPEC-002
Batch M13).
Two kernels, one per kind of tissue:
Barkley(1991) on a rectangularGridwith the isotropic 9-point Laplacian: a fast FitzHugh–Nagumo-type medium with sharp fronts whose semi-implicit update keepsu, v ∈ [0, 1]exactly (DICT-A5). The excitabilitybmay vary per node.AlievPanfilov(1996) on a maskedMedium(any shape, no-flux walls at the mask edge): the cardiac model whose restitution lets spirals break up (HRT).
Plus the analysis both spiral scenes need: count_singularities finds phase
singularities (spiral tips) by the winding of the excitation phase.
Structs§
- Aliev
Panfilov - Aliev & Panfilov (1996):
∂u/∂t = D∇²u − ku(u − a)(u − 1) − uv,∂v/∂t = ε(u, v)(−v − ku(u − a − 1)),ε = ε₀ + μ₁v/(u + μ₂), explicit Euler with node spacinghand stepdt(time units). - Barkley
- Barkley’s model
∂u/∂t = ∇²u + ε⁻¹u(1 − u)(u − u_th),u_th = (v + b)/a,∂v/∂t = u − v, discretised with node spacinghand sub-steptau(time units). - Front
- One broken front: a straight segment
a → b, excited on thenside. - Front
Stroke - How a
Frontis painted: the excited strip’s width, the refractory tail’s width (nodes), andvalong the tail from the front to its end. - Medium
- A lattice region of any shape: the nodes inside a mask and each node’s four neighbours, a neighbour outside the mask (or the lattice) replaced by the node itself, so the 5-point Laplacian sees a zero gradient there (no-flux wall).
Constants§
- AP_
V_ MAX vnever exceeds this in the model’s own dynamics (its nullcline tops out neark(1 + a)²/4 ≈ 2.6fork = 8); the clamp only guards the display and tests.
Functions§
- count_
singularities - Count phase singularities (spiral tips) of the fields on
m: plaquettes of four inside nodes around which the phase winds by ±2π. A tip found withinmergenodes (Chebyshev) of one already counted is the same tip seen twice and is not counted again. The firsttips.len()tips found are written totips(lattice coordinates of the plaquette’s top-left node), row by row.thetaandtakenare scratch of the lattice’s size. - excite_
disc - Excite (
u = 1) every node withinrnodes of(cx, cy)that has recovered tov < v_max: a pacemaker firing into a medium, which leaves refractory nodes alone. - paint_
front - Paint
frontinto the fields: afront_w-node strip ofu = 1on thenside of the segment, backed by atail_w-node strip whosevramps down away from it. - phase
- Excitation phase
atan2(v − v*, u − u*)of a node (radians,(−π, π]). - unit
- Unit vector from
atoband the distance (a zero-length segment points along x).