unnormalized_Vicsek: Unnormalized Vicsek model simulation

View source: R/particle_functions.R

unnormalized_VicsekR Documentation

Unnormalized Vicsek model simulation

Description

Simulates particle movement according to the unnormalized Vicsek model, where particles align their velocities with neighboring particles within a specified radius, subject to noise. The model implements both Gaussian and uniform noise options.

Usage

unnormalized_Vicsek(p0,v0,n_t,T_sim,h,cut_r,
                    sigma_0,noise_type='Gaussian')

Arguments

p0

A numeric vector of initial positions for all particles, structured as (x1, y1, x2, y2, ..., xn, yn).

v0

A numeric vector of initial velocities for all particles, structured similarly to p0.

n_t

An integer specifying the number of particles.

T_sim

An integer specifying the number of time steps to simulate.

h

A numeric value specifying the time step size.

cut_r

A numeric value specifying the interaction radius within which particles align.

sigma_0

A numeric value specifying the noise strength.

noise_type

A character string specifying the type of noise: either "Gaussian" (default) or "Uniform".

Value

Returns a list with three components:

pos

A matrix of dimension (2*n_t) x (T_sim+1) containing particle positions at each time step.

v

A matrix of dimension (2*n_t) x (T_sim+1) containing particle velocities at each time step.


FastGaSP documentation built on Aug. 27, 2025, 9:08 a.m.