자연 · 튜링 패턴

두 화학 물질은 어떻게 반점과 줄무늬를 키울까

규칙

두 화학 물질: 하나는 먹이가 되고, 하나는 퍼져 나가요. 동물 피부 같은 반점과 줄무늬가 저절로 자라요.

클릭하면 YouTube에서 재생돼요.

라이브 데모 · 브라우저에서 실행

해 보기: 규칙을 바꿔 보세요

공급 f · 제거 k 0.0545 · 0.062

0단계. 접시를 탭하면 B 방울이 더해져요. 모든 프리셋은 같은 두 방정식으로 만들어지고, f와 k만 달라요.

왜 이렇게 될까

두 화학 물질이 한 접시에 있어요. 하나는 먹이이고, 다른 하나는 그 먹이를 먹으며 자기를 늘리고, 둘 다 퍼져 나가요. 방울 하나에서 시작해 두 번째 물질이 저절로 반점, 줄무늬, 미로로 자라요. 동물 피부의 무늬처럼요.

∂A/∂t = D_A·∇²A − A·B² + f·(1 − A)∂B/∂t = D_B·∇²B + A·B² − (f + k)·B

직접 만들기

Python 3 · numpy · matplotlib

128 × 128 접시, B 방울 여섯 개, 그레이–스콧 규칙 6,000단계.

turing-patterns.py
"""Turing patterns: the Gray-Scott reaction-diffusion rule on a 128 x 128 grid.
Run: python turing-patterns.py   (needs: pip install numpy matplotlib; takes a few seconds)
"""
import numpy as np
import matplotlib.pyplot as plt

plt.style.use("dark_background")

size, steps = 128, 6000
f, k = 0.0545, 0.062  # feed and kill rates: coral
DA, DB = 1.0, 0.5  # A spreads twice as fast as B

A, B = np.ones((size, size)), np.zeros((size, size))
rng = np.random.default_rng()
for y, x in rng.integers(10, size - 18, (6, 2)):
    B[y : y + 8, x : x + 8] = 1.0  # six drops of B


def laplacian(Z):
    """Each cell against its neighbours: 0.2 for the four sides, 0.05 for the corners (Karl Sims)"""
    sides = np.roll(Z, 1, 0) + np.roll(Z, -1, 0) + np.roll(Z, 1, 1) + np.roll(Z, -1, 1)
    corners = (np.roll(np.roll(Z, 1, 0), 1, 1) + np.roll(np.roll(Z, 1, 0), -1, 1)
               + np.roll(np.roll(Z, -1, 0), 1, 1) + np.roll(np.roll(Z, -1, 0), -1, 1))
    return 0.2 * sides + 0.05 * corners - Z


for _ in range(steps):
    reaction = A * B * B  # one A and two B make three B
    A += DA * laplacian(A) - reaction + f * (1 - A)
    B += DB * laplacian(B) + reaction - (f + k) * B

plt.figure(figsize=(6, 6))
plt.imshow(B, cmap="magma", vmin=0, vmax=0.5)
plt.axis("off")
plt.show()

# Try: f, k = 0.039, 0.058 (a cell net) or 0.034, 0.063 (spots) -> the same rule, another pattern

해 보기: f, k = 0.039, 0.058이면 세포망, 0.034, 0.063이면 반점: 같은 규칙에서 다른 종이 나와요.

이 스크립트를 한 줄씩, 연습 문제와 퀴즈로 배우기 → · Google Colab에서 실행 (영어) →

영상이 들려주는 수학

영상 노트 보기 (YouTube에서, 영어)

Two chemicals share a dish. A is food, fed in everywhere at a slow rate; B eats A to make more of itself (two B's plus one A give three B's) and is removed at a fixed rate. Both spread by diffusion, but A spreads twice as fast as B.

That one asymmetry is the whole secret: Alan Turing showed in 1952 that a "fast inhibitor, slow activator" pair turns a uniform dish unstable, so that the tiniest speck of B grows into a pattern with a built-in wavelength — spots, stripes, labyrinths, cells. The equations here are the Gray–Scott model, and only two numbers change during the film: the feed rate f and the kill rate k. Every "new species" you see is the same rule with those two dials moved a little: coral (f 0.029, k 0.057), solitons that split and travel (0.030, 0.060), a cell net (0.039, 0.058), turbulence (0.026, 0.051).

Colour is age: fresh growth fronts are pink-white, mature tissue violet, old regions indigo; the second seed carries a cyan tint so you can see where the two fronts meet. In the finale the dish is wiped and reseeded inside the shape of the channel's monogram — the same rule, confined — and then the walls are removed. These are the equations behind leopard spots, zebra stripes and the ridges on your fingertips.

출처: 다음 영상의 설명 Turing Patterns: How Two Chemicals Grow Animal Spots (영어).

Shorts

출처