GLOBAL KNOWLEDGE ARK

Physics · Article

Molecular, particle, continuum, and agent-based simulation

Advance four labeled point particles, turn their masses into a coarse spatial summary, and compare model choices and update schedules without confusing a picture with a validated physical simulation.

Previous article: Inverse problems and Bayesian computation

Back to Physics

After reading, you can

  • State what a simulation entity represents, which variables it carries and how it is updated.
  • Calculate a supplied particle trajectory within its declared units and time domain.
  • Aggregate particle masses into cells with an explicit boundary convention.
  • Distinguish a coarse summary from a closed predictive continuum model.
  • Check how synchronous and sequential agent updates differ.
  • Choose a representation and numerical checks for a named observable and physical domain.
01

Start with four labeled points

Four point particles A, B, C and D start at x = 0.5 m, 1.5 m, 2.5 m and 3.5 m on a fixed straight coordinate line, with right positive. Each has a supplied, unchanged mass of 1 g and a prescribed constant velocity v = 1 m/s. For 0 ≤ t ≤ 1 s, the rule is xᵢ(t) = xᵢ(0) + vt, where i labels a particle and t is elapsed time from the start. What will their positions and the mass in a fixed interval be at 1 s?

A simulation represents selected entities or fields and computes their states using declared rules. A state is the information the chosen model carries at a given time or iteration. Here the four coordinates and masses, the prescribed velocity, and the time identify all required inputs. No interactions, collisions or reflecting or periodic walls are included in this point model.

Preparation is reading signed coordinates, multiplying velocity by duration, and dividing mass by length. Units, standards, and physical constants and Algebra, functions, graphs, and logarithms provide useful preparation. The interval and state-copy notation below are introduced locally. Begin with the point and cell tables; no calculus or simulation software is required.

02

Advance the declared particle rule

At 1 s, every coordinate increases by (1 m/s)(1 s) = 1 m. The new positions are 1.5 m, 2.5 m, 3.5 m and 4.5 m. The particle labels remain the same, and the four supplied masses still total 4 g. All trajectories stay inside the observation window 0 ≤ x ≤ 6 m during the supplied time interval.

The choice of system matters. The fixed interval 0 ≤ x < 4 m contains all four masses initially but only A, B and C at 1 s. Its contained mass changes from 4 g to 3 g because D leaves through the right boundary. The full tracked set retains 4 g by the stated mass rule; a smaller spatial window can exchange mass with its surroundings.

Two successive 0.5 s advances give the same final coordinates as one 1 s advance because this rule has a prescribed constant velocity: v(0.5 s) + v(0.5 s) = v(1 s). This exact agreement is specific to this model. It does not establish that an arbitrary numerical method or interacting particle simulation is independent of its time step.

Exact snapshots of the original point model. Mass is 1 g for each labeled particle, and only the stated 0–1 s time domain is used.
Particlex at 0 sx at 1 s
A0.5 m1.5 m
B1.5 m2.5 m
C2.5 m3.5 m
D3.5 m4.5 m
03

Identify what a molecular model represents

A particle is a represented entity, not a promise that it is a whole molecule. In a classical molecular-dynamics model it might represent an atom, a molecule or a coarse cluster. For example, an atomistic model carries atomic coordinates and velocities and uses specified interactions to calculate classical motion. The physical meaning and resolution of the variables must be declared.

An interaction model supplies how the represented particles affect one another. Its parameters and applicable conditions are part of the physical model, separate from the numerical method used to advance it. Changing the time step can change numerical error while leaving an unsuitable interaction model unsuitable for the requested observable.

The four 1 g points in this lesson have prescribed motion and no interaction model. They illustrate particle bookkeeping; they do not simulate a particular molecule, temperature or chemical process. Calling a representation molecular does not establish that its chosen variables and interactions predict the physical feature of interest.

04

Coarse-grain with declared cells

Coarse-graining keeps selected summaries while discarding some detail. Divide the observation window into C₁: 0 ≤ x < 2 m, C₂: 2 m ≤ x < 4 m and C₃: 4 m ≤ x ≤ 6 m. Each cell has length 2 m. The left endpoint is included; the right endpoint is excluded except at the final 6 m boundary. Thus a point at exactly 2 m belongs only to C₂.

