Designing Reliable Simulation Comparisons

Use nine network trajectories to understand replication, matching and temporal correlation, connecting every error bar to a defined measurement.

What differs between two simulation curves?

Stretch two rubber samples to the same length and one may require a larger force. A natural next question is why: it may contain more crosslinks, its chains may have started in a different arrangement, or the readings may have caught different fluctuations. Molecular simulations present the same possibilities. Identical temperature, particle count and loading speed still allow different initial arrangements to produce different instantaneous stresses. Comparing materials therefore requires decisions about what changes, what stays fixed and how a moving trajectory becomes one comparable measurement. Those decisions begin when the models are prepared, before a final plot is drawn.

We retain three networks built from a short-chain melt. Each cell contains eighty original chains of twenty beads, giving 1,600 beads, with zero, eighty or 160 additional connections. Beads retain repulsive interactions and bonded neighbours use finitely extensible springs. Every branch receives 100 time units of rest, 100 of constant-volume stretching and 100 of holding, reaching a stretch ratio of 1.2. Our question concerns comparison of mechanical responses under this particular procedure. Temperature, density, chain length, loading direction and timing are parts of that question, just as sample preparation and measurement conditions are parts of an experimental comparison.

One run at each link count supplies three curves, but leaves the effect of a different starting arrangement unexplored. Here three separately prepared melts each produce three link-count branches, giving nine runs. Differences within one preparation address the change in connectivity; differences between preparations describe variability generated by the preparation and loading procedure. Think of taking three portions from each of three independently mixed batches and applying three treatments. Portions from one batch share a starting history, while batches have their own differences. Retaining that relationship allows the statistical comparison to reflect the experiment that was actually performed.

Preparations, matched branches and saved recordsPreparation 1080160Shared starting melt0 / 80 / 160 added linksPreparation 2080160Shared starting melt0 / 80 / 160 added linksPreparation 3080160Shared starting melt0 / 80 / 160 added linksRows along time belong to the same branch
Figure 1 · Three levels: independent preparations, matched link-count branches, and chronological records within each branch.

By the end of the lesson, you should be able to calculate a response over a specified interval, distinguish chronological blocks from independent preparations, interpret a standard deviation and a standard error, and recognize when matching can help a comparison. The Python example reads all nine pressure records and displays every preparation, preserving more information than three mean-value bars. It also examines alternative block lengths and observation windows within the same records. Each statistic answers an identifiable question, so its numerical behaviour can guide a concrete next calculation instead of functioning as a decorative error bar.

An added bond persists throughout this model. Thermal motion changes bead positions, but chemical bond breaking is absent, and the cell contains no explicit water. The model supports an investigation of fixed connectivity, thermal fluctuations and mechanical loading. A hydrogel study involving solvent loss, reversible-bond lifetimes or tissue-fibre rearrangement would add the corresponding degrees of freedom and revise the comparison conditions. The statistical reasoning can carry over while the physical object changes. Defining the model first makes “three repetitions” a precise description of what was prepared and observed, including the processes represented in each run.

Finding the unit that was actually repeated

Each trajectory saves pressure every half time unit, producing 601 rows from zero to 300. These rows follow one continuous motion. A chain that was extended a moment ago is likely to remain extended at the next record, and a stress fluctuation can persist across several saved points. Thus 601 rows do not mean 601 separately prepared material samples. Row count describes recording density; preparation count describes how many distinct starts repeated the whole procedure. Both quantities matter, but they play different statistical roles. Combining them into one nominal sample count can make an average appear more stable than the preparation-level evidence supports.

The independent preparation identifiers are one, two and three. Each uses different seeds for starting chain arrangements, velocities and subsequent random processes, completing its own preparation stage. Within an identifier, the three link-count branches read the same prepared melt, sharing positions and velocities; the eighty-link set is a subset of the 160-link set. Branches consequently have an explicit common background. The records should retain both preparation identifier and link count. Renaming the nine files as runs one through nine would discard an important part of the study design, even though every trajectory file remained available for plotting.

Branches within a preparation also use the same thermostat seed. This explicitly matched arrangement can retain common random influences, while altered forces and connectivity gradually separate the trajectories. A shared seed does not prescribe the sign or magnitude of the correlation between measured responses; that relationship must be evaluated from paired results. Likewise, different seeds across preparations do not establish that every slowly changing conformation has been visited. Independence concerns how repetitions were generated. Coverage of slow configurations concerns the duration and structural exploration of those repetitions. Keeping these meanings separate helps identify which additional calculations would provide new information.

Another common procedure launches three runs from one restart while changing the thermostat seed. Their paths will separate, making them useful for dynamics conditional on that starting network, but the shared topology remains unchanged. A question about random crosslink formation calls for new connections or new material preparation, rather than thermostat changes alone. Similarly, many frames taken from one protein trajectory do not become many independent folding events. The statistical unit depends on the variation the result is intended to describe: thermal motion, network preparation, molecular conformation or model parameters. Designing that unit is part of the scientific question.

A compact condition table can preserve these levels alongside preparation identifier, bead count, original chain length, added-link count, density, temperature, thermostat timescale, loading history and recording interval. It needs no personal information. Its purpose is to keep the interpretation consistent: the zero-added-link system still contains original chain bonds; the 300 time units contain several stages; and 160 links are not 160 independent material specimens. When names and counts refer to the actual objects, averaging, subtraction and uncertainty calculations start from a well-defined comparison rather than an ambiguous collection of output files.

Increasing output frequency and increasing observation time are separate choices. Saving the same motion every quarter time unit instead of every half nearly doubles the row count without allowing the network any longer to relax. Denser records help resolve rapid fluctuations and locate stage boundaries, while longer trajectories offer more opportunity for slower rearrangements. The two choices address different questions and carry different storage and computational costs. Inspecting the timescale of the target observable helps decide how frequently to save, how long to run and how many preparations to repeat. A larger output file can be useful, but its value depends on the additional motion it resolves.

Defining one response from a moving record

Choose the observable before choosing how to average it. We read the three diagonal pressure components and calculate a normal-stress difference S: minus axial pressure plus the mean of the two transverse pressures. Subtraction removes a pressure contribution common to all three directions, leaving a quantity sensitive to directional mechanical response. Its unit is the model energy scale ε divided by the cube of length scale σ. The boundary condition differs from an axial-stress experiment with freely moving lateral surfaces: here both transverse cell lengths shrink during axial extension to preserve the total volume. That distinction remains part of the measured response.

Normal-stress difference from pressureEq. 1
SymbolMeaningUnit
SNormal-stress difference along x relative to transverse directionsε σ⁻³
Pₓₓ, Pᵧᵧ, PzzThree diagonal pressure components, positive under the pressure/compression conventionε σ⁻³
x, y, zLoading direction x and transverse directions y and z1
2Divisor for the arithmetic mean of two transverse components1
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipStress has the opposite sign to pressure. Subtracting transverse mean stress removes a common isotropic contribution.

