DOI: 10.5061/dryad.2rbnzs82v
title: Alignment phase transition in socially driven motion

description: Collective human movement is a hallmark of complex systems, exhibiting
 emergent order across contexts from pedestrian flows to biological
 collectives. In high-speed, directional settings, alignment ensures
 efficient navigation, whereas in low-speed, undirectional, socially
 engaged contexts, alignment arises from interpersonal interaction rather
 than locomotion goals. Using high-resolution spatial and orientation data
 from preschool classrooms, we uncover a sharp distance-dependent
 transition in pairwise alignment that reflects a spontaneous symmetry
 breaking between behavioral phases: below a threshold of ∼ 0.65 m,
 side-by-side orientations dominate, while face-to-face orientations
 prevail at larger distances. This transition stems from a
 distance-dependent competition among three alignment mechanisms:
 parallelization, opposition, and reciprocation, whose interplay generates
 a bifurcation structure in the effective interaction potential. Fourier
 decomposition of orientation distributions reveals these mechanisms,
 enabling a minimal pseudo-potential model that captures the transition as
 a non-equilibrium phase change. Monte Carlo simulations using inferred
 interaction terms reproduce empirical patterns, establishing a
 quantitative framework for social alignment with implications for
 biological collectives and artificial swarms.
description: <strong>UWB-RFID Technology:</strong><br> We
 used Ultra-Wideband Radio Frequency Identification (UWB-RFID) technology
 to continuously track children’s positions within the classroom. Each
 child wore a vest equipped with two UWB-RFID tags sewn near the left and
 right hips. These tags transmitted spatial data, including time, tag ID,
 and three-dimensional coordinates, at a frequency of 2-4 Hz to four
 receivers mounted at the corners of the classroom. This dual-tag
 configuration enabled high-resolution tracking of both position and
 orientation during natural preschool activities without disrupting
 classroom routines. <strong>Studied
 Classrooms:</strong><br> The study was conducted in preschool
 classrooms in Florida, over a four-year period from 2016 to 2020,
 involving multiple cohorts of children. Children wore RFID-equipped vests
 and participated in typical daily activities such as play, reading,
 painting, eating, and handwashing. Movements outside the classroom (e.g.,
 bathroom trips) were excluded. Wearing the vests did not noticeably alter
 children's behavior. Classrooms were furnished with standard
 preschool furniture and varied in layout and size. Figure 2 in the main
 text provides a visual overview of the classroom environments, including
 3D renderings, XY spatial layouts, and annotated floorplans for datasets
 LC1 and LC2.
