View source: R/particle_functions.R
simulate_particle | R Documentation |
Simulates particle trajectories using either the standard Vicsek model or a two-interaction variation of the Vicsek model.
simulate_particle(v_abs, n_t = 100, T_sim = 5, h = 0.1,
cut_r = 0.5, sigma_0 = 0.1,
noise_type = "Gaussian", model = "Vicsek")
v_abs |
Absolute velocity magnitude for all particles. |
n_t |
Number of particles (default: 100). |
T_sim |
Total simulation time steps (default: 5). |
h |
Time step size for numerical integration (default: 0.1). |
cut_r |
Radius of interaction between particles (default: 0.5). |
sigma_0 |
Standard deviation of noise (default: 0.1). |
noise_type |
Distribution of noise: "Gaussian" or "Uniform" (default: "Gaussian"). |
model |
Type of interaction model: "Vicsek" or "two_interactions_Vicsek" (default: "Vicsek"). |
Returns an S4 object of class particle.data
. See particle.data-class
for details of the returned object structure.
Vicsek, T., Czirok, A., Ben-Jacob, E., Cohen, I., & Shochet, O. (1995). Novel type of phase transition in a system of self-driven particles, Physical Review Letters, 75(6), 1226.
Chat'e, H., Ginelli, F., Gr'egoire, G., Peruani, F., & Raynaud, F. (2008). Modeling collective motion: variations on the Vicsek model, The European Physical Journal B, 64(3), 451-456.
Fang, X., & Gu, M. (2024). The inverse Kalman filter. arXiv:2407.10089.
particle.data-class
for details on the particle.data class structure
#--------------------------------------------------
# Example: Simulate using standard Vicsek model
#--------------------------------------------------
vx_abs=0.5
vy_abs=0.5
v_abs=sqrt(vx_abs^2+vy_abs^2)
sim1 <- simulate_particle(v_abs=v_abs)
#--------------------------------------------------
# Example: Simulate using two-interaction variation
#--------------------------------------------------
sim2 <- simulate_particle(v_abs=v_abs, model = 'two_interactions_Vicsek')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.