A worked exampleFor Pₓₓ=4.8, Pᵧᵧ=5.0 and Pzz=5.2, S=−4.8+(5.0+5.2)/2=0.3ε/σ³.

ConditionsThe pressure tensor of this constant-volume periodic model; every subsequent comparison uses this same S.

Instantaneous S fluctuates through positive and negative values. For each branch, we calculate a resting baseline over 50≤t<100 and a late-hold mean over 280<t≤300, then define response Y as the latter minus the former. These windows contain 100 and forty records, covering fifty and twenty time units respectively. Baseline subtraction expresses each branch relative to its own pre-loading state and reduces the direct influence of residual starting stress on the comparison. Y remains a finite-duration measurement under the stated protocol. The location of the observation windows is consequently part of its definition, not a plotting preference.

Window mean and baseline-relative responseEq. 2
SymbolMeaningUnit
W, j ∈ WW is a selected set of records; j identifies a record and ∈ means belongs to1
nWNumber of equally spaced records in the window1
Sⱼ, S̄WStress difference at record j and its window arithmetic meanε σ⁻³
ΣSum S over all records in the selected windowsummation operator
YHolding-window mean minus the resting mean of the same branchε σ⁻³
hold, resthold is 280<t≤300; rest is 50≤t<100, with t in τ1
1, overbarOne is the reciprocal numerator; an overbar denotes a mean1
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipEqual time spacing gives equal temporal weights. Subtracting the pre-loading mean expresses response relative to the branch baseline.

A worked exampleHolding values 0.2 and 0.4 average to 0.3; resting values 0.1 and 0.2 average to 0.15; Y=0.15ε/σ³. The actual windows contain forty and 100 records.

ConditionsEqually spaced records and the stated endpoint conventions. Y describes this finite loading procedure.

The mean is calculated by adding the S values inside a window and dividing by their count. Equal recording intervals give each row equal weight. Uneven intervals require attention to the time represented by each sample; dense and sparse records should not be combined as if their temporal weights were identical. Endpoints also matter: 50≤t<100 includes fifty but excludes 100, while 280<t≤300 includes 300 but excludes 280. Explicit masks and record-count checks make these choices inspectable, preventing an unnoticed difference in frame selection between branches that are supposed to receive the same analysis.

For preparation one, the zero-added-link baseline is about 0.06928 and its late response is −0.04163. The 160-link baseline is about −0.009295 and its response is −0.04285. Both negative responses mean that the selected late-hold mean S lies below the corresponding resting mean. They do not require negative stress throughout loading and do not define a negative elastic modulus. The values are differences between two fluctuating time averages. Reading their signs therefore requires the actual loading, holding and reference intervals, rather than assigning a material property from the sign of one finite-window contrast.

The program also retains early, middle and late equal-duration holding windows: 200<t≤220, 240<t≤260 and 280<t≤300. The main comparison uses the predefined late window; the other two reveal sensitivity to observation time. All three subtract the same branch baseline and therefore share information. Selecting whichever window best matches an expected trend would let the measurement question change after viewing its answer. A clearer design states which window addresses the main question, then displays the others as a chronological sensitivity analysis. This preserves useful temporal detail while keeping the central contrast consistent across every branch.

Subtract within each preparation, then compare preparations

Once each trajectory has one Y value, preserve the matching before pooling by link count. For the zero-versus-160 comparison, subtract the zero-link response from the 160-link response within each preparation to obtain paired difference d. Preparation one is compared with preparation one, two with two, and three with three. Each difference retains the information that its branches started together. Averaging the three differences then gives the mean paired contrast. Matching does not create additional material samples; it changes how the known relationship between existing samples is used in the calculation and in the interpretation of variability.

Paired differences within preparationsEq. 3
SymbolMeaningUnit
r, Rr identifies an independent preparation; R is the number of preparations, here three1
0, 160Labels for added-link counts; zero added links retains original chain bonds1
Yᵣ,₁₆₀, Yᵣ,₀Responses of two branches from the same preparationε σ⁻³
dᵣ, d̄One paired difference and its mean across preparationsε σ⁻³
Σᵣ₌₁ᴿ, 1/RSum preparations one through R and divide by preparation countsummation and averaging
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipSubtract within preparations to preserve matching, then average across independent preparations.

A worked exampleThe actual differences are approximately −0.001216, 0.122640 and −0.073884. Their sum divided by three gives 0.015846ε/σ³.

ConditionsBranches sharing an identifier have matched preparation and measurement definitions; preparations are independently generated.

Nine runs and three paired contrasts

Lines connect branches within each preparation. The right panel retains all three contrasts, with mean ± sample standard deviation of paired differences.

LAMMPS 30 Sep 2026 Update 1; official bead–spring interaction model, with 1600 beads in 80 chains of 20, ρ*=0.85 and T*=1, using three initial configurations. The FENE/WCA dynamics time step is 0.005τ.

image/svg+xml Matplotlib v3.10.9, https://matplotlib.org/
Branches with 0, 80 and 160 links are matched by preparation identity; all three signed 160-minus-0 differences are retained.

The three actual paired differences are approximately −0.00122, 0.12264 and −0.07388, with mean 0.01585 in ε/σ³. The first is near zero, the second positive and the third negative. Showing all three points communicates an essential feature of this calculation: different preparations produce substantially different contrasts under the finite-duration protocol. In the left panel, lines connect the three link-count results belonging to one preparation. Their purpose is to track matching, not to impose a monotonic response or require the eighty-link value to lie between the other two. Individual points, grouping and averages should be read together.

Why can matching sometimes stabilize a difference? Imagine two rulers measuring in a room whose temperature changes slightly: a common temperature-related shift may cancel on subtraction. Network branches may similarly share changes associated with starting arrangements. This is an analogy for covariance, not a prediction that cancellation must occur. Branch responses can instead move in opposite directions, increasing the spread of their difference. Covariance describes whether two quantities tend to be high or low together. The correlation coefficient divides that covariance by their individual standard deviations, expressing the relationship on a dimensionless scale from −1 to one.

Shared variation in matched observationsEq. 6
SymbolMeaningUnit
A, BTwo responses in one independent preparation; B here labels a response, whereas B denotes block count in the blocking formulaε σ⁻³
Ā, B̄Responses averaged over R preparationsε σ⁻³
σA, σBPopulation standard deviations; subscripted σ here differs from model length scale σε σ⁻³
ρPopulation correlation of A and B within a preparation, between −1 and one1
RNumber of mutually independent matched preparations1
Var, σA², σB²Variance and squared standard deviationsε² σ⁻⁶
ρσAσBCovariance describing their shared variationε² σ⁻⁶
2Two cross products from expanding a squared difference1
²Squaring by self-multiplicationoperator
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipExpanding a squared difference produces negative cross terms; independent pairs divide the variance of their mean difference by R.