description: # Alignment phase transition in socially driven motion ## Overview **This
 Dryad deposit contains:** 1\) **Processed dyad-alignment datasets** needed
 to reproduce the main θ₁–θ₂ alignment heatmaps and analysis reported in
 the associated manuscript accepted at *Science Advances*, and 2\) **Raw
 per-individual time series** (2D position and absolute heading) provided
 for transparency and for additional/alternative analyses beyond the
 published workflow. The repository is designed to be usable without
 reading the article. All variables, units, coordinate conventions, and
 geometric definitions are documented below. **Contents at a glance**
 **Folders** 1\. `Datasets_dyad_alignment___r_theta1_theta2/` Primary
 reproducibility dataset. Dyad-level samples with three columns per row:
 `r`, `theta1`, `theta2`. 2\. `Datasets_Raw___Time_X_Y_Alpha/` Raw
 per-individual trajectories and absolute orientations, organized by
 condition, year, and observation session. 3\.
 `Codes_for_Datasets_dyad_alignment___r_theta1_theta2/` (optional) Scripts
 used to create radial windows and generate θ₁–θ₂ heatmaps from the
 provided dyad files. Not required to reproduce the manuscript if you only
 need the finalized dyad `.dat` files as data products. Zipped mirrors (if
 included) \- `Datasets_dyad_alignment___r_theta1_theta2.zip` \-
 `Datasets_Raw___Time_X_Y_Alpha.zip` \-
 `Codes_for_Datasets_dyad_alignment___r_theta1_theta2.zip` If present, the
 `.zip` files contain the same structure and files as the corresponding
 folders. **1) Primary reproducibility dataset:** dyad alignment samples
 (r, θ₁, θ₂) Folder: `Datasets_dyad_alignment___r_theta1_theta2/` These
 files contain dyad-level alignment samples used for the manuscript’s θ₁–θ₂
 heatmaps and analysis. Reproducibility note: The files in this folder are
 the primary dataset required to reproduce the manuscript’s dyad-alignment
 results. **Files** \- `LC1_adults_dyad_alignments.dat` \-
 `LC1_preschoolers_dyad_alignments.dat` \- `LC2_adults_dyad_alignments.dat`
 \- `LC2_preschoolers_dyad_alignments.dat` Each file is
 whitespace-delimited (spaces/tabs) with one dyad sample per row and three
 numeric columns. `.dat` column definitions (order is exactly as stored)
 Each row has three columns in the following order: 1\. `r`
 Inter-individual distance between the two individuals (units: meters). 2\.
 `theta1` Relative alignment angle for individual 1, defined with respect
 to the dyad connecting direction from individual 1 to individual 2 (units:
 degrees, wrapped to [-180, 180]). 3\. `theta2` Relative alignment angle
 for individual 2, defined with respect to the dyad connecting direction
 from individual 2 to individual 1 (units: degrees, wrapped to [-180,
 180]). These angles are dyad-centric (not global). They depend only on the
 two headings and the vector connecting the pair. Exact geometric
 definition of θ₁ and θ₂ (standalone) For a pair of individuals A and B
 with positions (x1, y1) and (x2, y2) and absolute headings α1 and α2: \-
 Define the dyad vectors: \- AB = (x2 − x1, y2 − y1) (from A to B) \- BA =
 (x1 − x2, y1 − y2) (from B to A) \- Define heading unit vectors from the
 absolute headings: \- u1 = (cos α1, sin α1) \- u2 = (cos α2, sin α2) θ₁ is
 the signed angle from AB to u1 (pivot at A), computed as: θ₁ = atan2( AB_x
 * u1_y − AB_y * u1_x , AB_x * u1_x + AB_y * u1_y ) θ₂ is the signed angle
 from BA to u2 (pivot at B), computed as: θ₂ = atan2( BA_x * u2_y − BA_y *
 u2_x , BA_x * u2_x + BA_y * u2_y ) Sign convention: counterclockwise
 rotations are positive. Angles are wrapped to the principal interval. Unit
 convention in this repository: \- Raw headings α in the CSV files are
 stored in **degrees**. \- `theta1` and `theta2` in the `.dat` files are
 stored in **degrees** and wrapped to [-180, 180]. (Implementations may
 compute angles internally in radians for trigonometric functions and then
 convert to degrees.) Interpretation examples \- Face-to-face dyads: θ₁ ≈ 0
 and θ₂ ≈ 0. \- Side-by-side (parallel relative to the connecting line): θ₁
 and θ₂ near ±90°. **2) Raw data: per-individual time series** (Time, x, y,
 α) Folder: `Datasets_Raw___Time_X_Y_Alpha/` This folder contains raw
 tracking data for each individual as separate CSV files. Reuse note: These
 raw files are provided for transparency and to support alternative
 analyses. They are not required to reproduce the manuscript’s dyad heatmap
 results if you use the provided dyad `.dat` files above. Nested folder
 structure (how the raw files are organized) \- Top level:
 `Datasets_Raw___Time_X_Y_Alpha/` \- Condition and year folders: \-
 `LC1_Year#1/`, `LC1_Year#2/`, `LC1_Year#3/`, `LC1_Year#4/` \-
 `LC2_Year#1/`, `LC2_Year#2/`, `LC2_Year#3/` \- Within each year folder are
 observation-session folders named: \- `LC*_Year#??_Observation#??/` Each
 `Observation#??` folder corresponds to one observation session. All
 individuals tracked in that session appear as separate CSV files inside
 that folder, for example: \- `Adult_1.csv`, `Adult_2.csv`, ... (one file
 per adult when present) \- `Child_1.csv`, `Child_2.csv`, ... (one file per
 child when present) Each CSV is a time series for one tracked individual
 during that observation session. #### CSV column definitions Each raw CSV
 contains the following columns: \- `Time` Integer time index for the
 observation. Rows with the same `Time` across individuals in the same
 observation are synchronized. \`Time` is an index with a constant sampling
 interval within each observation. \- `Center_x` x-coordinate of the
 individual’s estimated 2D position in the classroom (units: meters).
 Positions are computed from dual-tag localization (each individual wears
 two tags, and the reported center position is derived from the two tag
 locations). \- `Center_y` y-coordinate of the individual’s estimated 2D
 position in the classroom (units: meters). Positions are computed from
 dual-tag localization as described above. Coordinate system note: For each
 classroom, the (0,0) origin of the coordinate system is defined separately
 and reset, so `Center_x` and `Center_y` are only comparable within the
 same classroom, not across different classrooms. \- `Alpha (Degrees)`
 Absolute heading angle α of the individual measured relative to the +x
 axis (units: degrees). α is in the range [0, 360). Angles increase
 counterclockwise. Notes: \- These raw CSVs provide absolute quantities in
 a classroom-specific coordinate system. \- The dyad-level quantities `r`,
 `theta1`, and `theta2` can be computed deterministically from pairs of
 individuals at matched `Time` using the geometric definition above. **3)
 Code** (optional) Folder:
 `Codes_for_Datasets_dyad_alignment___r_theta1_theta2/` This folder (if
 included) contains scripts used to generate radial windows and θ₁–θ₂
 heatmaps from the finalized dyad `.dat` files. These scripts are provided
 for convenience and transparency, but the processed dyad `.dat` files in
 `Datasets_dyad_alignment___r_theta1_theta2/` are the primary data product
 for reproducing the manuscript’s dyad heatmap results. **Files** \-
 `Code1_splitting_dyad_alignment_data_across_radial_windows.py` Splits a
 dyad alignment `.dat` file into separate radial windows based on `r`.
 Default radial window size is 0.6 m. \-
 `Code2_dyad_alignment_data-to-heatmap.py` For a given radial-window file,
 computes the θ₁–θ₂ alignment distribution and produces a heatmap
 normalized by a uniform distribution. It also writes the normalized
 heatmap matrix to disk. How to reproduce the θ₁–θ₂ heatmaps (from the
 provided dyad `.dat` files) Step 1: split a dyad `.dat` file into radial
 windows Example: \`python3
 Code1_splitting_dyad_alignment_data_across_radial_windows.py
 LC1_preschoolers_dyad_alignments.dat` This generates multiple `.txt`
 files, one per radial range, for example: \-
 `LC1_preschoolers_dyad_alignments_0.0-0.6.txt` \-
 `LC1_preschoolers_dyad_alignments_0.6-1.2.txt` \-
 `LC1_preschoolers_dyad_alignments_1.2-1.8.txt` (and so on) Each
 radial-window `.txt` file contains the same three columns in the same
 order: `r`, `theta1`, `theta2`, restricted to the corresponding `r`
 interval. Step 2: generate the normalized heatmap for a given radial
 window Example: \`python3 Code2_dyad_alignment_data-to-heatmap.py
 LC1_preschoolers_dyad_alignments_0.0-0.6.txt` This will: 1\) Save a
 normalized heatmap matrix, for example:
 \`LC1_preschoolers_dyad_alignments_0.0-0.6_normalized_heatmaps.txt` 2\)
 Display a publication-style heatmap plot using the settings used in the
 manuscript. Repeat Step 2 for each radial-window file created in Step 1.
 **Notes on naming conventions** \- `LC1` and `LC2` denote two classroom
 conditions used in the study. \- `preschoolers` and `adults` denote the
 group membership used when forming dyads for the derived `.dat` files. \-
 `Year#k` denotes the data collection year index within a condition. \-
 `Observation#k` denotes a specific observation session folder that
 contains the per-individual CSV files for that session. Contact: For
 questions about the dataset structure, conventions, or variable
 definitions: Debasish Sarker
 ([deb.sker@gmail.com](mailto:deb.sker@gmail.com)) Repository DOI:
 10.5061/dryad.2rbnzs82v ## Human subjects data All study procedures were
 reviewed and approved by the University of Miami Institutional Review
 Board (IRB Protocol 20160509). Written informed consent was obtained from
 all participating teachers, and parental/guardian consent was obtained for
 all participating children. The study involved preschool-aged children in
 a familiar classroom environment, and no interventions were introduced by
 the research team during data collection. All data were anonymized prior
 to analysis.