VicsekModel

Documentation for VicsekModel.

VicsekModel.VicsekModelParametersType

Fields

  • L: Length of the square box
  • ρ: Density of particles
  • N: Number of particles
  • r₀: Interaction radius
  • Δt: Time step
  • factor: Factor to determine the initial velocity
  • v₀: Initial velocity
  • η: Noise strength
  • alg: Algorithm to update the position and velocity
source
VicsekModel.VicsekModelVariablesType

Variables of the Vicsek model

Arguments

  • pos: Position of particles
  • vel: Velocity of particles
  • θ: Angle of particles
  • S: Complex number to calculate the average angle of neighbors
source
VicsekModel.VicsekModelVariablesMethod

Initialize the variables of the Vicsek model

Arguments

  • p: Variables of the Vicsek model
  • seed: keyword variable used as seed for random generator
source
VicsekModel.calculate_weights!Method

Calculate the average angle of neighbors

Arguments

  • pos: Position of particles
  • θ: Angle of particles
  • S: Complex number to calculate the average angle of neighbors
  • r₀: Interaction radius
  • ix: Index of particles
source
VicsekModel.calculate_weights!Method

Calculate the average angle of neighbors with KDTree

Arguments

  • tree: KDTree to find the neighbors
  • pos: Position of particles
  • θ: Angle of particles
  • S: Complex number to calculate the average angle of neighbors
  • r₀: Interaction radius
  • ix: Index of particles
source
VicsekModel.update!Method

Update the position and velocity of particles using a simple for-loop method

Arguments

  • var: Variables of the Vicsek model
  • p: Parameters of the Vicsek model
source
VicsekModel.update!Method

Update the position and velocity of particles using KDTree

Arguments

  • var: Variables of the Vicsek model
  • p: Parameters of the Vicsek model
source
VicsekModel.update_position!Method

Update the position and velocity of particles

Arguments

  • pos: Position of particles
  • vel: Velocity of particles
  • θ: Angle of particles
  • S: Complex number to calculate the average angle of neighbors
  • v₀: Initial velocity
  • η: Noise strength
  • ix: Index of particles
source
VicsekModel.update_with_anim!Method

Update the position and velocity of particles with animation

Arguments

  • t: Time step
  • var: Variables of the Vicsek model
  • p`: Parameters of the Vicsek model
source