A worked exampleThe interaction sets σA=σB=1 and R=4. At ρ=0, variance is 0.5 and SE≈0.7071; at ρ=0.5, variance is 0.25 and SE=0.5; at ρ=−0.5, SE≈0.8660.

ConditionsIndependent identically distributed pairs with finite variance. The interaction uses chosen population parameters; actual data require sample estimates.

Analytical matched-pair model: σA=σB=1 stress unit. Change population correlation and the number of independent preparations.

MatchedUnmatchedSE / stress unit0

Correlation is a chosen population parameter in this analytical model; relationships between actual paired responses are estimated from records.

The interaction fixes each side’s preparation-level standard deviation at one stress unit and varies the correlation and number of independent preparations. It displays the theoretical standard error of the mean difference. At zero correlation, the matched and unmatched expressions coincide. Positive correlation allows common variation to cancel; negative correlation increases the spread after subtraction. Correlation in this analytical exercise is a chosen population parameter, whereas the relationship between our nine trajectories must be estimated from observations. Reading the exercise alongside the real scatter plot connects the mathematical mechanism with the practical uncertainty of estimating it from a small collection of preparations.

For these three preparations, the standard error computed from paired differences is about 0.05737. Ignoring matching and combining the two marginal variances gives about 0.07377. The difference comes from treatment of within-preparation covariation, not from additional simulations. The individual contrasts also show why the mean of 0.01585 belongs beside preparation-to-preparation variability. To estimate the average contrast of this fixed procedure more precisely, further independently prepared networks and longer relevant observation windows can be added while retaining the same branch-matching structure. The scientific comparison then gains information without changing the meaning of its response variable.

What standard deviation and standard error describe

Standard deviation describes the spread of the values themselves. Subtract their mean to obtain deviations, square those deviations so positive and negative values do not cancel, sum them, divide by the number of repetitions minus one, and take the square root to restore the original stress unit. The subtraction of one reflects estimation of the mean from the same values: once two of three deviations are known, the third is constrained by their zero sum. The paired differences have sample standard deviation about 0.09937, describing the observed spread of contrasts across these three preparations.

Spread and precision of the meanEq. 4
SymbolMeaningUnit
dᵣ, d̄, sdIndividual difference, mean difference and sample standard deviationε σ⁻³
R, rIndependent preparation count and index; R must exceed one1
SE(d̄)Estimated standard error of the mean paired differenceε σ⁻³
(dᵣ−d̄)²Squared deviation; superscript two means multiply by itselfε² σ⁻⁶
Σ, R−1Sum squared deviations; normalize by R−1 after estimating the meansummation and dimensionless divisor
√Nonnegative square root, restoring the original unitoperator
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipStandard deviation describes the spread of differences. For independent identically distributed preparations with finite variance, averaging divides variance by R.

A worked exampleThe actual s_d is 0.0993668ε/σ³ and R=3, giving SE=0.0573695ε/σ³. If s_d=0.1 and R=4, SE=0.05.

ConditionsSample standard deviation uses ddof=1. SE concerns the mean under the same preparation and loading procedure. The plotted bar is labelled mean ± standard deviation.

Standard error addresses a different question: if the same preparation and loading procedure were repeated many times in studies containing three preparations each, how variable would their mean contrasts be? When preparations are independent draws from the same process with finite variance, the variance of their mean is the individual variance divided by preparation count. Dividing sample standard deviation by the square root of that count estimates the standard error. Increasing independent preparations from three to twelve would therefore halve its theoretical scale, provided the underlying variability remained comparable. The square root is the reason precision improves more slowly than the raw count increases.

Dividing by the square root of three does not move the original preparations closer together. Their standard deviation remains about 0.09937, while the estimated standard error is about 0.05737. The plot uses mean plus or minus between-pair standard deviation so its bar can be compared directly with the individual points. A standard-error bar would need that different label. A confidence interval would additionally require its construction method, assumptions and sample count. Before interpreting a short bar as strong evidence, identify the quantity it depicts and the level of repetition behind it. Its size acquires meaning through that definition.

These statistics describe variation within the present model and procedure. Model parameters occupy another level. Changing bead repulsion, bond stiffness or thermostat damping may shift the response, as may extending the loading interval from 100 to 300 time units. Such changes call for separately organized comparisons rather than being folded into one random-error number. This separation is useful operationally: preparation variability calls for more preparations; rate dependence calls for a loading-rate series; comparison with a real material calls for parameters and observables that connect to the relevant experiments. Each source of variation points towards its own informative calculation.

Individual points are especially informative with a small sample. Three values support a concrete matched comparison and permit calculation of a mean and sample standard deviation, while describing distribution shape only coarsely. Showing every point reveals the positive and negative contrasts behind the mean instead of asking readers to infer them from a symmetric bar. As more independent preparations become available, inspect whether one preparation dominates, whether the distribution is skewed and how stable the mean becomes under the same measurement definition. Statistical presentation can become more detailed as information accumulates, without assigning an elaborate distributional story to a handful of observations.

Standard deviation also supports a planning calculation. If paired differences under the same procedure have a spread near 0.1, four independent preparations give an estimated standard-error scale of 0.05, and sixteen give 0.025. This helps plan computation, with the spread re-estimated as new preparations arrive. A new preparation may encounter a network state absent from the first three and increase the observed standard deviation. The added repetition has then improved knowledge of preparation variability. Precision planning should be updated with accumulated evidence rather than treating the first three-value estimate as a fixed material constant.

Examining correlated records with chronological blocks

Temporal correlation appears in weather, river levels and cell motion as well as molecular simulation. Neighbouring molecular records share positions, velocities and surroundings, and an entire polymer’s direction can change more slowly than its local vibrations. Flyvbjerg and Petersen’s 1989 work addressed error estimates for averages of correlated data, providing an important reference for blocking approaches. The central intuition is to combine neighbouring observations into averages over longer pieces, then examine variation between those pieces. Chronological order is retained because the dependence being investigated is carried by that order, rather than by the file’s total number of rows.

From correlated time series to molecular sampling1989 · Flyvbjerg & PetersenError estimates for correlated averagesBlock 1Block 2Block 3Block 4t2019 · Grossfield and colleaguesFast vibrations and slowly changing configurationsConceptual series and molecular shapes
Figure 2 · Blocking retains chronological order; molecular sampling also requires attention to slower configuration changes. The series and chain shapes are conceptual.

