Skip to content

Commit e5e0d47

Browse files
committed
SDE discovery code
1 parent b55c236 commit e5e0d47

File tree

9 files changed

+2081434
-1
lines changed

9 files changed

+2081434
-1
lines changed

.DS_Store

-6 KB
Binary file not shown.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
__pycache__

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Data driven mesoscale SDE
22

3+
This repository contains the code for the manuscript:
4+
5+
Data-driven discovery of stochastic dynamical equations of collective motion.
6+
Nabeel, A., Jadhav, V., Sire, C., Theraulaz, G., Escobedo, R., Iyer, S. K., & Guttal, V. (2023).
7+
DOI: 10.1088/1478-3975/ace22d
8+
9+
The code is divided into two parts:
10+
- The directory `/spp_model` contains MATLAB code to simulate the agent-based models.
11+
- The directory `/sde_discovery` contains code to discover mesoscale SDEs from the simulated trajectories.
12+
313
## Simulating the flocking model
414

515
**Generate data of positions and velocities to calculate group polarisation for given group size and parameters.**
@@ -12,6 +22,10 @@ To simulate stochastic pairwise interaction set `k_alg = 1` in `sim_data.m`. Sim
1222

1323
After running the simulation, use the data in `n_pw.mat` to calculate the order parameter, i.e., group polarisation. To do so, run the Matlab code `/figures/grp_pol.m`. This file stores all the required data in the `n_pw.csv` file in the format `[mx, my, m]`.
1424

15-
## Simulation video
25+
### Simulation video
1626

1727
To see the collective motion of agents, run the code `/spp_model/simulations.m`. Make sure to load `n_pw.mat`. Variables are defined within the code and can be changed accordingly.
28+
29+
## Data driven SDE discovery
30+
31+
The notebook `/sde_discovery/sde-discovery.ipynb` contains code to analyze the order-parameter time series and discover mesoscale stochastic differential equations. The code uses the CSV file generated from the MATLAB code above. An example CSV file, corresponding to the _ternary local interaction model_ is provided.

sde_discovery/.ipynb_checkpoints/sde_discovery-checkpoint.ipynb

Lines changed: 40482 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)