This repository contains simulation codes used in our study of motile active particle clusters. The system involves a pair of self-propelled rods connected by a hinge and embedded in a crowded medium. We provide two simulation setups:
double/: Simulations where both rods are alive.single/: Simulations where one rod is already absorbed (asymmetric case).
π Note
Output folders: (data/, mfpt/, temp/)
These codes were used to generate the results for our paper titled:
Symmetry breaking in crowded channels
Leonardo Garibaldi Rigon and Yongjoo Baek
Submitted to: Soft Matter Journal
[arXiv link]
- GCC compiler
- Gnuplot for fitting survival curves
gcc double_hinge.c -lm -O3
./a.out
Set parameters at the top of the file:
- SIMULATION PARAMETERS section: typical values to change
- FIXED PARAMETERS section: for advanced control
Output files are written to ../data/
Optional flags (set in code):
- SAVE_CONFIGS = 1: saves particle positions
- SAVE_DETAILS = 1: saves angles and extra details
π Estimating MFPT (files: survival_rate.c and fit_mfpt.gnu)
gcc survival_rate.c -lm -O3
./a.out
Reads measurement files from ../data/
Outputs survival probabilities to ../mfpt/
Fitting with Gnuplot:
load 'fit_mfpt.gnu'
Adjust parameters in the .gnu file to match the simulation
π Calculating Mean Squared Displacement (MSD) (file: msd.c)
Requires: SAVE_DETAILS = 1 in double_hinge.c
Outputs saved to ../data/
gcc msd.c -lm -O3
./a.out
gcc single_hinge.c -lm -O3
./a.out
Setup similar to double_hinge.c
Extra optional flags (set in code):
- SAVE_MSD: computes MSD internally
- SAVE_FINALS: saves data from the final 50 steps (forces, torque, etc.)
- SAVE_TORQUE: saves torque data
- SAVE_N0: logs information when particles below the hinge are 0 or 1
π Estimating MFPT
Same process as in the double/ folder
π Estimating Time in State TN (files: terms_surv_rate.c and fit_mfpt_terms.gnu)
gcc terms_surv_rate.c -lm -O3
./a.out
Outputs survival rates for each coarse-grained state to mfpt/ folder
Fitting with Gnuplot:
load 'fit_mfpt_terms.gnu'