Flashcards for Python lesson 9: Grids and diffusion
Read the front, say the back to yourself, then open the card.
np.roll(Z, shift, axis)
Shifts an array along an axis; what falls off one end comes back at the other.
Laplacian
A cell’s neighbours minus the cell itself: where diffusion will move it.
Gray–Scott
A is fed in at f, B is removed at f + k, and A + 2B → 3B.
Turing instability
Diffusion breaks an even mixture into a pattern when one substance spreads faster.
plt.imshow(grid)
Shows a 2-D array as a picture, one pixel per cell.