Take the late resting interval of each 160-link branch. Each preparation contributes exactly 100 records, spaced by half a time unit. Averaging consecutive pairs produces fifty blocks of duration one; averaging consecutive groups of ten produces ten blocks of duration five. Longer blocks contain more of the shared motion history internally and may reduce dependence between block means. At the same time, fewer blocks remain. A block duration of twenty-five leaves two means, so their accidental closeness or separation strongly influences the spread estimate. Both the duration and number of blocks must therefore accompany a blocking result.

Chronological blockingEq. 5
SymbolMeaningUnit
n, m, BTotal records, records per block and block count; n=100 and m divides n1
k, jBlock index and within-block record index, both starting at one1
(k−1)m+jOriginal-sequence index of record j in block k1
S, bₖ, sbOriginal stress difference, block mean and sample standard deviation of block meansε σ⁻³
eBBlock-standard-error diagnosticε σ⁻³
Σ, √Summation and nonnegative square root; s_b is calculated using the sample-standard-deviation formulaoperators
=, +, −, /, ×Equality, addition, subtraction, division and multiplication; adjacent quantities multiplyoperators

Reading the relationshipAverage neighbouring records first, then examine variation between block means, retaining the remaining block count alongside block duration.

A worked exampleWith n=100 and m=10, B=10 blocks each last 5τ. Preparation one at 160 links has block SD≈0.139170, giving eB≈0.0440094ε/σ³.

ConditionsHere it diagnoses block-length sensitivity. Estimating a time-mean SE requires a stationary process, blocks long relative to correlation times and enough blocks.

Block duration and time-average diagnostics

Raw stress and block-SE diagnostics for the three 160-link branches over 50≤t<100. Longer blocks leave fewer means; interpret the complete curves.

image/svg+xml Matplotlib v3.10.9, https://matplotlib.org/
Block-size sensitivity diagnoses time-series averaging within each condition; time blocks and independent preparations are treated separately.

The upper panel shows the three recorded resting-stress sequences. The lower panel plots the standard deviation of block means divided by the square root of block count. For a stationary process, blocks longer than important correlation times and a sufficient number of blocks can support estimation of the time mean’s standard error. Our fifty-time-unit excerpts directly reveal sensitivity to the blocking choice: preparation one changes from about 0.03660 for individual records to about 0.05093 for ten-time-unit blocks, and preparation three also changes appreciably. A low point on this curve is not by itself a reason to select that block duration.

Preparation two gives smaller values at block durations of 12.5 and twenty-five. This is compatible with correlated motion: those choices retain four and two block means respectively, and a short record can produce means that happen to be close. The uncertainty estimate itself fluctuates. Assessing whether blocks are sufficiently long calls for longer trajectories, alternative chronological portions and independent preparations, looking for stability while enough blocks remain. Displaying the full sequence of block choices therefore serves a diagnostic purpose. It shows how the available history influences an estimate, rather than treating blocking as a search for the smallest possible error bar.

The 2019 guide on sampling quality and uncertainty in molecular simulations placed these concerns in a wider molecular context: a molecule may fluctuate frequently near one configuration while rarely visiting another. Protein side chains, polymer conformations and ion coordination can all combine fast and slow changes. A stable-looking pressure-blocking plot can therefore be accompanied by chain-size, orientation or coordination-state histories. Different observables respond differently to slow motion. A block duration chosen for pressure should be reconsidered against the actual time dependence of another observable, connecting statistical diagnostics with the molecular structures that generate the records.

Keeping the question clear when observation time changes

After the cell stops changing shape, segments continue rearranging, the thermostat continues exchanging energy and microscopic stress continues fluctuating. Early, middle and late holding averages can therefore differ. The next figure gives each preparation its own panel and shows the zero-, eighty- and 160-link branches over the three twenty-time-unit windows. Horizontal coordinates are the window midpoints, 210, 250 and 290; lines connect observations from the same branch. All panels share a vertical scale. This makes the magnitude of temporal and preparation-level variation directly comparable in the same model stress unit, while preserving which values belong together.

Observation windows within one procedure

Each point subtracts a branch resting baseline from a 20τ holding-window mean. Panels correspond to the three independent preparations.

image/svg+xml Matplotlib v3.10.9, https://matplotlib.org/
Panels separate the preparations and compare early, middle and late hold-window responses relative to each branch’s resting baseline.

For preparation one, the 160-link response moves from about 0.13283 in the early window to 0.16652 in the middle and −0.04285 in the late window. For preparation two at the same link count, the corresponding values are about 0.08621, 0.16222 and 0.15836. Their time dependence differs within the recorded duration. Selecting preparation one’s middle interval and preparation two’s late interval would mix observation times into the material comparison. Common windows plus a chronological sensitivity plot separate these questions: how branches differ at matching times, and how each branch changes through the holding stage.

The baseline also fluctuates, and every Y subtracts an estimated baseline. Variability consequently comes from more than the forty holding-stage records. Three windows within one branch share a baseline, which cancels when those windows are subtracted from each other. Across branches, variations in their separate baselines remain relevant. The program calculates the complete Y definition first, then compares it between independent preparations, preserving the combined influence of baseline and holding measurements in each response. A separate study of one trajectory’s time-average error would need to consider both chronological intervals and any dependence between them.

Additional computation should address an identified question. Longer holding at unchanged loading history investigates later responses. A loading-rate comparison keeps final stretch fixed while changing loading duration in organized groups. More independent melts and link realizations examine preparation variability. Changing all these together can define a useful new procedure, but then the comparison concerns the procedures as a whole. Expressing each change as a concrete physical operation helps prevent a stronger observed signal from being attributed to one parameter that was not varied independently. It also makes the next study easier to design and interpret.

Separate the questions before adding computationPreparation variationPrepare new melts and linksTemporal averagingExtend observation at the same protocolLoading-rate dependenceKeep final stretch; vary loading durationEach addition preserves a defined comparison
Figure 3 · Preparation, duration and loading rate call for distinct comparison designs, so additional evidence answers a defined question.

These distinctions matter for biomaterials. A comparison of hydrogels at equal stretching speed can still depend on hydration and crosslink preparation. Repeated protein-adsorption trajectories vary with starting orientation, while surface chemistry defines another level of the design. A simple model allows the statistical organization to be practised before carrying it into a more chemically specific system. Within a complete study, structural, dynamical and mechanical measurements should retain identities linking them to the same samples. That continuity supports interpretation of differences and directs further computation towards factors that materially affect the scientific explanation.

Running the comparison and planning the next study

The complete generator retains three independent preparations and their three link-count branches through melt preparation, network construction, stretching and holding. Directory names include preparation identifier and link count. LAMMPS reduced units use temperature one, number density 0.85, time step 0.005 and thermostat damping time one. Added links join nearby beads from different original chains, with at most one added bond per bead; each branch rests before loading. Seeds specify a reproducible generation procedure and make the common background of matched branches inspectable. The generator, native input and analysis together show how each plotted statistical unit was produced.