Let Mⱼ be the mass in cell j, where j labels a cell. Define its average linear mass density as λⱼ = Mⱼ/(2 m). The symbol λ denotes mass per length, with units g/m here. It is different from three-dimensional mass per volume, whose SI unit is kg/m³. Since 1 g = 0.001 kg, 0.5 g/m = 0.0005 kg/m.

Initially the counts are 2, 2 and 0, giving densities 1 g/m, 1 g/m and 0 g/m. At 1 s the counts are 1, 2 and 1, giving 0.5 g/m, 1 g/m and 0.5 g/m. Predict which cell density changes before comparing the two rows of the diagram. Multiplying each density by its cell length recovers the contained mass; adding the three cell masses gives 4 g at either snapshot.

The right-hand bars assign a constant average density within each selected cell. They do not locate an individual particle uniformly throughout that cell. On the left, the point positions remain visible; marker size and vertical placement carry no physical radius or second coordinate. The common horizontal scale makes the aggregation explicit.

Particle positions and their coarse linear mass densityTwo rows compare times 0 s and 1 s in the exact supplied four-point model. The left column shows labeled particle coordinates on 0–6 m; only horizontal position is physical, and marker sizes and vertical placement are decorative. Circles mark 0 s and diamonds mark 1 s. The right column uses the same position scale and the declared 2 m cells, with a shared linear-density scale from 0 to 1.25 g/m. Solid outlined bars show initial densities 1, 1 and 0 g/m; hatched bars show final densities 0.5, 1 and 0.5 g/m. Bar widths represent actual cell lengths. This is a stipulated aggregation comparison, not measured motion or a smooth continuum solution.
Predict the cell counts at 1 s before comparing the two snapshots. Left panels preserve the labeled coordinates; right panels show average linear mass density over the same 2 m cells. Both rows and columns use the same 0–6 m position scale, and both density panels use 0–1.25 g/m. The assigned masses total 4 g at either time.
Text equivalent of the coarse-density diagram. The stated endpoint convention assigns every point once; all densities are averages over 2 m cells.
TimeCellParticle countCell massLinear mass density
0 sC₁22 g1 g/m
0 sC₂22 g1 g/m
0 sC₃00 g0 g/m
1 sC₁11 g0.5 g/m
1 sC₂22 g1 g/m
1 sC₃11 g0.5 g/m
05

Ask what a continuum field can predict

A continuum model describes selected material quantities as fields across a region. A field assigns a quantity to a location and time, such as mass density or velocity. This description is an idealization at chosen length and time scales; it does not resolve every atom. Our cell averages are a simple coarse representation, not evidence that four points behave as a smooth material.

A summary does not automatically contain enough information to predict its own next value. For example, initial coordinates 0.25 m, 1.75 m, 2.25 m and 3.75 m give the same 2 m cell counts as the main model. With the same velocity 1 m/s, at 0.25 s their counts are 1, 2 and 1, whereas the main model still has counts 2, 2 and 0. The lost positions within cells affect boundary-crossing times.

A predictive field model therefore needs stated evolution rules and, where relevant, material relations and initial and boundary conditions. The cell averages alone do not supply those rules. Smaller cells retain more spatial detail but do not by themselves establish the physical validity of a continuum approximation or determine every coordinate.

Partial differential equations and Green functions is an optional return path for the field-equation discussion. On a first reading, use the finite counterexample and the density-times-length check; they show the information and unit issues without requiring differential equations.

06

Declare an agent rule and update schedule

An agent-based model represents individual entities with state variables and rules for their behavior or interaction. The entities need not be thinking people: a model can assign rules to abstract or physical entities. Specify what each state means, what information a rule reads, and when updates become visible to other agents.

For a separate abstract example, agents A and B each carry a dimensionless state s that is either 0 or 1. Start with (sA, sB) = (0, 1). One synchronous update makes each copy the other agent’s previous state, so the new pair is (1, 0). Synchronous means all outputs are calculated from the same old pair before either stored input is replaced. The iteration index n counts updates; no duration in seconds is assigned.

With sequential updates in order A then B, A first copies 1, and B then sees A’s new 1; the result is (1, 1). Reversing the order gives (0, 0). These are different rules for when information is read, rather than a numerical rounding difference. The binary labels are not masses, and their sum has no declared physical conservation law.

Store an unchanged old state and a separate new state when the intended rule requires synchronous reading. A different model may deliberately use sequential or randomized updates. The schedule belongs to the model and implementation specification; no particular order is universally the physically correct one.

