View source: R/particle_functions.R
f_Vicsek_variation | R Documentation |
A modified interaction function for the Vicsek model that defines the interaction strength between particles based on their distance. This function is used as one of the interactions in the two-interaction Vicsek model.
f_Vicsek_variation(r, a = 0.02, b = 1, r_min = 0.01, r_max = 0.8, beta = 20)
r |
numeric, the distance between particles |
a |
numeric, strength parameter for the short-range interaction term. Default is 0.02 |
b |
numeric, strength parameter for the linear term. Default is 1 |
r_min |
numeric, minimum distance parameter for the interaction term. Default is 0.01 |
r_max |
numeric, maximum distance parameter. Default is 0.8 |
beta |
numeric, scaling parameter for the overall interaction. Default is 20 |
The function implements a modified Vicsek interaction with three components:
A short-range term (-a/(r+r_min))
A linear term (-b*(r-r_max))
A constant offset term (a/r_max)
The final value is scaled by the beta parameter.
Returns a numeric value representing the interaction strength at distance r.
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.
# Calculate interaction values at various distances
r_seq <- seq(0.01, 1, by = 0.01)
interaction <- f_Vicsek_variation(r_seq)
plot(r_seq, interaction, type = "l",
xlab = "Distance", ylab = "Interaction Strength",
main = "Vicsek Variation Interaction Function")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.