Complete model construction and simulation

"""Prepare, connect, relax and stretch a FENE bead-spring network.

python run_network.py --beads 1600 --replica 1 --out-dir network-runs
The LAMMPS executable is selected by --lmp or the LAMMPS environment variable.
Each independent preparation is followed by zero, one or two links per
original chain in total. The linked cases share nested selected-edge lists.
The output retains the exact selected endpoints, inputs and simulation logs.
"""
from pathlib import Path
import argparse,json,hashlib,subprocess,time,re,math
import numpy as np
import os,shutil
p=argparse.ArgumentParser();p.add_argument('--beads',type=int,default=1600);p.add_argument('--replica',type=int,default=1);p.add_argument('--out-dir',type=Path,default=Path('network-runs'));p.add_argument('--lmp',default=os.environ.get('LAMMPS','lmp'));a=p.parse_args()
N=a.beads;M=N//20;assert N%20==0
base=a.out_dir.resolve();d=base/f'n{N}-rep{a.replica}'
if d.exists():raise SystemExit('Choose a new output directory for this configuration.')
d.mkdir(parents=True)
seed=20263000+a.replica;generator=np.random.default_rng(seed);L=(N/.85)**(1/3);coords=[];bonds=[]
# Pack open chains while retaining the seeded sequence of random draws.
for chain in range(M):
 current=generator.uniform(0,L,3)
 for local in range(20):
  for attempt in range(100000):
   candidate=generator.uniform(0,L,3) if local==0 else current+.97*(v:=generator.normal(size=3))/np.linalg.norm(v)
   if coords:
    dr=np.array(coords)-candidate;dr-=L*np.round(dr/L)
    if np.min(np.sum(dr*dr,axis=1))<.65**2:continue
   break
  else:raise RuntimeError('Chain packing did not find a valid location')
  coords.append(candidate.copy());current=candidate
  if local:bonds.append((len(coords)-1,len(coords)))
lines=['Generated FENE chain starting configuration','',f'{N} atoms',f'{len(bonds)} bonds','','1 atom types','2 bond types','',f'0 {L:.15g} xlo xhi',f'0 {L:.15g} ylo yhi',f'0 {L:.15g} zlo zhi','','Masses','','1 1.0','','Atoms # bond','']
for i,xyz in enumerate(coords):
 image=np.floor(xyz/L).astype(int);wrapped=xyz-L*image;lines.append(f'{i+1} {i//20+1} 1 '+' '.join(f'{x:.15g}' for x in wrapped)+' '+' '.join(str(x) for x in image))
lines+=['','Bonds','']+[f'{j+1} 1 {i} {k}' for j,(i,k) in enumerate(bonds)]
(d/'initial.data').write_text('\n'.join(lines)+'\n')
# Shared reduced-unit, neighbour and special-pair definitions.
header='''units lj
atom_style bond
boundary p p p
special_bonds fene
neighbor 0.4 bin
neigh_modify every 1 delay 0 check yes
'''
# Instantaneous records: time, T, U/N, K/N, E/N, pressure, box and longest bond.
record='''compute cTemp all temp
compute cPE all pe
compute cKE all ke
compute cP all pressure cTemp
compute bl all bond/local dist
compute maxbl all reduce max c_bl inputs local
variable clock equal time
variable T equal c_cTemp
variable U equal c_cPE/atoms
variable K equal c_cKE/atoms
variable E equal (c_cPE+c_cKE)/atoms
variable pxx equal c_cP[1]
variable pyy equal c_cP[2]
variable pzz equal c_cP[3]
variable bx equal lx
variable by equal ly
variable bz equal lz
variable bmax equal c_maxbl
thermo_style custom step time c_cTemp pe ke etotal c_cP[1] c_cP[2] c_cP[3] lx ly lz c_maxbl
thermo_modify norm no
thermo 1000
fix record all ave/time 100 1 100 v_clock v_T v_U v_K v_E v_pxx v_pyy v_pzz v_bx v_by v_bz v_bmax file thermo.dat format " %.15g"
dump trajectory all custom 500 trajectory.lammpstrj id mol type x y z vx vy vz ix iy iz
dump_modify trajectory sort id
compute chunks all chunk/atom molecule
compute chainRg all gyration/chunk chunks
fix rg all ave/time 100 1 100 c_chainRg file chain-rg.dat mode vector format " %.15g"
'''
# Soft separation, FENE switch, minimization and 100 tau melt preparation.
prepare=header+f'''read_data initial.data
bond_style harmonic
bond_coeff * 100.0 0.97
pair_style soft 1.122462048309373
pair_coeff * * 0
velocity all create 1.0 {seed+100} mom yes rot no dist gaussian
fix dyn all nve
fix bath all langevin 1.0 1.0 1.0 {seed+200} zero yes
variable softA equal ramp(0,100)
fix soften all adapt 1 pair soft a * * v_softA
timestep 0.002
thermo 1000
thermo_style custom step temp pe ke etotal
run 20000
unfix soften
unfix dyn
unfix bath
write_data after-soft.data
pair_style lj/cut 1.122462048309373
pair_modify shift yes
pair_coeff * * 1 1 1.122462048309373
bond_style fene
bond_coeff * 30.0 1.5 1.0 1.0
min_style cg
min_modify dmax 0.01
minimize 1e-8 0.01 10000 100000
reset_timestep 0
timestep 0.005
fix dyn all nve
fix bath all langevin 1.0 1.0 1.0 {seed+300} zero yes
'''+record+'''run 20000
write_restart melt.restart
write_data melt.data
'''
(d/'prepare.lmp').write_text(prepare,encoding='utf-8',newline='\n')
found=shutil.which(a.lmp);assert found, f'LAMMPS executable not found: {a.lmp}';binary=Path(found).resolve();logs=[]
def run(where,script):
 cmd=[str(binary),'-in',script,'-log','simulation.log']
 r=dict(command=cmd,directory=where.relative_to(base).as_posix(),input_sha256={f.name:hashlib.sha256(f.read_bytes()).hexdigest() for f in where.iterdir() if f.is_file()});t=time.perf_counter()
 with (where/'stdout.log').open('wb') as f:q=subprocess.run(cmd,cwd=where,env={**os.environ,'OMP_NUM_THREADS':'1'},stdout=f,stderr=subprocess.STDOUT)
 r.update(exit_code=q.returncode,wall_seconds=time.perf_counter()-t,output_sha256={f.name:hashlib.sha256(f.read_bytes()).hexdigest() for f in where.iterdir() if f.is_file()});logs.append(r)
 (d/'progress.json').write_text(json.dumps(logs,indent=2));print(json.dumps({'directory':str(where),'exit_code':q.returncode,'wall_seconds':r['wall_seconds']}),flush=True)
 if q.returncode:raise SystemExit(q.returncode)