The same initial binary state (0, 1) gives different outputs under three explicitly different reading schedules. This is an abstract rule comparison, not a measured physical process.
Update schedulePair after one update
Synchronous old-state copy(1, 0)
Sequential A then B(1, 1)
Sequential B then A(0, 0)
07

Separate model checks from numerical checks

Check a named observable, such as a particle coordinate, the mass in a window or a cell-average density. Test units, membership at cell boundaries, and whether the update reads the intended state. The exact point model and binary copy rule provide small cases whose outputs can be calculated before writing a program.

For a numerical approximation, compare appropriate time-step or spatial-resolution choices and account for the numerical error relevant to the requested output. Agreement on one small case checks that case; it does not verify every interaction, boundary condition or code path. A finer mesh or smaller time step also does not supply missing physical variables.

For a physical application, check that the representation and interaction or field rules apply to the scale, conditions and observable, then compare suitable outputs with appropriate evidence. Model uncertainty, numerical approximation and statistical sampling are separate issues. This lesson supplies exact models and arithmetic, not a run of a molecular, continuum or agent-based software package.

08

Choose a representation for the question

The four descriptions overlap. An atom in a classical molecular model is represented as a particle; an agent can also carry a particle coordinate. A continuum field instead describes selected quantities across space. These are choices of variables and rules, not a universal ladder in which more detailed always means more accurate for every question.

If the question is where D is at 1 s, the labeled trajectory gives 4.5 m. If it is the mass in C₃, the cell summary gives 1 g. The density picture cannot recover D’s exact coordinate from that mass alone. Start with the requested observable, declare the state and its evolution, then retain enough detail to answer it within the chosen domain.

Record the initial state, units, boundaries, interaction or update rule, schedule and numerical method needed to reproduce the calculation. The next mapped lesson is High-performance computing, visualization, and machine learning; greater computing capacity can help evaluate a chosen model, while its physical assumptions still need scrutiny.

Worked examples

Advance the four coordinates

Use the exact four-point model on 0 ≤ t ≤ 1 s. Find all positions at 1 s and compare one full advance with two half advances.

  1. For every particle, vΔt = (1 m/s)(1 s) = 1 m. Add this same displacement to the four supplied initial coordinates.
  2. The coordinates become A: 1.5 m, B: 2.5 m, C: 3.5 m and D: 4.5 m, all inside 0 ≤ x ≤ 6 m.
  3. A half advance adds 0.5 m, and the next adds another 0.5 m. Their sum is exactly 1 m under the unchanged prescribed velocity.
  4. The four 1 g masses still total 4 g. Inside 0 ≤ x < 4 m only A, B and C remain, so that window contains 3 g.

The final coordinates are 1.5 m, 2.5 m, 3.5 m and 4.5 m. Both advance choices agree for this exact constant-velocity rule; the full tracked mass is 4 g while the smaller window contains 3 g.

Recover cell mass from linear density

At 1 s, use the declared 2 m cells and the four coordinates. Calculate each cell’s average linear mass density and recover the total mass.

  1. C₁ contains A, C₂ contains B and C, and C₃ contains D, so the counts are 1, 2 and 1. Each point carries 1 g.
  2. The cell masses are 1 g, 2 g and 1 g. Divide by the same 2 m cell length to obtain 0.5 g/m, 1 g/m and 0.5 g/m.
  3. Multiply back: (0.5 g/m)(2 m) = 1 g, (1 g/m)(2 m) = 2 g, and (0.5 g/m)(2 m) = 1 g.
  4. Add the recovered masses: 1 g + 2 g + 1 g = 4 g. A density has units of mass per length; it is not itself the cell mass.

The densities are 0.5 g/m, 1 g/m and 0.5 g/m, and their cell-length-weighted sum recovers 4 g. The coarse values retain the cell masses without retaining every coordinate.

Compare old-state and sequential copy

Start the abstract binary agents at (sA, sB) = (0, 1). Apply one synchronous old-state copy and one sequential A-then-B copy separately.

  1. For the synchronous rule, read the unchanged old pair. A’s next value is the old B value 1; B’s next value is the old A value 0.
  2. Store both new values together to obtain (1, 0). Neither new value was used as an input in that update.
  3. For the sequential rule, A first becomes 1. B then reads this already replaced A value and becomes 1 too.
  4. The sequential result is (1, 1). It differs because the reading schedule changed, even though every copied binary value is exact.

