Idea. John von Neumann (1940s) asked what a machine needs in order to build a copy of itself: a description of itself, a constructor that follows the description, and raw material. Living cells do this today. This page models only the growth arithmetic of such a machine population, not any real device.
Model. A square factory floor holds 30 x 30 cells, each with M0 kg of raw material. A machine gathers material from its own cell at rate g (kg/s). When it carries C = 10 kg it spends tau seconds assembling a copy (its arms move, the copy appears next to it). A machine whose cell is empty walks one cell at a time towards the nearest cell that still has material (0.5 s per cell). Time is stepped with a fixed 1/32 s step.
t_d = C/g + tau, so N(t) = N0 * 2^(t/t_d) (exponential growth, doubling every t_d).N(t) = K / (1 + (K/N0 - 1) e^(-r t)) with r = ln2 / t_d and K = N0 + M_total / C. It is a rough guide only; the agent simulation is slower because machines must walk to fresh material and compete for the same cell.sum(cells) + sum(carried) + (N + N_building) * C = const. The page shows this error live; it stays at floating-point round-off (about 1e-10 kg).Independent checks. (1) A headless run with effectively unlimited matter and one seed machine must reach exactly 2^5 = 32 machines after 5 cycle times. This is an analytic prediction that does not use the plotting code. (2) Mass balance as above. (3) When all matter is used, the final count must equal the ceiling N0 + M_total/C minus the stranded partial loads.
Simplifications and honesty. Machines never fail, copy errors (mutations) are not modelled, energy is free, and collisions are ignored. Real self-replicating systems (cells, or proposed lunar-factory concepts) need energy, many different raw elements and error control. Unlimited exponential growth is impossible in a finite world; the saturation seen here is the point of the exercise. The visible cap is 1500 machines.
Models, textures and the factory floor were made in Blender; the dynamics run in Three.js r160.