run(d,'prepare.lmp')
data=(d/'melt.data').read_text();atompart=re.search(r'\nAtoms[^\n]*\n(.*?)(?=\n[A-Z][A-Za-z ]*(?:#.*)?\n|\Z)',data,re.S)[1]
atoms=np.array([[float(x) for x in line.split()] for line in atompart.splitlines() if line.strip()]);atoms=atoms[np.argsort(atoms[:,0])];xyz=atoms[:,3:6];mol=atoms[:,1].astype(int)
# Candidate edges connect nearby beads with different original chain IDs.
candidate=[]
for i in range(N-1):
 dr=xyz[i+1:]-xyz[i];dr-=L*np.round(dr/L);r2=np.sum(dr*dr,1)
 for j in np.flatnonzero((r2<=1.15**2)&(mol[i+1:]!=mol[i])):candidate.append((i,int(i+1+j),float(np.sqrt(r2[j]))))
# Greedy matching uses each bead once; prefixes of one list give nested cases.
edgegen=np.random.default_rng(seed+400);edgegen.shuffle(candidate);edges=[];used=set()
for i,j,dist in candidate:
 if i not in used and j not in used:edges.append((i+1,j+1,dist));used.update((i,j))
target=M*2
if len(edges)<target:raise RuntimeError(f'Only {len(edges)} available edges for {target} target')
# Each branch: 100 tau relaxation, 100 tau extension, 100 tau fixed strain.
choices=[0,M,2*M]
for nc in choices:
 sub=d/f'links-{nc}';sub.mkdir();selected=edges[:nc];text=data
 text=re.sub(r'^\d+ bonds$',f'{len(bonds)+nc} bonds',text,flags=re.M)
 match=re.search(r'\nBonds\s*\n(.*?)(?=\n[A-Z][A-Za-z ]*(?:#.*)?\n|\Z)',text,re.S)
 original=match[1].strip();addition='\n'.join(f'{len(bonds)+j+1} 2 {i} {k}' for j,(i,k,_) in enumerate(selected))
 text=text[:match.start(1)]+original+'\n'+addition+'\n'+text[match.end(1):]
 (sub/'network.data').write_text(text)
 (sub/'selected-crosslinks.json').write_text(json.dumps(dict(seed=seed+400,candidates=len(candidate),selected=selected,definition='Different original chain IDs, minimum-image distance<=1.15, at most one added edge per bead; common ordered candidate list gives nested link sets.'),indent=2))
 protocol=header+f'''bond_style fene
pair_style lj/cut 1.122462048309373
pair_modify shift yes
read_data network.data
bond_coeff * 30.0 1.5 1.0 1.0
pair_coeff * * 1 1 1.122462048309373
reset_timestep 0
timestep 0.005
fix dyn all nve
fix bath all langevin 1.0 1.0 1.0 {seed+500} zero yes
'''+record+'''run 20000
write_data relaxed.data
write_restart relaxed.restart
fix stretch all deform 1 x scale 1.2 y volume z volume remap x units box
run 20000
unfix stretch
write_data stretched.data
run 20000
write_data final.data
write_restart final.restart
'''
 (sub/'network.lmp').write_text(protocol,encoding='utf-8',newline='\n');run(sub,'network.lmp')
receipt=dict(case='lammps-network',N=N,chains=M,replica=a.replica,seed=seed,rho=.85,chain_length=20,links=choices,binary_sha256=hashlib.sha256(binary.read_bytes()).hexdigest(),source='Official LAMMPS30Sep2026Update1 bench/in.chain interaction model; independently generated coordinates and explicitly added crosslink/deformation protocols',runs=logs,exit_code=0)
(d/'receipt.json').write_text(json.dumps(receipt,indent=2));print('Network comparison complete',flush=True)

Each independently prepared melt produces three link-count branches, retaining matching identities, inputs and records.

Complete input for preparation one at eighty links

units lj
atom_style bond
boundary p p p
special_bonds fene
neighbor 0.4 bin
neigh_modify every 1 delay 0 check yes
bond_style fene
pair_style lj/cut 1.122462048309373
pair_modify shift yes
read_data network.data
bond_coeff * 30.0 1.5 1.0 1.0
pair_coeff * * 1 1 1.122462048309373
reset_timestep 0
timestep 0.005
fix dyn all nve
fix bath all langevin 1.0 1.0 1.0 20263501 zero yes
compute cTemp all temp
compute cPE all pe
compute cKE all ke
compute cP all pressure cTemp
compute bl all bond/local dist
compute maxbl all reduce max c_bl inputs local
variable clock equal time
variable T equal c_cTemp
variable U equal c_cPE/atoms
variable K equal c_cKE/atoms
variable E equal (c_cPE+c_cKE)/atoms
variable pxx equal c_cP[1]
variable pyy equal c_cP[2]
variable pzz equal c_cP[3]
variable bx equal lx
variable by equal ly
variable bz equal lz
variable bmax equal c_maxbl
thermo_style custom step time c_cTemp pe ke etotal c_cP[1] c_cP[2] c_cP[3] lx ly lz c_maxbl
thermo_modify norm no
thermo 1000
fix record all ave/time 100 1 100 v_clock v_T v_U v_K v_E v_pxx v_pyy v_pzz v_bx v_by v_bz v_bmax file thermo.dat format " %.15g"
dump trajectory all custom 500 trajectory.lammpstrj id mol type x y z vx vy vz ix iy iz
dump_modify trajectory sort id
compute chunks all chunk/atom molecule
compute chainRg all gyration/chunk chunks
fix rg all ave/time 100 1 100 c_chainRg file chain-rg.dat mode vector format " %.15g"
run 20000
write_data relaxed.data
write_restart relaxed.restart
fix stretch all deform 1 x scale 1.2 y volume z volume remap x units box
run 20000
unfix stretch
write_data stretched.data
run 20000
write_data final.data
write_restart final.restart

The generator writes the input for each branch beside its network.data. This is the complete preparation-one eighty-link example.

The run script generates preparations one through three and then executes the complete analysis. With downloaded reference records, the directory containing those three preparations can be passed directly to the analysis, reusing the available trajectories. Each branch supplies thermo.dat with fixed columns for time, temperature, energy and pressure components. The program checks record count and time spacing before calculating S, baseline and Y, then saves a table of individual conditions. This order exposes unexpected inputs before averaging and allows every plotted point to be checked against a row in the CSV output rather than inferred from the rendered figure.

Run three preparations and generate bilingual figures