Synchronous copying gives (1, 0); sequential A then B gives (1, 1). Reusing a newly written value would implement the wrong rule if old-state copying was intended.

Try it yourself

  1. In the main point model, where is D at 0.5 s? Which declared 2 m cell contains it, and is it inside 0 ≤ x < 4 m?

    Show the answer and reasoning

    D is at 4 m, in C₃, and outside the smaller half-open window.

    xD = 3.5 m + (1 m/s)(0.5 s) = 4 m. C₂ excludes its right endpoint, while C₃ includes its left endpoint, so D is counted once.

  2. At 1 s, C₁ has average linear mass density 0.5 g/m and length 2 m. What is its mass? Express that density in kg/m as well.

    Show the answer and reasoning

    The mass is 1 g, and the density is 0.0005 kg/m.

    Multiply density by length: (0.5 g/m)(2 m) = 1 g. Since 1 g = 0.001 kg, multiply 0.5 g/m by the conversion factor to obtain 0.0005 kg/m. These are different quantities.

  3. Compare the main initial coordinates with 0.25 m, 1.75 m, 2.25 m and 3.75 m, all with the same velocity 1 m/s. Both sets have initial 2 m cell counts 2, 2, 0. What are their counts at 0.25 s?

    Show the answer and reasoning

    The main counts remain 2, 2, 0; the alternative counts become 1, 2, 1.

    The main coordinates are then 0.75 m, 1.75 m, 2.75 m and 3.75 m. The alternative coordinates are 0.5 m, 2 m, 2.5 m and 4 m. The stated endpoint convention gives different counts, so the initial coarse summary and common velocity alone do not determine these exact later cell counts.

  4. At 1 s, divide 0 ≤ x ≤ 6 m into six 1 m cells, each left-inclusive and right-exclusive except the last endpoint. What are the particle counts from left to right? Does this finer summary give each exact coordinate?

    Show the answer and reasoning

    The counts are 0, 1, 1, 1, 1, 0. The summary alone still does not give each exact coordinate.

    The positions 1.5 m, 2.5 m, 3.5 m and 4.5 m lie in the second through fifth cells. Counts identify occupied cells but discard where inside each cell a point sits; finer resolution is not identical to retaining every coordinate.

  5. Start the binary pair at (0, 1). What follows after two synchronous old-state copies? What follows after one sequential B-then-A copy?

    Show the answer and reasoning

    Two synchronous copies return (0, 1). One sequential B then A gives (0, 0).

    Synchronous copying swaps the pair: (0, 1) becomes (1, 0), then (0, 1). In the reversed sequential order B first reads A’s 0, then A reads B’s new 0. Iterations have no assigned physical duration here.

  6. A program carries coordinates labeled atoms, but its interaction rule is unspecified. Does that label alone establish a useful classical molecular model for a chosen physical observable? Would a smaller time step supply the missing interaction rule?

    Show the answer and reasoning

    No to both questions.

    The represented entities, interactions, applicable conditions and requested observable must be declared and checked. A time-step choice concerns how a given evolution rule is computed; it does not define a missing physical interaction model.

What to carry forward

  • A simulation needs a declared representation, initial state, evolution or interaction rule and numerical procedure where relevant.
  • Particle identity and coordinates contain detail that cell-average densities discard.
  • Linear mass density multiplied by cell length recovers mass; it is different from mass per volume.
  • A coarse summary is not automatically a physically valid or closed predictive continuum model.
  • Old-state, sequential and randomized schedules are distinct modeling choices when agents read one another’s state.
  • Check the requested observable, physical domain and numerical error; a detailed picture or successful program output does not establish model validity.

References

Sources for the concepts and teaching approaches in this article.

  1. Overview of LAMMPSLAMMPS developers — collaborative project originally developed at Sandia National LaboratoriesReference guidedocs.lammps.orgRead source
  2. Concept of ContinuumGautam Biswas and Suman Chakraborty — NPTEL, Fluid Mechanics (IIT Kanpur course record)Teaching resourcearchive.nptel.ac.inRead source
  3. Fluid MechanicsDavid Tong — University of CambridgeCourse notes · PDFFluid Mechanics1.1 The Basicsdavidtong.org
  4. Programming GuideUri Wilensky — Center for Connected Learning and Computer-Based Modeling, Northwestern UniversityReference guidedocs.netlogo.orgRead source