#!/usr/bin/env bash
set -euo pipefail
for replica in 1 2 3; do
  python run_network.py --beads 1600 --replica "$replica" --out-dir network-runs
done
python analyze_comparisons.py network-runs --out comparison/en --language en
python analyze_comparisons.py network-runs --out comparison/zh --language zh

Run in the directory containing these four files. The LAMMPS environment variable selects the executable.

Complete matched, blocking and window analysis

"""Compare independently prepared networks with matched branches.

python analyze_comparisons.py network-runs --out comparison --language en
Each n1600-rep1/2/3/links-0/80/160 folder supplies thermo.dat.
Requires NumPy and Matplotlib. Stress units are epsilon/sigma cubed.
"""
from pathlib import Path
import argparse
import csv
import json
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import font_manager


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('records', type=Path)
    parser.add_argument('--out', type=Path, default=Path('comparison'))
    parser.add_argument('--language', choices=['zh', 'en'], default='en')
    args = parser.parse_args()
    args.out.mkdir(parents=True, exist_ok=True)
    summaries, blocks, raw = [], [], {}
    windows = [(200, 220), (240, 260), (280, 300)]
    for rep in (1, 2, 3):
        for links in (0, 80, 160):
            p = args.records/f'n1600-rep{rep}'/f'links-{links}'/'thermo.dat'
            a = np.loadtxt(p, comments='#')
            if a.shape != (601, 13) or not np.allclose(a[:, 1], np.arange(601)*.5):
                raise ValueError(f'Unexpected observation grid: {p.name}')
            t = a[:, 1]
            stress = -a[:, 6]+(a[:, 7]+a[:, 8])/2
            rest = (t >= 50) & (t < 100)
            baseline = float(stress[rest].mean())
            hold = []
            for left, right in windows:
                values = stress[(t > left) & (t <= right)]
                assert len(values) == 40
                hold.append(float(values.mean()-baseline))
            summaries.append({'replica': rep, 'added_links': links,
                              'resting_records': int(rest.sum()),
                              'resting_mean': baseline,
                              'early_change': hold[0], 'middle_change': hold[1],
                              'late_change': hold[2], 'records_per_hold_window': 40})
            raw[(rep, links)] = {'time': t, 'stress': stress, 'baseline': baseline}
            # Equal-duration contiguous blocks of the same 50tau resting window.
            # SE is a block-length diagnostic; successive blocks may be correlated.
            if links == 160:
                v = stress[rest]
                for frames in (1, 2, 5, 10, 20, 25, 50):
                    means = v.reshape(-1, frames).mean(axis=1)
                    blocks.append({'replica': rep, 'block_tau': frames*.5,
                                   'blocks': len(means), 'mean': float(means.mean()),
                                   'block_sd': float(means.std(ddof=1)),
                                   'block_SE_diagnostic': float(means.std(ddof=1)/np.sqrt(len(means)))})
    table = {(r['replica'], r['added_links']): r for r in summaries}
    left = np.array([table[(rep, 0)]['late_change'] for rep in (1, 2, 3)])
    right = np.array([table[(rep, 160)]['late_change'] for rep in (1, 2, 3)])
    differences = right-left
    groups = {}
    for links in (0, 80, 160):
        values = np.array([table[(rep, links)]['late_change'] for rep in (1, 2, 3)])
        groups[str(links)] = {'values': values.tolist(), 'mean': float(values.mean()),
                              'sample_sd': float(values.std(ddof=1)),
                              'SE_of_preparation_mean': float(values.std(ddof=1)/np.sqrt(3))}
    result = {'definition': 'Y=meanS(280<t<=300)-meanS(50<=t<100); S=-Pxx+(Pyy+Pzz)/2',
              'replicate_unit': 'Three independently seeded prepared melts; link branches matched within each melt',
              'paired_difference': 'd=Y160-Y0 within each preparation',
              'paired_values': differences.tolist(), 'paired_mean': float(differences.mean()),
              'paired_sample_sd': float(differences.std(ddof=1)),
              'paired_SE': float(differences.std(ddof=1)/np.sqrt(3)),
              'unpaired_SE_formula_on_same_marginals': float(np.sqrt(left.var(ddof=1)/3+right.var(ddof=1)/3)),
              'groups': groups, 'window_means': summaries, 'block_diagnostics': blocks,
              'interpretation': 'Fixed finite-protocol responses. Block-SE curves diagnose the chosen resting window; independent-preparation SE is conditional on this preparation and loading protocol.'}
    (args.out/'comparison_summary.json').write_text(json.dumps(result, indent=2), encoding='utf-8')
    for name, rows in [('comparison_metrics.csv', summaries), ('block_diagnostics.csv', blocks)]:
        with (args.out/name).open('w', newline='', encoding='utf-8') as stream:
            writer = csv.DictWriter(stream, fieldnames=list(rows[0])); writer.writeheader(); writer.writerows(rows)
    zh = args.language == 'zh'
    tr = lambda a, b: a if zh else b
    available = {x.name for x in font_manager.fontManager.ttflist}
    fonts = ['Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', 'WenQuanYi Zen Hei', 'DejaVu Sans']
    plt.rcParams.update({'font.family': [f for f in fonts if f in available] if zh else ['DejaVu Sans'],
                         'font.size': 14, 'axes.spines.top': False, 'axes.spines.right': False,
                         'svg.fonttype': 'path', 'axes.unicode_minus': False,
                         'figure.facecolor': '#faf9f5', 'axes.facecolor': '#faf9f5',
                         'text.color': '#193d43', 'axes.labelcolor': '#193d43'})
    colors = ['#167d84', '#c16b3d', '#466eaa']
    def save(fig, name):
        fig.savefig(args.out/f'{name}-{args.language}.svg')
        fig.savefig(args.out/f'{name}-{args.language}.png', dpi=160)
        plt.close(fig)
    fig, axes = plt.subplots(1, 2, figsize=(13, 6), constrained_layout=True)
    for rep, color in zip((1, 2, 3), colors):
        values = [table[(rep, links)]['late_change'] for links in (0, 80, 160)]
        axes[0].plot([0, 80, 160], values, 'o-', color=color, lw=1.6, ms=7,
                     label=tr(f'制备 {rep}', f'Preparation {rep}'))
        axes[1].scatter(rep, differences[rep-1], color=color, s=65, zorder=3)
    axes[0].set(xlabel=tr('新增边数', 'Added links'), ylabel=tr('后段响应 Y / (ε σ⁻³)', 'Late-window response Y / (ε σ⁻³)'),
                xticks=[0, 80, 160], title=tr('同一制备内连接三个分支', 'Matched branches within a preparation'))
    axes[0].legend(frameon=False, loc='lower center', bbox_to_anchor=(.5, 1.10), ncol=3, fontsize=11)
    axes[1].errorbar(4.3, differences.mean(), yerr=differences.std(ddof=1), fmt='D', color='#193d43', capsize=7,
                     label=tr('均值 ± 组间SD', 'Mean ± between-pair SD'))
    axes[1].set(xticks=[1, 2, 3, 4.3], xticklabels=['1', '2', '3', tr('平均', 'Mean')],
                ylabel=tr('配对差 d / (ε σ⁻³)', 'Paired difference d / (ε σ⁻³)'),
                title=tr('160边减去0边', '160 links minus 0 links'))
    axes[1].legend(frameon=False, loc='lower center', bbox_to_anchor=(.5, 1.10), fontsize=11)
    for ax in axes: ax.axhline(0, color='#8a9390', lw=.8); ax.grid(alpha=.18)
    fig.suptitle(tr('比较单位是三组独立制备', 'The comparison contains three independent preparations'), fontsize=18)
    save(fig, 'comparison-paired')
    fig, axes = plt.subplots(2, 1, figsize=(12, 8), constrained_layout=True)
    for rep, color in zip((1, 2, 3), colors):
        rr = raw[(rep, 160)];mask = (rr['time'] >= 50) & (rr['time'] < 100)
        axes[0].plot(rr['time'][mask], rr['stress'][mask], color=color, lw=1.1, alpha=.85,
                     label=tr(f'制备 {rep}', f'Preparation {rep}'))
        b = [r for r in blocks if r['replica'] == rep]
        axes[1].plot([r['block_tau'] for r in b], [r['block_SE_diagnostic'] for r in b], 'o-', color=color)
    axes[0].set(xlabel=tr('静置阶段时间 / τ', 'Resting-stage time / τ'), ylabel=tr('S / (ε σ⁻³)', 'S / (ε σ⁻³)'))
    axes[0].legend(frameon=False, ncol=3, loc='lower center', bbox_to_anchor=(.5, 1.02))
    axes[1].set(xlabel=tr('连续块长度 / τ', 'Contiguous-block length / τ'),
                ylabel=tr('分块SE诊断 / (ε σ⁻³)', 'Block-SE diagnostic / (ε σ⁻³)'), xscale='log')
    for ax in axes: ax.grid(alpha=.18)
    fig.suptitle(tr('相同50τ窗口:改变分块长度,观察估计怎样变化',
                     'One 50τ window: inspect the effect of block duration'), fontsize=17)
    save(fig, 'comparison-blocking')
    fig, axes = plt.subplots(1, 3, figsize=(14, 5.8), sharey=True, constrained_layout=True)
    fig.get_layout_engine().set(wspace=.12)
    for rep, ax in zip((1, 2, 3), axes):
        for links, color in zip((0, 80, 160), colors):
            rr=table[(rep, links)]
            ax.plot([210, 250, 290], [rr['early_change'], rr['middle_change'], rr['late_change']], 'o-', color=color,
                    label=tr(f'{links} 边', f'{links} links'))
        ax.set(title=tr(f'制备 {rep}', f'Preparation {rep}'), xticks=[210, 250, 290],
               xlabel=tr('窗口中点 / τ', 'Window midpoint / τ'))
        ax.axhline(0,color='#8a9390',lw=.8);ax.grid(alpha=.18)
    axes[0].set_ylabel(tr('相对静置基线的 Y / (ε σ⁻³)', 'Y relative to resting baseline / (ε σ⁻³)'))
    handles,labels=axes[0].get_legend_handles_labels()
    fig.legend(handles,labels,loc='outside upper center',ncol=3,frameon=False)
    save(fig, 'comparison-windows')
    print(json.dumps({k:result[k] for k in ['paired_values','paired_mean','paired_sample_sd','paired_SE']},indent=2))


if __name__ == '__main__':
    main()

Read the nine thermo.dat records under three preparations; save branch tables, statistics and three bilingual figures.

comparison_metrics.csv stores the baseline and early, middle and late responses for all nine branches. block_diagnostics.csv stores block duration, count, spread and the block-standard-error diagnostic. comparison_summary.json contains the paired differences, their mean, sample standard deviation and standard error. The figures show matching, blocking and observation-window sensitivity. Chinese and English versions use identical numerical arrays with translated labels. Keeping tables and figures linked to the same analysis means a changed window or an added preparation can update all dependent results consistently, instead of requiring manual edits to selected numbers or labels in a plot.

A useful exercise changes one interpretable choice: widen the main holding window to 260<t≤300 while retaining the resting baseline and every simulation condition, then recalculate the three paired differences. Predict how the wider average might affect fluctuations, inspect the result and display old and new window definitions together. Next, add an independent preparation and examine changes in the mean and between-preparation spread. The useful outcome is a clearly defined comparison table in which the sample identity, observation interval and subtraction behind every row can be reconstructed from inputs and records. This is the foundation for extending the workflow to a larger study.

A material-simulation comparison can now be organized around four connected questions: what changed in the model, which runs shared a starting preparation, how a response was defined from chronological records, and how the observed contrast varied across preparations and windows. The final lesson places this statistical structure alongside connectivity, chain orientation and mechanical loading in one complete case. Structural analysis identifies which chains are connected, mechanics measures their response under the prescribed procedure, and matched replication ensures that both kinds of information refer to the same identifiable samples. The resulting study can then grow while retaining a coherent relationship between model, measurement and interpretation.

Further Reading and Open Materials

  • LAMMPS 30Sep2026 Update1 — bench/in.chain · LAMMPS developers · LAMMPS source and bundled example: GPL-2.0; retain the distributed licence.

    FENE-chain and repulsive-bead baseline.

    Retain the chain model with 1,600 beads and three preparations; add 0/80/160 interchain links, stretch and hold at constant volume, and analyse matched statistics. Time step 0.005, damping 1τ, cutoff exactly 2^(1/6)σ.

  • Error estimates on averages of correlated data (1989) · Henrik Flyvbjerg and H. G. Petersen · Scholarly citation; no paper text or figure reproduced.

    History of correlated time-series error estimation and blocking.

    Original blocking illustration and analysis of specified block durations in this case.

  • Best Practices for Quantification of Uncertainty and Sampling Quality in Molecular Simulations (2019) · Alan Grossfield, Paul N. Patrone, Daniel R. Roe, Andrew J. Schultz, Daniel W. Siderius and Daniel M. Zuckerman · Scholarly citation; original explanations and figures here, no third-party figure reproduced.

    Molecular sampling, correlation and observable-specific statistical interpretation.

    Apply the concepts to nine network trajectories, independent preparations, matched differences and time windows.

Buy me a coffee

WeChat support QR code
WeChat
Alipay support QR code
Alipay
PayPal